Skip to content

Commit

Permalink
types: modals type and doc fixes (#7608)
Browse files Browse the repository at this point in the history
  • Loading branch information
IRONM00N committed Mar 6, 2022
1 parent cb566c8 commit 93854a8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions packages/discord.js/src/util/Components.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
3 changes: 2 additions & 1 deletion packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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]>;
Expand Down

0 comments on commit 93854a8

Please sign in to comment.