mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
* fix(handlers): create burst handler for interaction callbacks * docs: use remarks instead of info block Co-Authored-By: Almeida <almeidx@pm.me> * refactor: move code duplication to shared handler Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> * Update packages/rest/src/lib/handlers/BurstHandler.ts --------- Co-authored-by: Almeida <almeidx@pm.me> Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> Co-authored-by: Aura Román <kyradiscord@gmail.com>
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
import type { Dispatcher } from 'undici';
|
|
import type { RequestOptions } from '../REST';
|
|
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: RequestOptions,
|
|
requestData: HandlerRequestData,
|
|
): Promise<Dispatcher.ResponseData>;
|
|
}
|
|
|
|
export interface PolyFillAbortSignal {
|
|
readonly aborted: boolean;
|
|
addEventListener(type: 'abort', listener: () => void): void;
|
|
removeEventListener(type: 'abort', listener: () => void): void;
|
|
}
|