REST
declare class REST extends EventEmitter
declare class REST extends EventEmitter
No summary provided.
Extends
EventEmitterconstructor(options?)
Constructs a new instance of the
REST
className | Type | Optional | Description |
---|---|---|---|
options | Partial<RESTOptions> | Yes | None |
Readonly
cdn
:
CDN
Readonly
requestManager
:
RequestManager
emit
:
(<K extends keyof RestEvents>(event: K, ...args: RestEvents[K]) => boolean) & (<S extends string | symbol>(event: Exclude<S, keyof RestEvents>, ...args: any[]) => boolean)
Inherited from REST
off
:
(<K extends keyof RestEvents>(event: K, listener: (...args: RestEvents[K]) => void) => this) & (<S extends string | symbol>(event: Exclude<S, keyof RestEvents>, listener: (...args: any[]) => void) => this)
Inherited from REST
on
:
(<K extends keyof RestEvents>(event: K, listener: (...args: RestEvents[K]) => void) => this) & (<S extends string | symbol>(event: Exclude<S, keyof RestEvents>, listener: (...args: any[]) => void) => this)
Inherited from REST
once
:
(<K extends keyof RestEvents>(event: K, listener: (...args: RestEvents[K]) => void) => this) & (<S extends string | symbol>(event: Exclude<S, keyof RestEvents>, listener: (...args: any[]) => void) => this)
Inherited from REST
removeAllListeners
:
(<K extends keyof RestEvents>(event?: K) => this) & (<S extends string | symbol>(event?: Exclude<S, keyof RestEvents>) => this)
Inherited from REST
delete(fullRoute, options?)
:
Promise<unknown>
Runs a delete request from the api
Name | Type | Optional | Description |
---|---|---|---|
fullRoute | RouteLike | No | The full route to query |
options | RequestData | Yes | Optional request options |
get(fullRoute, options?)
:
Promise<unknown>
Runs a get request from the api
Name | Type | Optional | Description |
---|---|---|---|
fullRoute | RouteLike | No | The full route to query |
options | RequestData | Yes | Optional request options |
getAgent()
:
Dispatcher | null
Gets the agent set for this instance
patch(fullRoute, options?)
:
Promise<unknown>
Runs a patch request from the api
Name | Type | Optional | Description |
---|---|---|---|
fullRoute | RouteLike | No | The full route to query |
options | RequestData | Yes | Optional request options |
post(fullRoute, options?)
:
Promise<unknown>
Runs a post request from the api
Name | Type | Optional | Description |
---|---|---|---|
fullRoute | RouteLike | No | The full route to query |
options | RequestData | Yes | Optional request options |
put(fullRoute, options?)
:
Promise<unknown>
Runs a put request from the api
Name | Type | Optional | Description |
---|---|---|---|
fullRoute | RouteLike | No | The full route to query |
options | RequestData | Yes | Optional request options |
raw(options)
:
Promise<Dispatcher.ResponseData>
Runs a request from the API, yielding the raw Response object
Name | Type | Optional | Description |
---|---|---|---|
options | InternalRequest | No | Request options |
request(options)
:
Promise<unknown>
Runs a request from the api
Name | Type | Optional | Description |
---|---|---|---|
options | InternalRequest | No | Request options |
setAgent(agent)
:
this
Sets the default agent to use for requests performed by this instance
Name | Type | Optional | Description |
---|---|---|---|
agent | Dispatcher | No | Sets the agent to use |
setToken(token)
:
this
Sets the authorization token that should be used for requests
Name | Type | Optional | Description |
---|---|---|---|
token | string | No | The authorization token to use |