evented: {
    handlers: Record<string, unknown>;
    getHandlers(event: string): Function[];
    off(event: string, handler: Function): void;
    on(event: string, handler: Function): void;
    one(event: string, handler: Function): void;
    trigger(event: string, ...args: any[]): void;
}

The evented mixin provides methods allowing an object to trigger events, running externally registered event handlers.

Deprecated

v1.2, to be removed in v2.0

Type declaration

  • Protected handlers: Record<string, unknown>

    Arrays of registered event handlers, grouped by the event name.

    Deprecated

  • getHandlers:function
  • off:function
    • Unregister an event handler.

      Deprecated

      Parameters

      • event: string

        The name of the event.

      • handler: Function

        The function that handles the event.

      Returns void

  • on:function
    • Register an event handler.

      Deprecated

      Parameters

      • event: string

        The name of the event.

      • handler: Function

        The function to handle the event.

      Returns void

  • one:function
    • Register an event handler so that it will run only once, and then unregister itself.

      Deprecated

      Parameters

      • event: string

        The name of the event.

      • handler: Function

        The function to handle the event.

      Returns void

  • trigger:function
    • Trigger an event.

      Deprecated

      Parameters

      • event: string

        The name of the event.

      • Rest ...args: any[]

        Arguments to pass to event handlers.

      Returns void

Generated using TypeDoc v0.23.24