Script API - v1.21.130.27
    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>,
        ): Promise<T | TReject>;
        finally(onfinally?: () => void): Promise<T>;
        then<TFulfill = T, TReject = never>(
            onfulfilled?: (value: T) => TFulfill | PromiseLike<TFulfill>,
            onrejected?: (reason: unknown) => TReject | PromiseLike<TReject>,
        ): 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>

        Called if the promise rejects

      Returns Promise<T | TReject>

    • Promise-like interface finally.

      Parameters

      • Optionalonfinally: () => void

        Called when the promise resolves

      Returns Promise<T>

    • Promise-like interface then.

      Type Parameters

      • TFulfill = T
      • TReject = never

      Parameters

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

        Called if the promise fulfills

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

        Called if the promise rejects

      Returns Promise<TFulfill | TReject>