interface FormHandle {
    el: HTMLElement;
    destroy(): void;
    focusFirst(): boolean;
    setError(key: string, message: null | string): void;
    sync(values: Readonly<Record<string, unknown>>): void;
    validate(): boolean;
    values(): Record<string, unknown>;
}

Properties

el: HTMLElement

Methods

  • Dispose nested controls and any open overlays before removing the form.

    Returns void

  • Attach a rejected native write to its field; null clears that error.

    Parameters

    • key: string
    • message: null | string

    Returns void

  • Re-read values into every control the user is not currently in, hidden ones included, then re-read which controls are shown and editable.

    Parameters

    • values: Readonly<Record<string, unknown>>

    Returns void

  • Validate typed drafts without replacing them or committing settings. A hidden or disabled control is skipped: it cannot be corrected from where the user is, so its draft never blocks a save, and it is never written.

    Returns boolean

  • Every control's current value, keyed the way onChange reports it; a hidden draft included.

    Returns Record<string, unknown>