/** Supported input field types for form widgets. */ declare type FieldType = 'text' | 'email' | 'password' | 'tel' | 'url' | 'textarea' | 'number' | 'select' | 'multiselect' | 'date' | 'datetime' | 'time' | 'toggle' | 'range' | 'radio' | 'checkbox'; declare interface FormdownField { name: string; type: string; label?: string; required?: boolean; placeholder?: string; options?: string[]; attributes?: Record; } export declare function mapActions(actions: FormdownField[]): UWidgetAction[]; export declare function mapFields(fields: FormdownField[]): UWidgetFieldDefinition[]; /** * Action button definition. * * Reserved actions: `"submit"`, `"cancel"`, `"navigate"`. * Custom action strings are forwarded to the host via the `u-widget-event`. * * @example * ```json * { "label": "Submit", "action": "submit", "style": "primary" } * ``` */ declare interface UWidgetAction { /** Button display text. */ label: string; /** Action identifier emitted in the widget event. */ action: string; /** Visual style hint. */ style?: 'primary' | 'danger' | 'default'; /** Whether the button is disabled. */ disabled?: boolean; /** URL for `"navigate"` actions. */ url?: string; } /** * Field definition for form/confirm input widgets. * * @example * ```json * { "field": "email", "label": "Email", "type": "email", "required": true } * ``` */ declare interface UWidgetFieldDefinition { /** Data field name (maps to `data[field]` for defaults and output). */ field: string; /** Display label. Defaults to the field name. */ label?: string; /** Input type. Defaults to `"text"`. */ type?: FieldType; /** Whether the field must be filled before submit. */ required?: boolean; /** Placeholder text shown when the field is empty. */ placeholder?: string; /** Options for select, multiselect, radio, and checkbox types. */ options?: string[]; /** Minimum character length for text inputs. */ minLength?: number; /** Maximum character length for text inputs. */ maxLength?: number; /** Custom regex pattern for validation (e.g. `"^[A-Z]{3}$"`). */ pattern?: string; /** Number of visible rows for textarea type. */ rows?: number; /** Minimum value (number) or date string. */ min?: number | string; /** Maximum value (number) or date string. */ max?: number | string; /** Step increment for number and range inputs. */ step?: number; /** Custom validation error message (overrides locale default). */ message?: string; } export { }