declare class REST extends AsyncEventEmitter<RestEvents>Represents the class that manages handlers for endpoints
Constructors
externalconstructor(options?: Partial<RESTOptions>)
Constructs a new instance of the REST class
externalagent : Dispatcher | null
The Agent for all requests performed by this manager.
readonlyexternalcdn : CDN
externalglobalRemaining : number
The number of requests remaining in the global bucket
externalglobalReset : number
The timestamp at which the global bucket resets
readonlyexternalhandlers : Collection<string, IHandler>
Request handlers created from the bucket hash and the major parameters
readonlyexternalhashes : Collection<string, HashData>
API bucket hashes that are cached from provided routes
readonlyexternaloptions : RESTOptions
external clearHandlerSweeper() : void
Stops the request handler sweeping interval
external clearHashSweeper() : void
Stops the hash sweeping interval
external delete(fullRoute: RouteLikeoptions?: RequestData) : Promise<unknown>
Runs a delete request from the api
external get(fullRoute: RouteLikeoptions?: RequestData) : Promise<unknown>
Runs a get request from the api
external patch(fullRoute: RouteLikeoptions?: RequestData) : Promise<unknown>
Runs a patch request from the api
external post(fullRoute: RouteLikeoptions?: RequestData) : Promise<unknown>
Runs a post request from the api
external put(fullRoute: RouteLikeoptions?: RequestData) : Promise<unknown>
Runs a put request from the api
external queueRequest(request: InternalRequest) : Promise<ResponseLike>
Queues a request to be sent
Returns: The response from the api request
external request(options: InternalRequest) : Promise<unknown>
Runs a request from the api
external setAgent(agent: Dispatcher) : this
Sets the default agent to use for requests performed by this manager
external setToken(token: string) : this
Sets the authorization token that should be used for requests