Class BrowserEventDispatcher<T>

A concrete implementation of EventDispatcher that dispatches events to the browser window.

Type Parameters

  • T extends {
        type: string;
    }

Hierarchy

  • BrowserEventDispatcher

Implements

Constructors

Methods

  • Adds an event listener to the browser window.

    Returns

    A function that removes the listener.

    Type Parameters

    • P extends `ton-connect-${string}` | `ton-connect-ui-${string}`

    Parameters

    • eventName: P

      The name of the event to listen for.

    • listener: ((event: CustomEvent<T & {
          type: RemoveTonConnectPrefix<P>;
      }>) => void)

      The listener to add.

    • Optional options: AddEventListenerOptions

      The options for the listener.

    Returns Promise<(() => void)>

Generated using TypeDoc