import React from 'react'; declare type UseFormValues = { [field: string]: any; }; declare type UseFormTouched = { [K in keyof Values]?: boolean; }; declare type UseFormErrors = { [K in keyof Values]?: string; }; declare type UseFormState = { values: Values; touched: UseFormTouched; errors: UseFormErrors; submitting: boolean; }; declare type UseFormProps = { initialValues: Values; onSubmit: (values: Values) => void | Promise; validate?: (values: Values) => UseFormErrors; }; declare type HandleChange = (event: React.ChangeEvent) => void; declare type HandleBlur = (event: React.FocusEvent) => void; declare type HandleSubmit = (event: React.FormEvent) => void; declare type GetFieldProps = (name: keyof Values) => { name: keyof Values; value: any; onChange: HandleChange; onBlur: HandleBlur; touched?: boolean; error?: string; }; declare type UseFormResponse = { values: Values; touched: UseFormTouched; errors: UseFormErrors; submitting: boolean; handleChange: HandleChange; handleBlur: HandleBlur; handleSubmit: HandleSubmit; getFieldProps: GetFieldProps; }; declare type SetFieldValueAction = { type: 'SET_FIELD_VALUE'; payload: { [field: string]: string; }; }; declare type SetFieldTouchedActions = { type: 'SET_FIELD_TOUCHED'; payload: { [field: string]: boolean; }; }; declare type SetErrorsAction = { type: 'SET_ERRORS'; payload: UseFormErrors; }; declare type SubmitAttemptAction = { type: 'SUBMIT_ATTEMPT'; }; declare type SubmitSuccessAction = { type: 'SUBMIT_SUCCESS'; }; declare type SubmitFailedAction = { type: 'SUBMIT_FAILED'; }; declare type UseFormActions = SetFieldValueAction | SetFieldTouchedActions | SetErrorsAction | SubmitAttemptAction | SubmitSuccessAction | SubmitFailedAction; export declare function useFormReducer(state: UseFormState, action: UseFormActions): UseFormState; declare const useForm: (props: UseFormProps) => UseFormResponse; export default useForm;