/** Tells us which form fields are valid. */ export interface FieldValidity { [name: string]: boolean; } /** * Like [[`useFieldValidity`]], but lets you pass in whatever * `fieldValidityIsValid` function you want. * * Usually you'll want to use [[`useFieldValidity`]]. */ export declare function useFieldValidityCore({ onValidChange, defaultValue, fieldValidityIsValid, }: { onValidChange: ((valid: boolean) => void) | undefined; defaultValue: FieldValidity | undefined; fieldValidityIsValid: (fieldValidity: FieldValidity) => boolean; }): { onChildValidChange: (fieldName: string, valid: boolean) => void; allFieldsValid: boolean; fieldValidity: FieldValidity; }; /** * Keep tracks of a [[`FieldValidity`]] and returns a function to update the * the `FieldValidty`. * * You don't need to use this if there is only one validated input. In that case, * a simple `const [valid, setValid] = useState(false)` is sufficient. * * Top-level usage (e.g. when using `EasyFormDialog`): * * ``` * const { onChildValidChange, allFieldsValid } = useFieldValidity() * ``` * * Usage with `onValidChange` from props: * * ``` * const { onChildValidChange } = useFieldValidity({ onValidChange }) * ``` */ export declare function useFieldValidity(options?: { onValidChange?: (valid: boolean) => void; defaultValue?: FieldValidity; }): ReturnType;