Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EventEmitter<Events>

Type parameters

Hierarchy

  • EventEmitter

Index

Constructors

constructor

Methods

emit

  • emit<Event>(event: Event): Promise<Event>

emitSerial

  • emitSerial<Event>(event: Event): Promise<Event>

emitSync

  • emitSync<Event>(event: Event): Event

getListeners

  • getListeners<Event>(event: string): Listener<Event>[]

off

  • off<EventName>(event: EventName, listener: Listener<Events[EventName]>): void
  • off<K>(event: string, listener: Listener<K>): void

on

  • on<EventName>(event: EventName, listener: Listener<Events[EventName]>): () => void
  • on<K>(event: string, listener: Listener<K>): () => void
  • Type parameters

    • EventName: string | number | symbol

    Parameters

    • event: EventName
    • listener: Listener<Events[EventName]>

    Returns () => void

      • (): void
      • Returns void

  • Type parameters

    Parameters

    • event: string
    • listener: Listener<K>

    Returns () => void

      • (): void
      • Returns void

once

  • once<EventName>(event: EventName, listener: Listener<Events[EventName]>): () => void
  • once<K>(event: string, listener: Listener<K>): () => void
  • Type parameters

    • EventName: string | number | symbol

    Parameters

    • event: EventName
    • listener: Listener<Events[EventName]>

    Returns () => void

      • (): void
      • Returns void

  • Type parameters

    Parameters

    • event: string
    • listener: Listener<K>

    Returns () => void

      • (): void
      • Returns void

removeAllListeners

  • removeAllListeners(): void

removeListeners

  • removeListeners(event: string): void

wait

  • wait<EventName>(event: EventName): Promise<Events[EventName]>
  • wait(event: string): Promise<BasicEvent>

waitf

  • waitf<EventName>(event: EventName, filter: (ev: Events[EventName]) => boolean | Promise<boolean>): Promise<Events[EventName]>
  • waitf<K>(event: string, filter: (ev: K) => boolean | Promise<boolean>): Promise<BasicEvent>
  • Type parameters

    • EventName: string | number | symbol

    Parameters

    • event: EventName
    • filter: (ev: Events[EventName]) => boolean | Promise<boolean>
        • (ev: Events[EventName]): boolean | Promise<boolean>
        • Parameters

          • ev: Events[EventName]

          Returns boolean | Promise<boolean>

    Returns Promise<Events[EventName]>

  • Type parameters

    Parameters

    • event: string
    • filter: (ev: K) => boolean | Promise<boolean>
        • (ev: K): boolean | Promise<boolean>
        • Parameters

          • ev: K

          Returns boolean | Promise<boolean>

    Returns Promise<BasicEvent>

Generated using TypeDoc