hoshii / Exports / RequestHandler

RequestHandler

Represents a request handler to handle requests to the Guilded API

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new RequestHandler(client, options?)

Create a new RequestHandler

Parameters

NameTypeDescription
clientClientThe client
optionsRESTOptionsThe options for the request handler

Defined in

lib/rest/RequestHandler.ts:87open in new window

Properties

_client

Private _client: Client

The client

Defined in

lib/rest/RequestHandler.ts:55open in new window


globalBlock

globalBlock: boolean = false

Whether the request is globally blocked

Defined in

lib/rest/RequestHandler.ts:60open in new window


latencyRef

latencyRef: LatencyRef

The latency reference

Defined in

lib/rest/RequestHandler.ts:65open in new window


options

options: RESTOptions

The options for the request handler

Defined in

lib/rest/RequestHandler.ts:70open in new window


ratelimits

ratelimits: Record<string, SequentialBucket> = {}

The ratelimits for the request handler

Defined in

lib/rest/RequestHandler.ts:75open in new window


readyQueue

readyQueue: () => void[] = []

The ready queue for the request handler

Defined in

lib/rest/RequestHandler.ts:80open in new window

Methods

authRequest

authRequest<T>(options): Promise<T>

Sends an authenticated request to the Guilded API

Type parameters

NameType
Tunknown

Parameters

NameTypeDescription
optionsOmit<RequestOptions, "auth">The request options

Returns

Promise<T>

Defined in

lib/rest/RequestHandler.ts:122open in new window


globalUnblock

Private globalUnblock(): void

Unblock the request handler

Returns

void

Defined in

lib/rest/RequestHandler.ts:134open in new window


request

request<T>(options): Promise<T>

Sends a request to the Guilded API

Type parameters

NameType
Tunknown

Parameters

NameTypeDescription
optionsRequestOptionsThe request options

Returns

Promise<T>

Defined in

lib/rest/RequestHandler.ts:147open in new window

Last Updated:
Contributors: Reinhardt