Properties
emit
emit: ((event, ...args) => boolean)
Type declaration
-
- (event, ...args): boolean
-
Parameters
-
event: TEvent
-
Rest
...args: Parameters<TFunc>
Returns boolean
eventNames
eventNames: (() => TEvent[])
Type declaration
-
- (): TEvent[]
-
Returns TEvent[]
listenerCount
listenerCount: ((event) => number)
Type declaration
-
- (event): number
-
Returns number
listeners
listeners: ((event) => TFunc[])
Type declaration
-
- (event): TFunc[]
-
Returns TFunc[]
rawListeners
rawListeners: ((event) => TFunc[])
Type declaration
-
- (event): TFunc[]
-
Returns TFunc[]
A typed interface of EventEmitter.
Use the
&
operator to combine multiple event/function pairs into a single event emitter. The result needs to be a type and not an interface because of https://github.com/microsoft/TypeScript/issues/16936.Use the createGenericEventEmitterClass function to generate an event emitter class with the correct typings in case EventEmitter needs to be extended.