Interface NodeJsEventEmitter
Methods
addListener
- addListener(event: string | symbol, listener: function): this
-
Parameters
-
event: string | symbol
-
listener: function
Returns this
emit
- emit(event: string | symbol, ...args: any[]): boolean
-
Parameters
-
event: string | symbol
-
Rest ...args: any[]
Returns boolean
eventNames
- eventNames(): Array<string | symbol>
-
Returns Array<string | symbol>
getMaxListeners
- getMaxListeners(): number
-
Returns number
listenerCount
- listenerCount(type: string | symbol): number
-
Parameters
Returns number
listeners
- listeners(event: string | symbol): Function[]
-
Parameters
Returns Function[]
on
- on(event: string | symbol, listener: function): this
-
Parameters
-
event: string | symbol
-
listener: function
Returns this
once
- once(event: string | symbol, listener: function): this
-
Parameters
-
event: string | symbol
-
listener: function
Returns this
prependListener
- prependListener(event: string | symbol, listener: function): this
-
Parameters
-
event: string | symbol
-
listener: function
Returns this
prependOnceListener
- prependOnceListener(event: string | symbol, listener: function): this
-
Parameters
-
event: string | symbol
-
listener: function
Returns this
removeAllListeners
- removeAllListeners(event?: string | symbol): this
-
Parameters
-
Optional event: string | symbol
Returns this
removeListener
- removeListener(event: string | symbol, listener: function): this
-
Parameters
-
event: string | symbol
-
listener: function
Returns this
setMaxListeners
- setMaxListeners(n: number): this
-
Parameters
Returns this
NodeJS.EventEmitter type included here so that this package does not need to take a dependency on the Node typings. See: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/events.d.ts