Documentation

ComponentEventHandler

type ComponentEventHandler

type ComponentEventHandler<TComponent = Component, TEvent = ComponentEvent> = string | ((this: TComponent, e: TEvent) => void);

Event handler type, can be used to define the type of a preset event handler as a string or function.

Primarily used in interface definitions for the first argument to an overridden Component.preset method.

Example

export interface MyComponentPresets {
  // ...
  onSomeEvent: ComponentEventHandler<MyComponent>;
}