From 93854a8013d07234cb849bfcbfa99f74a4c3cdb4 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sun, 6 Mar 2022 10:24:43 -0500 Subject: [PATCH] types: modals type and doc fixes (#7608) --- packages/discord.js/src/util/Components.js | 12 ++++++++++++ packages/discord.js/typings/index.d.ts | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/discord.js/src/util/Components.js b/packages/discord.js/src/util/Components.js index 3b91720b0..d4696d8a9 100644 --- a/packages/discord.js/src/util/Components.js +++ b/packages/discord.js/src/util/Components.js @@ -41,6 +41,18 @@ * @typedef {ActionRowData|ButtonComponentData|SelectMenuComponentData} MessageComponentData / +/** + * @typedef {BaseComponentData} TextInputComponentData + * @property {string} customId The custom id of the text input + * @property {TextInputStyle} style The style of the text input + * @property {string} label The text that appears on top of the text input field + * @property {?number} minLength The minimum number of characters that can be entered in the text input + * @property {?number} maxLength The maximum number of characters that can be entered in the text input + * @property {?boolean} required Whether or not the text input is required or not + * @property {?string} value The pre-filled text in the text input + * @property {?string} placeholder Placeholder for the text input + */ + /** * @typedef {ActionRowData|ButtonComponentData|SelectMenuComponentData|TextInputComponentData} ComponentData */ diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 3e003d4ec..1e2cd759f 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -1744,6 +1744,7 @@ export interface ModalFieldData { export class ModalSubmitFieldsResolver { constructor(components: ModalFieldData[][]); + public components: ModalFieldData[][]; public fields: Collection; public getField(customId: string): ModalFieldData; public getTextInputValue(customId: string): string; @@ -3216,7 +3217,7 @@ export interface TextBasedChannelFields extends PartialTextBasedChannelFields { lastMessageId: Snowflake | null; get lastMessage(): Message | null; lastPinTimestamp: number | null; - readonly lastPinAt: Date | null; + get lastPinAt(): Date | null; awaitMessageComponent( options?: AwaitMessageCollectorOptionsParams, ): Promise;