Script API - v1.26.30.28
    Preparing search index...

    A promise wrapper utility which returns a new promise that will resolve when the next event is raised.

    interface EventPromise<T> {
        "[toStringTag]": string;
        cancel(): void;
        catch<TReject = never>(
            onrejected?:
                | ((reason: unknown) => TReject | PromiseLike<TReject>)
                | null,
        ): Promise<T | TReject | undefined>;
        finally(onfinally?: (() => void) | null): Promise<T | undefined>;
        then<TFulfill = T | undefined, TReject = never>(
            onfulfilled?:
                | ((value: T | undefined) => TFulfill | PromiseLike<TFulfill>)
                | null,
            onrejected?: ((reason: unknown) => TReject | PromiseLike<TReject>) | null,
        ): Promise<TFulfill | TReject>;
    }

    Type Parameters

    • T

    Hierarchy

    • Promise<T | undefined>
      • EventPromise
    Index

    Properties

    "[toStringTag]": string

    Methods

    • Cancels the promise and unsubscribes from the event signal. Cancellation is done by fulfilling with undefined.

      Returns void

    • Promise-like interface catch.

      Type Parameters

      • TReject = never

      Parameters

      • Optionalonrejected: ((reason: unknown) => TReject | PromiseLike<TReject>) | null

        Called if the promise rejects

      Returns Promise<T | TReject | undefined>

    • Promise-like interface finally.

      Parameters

      • Optionalonfinally: (() => void) | null

        Called when the promise resolves

      Returns Promise<T | undefined>

    • Promise-like interface then.

      Type Parameters

      • TFulfill = T | undefined
      • TReject = never

      Parameters

      • Optionalonfulfilled: ((value: T | undefined) => TFulfill | PromiseLike<TFulfill>) | null

        Called if the promise fulfills

      • Optionalonrejected: ((reason: unknown) => TReject | PromiseLike<TReject>) | null

        Called if the promise rejects

      Returns Promise<TFulfill | TReject>