Options
All
  • Public
  • Public/Protected
  • All
Menu

Class List<IN, IEventsList>

Already mixed class. Plug and play.

Type parameters

Hierarchy

Indexable

[key: string]: any

Already mixed class. Plug and play.

Index

Constructors

Static constructor

  • new List(id?: string): List

Properties

Static Node

Node: TClass<IN>

Node class for simple adding new item to list.

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?

Static nodes

nodes: object

Container for list.

Type declaration

  • [id: string]: IN

Methods

Static add

  • add(node: IN): this

Static create

  • create(id?: string): IN

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

Static remove

  • remove(node: IN): this

Static wrap

  • wrap(node: IN): this

Generated using TypeDoc