Class TypedEventEmitter<TEvents>
Type Parameters
TEvents extends Record<string, any>
Constructors
constructor
- new TypedEventEmitter<TEvents>(): TypedEventEmitter<TEvents>
Type Parameters
TEvents extends Record<string, any>
Methods
emit
- emit<TEventName>(eventName, ...eventArg): void
Type Parameters
TEventName extends string
Parameters
eventName: TEventName
Rest
...eventArg: TEvents[TEventName]
Returns void
off
- off<TEventName>(eventName, handler): void
Type Parameters
TEventName extends string
Parameters
eventName: TEventName
handler: ((...eventArg) => void)
- (...eventArg): void
Parameters
Rest
...eventArg: TEvents[TEventName]
Returns void
Returns void
on
- on<TEventName>(eventName, handler): void
Type Parameters
TEventName extends string
Parameters
eventName: TEventName
handler: ((...eventArg) => void)
- (...eventArg): void
Parameters
Rest
...eventArg: TEvents[TEventName]
Returns void
Returns void