@mitcsutt/kiln-forms
Version:
Kiln forms: typed React forms on TanStack Form, in component or JSON schema mode, rendered through kiln-ui
16 lines (15 loc) • 848 B
TypeScript
import { type ValidationLogicFn } from '@tanstack/react-form';
import { type ValidateOn } from './formRuntime.js';
export interface KitValidationLogicOptions {
/** When `onDynamic` first runs. After a field's first blur (or any submit) it is always live. */
validateOn?: ValidateOn;
/** An explicit TanStack logic (e.g. `revalidateLogic()`); inactive gating still wraps it. */
base?: ValidationLogicFn;
}
/**
* The kit's `validationLogic` (§5.2): TanStack's standard slots unchanged; `onDynamic` runs on
* submit always, on blur unless `validateOn: 'submit'`, and on change once the field is live (a
* form-level one also while any of its errors is up); nothing runs for an inactive field's own
* validators.
*/
export declare function kitValidationLogic({ validateOn, base, }?: KitValidationLogicOptions): ValidationLogicFn;