mirror of
https://github.com/discordjs/discord.js.git
synced 2026-06-03 09:30:08 +00:00
BREAKING CHANGE: NodeJS v18+ is required when using node due to the use of global `fetch` BREAKING CHANGE: The raw method of REST now returns a web compatible `Respone` object. BREAKING CHANGE: The `parseResponse` utility method has been updated to operate on a web compatible `Response` object. BREAKING CHANGE: Many underlying internals have changed, some of which were exported. BREAKING CHANGE: `DefaultRestOptions` used to contain a default `agent`, which is now set to `null` instead.
29 lines
845 B
TypeScript
29 lines
845 B
TypeScript
import type { RequestInit } from 'undici';
|
|
import type { ResponseLike } from '../REST.js';
|
|
import type { HandlerRequestData, RouteData } from '../RequestManager.js';
|
|
|
|
export interface IHandler {
|
|
/**
|
|
* The unique id of the handler
|
|
*/
|
|
readonly id: string;
|
|
/**
|
|
* If the bucket is currently inactive (no pending requests)
|
|
*/
|
|
get inactive(): boolean;
|
|
/**
|
|
* Queues a request to be sent
|
|
*
|
|
* @param routeId - The generalized api route with literal ids for major parameters
|
|
* @param url - The url to do the request on
|
|
* @param options - All the information needed to make a request
|
|
* @param requestData - Extra data from the user's request needed for errors and additional processing
|
|
*/
|
|
queueRequest(
|
|
routeId: RouteData,
|
|
url: string,
|
|
options: RequestInit,
|
|
requestData: HandlerRequestData,
|
|
): Promise<ResponseLike>;
|
|
}
|