Options
All
  • Public
  • Public/Protected
  • All
Menu
export
interface

TxiosPromise

template

T

extends

{Promise}

description

txios 函数返回的是一个 Promise 对象 所以定义这个接口,它继承于泛型接口 Promise 当 txios 返回 TxiosPromise 类型时,resolve 函数中的参数 就是一个 TxiosResponse 类型

Type parameters

  • T

Hierarchy

Index

Properties

Promise

Promise: PromiseConstructor

[Symbol.toStringTag]

[Symbol.toStringTag]: string

Methods

catch

  • catch<TResult>(onrejected?: function | undefined | null): Promise<TxiosResponse<T> | TResult>
  • Attaches a callback for only the rejection of the Promise.

    Type parameters

    • TResult

    Parameters

    • Optional onrejected: function | undefined | null

      The callback to execute when the Promise is rejected.

    Returns Promise<TxiosResponse<T> | TResult>

    A Promise for the completion of the callback.

finally

  • finally(onfinally?: function | undefined | null): Promise<TxiosResponse<T>>
  • Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.

    Parameters

    • Optional onfinally: function | undefined | null

      The callback to execute when the Promise is settled (fulfilled or rejected).

    Returns Promise<TxiosResponse<T>>

    A Promise for the completion of the callback.

then

  • then<TResult1, TResult2>(onfulfilled?: function | undefined | null, onrejected?: function | undefined | null): Promise<TResult1 | TResult2>
  • Attaches callbacks for the resolution and/or rejection of the Promise.

    Type parameters

    • TResult1

    • TResult2

    Parameters

    • Optional onfulfilled: function | undefined | null

      The callback to execute when the Promise is resolved.

    • Optional onrejected: function | undefined | null

      The callback to execute when the Promise is rejected.

    Returns Promise<TResult1 | TResult2>

    A Promise for the completion of which ever callback is executed.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • 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

Generated using TypeDoc