Type Parameters

  • T

Hierarchy

  • CancelablePromise

Implements

  • Promise<T>

Constructors

  • Type Parameters

    • T

    Parameters

    • executor: ((resolve: ((value: T | PromiseLike<T>) => void), reject: ((reason?: any) => void), onCancel: OnCancel) => void)
        • (resolve: ((value: T | PromiseLike<T>) => void), reject: ((reason?: any) => void), onCancel: OnCancel): void
        • Parameters

          • resolve: ((value: T | PromiseLike<T>) => void)
              • (value: T | PromiseLike<T>): void
              • Parameters

                • value: T | PromiseLike<T>

                Returns void

          • reject: ((reason?: any) => void)
              • (reason?: any): void
              • Parameters

                • Optional reason: any

                Returns void

          • onCancel: OnCancel

          Returns void

    Returns CancelablePromise<T>

Properties

#cancelHandlers: (() => void)[]
#isCancelled: boolean
#isRejected: boolean
#isResolved: boolean
#promise: Promise<T>
#reject?: ((reason?: any) => void)

Type declaration

    • (reason?: any): void
    • Parameters

      • Optional reason: any

      Returns void

#resolve?: ((value: T | PromiseLike<T>) => void)

Type declaration

    • (value: T | PromiseLike<T>): void
    • Parameters

      • value: T | PromiseLike<T>

      Returns void

[toStringTag]: string

Accessors

  • get isCancelled(): boolean
  • Returns boolean

Methods

  • Returns void

  • Type Parameters

    • TResult = never

    Parameters

    • Optional onRejected: ((reason: any) => TResult | PromiseLike<TResult>)
        • (reason: any): TResult | PromiseLike<TResult>
        • Parameters

          • reason: any

          Returns TResult | PromiseLike<TResult>

    Returns Promise<T | TResult>

  • Parameters

    • Optional onFinally: (() => void)
        • (): void
        • Returns void

    Returns Promise<T>

  • Type Parameters

    • TResult1 = T

    • TResult2 = never

    Parameters

    • Optional onFulfilled: ((value: T) => TResult1 | PromiseLike<TResult1>)
        • (value: T): TResult1 | PromiseLike<TResult1>
        • Parameters

          • value: T

          Returns TResult1 | PromiseLike<TResult1>

    • Optional onRejected: ((reason: any) => TResult2 | PromiseLike<TResult2>)
        • (reason: any): TResult2 | PromiseLike<TResult2>
        • Parameters

          • reason: any

          Returns TResult2 | PromiseLike<TResult2>

    Returns Promise<TResult1 | TResult2>