import * as React from 'react'; export type Rules = { [unit in keyof Partial]: { 'required'?: string | boolean; 'isAllowed'?: { func: (value: any, values: ValuesType) => boolean; msg: React.ReactNode | string; }; }; }; export type ErrorForm = { [unit in keyof ValuesType | string]: string | React.ReactNode | undefined | null; } | { [K: string]: string | React.ReactNode | undefined | null; }; export type ReactChangeEvent = React.ChangeEvent; export type Argument1OnChange = Function | ReactChangeEvent | string | {}; export type Validate = boolean | [boolean, {}, ValuesType]; export type UseFormType = { initialValues: ValuesType; values: ValuesType; submitting: boolean; setSubmitting: Function; rules: Rules; errors: ErrorForm; setValues: (prev: ValuesType) => any; validate: (next: Function | null, end: Function, getErrorArray?: boolean, onSubmitError?: (errors: {}) => void) => Validate; setRules: (prev: Rules | ((prev: Rules) => Rules)) => void; setErrors: (prev: ErrorForm) => any; handlerReset: (values: {}) => void; handlerChange: (name: Argument1OnChange | Partial | keyof ValuesType, value?: any, type?: 'string' | 'number') => void; blackList?: string | string[]; whiteList?: string | string[]; submitted: boolean; }; export interface Props { initialValues: ValuesType; rules: Rules; blackList?: string | string[]; whiteList?: string | string[]; onValuesUpdate?: (values: ValuesType) => void; } declare const useForm: (props: Props) => UseFormType; export default useForm;