Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • PromiseConstructor

Index

Constructors

  • new PromiseConstructor<T>(executor: ((resolve: ((value: T | PromiseLike<T>) => void), reject: ((reason?: any) => void)) => void)): internal.Promise<T>
  • Creates a new Promise.

    Type Parameters

    • T

    Parameters

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

      A callback used to initialize the promise. This callback is passed two arguments: a resolve callback used to resolve the promise with a value or the result of another promise, and a reject callback used to reject the promise with a provided reason or error.

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

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

                • Optional reason: any

                Returns void

          Returns void

    Returns internal.Promise<T>

Properties

prototype: internal.Promise<any>

A reference to the prototype.

Methods

  • Creates a Promise that is resolved with an array of results when all of the provided Promises resolve, or rejected when any Promise is rejected.

    Type Parameters

    • T

    Parameters

    Returns internal.Promise<Awaited<T>[]>

    A new Promise.

  • Creates a Promise that is resolved with an array of results when all of the provided Promises resolve, or rejected when any Promise is rejected.

    Type Parameters

    • T extends readonly unknown[] | []

    Parameters

    • values: T

      An array of Promises.

    Returns internal.Promise<{ -readonly [ P in string | number | symbol]: Awaited<T[P]> }>

    A new Promise.

  • Creates a Promise that is resolved with an array of results when all of the provided Promises resolve or reject.

    Type Parameters

    • T extends readonly unknown[] | []

    Parameters

    • values: T

      An array of Promises.

    Returns internal.Promise<{ -readonly [ P in string | number | symbol]: PromiseSettledResult<Awaited<T[P]>> }>

    A new Promise.

  • Creates a Promise that is resolved with an array of results when all of the provided Promises resolve or reject.

    Type Parameters

    • T

    Parameters

    Returns internal.Promise<PromiseSettledResult<Awaited<T>>[]>

    A new Promise.

  • The any function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an AggregateError containing an array of rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm.

    Type Parameters

    • T extends readonly unknown[] | []

    Parameters

    • values: T

      An array or iterable of Promises.

    Returns internal.Promise<Awaited<T[number]>>

    A new Promise.

  • The any function returns a promise that is fulfilled by the first given promise to be fulfilled, or rejected with an AggregateError containing an array of rejection reasons if all of the given promises are rejected. It resolves all elements of the passed iterable to promises as it runs this algorithm.

    Type Parameters

    • T

    Parameters

    Returns internal.Promise<Awaited<T>>

    A new Promise.

  • Creates a Promise that is resolved or rejected when any of the provided Promises are resolved or rejected.

    Type Parameters

    • T

    Parameters

    Returns internal.Promise<Awaited<T>>

    A new Promise.

  • Creates a Promise that is resolved or rejected when any of the provided Promises are resolved or rejected.

    Type Parameters

    • T extends readonly unknown[] | []

    Parameters

    • values: T

      An array of Promises.

    Returns internal.Promise<Awaited<T[number]>>

    A new Promise.

  • Creates a new rejected promise for the provided reason.

    Type Parameters

    • T = never

    Parameters

    • Optional reason: any

      The reason the promise was rejected.

    Returns internal.Promise<T>

    A new rejected Promise.

  • Creates a new resolved promise.

    Returns internal.Promise<void>

    A resolved promise.

  • Creates a new resolved promise for the provided value.

    Type Parameters

    • T

    Parameters

    • value: T

      A promise.

    Returns internal.Promise<Awaited<T>>

    A promise whose internal state matches the provided promise.

  • Creates a new resolved promise for the provided value.

    Type Parameters

    • T

    Parameters

    Returns internal.Promise<Awaited<T>>

    A promise whose internal state matches the provided promise.

Generated using TypeDoc