Interface HasEventHandling

Base class providing an event listener API for Deephaven JS client objects.

Hierarchy

  • HasEventHandling

Implemented by

Methods

  • Listen for events on this object.

    Type Parameters

    • T

      The type of the data that the event will provide.

    Parameters

    • name: string

      The name of the event to listen for.

    • callback: ((e) => void)

      A function to call when the event occurs.

        • (e): void
        • Parameters

          Returns void

    Returns (() => void)

    Returns a cleanup function.

      • (): void
      • Listen for events on this object.

        Returns void

        Returns a cleanup function.

  • Checks whether any event listeners are registered for the given event name.

    Parameters

    • name: string

      The event name.

    Returns boolean

    true if there is at least one listener registered for name; false otherwise.

  • Returns a promise that resolves the next time the named event occurs, with the value of the event's detail. If a timeout is specified and occurs before the event takes place, the promise will reject, otherwise waits indefinitely.

    Type Parameters

    • T

      The type of the event detail.

    Parameters

    • eventName: string

      The event name.

    • Optional timeoutInMillis: number

      Optional timeout in milliseconds.

    Returns Promise<Event<T>>

    A promise that resolves with the next matching event.

  • Removes an event listener added to this table.

    Type Parameters

    • T

    Parameters

    • name: string
    • callback: ((e) => void)
        • (e): void
        • Parameters

          Returns void

    Returns boolean