mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 03:53:29 +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');
|
const MessagePayload = require('../MessagePayload');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} ModalData
|
* @typedef {Object} ModalComponentData
|
||||||
* @property {string} title The title of the modal
|
* @property {string} title The title of the modal
|
||||||
* @property {string} customId The custom id 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>;
|
fetchReply(): Promise<Message>;
|
||||||
followUp(options: string | MessagePayload | InteractionReplyOptions): Promise<Message>;
|
followUp(options: string | MessagePayload | InteractionReplyOptions): Promise<Message>;
|
||||||
showModal(
|
showModal(
|
||||||
modal: JSONEncodable<APIModalInteractionResponseCallbackData> | ModalData | APIModalInteractionResponseCallbackData,
|
modal:
|
||||||
|
| JSONEncodable<APIModalInteractionResponseCallbackData>
|
||||||
|
| ModalComponentData
|
||||||
|
| APIModalInteractionResponseCallbackData,
|
||||||
): Promise<void>;
|
): Promise<void>;
|
||||||
awaitModalSubmit(options: AwaitModalSubmitOptions<ModalSubmitInteraction>): Promise<ModalSubmitInteraction<Cached>>;
|
awaitModalSubmit(options: AwaitModalSubmitOptions<ModalSubmitInteraction>): Promise<ModalSubmitInteraction<Cached>>;
|
||||||
}
|
}
|
||||||
@@ -448,7 +451,10 @@ export abstract class CommandInteraction<Cached extends CacheType = CacheType> e
|
|||||||
options: string | MessagePayload | InteractionReplyOptions,
|
options: string | MessagePayload | InteractionReplyOptions,
|
||||||
): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
||||||
public showModal(
|
public showModal(
|
||||||
modal: JSONEncodable<APIModalInteractionResponseCallbackData> | ModalData | APIModalInteractionResponseCallbackData,
|
modal:
|
||||||
|
| JSONEncodable<APIModalInteractionResponseCallbackData>
|
||||||
|
| ModalComponentData
|
||||||
|
| APIModalInteractionResponseCallbackData,
|
||||||
): Promise<void>;
|
): Promise<void>;
|
||||||
public awaitModalSubmit(
|
public awaitModalSubmit(
|
||||||
options: AwaitModalSubmitOptions<ModalSubmitInteraction>,
|
options: AwaitModalSubmitOptions<ModalSubmitInteraction>,
|
||||||
@@ -1787,7 +1793,10 @@ export class MessageComponentInteraction<Cached extends CacheType = CacheType> e
|
|||||||
options: string | MessagePayload | InteractionUpdateOptions,
|
options: string | MessagePayload | InteractionUpdateOptions,
|
||||||
): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
): Promise<InteractionResponse<BooleanCache<Cached>>>;
|
||||||
public showModal(
|
public showModal(
|
||||||
modal: JSONEncodable<APIModalInteractionResponseCallbackData> | ModalData | APIModalInteractionResponseCallbackData,
|
modal:
|
||||||
|
| JSONEncodable<APIModalInteractionResponseCallbackData>
|
||||||
|
| ModalComponentData
|
||||||
|
| APIModalInteractionResponseCallbackData,
|
||||||
): Promise<void>;
|
): Promise<void>;
|
||||||
public awaitModalSubmit(
|
public awaitModalSubmit(
|
||||||
options: AwaitModalSubmitOptions<ModalSubmitInteraction>,
|
options: AwaitModalSubmitOptions<ModalSubmitInteraction>,
|
||||||
@@ -1882,6 +1891,12 @@ export class MessageReaction {
|
|||||||
public toJSON(): unknown;
|
public toJSON(): unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ModalComponentData {
|
||||||
|
customId: string;
|
||||||
|
title: string;
|
||||||
|
components: (ActionRow<ModalActionRowComponent> | ActionRowData<ModalActionRowComponentData>)[];
|
||||||
|
}
|
||||||
|
|
||||||
export interface BaseModalData {
|
export interface BaseModalData {
|
||||||
customId: string;
|
customId: string;
|
||||||
type: ComponentType;
|
type: ComponentType;
|
||||||
|
|||||||
Reference in New Issue
Block a user