Options
All
  • Public
  • Public/Protected
  • All
Menu

Module core

Index

Variables

GlobalOptions: { yafetch: Omit<Options, "body" | "data" | "window" | "signal" | "skipPlugins"> } = ...
description

Global options to use for all API calls

Type declaration

  • yafetch: Omit<Options, "body" | "data" | "window" | "signal" | "skipPlugins">

Functions

  • default(request: RequestInfo): Promise<Response>
  • default(request: RequestInfo, options: Options): Promise<Response>
  • default(request: RequestInfo, options: undefined | Options, returnAs: "text"): Promise<string>
  • default(request: RequestInfo, options: undefined | Options, returnAs: "blob"): Promise<Blob>
  • default(request: RequestInfo, options: undefined | Options, returnAs: "formData"): Promise<FormData>
  • default(request: RequestInfo, options: undefined | Options, returnAs: "arrayBuffer"): Promise<ArrayBuffer>
  • default<TResponse>(request: RequestInfo, options: undefined | Options, returnAs: "json"): Promise<TResponse>
  • description

    Make a fetch call and return the response

    Parameters

    • request: RequestInfo

      Existing request or a url

    Returns Promise<Response>

  • description

    Make a fetch call and return the response

    Parameters

    • request: RequestInfo

      Existing request or a url

    • options: Options

      Fetch options

    Returns Promise<Response>

  • description

    Make a fetch call and return the response

    Parameters

    • request: RequestInfo

      Existing request or a url

    • options: undefined | Options

      Fetch options

    • returnAs: "text"

      Parse response as string

    Returns Promise<string>

  • description

    Make a fetch call and return the response

    Parameters

    • request: RequestInfo

      Existing request or a url

    • options: undefined | Options

      Fetch options

    • returnAs: "blob"

      Parse response as Blob

    Returns Promise<Blob>

  • description

    Make a fetch call and return the response

    Parameters

    • request: RequestInfo

      Existing request or a url

    • options: undefined | Options

      Fetch options

    • returnAs: "formData"

      Parse response as FormData

    Returns Promise<FormData>

  • description

    Make a fetch call and return the response

    Parameters

    • request: RequestInfo

      Existing request or a url

    • options: undefined | Options

      Fetch options

    • returnAs: "arrayBuffer"

      Parse response as ArrayBuffer

    Returns Promise<ArrayBuffer>

  • description

    Make a fetch call and return the response

    Type parameters

    • TResponse

    Parameters

    • request: RequestInfo

      Existing request or a url

    • options: undefined | Options

      Fetch options

    • returnAs: "json"

      Parse response as a JSON object

    Returns Promise<TResponse>

  • description

    Merge per-request options with global options

    Parameters

    • Optional options: Options

      Incoming options to merge with global options

    Returns Options

    Merged per-request and global options

Generated using TypeDoc