mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
types(modal): fix showModal() typings (#8014)
This commit is contained in:
@@ -8,10 +8,10 @@ const InteractionResponse = require('../InteractionResponse');
|
||||
const MessagePayload = require('../MessagePayload');
|
||||
|
||||
/**
|
||||
* @typedef {Object} ModalData
|
||||
* @typedef {Object} ModalComponentData
|
||||
* @property {string} title The title of the modal
|
||||
* @property {string} customId The custom id of the modal
|
||||
* @property {ActionRowData[]} components The components within this modal
|
||||
* @property {ActionRow[]} components The components within this modal
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
21
packages/discord.js/typings/index.d.ts
vendored
21
packages/discord.js/typings/index.d.ts
vendored
@@ -400,7 +400,10 @@ export interface InteractionResponseFields<Cached extends CacheType = CacheType>
|
||||
fetchReply(): Promise<Message>;
|
||||
followUp(options: string | MessagePayload | InteractionReplyOptions): Promise<Message>;
|
||||
showModal(
|
||||
modal: JSONEncodable<APIModalInteractionResponseCallbackData> | ModalData | APIModalInteractionResponseCallbackData,
|
||||
modal:
|
||||
| JSONEncodable<APIModalInteractionResponseCallbackData>
|
||||
| ModalComponentData
|
||||
| APIModalInteractionResponseCallbackData,
|
||||
): Promise<void>;
|
||||
awaitModalSubmit(options: AwaitModalSubmitOptions<ModalSubmitInteraction>): Promise<ModalSubmitInteraction<Cached>>;
|
||||
}
|
||||
@@ -448,7 +451,10 @@ export abstract class CommandInteraction<Cached extends CacheType = CacheType> e
|
||||
options: string | MessagePayload | InteractionReplyOptions,
|
||||
): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
||||
public showModal(
|
||||
modal: JSONEncodable<APIModalInteractionResponseCallbackData> | ModalData | APIModalInteractionResponseCallbackData,
|
||||
modal:
|
||||
| JSONEncodable<APIModalInteractionResponseCallbackData>
|
||||
| ModalComponentData
|
||||
| APIModalInteractionResponseCallbackData,
|
||||
): Promise<void>;
|
||||
public awaitModalSubmit(
|
||||
options: AwaitModalSubmitOptions<ModalSubmitInteraction>,
|
||||
@@ -1787,7 +1793,10 @@ export class MessageComponentInteraction<Cached extends CacheType = CacheType> e
|
||||
options: string | MessagePayload | InteractionUpdateOptions,
|
||||
): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
||||
public showModal(
|
||||
modal: JSONEncodable<APIModalInteractionResponseCallbackData> | ModalData | APIModalInteractionResponseCallbackData,
|
||||
modal:
|
||||
| JSONEncodable<APIModalInteractionResponseCallbackData>
|
||||
| ModalComponentData
|
||||
| APIModalInteractionResponseCallbackData,
|
||||
): Promise<void>;
|
||||
public awaitModalSubmit(
|
||||
options: AwaitModalSubmitOptions<ModalSubmitInteraction>,
|
||||
@@ -1882,6 +1891,12 @@ export class MessageReaction {
|
||||
public toJSON(): unknown;
|
||||
}
|
||||
|
||||
export interface ModalComponentData {
|
||||
customId: string;
|
||||
title: string;
|
||||
components: (ActionRow<ModalActionRowComponent> | ActionRowData<ModalActionRowComponentData>)[];
|
||||
}
|
||||
|
||||
export interface BaseModalData {
|
||||
customId: string;
|
||||
type: ComponentType;
|
||||
|
||||
Reference in New Issue
Block a user