Search...

REST

export declare class REST extends EventEmitter 
export declare class REST extends EventEmitter 

No summary provided.

Extends

EventEmitter

constructor(options?)

Constructs a new instance of the REST class
NameTypeOptionalDescription
optionsPartial<RESTOptions>YesNone
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
NameTypeOptionalDescription
fullRouteRouteLikeNoThe full route to query
optionsRequestDataYesOptional request options

get(fullRoute, options?)

:

Promise<unknown>

Runs a get request from the api
NameTypeOptionalDescription
fullRouteRouteLikeNoThe full route to query
optionsRequestDataYesOptional request options

getAgent()

:

Dispatcher | null

Gets the agent set for this instance

patch(fullRoute, options?)

:

Promise<unknown>

Runs a patch request from the api
NameTypeOptionalDescription
fullRouteRouteLikeNoThe full route to query
optionsRequestDataYesOptional request options

post(fullRoute, options?)

:

Promise<unknown>

Runs a post request from the api
NameTypeOptionalDescription
fullRouteRouteLikeNoThe full route to query
optionsRequestDataYesOptional request options

put(fullRoute, options?)

:

Promise<unknown>

Runs a put request from the api
NameTypeOptionalDescription
fullRouteRouteLikeNoThe full route to query
optionsRequestDataYesOptional request options

raw(options)

:

Promise<Dispatcher.ResponseData>

Runs a request from the API, yielding the raw Response object
NameTypeOptionalDescription
optionsInternalRequestNoRequest options

request(options)

:

Promise<unknown>

Runs a request from the api
NameTypeOptionalDescription
optionsInternalRequestNoRequest options

setAgent(agent)

:

this

Sets the default agent to use for requests performed by this instance
NameTypeOptionalDescription
agentDispatcherNoSets the agent to use

setToken(token)

:

this

Sets the authorization token that should be used for requests
NameTypeOptionalDescription
tokenstringNoThe authorization token to use