import type { ParsedRule } from '@openuidev/lang-core'; import type { Context } from '@lynx-js/react'; /** * Validation state and helpers for OpenUI form fields. */ export interface FormValidationContextValue { errors: Record; getFieldError: (name: string) => string | undefined; validateField: (name: string, value: unknown, rules: ParsedRule[]) => boolean; registerField: (name: string, rules: ParsedRule[], getValue: () => unknown) => void; unregisterField: (name: string) => void; validateForm: () => boolean; clearFieldError: (name: string) => void; } /** Validation state for the nearest enclosing OpenUI form. */ export declare const FormValidationContext: Context; /** * Read the nearest OpenUI form validation context, if one exists. */ export declare function useFormValidation(): FormValidationContextValue | null; /** * Create form validation state and callbacks for an OpenUI form boundary. */ export declare function useCreateFormValidation(): FormValidationContextValue;