import { ModalBuilder, TextInputStyle, ModalSubmitInteraction, Client } from 'discord.js'; export { TextInputStyle } from 'discord.js'; export type ModalSubmitExecutor = (interaction: ModalSubmitInteraction) => Promise | void; export interface ModalFieldConfig { /** Custom ID for this field — retrieve with `interaction.fields.getTextInputValue(id)` */ id: string; label: string; style: TextInputStyle; placeholder?: string; value?: string; required?: boolean; minLength?: number; maxLength?: number; } export interface ModalConfig { /** Custom ID used to identify the modal submission */ id: string; title: string; fields: ModalFieldConfig[]; /** Handler called when the modal is submitted */ onSubmit?: ModalSubmitExecutor; } /** * Build a discord.js `ModalBuilder` from a simple config object. * * @example * const m = buildModal({ * id: 'feedback_form', * title: 'Submit Feedback', * fields: [ * { id: 'name', label: 'Your name', style: TextInputStyle.Short }, * { id: 'message', label: 'Your feedback', style: TextInputStyle.Paragraph, required: true }, * ], * }); * await interaction.showModal(m); */ export declare function buildModal(config: ModalConfig): ModalBuilder; export declare class ModalHandler { private handlers; /** * Register a submit handler for a modal ID (or ID prefix for dynamic IDs). * @returns `this` for chaining */ on(modalId: string, executor: ModalSubmitExecutor): this; /** * Handle an incoming `ModalSubmitInteraction`. * Matches exact ID first, then ID prefix. */ handle(interaction: ModalSubmitInteraction): Promise; /** Attach to a Client — listens for modalSubmit interactions automatically */ attach(client: Client): this; } //# sourceMappingURL=modals.d.ts.map