Options
All
  • Public
  • Public/Protected
  • All
Menu

Tracks event listeners and notifies them when events occur.

Hierarchy

  • EventManager

Index

Constructors

constructor

Properties

on

on: (eventType: string, callback: (ev: Event) => any, id?: string) => string = ...

Type declaration

    • (eventType: string, callback: (ev: Event) => any, id?: string): string
    • Add an event listener to the listener list.

      Parameters

      • eventType: string

        The type of the event.

      • callback: (ev: Event) => any

        The listener to call when the specified event type occurs

      • Optional id: string

        Optional. An Id to reference the listener by.

      Returns string

      The id to reference the listener by. For use in removing the listener. If not explicitly provided a listener Id will be generated.

Methods

addEventListener

  • addEventListener(eventType: string, callback: (ev: Event) => any, id?: string): string
  • Add an event listener to the listener list.

    Parameters

    • eventType: string

      The type of the event.

    • callback: (ev: Event) => any

      The listener to call when the specified event type occurs

    • Optional id: string

      Optional. An Id to reference the listener by.

    Returns string

    The id to reference the listener by. For use in removing the listener. If not explicitly provided a listener Id will be generated.

clearEventListeners

  • clearEventListeners(eventType: string): void
  • Clear all event listeners for a given event type.

    Parameters

    • eventType: string

      The type of the event.

    Returns void

notify

  • notify(event: Event): void
  • notify(eventType: string, data?: any, time?: number): void
  • Notify event listeners when an event has occured. Overloads:

    • notify(anEvent);
    • notify(eventType, someDate, eventTime);

    Parameters

    Returns void

  • Notify event listeners when an event has occured. Overloads:

    • notify(anEvent);
    • notify(eventType, someDate, eventTime);

    Parameters

    • eventType: string
    • Optional data: any
    • Optional time: number

    Returns void

removeEventListener

  • removeEventListener(eventListenerId: string): void
  • Remove an event listener.

    Parameters

    • eventListenerId: string

      The id of the listener to remove.

    Returns void

Generated using TypeDoc