Skip to main content

HttpResponseType

Used with TwinfinityApiClient.get to convert responses to correct data. See TwinfinityApiClient.get for an example.

Index

Properties

publicreadonlyarrayBuffer

arrayBuffer: (r: Response) => TypedResponse<ArrayBuffer>

Converts an array buffer Response to

<ArrayBuffer>
.


Type declaration

publicreadonlyblob

blob: (r: Response) => TypedResponse<Blob>

Converts a blob Response to

<Blob>
.


Type declaration

publicreadonlyempty

empty: (r: Response) => TypedResponse<undefined>

Converts an empty Response to

<undefined>
.


Type declaration

publicreadonlyjson

json: <T>(r: Response) => TypedResponse<T>

Converts a JSON Response to TypedResponse.


Type declaration

publicreadonlytext

text: (r: Response) => TypedResponse<string>

Converts a text Response to

<string>
.


Type declaration

publicstaticreadonlydefault

default: HttpResponseType = ...

By default, TypedResponse.value conversion methods only assign TypedResponse.value when Response.status === 200

Methods

publicstaticarrayBuffer

  • Converts an array buffer Response to

    <ArrayBuffer>
    .


    Parameters

    • r: Response

    Returns TypedResponse<ArrayBuffer>

publicstaticblob

  • Converts a blob Response to

    <Blob>
    .


    Parameters

    • r: Response

    Returns TypedResponse<Blob>

publicstaticjson

publicstaticstatus

publicstatictext

  • Converts a text Response to

    <string>
    .


    Parameters

    • r: Response

    Returns TypedResponse<string>