mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
ci: api-extractor support for docs
This commit is contained in:
@@ -39,11 +39,13 @@ export interface RequestData {
|
||||
appendToFormData?: boolean;
|
||||
/**
|
||||
* If this request needs the `Authorization` header
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
auth?: boolean;
|
||||
/**
|
||||
* The authorization prefix to use for this request, useful if you use this with bearer tokens
|
||||
*
|
||||
* @default 'Bot'
|
||||
*/
|
||||
authPrefix?: 'Bot' | 'Bearer';
|
||||
@@ -79,6 +81,7 @@ export interface RequestData {
|
||||
reason?: string;
|
||||
/**
|
||||
* If this request should be versioned
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
versioned?: boolean;
|
||||
@@ -273,7 +276,8 @@ export class RequestManager extends EventEmitter {
|
||||
|
||||
/**
|
||||
* Sets the default agent to use for requests performed by this manager
|
||||
* @param agent The agent to use
|
||||
*
|
||||
* @param agent - The agent to use
|
||||
*/
|
||||
public setAgent(agent: Dispatcher) {
|
||||
this.agent = agent;
|
||||
@@ -282,7 +286,8 @@ export class RequestManager extends EventEmitter {
|
||||
|
||||
/**
|
||||
* Sets the authorization token that should be used for requests
|
||||
* @param token The authorization token to use
|
||||
*
|
||||
* @param token - The authorization token to use
|
||||
*/
|
||||
public setToken(token: string) {
|
||||
this.#token = token;
|
||||
@@ -291,7 +296,9 @@ export class RequestManager extends EventEmitter {
|
||||
|
||||
/**
|
||||
* Queues a request to be sent
|
||||
* @param request All the information needed to make a request
|
||||
*
|
||||
* @param request - All the information needed to make a request
|
||||
*
|
||||
* @returns The response from the api request
|
||||
*/
|
||||
public async queueRequest(request: InternalRequest): Promise<Dispatcher.ResponseData> {
|
||||
@@ -321,8 +328,10 @@ export class RequestManager extends EventEmitter {
|
||||
|
||||
/**
|
||||
* Creates a new rate limit handler from a hash, based on the hash and the major parameter
|
||||
* @param hash The hash for the route
|
||||
* @param majorParameter The major parameter for this handler
|
||||
*
|
||||
* @param hash - The hash for the route
|
||||
* @param majorParameter - The major parameter for this handler
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
private createHandler(hash: string, majorParameter: string) {
|
||||
@@ -336,7 +345,8 @@ export class RequestManager extends EventEmitter {
|
||||
|
||||
/**
|
||||
* Formats the request data to a usable format for fetch
|
||||
* @param request The request data
|
||||
*
|
||||
* @param request - The request data
|
||||
*/
|
||||
private async resolveRequest(request: InternalRequest): Promise<{ url: string; fetchOptions: RequestOptions }> {
|
||||
const { options } = this;
|
||||
@@ -460,8 +470,10 @@ export class RequestManager extends EventEmitter {
|
||||
|
||||
/**
|
||||
* Generates route data for an endpoint:method
|
||||
* @param endpoint The raw endpoint to generalize
|
||||
* @param method The HTTP method this endpoint is called without
|
||||
*
|
||||
* @param endpoint - The raw endpoint to generalize
|
||||
* @param method - The HTTP method this endpoint is called without
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
private static generateRouteData(endpoint: RouteLike, method: RequestMethod): RouteData {
|
||||
|
||||
Reference in New Issue
Block a user