Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Node<IEventsList>

Already mixed class. Plug and play.

Type parameters

Hierarchy

Indexable

[key: string]: any

Already mixed class. Plug and play.

Index

Constructors

Properties

Methods

Constructors

Static constructor

  • new Node(id?: string): Node

Properties

Static emitter

emitter: EventEmitter

Native nodejs EventEmitter.

Static id

id: string

Unic string for this node.

Static isDestroyed

isDestroyed: boolean

Does this node took the destroy command?

Methods

Static destroy

  • destroy(): void

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 generateId

  • generateId(): string

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