import { Dispatch, SetStateAction } from 'react';

export declare function useForm<T extends object, V extends Record<keyof T, string> = Record<keyof T, string>>(initialState: T, validation?: {
    validationState?: V;
    validationCallback?: (values: T, errors: Record<keyof T, string>) => typeof errors;
}): UseFormReturn<T, V>;
export type UseFormReturn<T extends object, V extends Record<keyof T, string> = Record<keyof T, string>> = {
    values: T;
    errors: Record<keyof T, string>;
    setValue: <K extends keyof T>(key: K, value: T[K]) => void;
    setValues: React.Dispatch<React.SetStateAction<T>>;
    reset: () => void;
    setErrors: Dispatch<SetStateAction<Record<keyof T, string>>>;
    valid: boolean;
    setError: <K extends keyof V>(key: K, value: V[K]) => void;
    resetErrors: () => void;
    validate: (showAllErrors?: boolean) => boolean;
    resetForm: () => void;
};
