UNPKG

@mitcsutt/kiln-forms

Version:

Kiln forms: typed React forms on TanStack Form, in component or JSON schema mode, rendered through kiln-ui

17 lines (16 loc) • 865 B
import { type AnyKitForm } from './formRuntime.js'; /** * Makes `values` the form's new defaults (the baseline `isDirty` compares against). * - default: `form.reset(values)` — values and meta reset, the form is clean. * - `keepValues`: only the defaults move; the current values (and meta) stay, so edits made * meanwhile still read as dirty. * The baseline survives re-renders of the host until the app passes different `defaultValues`. */ export declare function rebaseline(target: AnyKitForm, values: unknown, opts?: { keepValues?: boolean; }): void; /** * Resets the form. `'baseline'` (default): to the current baseline (the defaults, or the values * last rebaselined to). `'defaults'`: to the app's original `defaultValues`, dropping any baseline. */ export declare function resetForm(target: AnyKitForm, to?: 'baseline' | 'defaults'): void;