mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(Typings): add missing typings for HttpError -> requestData (#5742)
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
This commit is contained in:
@@ -42,8 +42,9 @@ class HTTPError extends Error {
|
||||
/**
|
||||
* The attachment data that is sent to Discord
|
||||
* @typedef {Object} HTTPAttachmentData
|
||||
* @property {string|Buffer|Stream} attachment The source of this attachment data
|
||||
* @property {string} name The file name
|
||||
* @property {Buffer} file The file buffer
|
||||
* @property {Buffer|Stream} file The file buffer
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
17
typings/index.d.ts
vendored
17
typings/index.d.ts
vendored
@@ -703,13 +703,14 @@ declare module 'discord.js' {
|
||||
}
|
||||
|
||||
export class DiscordAPIError extends Error {
|
||||
constructor(path: string, error: unknown, method: string, httpStatus: number);
|
||||
constructor(error: unknown, status: number, request: unknown);
|
||||
private static flattenErrors(obj: unknown, key: string): string[];
|
||||
|
||||
public code: number;
|
||||
public method: string;
|
||||
public path: string;
|
||||
public httpStatus: number;
|
||||
public requestData: HTTPErrorData;
|
||||
}
|
||||
|
||||
export class DMChannel extends TextBasedChannel(Channel, ['bulkDelete']) {
|
||||
@@ -1045,11 +1046,12 @@ declare module 'discord.js' {
|
||||
}
|
||||
|
||||
export class HTTPError extends Error {
|
||||
constructor(message: string, name: string, code: number, method: string, path: string);
|
||||
constructor(message: string, name: string, code: number, request: unknown);
|
||||
public code: number;
|
||||
public method: string;
|
||||
public name: string;
|
||||
public path: string;
|
||||
public requestData: HTTPErrorData;
|
||||
}
|
||||
|
||||
export class Integration extends Base {
|
||||
@@ -3083,6 +3085,17 @@ declare module 'discord.js' {
|
||||
cache?: boolean;
|
||||
}
|
||||
|
||||
interface HTTPAttachmentData {
|
||||
attachment: string | Buffer | Stream;
|
||||
name: string;
|
||||
file: Buffer | Stream;
|
||||
}
|
||||
|
||||
interface HTTPErrorData {
|
||||
json: unknown;
|
||||
files: HTTPAttachmentData[];
|
||||
}
|
||||
|
||||
interface HTTPOptions {
|
||||
api?: string;
|
||||
version?: number;
|
||||
|
||||
Reference in New Issue
Block a user