import { type Accessor } from "solid-js"; import type { FieldRootState, FieldValidateFn, FieldValidationProps, FieldValidityData, MutableRef } from "../field-context.js"; export interface UseFieldValidationParameters { setValidityData: (data: FieldValidityData) => void; validate: Accessor; validityData: Accessor; validationDebounceTime: Accessor; invalid: Accessor; markedDirtyRef: MutableRef; state: Accessor; name: Accessor; /** ``-level id (for Form registration) — used to key the * fields map when updating the form's combined validity snapshot. */ controlId: Accessor; shouldValidateOnChange: Accessor; } /** * Port of Base UI React's `useFieldValidation` * (`packages/react/src/field/root/useFieldValidation.ts`). Produces the * props-factories and the imperative `commit` function that the Field root * exposes to the rest of the field parts. * * Solid 2 notes: * * - Every parameter except the plain refs is an `Accessor`. Callers read * them through the stable-callback trampolines below, so invocation-time * values always win. * - `commit` wraps a setValidityData write; the parent root is expected to * route that through its own `createStableCallback`-wrapped setter so * writes inside reactive scope are legal. * - React used `ReactDOM.flushSync` for synchronous submit validation; the * Solid port calls `flush()` is NOT needed here because consumers do it * themselves after invoking `validate`. The `flushSync` parameter is * accepted for API parity with the React entry handled. */ export declare function useFieldValidation(params: UseFieldValidationParameters): FieldValidationProps; //# sourceMappingURL=use-field-validation.d.ts.map