types: modals type and doc fixes (#7608)

This commit is contained in:
IRONM00N
2022-03-06 10:24:43 -05:00
committed by GitHub
parent cb566c8b6a
commit 93854a8013
2 changed files with 14 additions and 1 deletions

View File

@@ -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
*/

View File

@@ -1744,6 +1744,7 @@ export interface ModalFieldData {
export class ModalSubmitFieldsResolver {
constructor(components: ModalFieldData[][]);
public components: ModalFieldData[][];
public fields: Collection<string, ModalFieldData>;
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<T extends MessageComponentType = ComponentType.ActionRow>(
options?: AwaitMessageCollectorOptionsParams<T, true>,
): Promise<MappedInteractionTypes[T]>;