Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Promise<T>

Type parameters

  • T

Hierarchy

  • PromiseLike<T>

Index

Methods

Methods

catch

  • catch<U>(onRejected?: function): Promise<U>
  • catch<U>(onRejected?: function): Promise<U>
  • catch<U>(onRejected?: function): Promise<U>
  • Sugar for promise.then(undefined, onRejected)

    Type parameters

    • U

    Parameters

    • Optional onRejected: function

      called when/if "promise" rejects

        • (error: any): PromiseLike<U>
        • Parameters

          • error: any

          Returns PromiseLike<U>

    Returns Promise<U>

  • Sugar for promise.then(undefined, onRejected)

    Type parameters

    • U

    Parameters

    • Optional onRejected: function

      called when/if "promise" rejects

        • (error: any): U
        • Parameters

          • error: any

          Returns U

    Returns Promise<U>

  • Sugar for promise.then(undefined, onRejected)

    Type parameters

    • U

    Parameters

    • Optional onRejected: function

      called when/if "promise" rejects

        • (error: any): void
        • Parameters

          • error: any

          Returns void

    Returns Promise<U>

then

  • then<U>(onFulfilled?: function, onRejected?: function): Promise<U>
  • then<U>(onFulfilled?: function, onRejected?: function): Promise<U>
  • then<U>(onFulfilled?: function, onRejected?: function): Promise<U>
  • then<U>(onFulfilled?: function, onRejected?: function): Promise<U>
  • then<U>(onFulfilled?: function, onRejected?: function): Promise<U>
  • then<U>(onFulfilled?: function, onRejected?: function): Promise<U>
  • onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects. Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called. Both callbacks have a single parameter , the fulfillment value or rejection reason. "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve. If an error is thrown in the callback, the returned promise rejects with that error.

    Type parameters

    • U

    Parameters

    • Optional onFulfilled: function

      called when/if "promise" resolves

        • (value: T): PromiseLike<U>
        • Parameters

          • value: T

          Returns PromiseLike<U>

    • Optional onRejected: function

      called when/if "promise" rejects

        • (error: any): PromiseLike<U>
        • Parameters

          • error: any

          Returns PromiseLike<U>

    Returns Promise<U>

  • onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects. Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called. Both callbacks have a single parameter , the fulfillment value or rejection reason. "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve. If an error is thrown in the callback, the returned promise rejects with that error.

    Type parameters

    • U

    Parameters

    • Optional onFulfilled: function

      called when/if "promise" resolves

        • (value: T): PromiseLike<U>
        • Parameters

          • value: T

          Returns PromiseLike<U>

    • Optional onRejected: function

      called when/if "promise" rejects

        • (error: any): U
        • Parameters

          • error: any

          Returns U

    Returns Promise<U>

  • onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects. Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called. Both callbacks have a single parameter , the fulfillment value or rejection reason. "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve. If an error is thrown in the callback, the returned promise rejects with that error.

    Type parameters

    • U

    Parameters

    • Optional onFulfilled: function

      called when/if "promise" resolves

        • (value: T): PromiseLike<U>
        • Parameters

          • value: T

          Returns PromiseLike<U>

    • Optional onRejected: function

      called when/if "promise" rejects

        • (error: any): void
        • Parameters

          • error: any

          Returns void

    Returns Promise<U>

  • onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects. Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called. Both callbacks have a single parameter , the fulfillment value or rejection reason. "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve. If an error is thrown in the callback, the returned promise rejects with that error.

    Type parameters

    • U

    Parameters

    • Optional onFulfilled: function

      called when/if "promise" resolves

        • (value: T): U
        • Parameters

          • value: T

          Returns U

    • Optional onRejected: function

      called when/if "promise" rejects

        • (error: any): PromiseLike<U>
        • Parameters

          • error: any

          Returns PromiseLike<U>

    Returns Promise<U>

  • onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects. Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called. Both callbacks have a single parameter , the fulfillment value or rejection reason. "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve. If an error is thrown in the callback, the returned promise rejects with that error.

    Type parameters

    • U

    Parameters

    • Optional onFulfilled: function

      called when/if "promise" resolves

        • (value: T): U
        • Parameters

          • value: T

          Returns U

    • Optional onRejected: function

      called when/if "promise" rejects

        • (error: any): U
        • Parameters

          • error: any

          Returns U

    Returns Promise<U>

  • onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects. Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called. Both callbacks have a single parameter , the fulfillment value or rejection reason. "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve. If an error is thrown in the callback, the returned promise rejects with that error.

    Type parameters

    • U

    Parameters

    • Optional onFulfilled: function

      called when/if "promise" resolves

        • (value: T): U
        • Parameters

          • value: T

          Returns U

    • Optional onRejected: function

      called when/if "promise" rejects

        • (error: any): void
        • Parameters

          • error: any

          Returns void

    Returns Promise<U>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method