TypedEventEmitter <Events>
Methods
- emit<E>(event: E, ...args: Parameters<Events[E]>): boolean
Type parameters
- E: string | number | symbol
Parameters
event: E
rest...args: Parameters<Events[E]>
Returns boolean
- eventNames(): (string | symbol | keyof Events)[]
Returns (string | symbol | keyof Events)[]
- listenerCount<E>(event: E): number
Type parameters
- E: string | number | symbol
Parameters
Returns number
- listeners<E>(event: E): Events[E][]
Type parameters
- E: string | number | symbol
Parameters
Returns Events[E][]
- off<E>(event: E, listener: Events[E]): this
Type parameters
- E: string | number | symbol
Parameters
event: E
listener: Events[E]
Returns this
- on<E>(event: E, listener: Events[E]): this
Type parameters
- E: string | number | symbol
Parameters
event: E
listener: Events[E]
Returns this
- once<E>(event: E, listener: Events[E]): Events[E]
Type parameters
- E: string | number | symbol
Parameters
event: E
listener: Events[E]
Returns Events[E]
- removeAllListeners<E>(event?: E): this
Type parameters
- E: string | number | symbol
Parameters
Returns this