import type { CheckResult } from 'schema-typed'; export interface FormImperativeMethods, M = string, E = { [P in keyof T]?: M; }> { /** * Verify form data */ check: (callback?: (formError: E) => void) => boolean; /** * Asynchronously check form data */ checkAsync: () => Promise; /** * Check the data field */ checkForField: (fieldName: keyof T, callback?: (checkResult: CheckResult) => void) => boolean; /** * Asynchronous verification as a data field */ checkForFieldAsync: (fieldName: keyof T) => Promise; /** * Clear all error messages */ cleanErrors: (callback?: () => void) => void; /** * Clear the error message of the specified field */ cleanErrorForField: (fieldName: keyof E, callback?: () => void) => void; /** * All error messages are reset, and an initial value can be set */ resetErrors: (formError?: E) => void; /** * Reset form data to initial value and clear all error messages */ reset: () => void; /** * Submit form data and verify */ submit: () => void; } export interface FormInstance, M = string, E = { [P in keyof T]?: M; }> extends FormImperativeMethods { /** * Form root element */ root: HTMLFormElement | null; } interface FormRefProps, M = string, E = { [P in keyof T]?: M; }> { imperativeMethods: FormImperativeMethods; } export default function useFormRef(ref: React.Ref, props: FormRefProps): import("react").RefObject; export {};