Type

FormEventConstructor

@ng-forge/dynamic-forms

Constructor type for form event classes.

Defines the shape of event class constructors that can be used with the event bus dispatch system. Supports both parameterless and parameterized event constructors.

Signature

type FormEventConstructor<T extends FormEvent = FormEvent> = new (...args: any[]) => T;

Type Parameters

NameConstraintDefaultDescription
TFormEventFormEventThe form event type being constructed

Examples

// Parameterless event constructor
const SubmitEventCtor: FormEventConstructor<SubmitEvent> = SubmitEvent;

// Parameterized event constructor
const ErrorEventCtor: FormEventConstructor<ErrorEvent> = ErrorEvent;
eventBus.dispatch(ErrorEventCtor);