Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface EndpointInterface

Hierarchy

  • EndpointInterface

Callable

  • __call(options: EndpointOptions): RequestOptions
  • __call<R>(route: keyof Endpoints | R, options?: R extends keyof Endpoints ? Endpoints[R]["parameters"] & RequestParameters : RequestParameters): R extends keyof Endpoints ? Endpoints[R]["request"] : RequestOptions
  • Transforms a GitHub REST API endpoint into generic request options

    Parameters

    Returns RequestOptions

  • Transforms a GitHub REST API endpoint into generic request options

    Type parameters

    Parameters

    • route: keyof Endpoints | R

      Request method + URL. Example: 'GET /orgs/:org'

    • Optional options: R extends keyof Endpoints ? Endpoints[R]["parameters"] & RequestParameters : RequestParameters

    Returns R extends keyof Endpoints ? Endpoints[R]["request"] : RequestOptions

Index

Properties

DEFAULTS

Object with current default route and parameters

defaults

defaults: function

Returns a new endpoint with updated route and parameters

Type declaration

merge

merge: function

Type declaration

parse

parse: function

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

param

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

Type declaration

Generated using TypeDoc