export type ValidateOnEvent = 'input' | 'change' | 'blur'; export type FieldBinding = { name: string; value: V; error: boolean; on: { input: (v: V) => void; change: (v: V) => void; blur: () => void; }; }; import type { FormValidationHandler } from '../../core/validation'; import type { Snippet } from 'svelte'; declare function $$render, K extends keyof T & string>(): { props: { /** Form validation handler instance. */ handler: FormValidationHandler; /** Field name in the form handler. */ name: K; /** * Which events trigger validation. Value is always updated synchronously on `input`/`change` * regardless of this option — it only controls when the validator runs. * @default ['input', 'change', 'blur'] */ validateOn?: ValidateOnEvent[]; /** * Debounce validator calls in ms. Value update stays sync; only validation is delayed. * @default 0 */ debounceMs?: number; /** Show errors even when the field has not been touched. @default false */ disableTouchedTracking?: boolean; /** * Reserve space below the field for the error message. Turn off when a sibling must align to * the field's real bottom edge — the message then overlays whatever sits below the field. * @default false */ reserveErrorSpace?: boolean; /** * Extra consumer callbacks. Run AFTER the validation wiring; they cannot override it. * The `children` snippet always receives fully-wired `field.on.*`. */ on?: { input?: (value: T[K]) => void; change?: (value: T[K]) => void; blur?: () => void; }; /** * Receives a wired `FieldBinding` to spread into a kit input, plus a `validating` flag — * true from the value change until the validator has caught up, debounce window included. */ children: Snippet<[FieldBinding, boolean]>; }; exports: {}; bindings: ""; slots: {}; events: {}; }; declare class __sveltets_Render, K extends keyof T & string> { props(): ReturnType>['props']; events(): ReturnType>['events']; slots(): ReturnType>['slots']; bindings(): ""; exports(): {}; } interface $$IsomorphicComponent { new , K extends keyof T & string>(options: import('svelte').ComponentConstructorOptions['props']>>): import('svelte').SvelteComponent['props']>, ReturnType<__sveltets_Render['events']>, ReturnType<__sveltets_Render['slots']>> & { $$bindings?: ReturnType<__sveltets_Render['bindings']>; } & ReturnType<__sveltets_Render['exports']>; , K extends keyof T & string>(internal: unknown, props: ReturnType<__sveltets_Render['props']> & {}): ReturnType<__sveltets_Render['exports']>; z_$$bindings?: ReturnType<__sveltets_Render['bindings']>; } /** * Binds a form field to any kit input via a render-prop snippet. The base inputs stay unchanged; * `Validatable` is the only place that knows about `FormValidationHandler`. Wraps children in an * internal `FieldFrame` that reserves space for the error message so toggling doesn't shift * layout; `reserveErrorSpace={false}` drops the reserve — the message overlays content below. * * ### Usage * ```svelte * * {#snippet children(field)} * * {/snippet} * * ``` * * The first snippet argument has shape `{ name, value, error, on: { input, change, blur } }` — the * minimal interface every kit input supports. Inputs whose primary value prop is not `value` * (e.g. `Checkbox` uses `checked`) wire the field explicitly inside the snippet. * * ### Validating flag * The second snippet argument is true from the value change until the validator has caught up — the * debounce window included, which `handler.isValidating` does not cover. Drives an inline async * indicator; everything else it might pair with is already public (`field.error` for the gated error * state, `handler.errors[name]` for the text, `handler.touched[name]`): * * ```svelte * * {#snippet children(field, validating)} * * {/snippet} * * ``` * * With a `validateOn` that excludes `input` and `change`, the flag stays true for the whole typing * session — pair an async indicator with the default `validateOn` plus a `debounceMs`. * * ### Validation events * `validateOn` accepts an array. Default `['input', 'change', 'blur']` validates on every event. * Pass `['blur']` for blur-only validation, `['change', 'blur']` for the classic "validate on commit" pattern. * * ### Consumer callbacks * Pass extra callbacks via `Validatable`'s own `on={...}` — they run AFTER the validation wiring * and cannot override it. */ declare const Cmp: $$IsomorphicComponent; type Cmp, K extends keyof T & string> = InstanceType>; export default Cmp;