Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IEventEmitter<H, E>

Type parameters

  • H

  • E

Hierarchy

  • IEventEmitter

Implemented by

Index

Properties

event

Methods

emit

  • emit<K>(event: K, ...args: ArgsOf<E[K]>): H
  • Type parameters

    • K: keyof E

    Parameters

    • event: K
    • Rest ...args: ArgsOf<E[K]>

    Returns H

emitAsync

  • Type parameters

    • K: keyof E

    Parameters

    • event: K
    • Rest ...args: ArgsOf<E[K]>

    Returns Promise<Stream<Exclude<ReturnOf<E[K]>, Promise<any>>>> & { isResolved?: undefined | true }

emitFirst

  • Type parameters

    • K: keyof E

    Parameters

    • event: K
    • Rest ...args: ArgsOf<E[K]>

    Returns UndefinedFromVoid<ReturnOf<E[K]>> | undefined

emitFirstDefault

  • emitFirstDefault<K, D>(event: K, generateDefault: () => D, ...args: ArgsOf<E[K]>): Exclude<ReturnOf<E[K]>, null | undefined> | D
  • Type parameters

    • K: keyof E

    • D

    Parameters

    • event: K
    • generateDefault: () => D
        • (): D
        • Returns D

    • Rest ...args: ArgsOf<E[K]>

    Returns Exclude<ReturnOf<E[K]>, null | undefined> | D

emitReduce

  • emitReduce<K, A>(event: K, arg: A, ...args: Tail<ArgsOf<E[K]>>)
  • Type parameters

    Parameters

    • event: K
    • arg: A
    • Rest ...args: Tail<ArgsOf<E[K]>>

emitStream

  • emitStream<K>(event: K, ...args: ArgsOf<E[K]>): Stream<ReturnOf<E[K]>>
  • Type parameters

    • K: keyof E

    Parameters

    • event: K
    • Rest ...args: ArgsOf<E[K]>

    Returns Stream<ReturnOf<E[K]>>

hasHandlersForEvent

  • hasHandlersForEvent(...events: Array<keyof E>): boolean
  • Parameters

    • Rest ...events: Array<keyof E>

    Returns boolean

subscribe

  • subscribe<K>(event: K, handler: IterableOr<Handler<H, K extends any[] ? E[K[number]] : E[Extract<K, keyof E>]>>, priority?: undefined | number): H
  • Type parameters

    Parameters

    • event: K
    • handler: IterableOr<Handler<H, K extends any[] ? E[K[number]] : E[Extract<K, keyof E>]>>
    • Optional priority: undefined | number

    Returns H

unsubscribe

  • unsubscribe<K>(event: K, handler: IterableOr<Handler<H, K extends any[] ? E[K[number]] : E[Extract<K, keyof E>]>>, priority?: undefined | number): boolean
  • Type parameters

    Parameters

    • event: K
    • handler: IterableOr<Handler<H, K extends any[] ? E[K[number]] : E[Extract<K, keyof E>]>>
    • Optional priority: undefined | number

    Returns boolean

until

waitFor

  • waitFor<K>(events: K, priority?: undefined | number): Promise<ArgsOf<K extends any[] ? E[K[number]] : E[Extract<K, keyof E>]>>
  • Type parameters

    Parameters

    • events: K
    • Optional priority: undefined | number

    Returns Promise<ArgsOf<K extends any[] ? E[K[number]] : E[Extract<K, keyof E>]>>

Generated using TypeDoc