export interface BaseInputOptions { /** Optional heading displayed above the prompt. */ title?: string; /** Hint displayed while the field is empty. */ placeholder?: string; /** Reject an empty value when true. */ required?: boolean; /** Label for the submit button. Defaults to the `rpg.input.confirm` translation. */ confirmText?: string; /** Label for the cancellation button. Defaults to the `rpg.input.cancel` translation. */ cancelText?: string; /** Display the cancellation button. Defaults to true. */ cancelButton?: boolean; } /** Options for a single-line text, password, or email input. */ export interface TextInputOptions extends BaseInputOptions { control?: 'input'; type?: 'text' | 'password' | 'email'; defaultValue?: string; minLength?: number; maxLength?: number; } /** Options for a single-line numeric input that resolves to a number. */ export interface NumberInputOptions extends BaseInputOptions { control?: 'input'; type: 'number'; defaultValue?: number; min?: number; max?: number; step?: number; } /** Options for a multiline text field that resolves to a string. */ export interface TextareaInputOptions extends BaseInputOptions { control: 'textarea'; type?: 'text'; defaultValue?: string; minLength?: number; maxLength?: number; rows?: number; } export type InputOptions = TextInputOptions | NumberInputOptions | TextareaInputOptions; export type InputResult = T extends NumberInputOptions ? number | null : string | null; export type InputFormData = BaseInputOptions & { message: string; control: 'input' | 'textarea'; type: 'text' | 'password' | 'email' | 'number'; defaultValue: string | number; required: boolean; errorKey?: string; errorParams?: Record; minLength?: number; maxLength?: number; min?: number; max?: number; step?: number; rows?: number; }; export type InputValidationResult = { value: string | number | null; } | { errorKey: string; errorParams?: Record; }; export declare class InputFormController { data: InputFormData; constructor(message: string, options?: InputOptions); validate(rawValue: unknown): InputValidationResult; applyError(result: Exclude): InputFormData; }