Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface EndpointInterface<D>

Type parameters

  • D: object = object

Hierarchy

  • EndpointInterface

Callable

Index

Properties

Methods

Properties

DEFAULTS

DEFAULTS: D & RequestParameters & { baseUrl: string; headers: RequestHeaders & { accept: string; user-agent: string }; mediaType: { format: string; previews: string[] }; method: RequestMethod; url?: string }

Object with current default route and parameters

merge

merge: { <R, P>(route: R | keyof Endpoints, parameters?: P): D & R extends keyof Endpoints ? Endpoints[R]["request"] & Endpoints[R]["parameters"] : EndpointDefaults & P; <P>(options: P): RequestParameters & { baseUrl: string; headers: RequestHeaders & { accept: string; user-agent: string }; mediaType: { format: string; previews: string[] }; method: RequestMethod; url?: string } & D & P; (): D & RequestParameters & { baseUrl: string; headers: RequestHeaders & { accept: string; user-agent: string }; mediaType: { format: string; previews: string[] }; method: RequestMethod; url?: string } }

Type declaration

Methods

defaults

parse

  • Stateless method to turn endpoint options into request options. Calling endpoint(options) is the same as calling endpoint.parse(endpoint.merge(options)).

    Type parameters

    Parameters

    • options: O

      method, url. Plus URL, query or body parameters, as well as headers, mediaType.{format|previews}, request, or baseUrl.

    Returns RequestOptions & Pick<O, keyof RequestOptions>

Generated using TypeDoc