Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EventEmitter

Hierarchy

  • EventEmitter

Index

Properties

Static defaultMaxListeners

defaultMaxListeners: number

Methods

addListener

  • addListener(type: string | number, listener: Listener): this
  • Parameters

    • type: string | number
    • listener: Listener

    Returns this

emit

  • emit(type: string | number, ...args: any[]): boolean
  • Parameters

    • type: string | number
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): Array<string | number>
  • Returns Array<string | number>

getMaxListeners

  • getMaxListeners(): number
  • Returns number

listenerCount

  • listenerCount(type: string | number): number
  • Parameters

    • type: string | number

    Returns number

listeners

  • listeners(type: string | number): Listener[]
  • Parameters

    • type: string | number

    Returns Listener[]

off

  • off(type: string | number, listener: Listener): this
  • Parameters

    • type: string | number
    • listener: Listener

    Returns this

on

  • on(type: string | number, listener: Listener): this
  • Parameters

    • type: string | number
    • listener: Listener

    Returns this

once

  • once(type: string | number, listener: Listener): this
  • Parameters

    • type: string | number
    • listener: Listener

    Returns this

prependListener

  • prependListener(type: string | number, listener: Listener): this
  • Parameters

    • type: string | number
    • listener: Listener

    Returns this

prependOnceListener

  • prependOnceListener(type: string | number, listener: Listener): this
  • Parameters

    • type: string | number
    • listener: Listener

    Returns this

rawListeners

  • rawListeners(type: string | number): Listener[]
  • Parameters

    • type: string | number

    Returns Listener[]

removeAllListeners

  • removeAllListeners(type?: string | number): this
  • Parameters

    • Optional type: string | number

    Returns this

removeListener

  • removeListener(type: string | number, listener: Listener): this
  • Parameters

    • type: string | number
    • listener: Listener

    Returns this

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

Static listenerCount

  • listenerCount(emitter: EventEmitter, type: string | number): number
  • Parameters

    Returns number

Generated using TypeDoc