Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Events<IEventsList>

Already mixed class. Plug and play.

Type parameters

  • IEventsList

Hierarchy

Indexable

[key: string]: any

Already mixed class. Plug and play.

Index

Properties

Methods

Properties

Static destroy

destroy: function

Delte all linstening events.

Type declaration

    • (): void
    • Returns void

Static emitter

emitter: EventEmitter

Native nodejs EventEmitter.

Methods

Static emit

  • emit<IE>(eventName: IE, data: IEventsList[IE]): this
  • Emit event with custom data and "emit" event with data { eventName: string, data: any }

    Type parameters

    • IE: keyof IEventsList

    Parameters

    • eventName: IE
    • data: IEventsList[IE]

    Returns this

Static off

  • off<IE>(eventName: IE, listener: function): this
  • Removes the specified listener from the listener array for the event named eventName.

    Type parameters

    • IE: keyof IEventsList

    Parameters

    • eventName: IE
    • listener: function
        • (data: IEventsList[IE]): void
        • Parameters

          • data: IEventsList[IE]

          Returns void

    Returns this

Static on

  • on<IE>(eventName: IE, listener: function): this
  • Adds the listener export function to the end of the listeners array for the event named eventName.

    Type parameters

    • IE: keyof IEventsList

    Parameters

    • eventName: IE
    • listener: function
        • (data: IEventsList[IE]): void
        • Parameters

          • data: IEventsList[IE]

          Returns void

    Returns this

Static once

  • once<IE>(eventName: IE, listener: function): this
  • Adds a one-time listener export function for the event named eventName.

    Type parameters

    • IE: keyof IEventsList

    Parameters

    • eventName: IE
    • listener: function
        • (data: IEventsList[IE]): void
        • Parameters

          • data: IEventsList[IE]

          Returns void

    Returns this

Generated using TypeDoc