Methods
addListener
Parameters
event: string | symbol
listener: ((...args: any[]) => void)
on
Parameters
event: string | symbol
listener: ((...args: any[]) => void)
once
Parameters
event: string | symbol
listener: ((...args: any[]) => void)
removeListener
Parameters
event: string | symbol
listener: ((...args: any[]) => void)
off
Parameters
event: string | symbol
listener: ((...args: any[]) => void)
removeAllListeners
Parameters
Optional event: string | symbol
setMaxListeners
Parameters
getMaxListeners
- getMaxListeners(): number
Returns number
listeners
- listeners(event: string | symbol): Function[]
Parameters
Returns Function[]
rawListeners
- rawListeners(event: string | symbol): Function[]
Parameters
Returns Function[]
emit
- emit(event: string | symbol, ...args: any[]): boolean
Parameters
event: string | symbol
Rest ...args: any[]
Returns boolean
listenerCount
- listenerCount(type: string | symbol): number
Parameters
Returns number
prependListener
Parameters
event: string | symbol
listener: ((...args: any[]) => void)
prependOnceListener
Parameters
event: string | symbol
listener: ((...args: any[]) => void)
eventNames
- eventNames(): (string | symbol)[]
Returns (string | symbol)[]