mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 20:43:30 +01:00
types: improve toJSON methods for message components & embeds (#6925)
This commit is contained in:
16
typings/index.d.ts
vendored
16
typings/index.d.ts
vendored
@@ -27,6 +27,7 @@ import {
|
|||||||
APIApplicationCommandOption,
|
APIApplicationCommandOption,
|
||||||
APIApplicationCommandPermission,
|
APIApplicationCommandPermission,
|
||||||
APIAuditLogChange,
|
APIAuditLogChange,
|
||||||
|
APIButtonComponent,
|
||||||
APIEmbed,
|
APIEmbed,
|
||||||
APIEmoji,
|
APIEmoji,
|
||||||
APIInteractionDataResolvedChannel,
|
APIInteractionDataResolvedChannel,
|
||||||
@@ -39,6 +40,7 @@ import {
|
|||||||
APIPartialEmoji,
|
APIPartialEmoji,
|
||||||
APIPartialGuild,
|
APIPartialGuild,
|
||||||
APIRole,
|
APIRole,
|
||||||
|
APISelectMenuComponent,
|
||||||
APITemplateSerializedSourceGuild,
|
APITemplateSerializedSourceGuild,
|
||||||
APIUser,
|
APIUser,
|
||||||
GatewayVoiceServerUpdateDispatchData,
|
GatewayVoiceServerUpdateDispatchData,
|
||||||
@@ -1406,7 +1408,7 @@ export class Message<Cached extends boolean = boolean> extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class MessageActionRow extends BaseMessageComponent {
|
export class MessageActionRow extends BaseMessageComponent {
|
||||||
public constructor(data?: MessageActionRow | MessageActionRowOptions);
|
public constructor(data?: MessageActionRow | MessageActionRowOptions | APIActionRowComponent);
|
||||||
public type: 'ACTION_ROW';
|
public type: 'ACTION_ROW';
|
||||||
public components: MessageActionRowComponent[];
|
public components: MessageActionRowComponent[];
|
||||||
public addComponents(
|
public addComponents(
|
||||||
@@ -1420,7 +1422,7 @@ export class MessageActionRow extends BaseMessageComponent {
|
|||||||
deleteCount: number,
|
deleteCount: number,
|
||||||
...components: MessageActionRowComponentResolvable[] | MessageActionRowComponentResolvable[][]
|
...components: MessageActionRowComponentResolvable[] | MessageActionRowComponentResolvable[][]
|
||||||
): this;
|
): this;
|
||||||
public toJSON(): unknown;
|
public toJSON(): APIActionRowComponent;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class MessageAttachment {
|
export class MessageAttachment {
|
||||||
@@ -1444,7 +1446,7 @@ export class MessageAttachment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class MessageButton extends BaseMessageComponent {
|
export class MessageButton extends BaseMessageComponent {
|
||||||
public constructor(data?: MessageButton | MessageButtonOptions);
|
public constructor(data?: MessageButton | MessageButtonOptions | APIButtonComponent);
|
||||||
public customId: string | null;
|
public customId: string | null;
|
||||||
public disabled: boolean;
|
public disabled: boolean;
|
||||||
public emoji: APIPartialEmoji | null;
|
public emoji: APIPartialEmoji | null;
|
||||||
@@ -1458,7 +1460,7 @@ export class MessageButton extends BaseMessageComponent {
|
|||||||
public setLabel(label: string): this;
|
public setLabel(label: string): this;
|
||||||
public setStyle(style: MessageButtonStyleResolvable): this;
|
public setStyle(style: MessageButtonStyleResolvable): this;
|
||||||
public setURL(url: string): this;
|
public setURL(url: string): this;
|
||||||
public toJSON(): unknown;
|
public toJSON(): APIButtonComponent;
|
||||||
private static resolveStyle(style: MessageButtonStyleResolvable): MessageButtonStyle;
|
private static resolveStyle(style: MessageButtonStyleResolvable): MessageButtonStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1546,7 +1548,7 @@ export class MessageEmbed {
|
|||||||
public setURL(url: string): this;
|
public setURL(url: string): this;
|
||||||
public spliceFields(index: number, deleteCount: number, ...fields: EmbedFieldData[] | EmbedFieldData[][]): this;
|
public spliceFields(index: number, deleteCount: number, ...fields: EmbedFieldData[] | EmbedFieldData[][]): this;
|
||||||
public equals(embed: MessageEmbed | APIEmbed): boolean;
|
public equals(embed: MessageEmbed | APIEmbed): boolean;
|
||||||
public toJSON(): unknown;
|
public toJSON(): APIEmbed;
|
||||||
|
|
||||||
public static normalizeField(name: string, value: string, inline?: boolean): Required<EmbedFieldData>;
|
public static normalizeField(name: string, value: string, inline?: boolean): Required<EmbedFieldData>;
|
||||||
public static normalizeFields(...fields: EmbedFieldData[] | EmbedFieldData[][]): Required<EmbedFieldData>[];
|
public static normalizeFields(...fields: EmbedFieldData[] | EmbedFieldData[][]): Required<EmbedFieldData>[];
|
||||||
@@ -1630,7 +1632,7 @@ export class MessageReaction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class MessageSelectMenu extends BaseMessageComponent {
|
export class MessageSelectMenu extends BaseMessageComponent {
|
||||||
public constructor(data?: MessageSelectMenu | MessageSelectMenuOptions);
|
public constructor(data?: MessageSelectMenu | MessageSelectMenuOptions | APISelectMenuComponent);
|
||||||
public customId: string | null;
|
public customId: string | null;
|
||||||
public disabled: boolean;
|
public disabled: boolean;
|
||||||
public maxValues: number | null;
|
public maxValues: number | null;
|
||||||
@@ -1650,7 +1652,7 @@ export class MessageSelectMenu extends BaseMessageComponent {
|
|||||||
deleteCount: number,
|
deleteCount: number,
|
||||||
...options: MessageSelectOptionData[] | MessageSelectOptionData[][]
|
...options: MessageSelectOptionData[] | MessageSelectOptionData[][]
|
||||||
): this;
|
): this;
|
||||||
public toJSON(): unknown;
|
public toJSON(): APISelectMenuComponent;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NewsChannel extends BaseGuildTextChannel {
|
export class NewsChannel extends BaseGuildTextChannel {
|
||||||
|
|||||||
Reference in New Issue
Block a user