import { ChangeEvent, FormEvent, KeyboardEvent } from 'react';
import { ActionCreatorWithPayload } from '@reduxjs/toolkit';
import { FilterNames, Filters } from '../../types/types';
interface Validation {
    required?: {
        value: boolean;
        message: string;
    };
    pattern?: {
        value: string;
        message: string;
    };
    custom?: {
        isValid: (value: string) => boolean;
        message?: string;
    };
}
type Validations<T extends {}> = Partial<Record<keyof T, Validation>>;
export type UseFormChangeEvent = ChangeEvent<HTMLInputElement & HTMLSelectElement>;
export declare const useForm: <T extends Record<keyof T, any> = {}>(options?: {
    validations?: Validations<T>;
    initialValues?: Partial<T>;
    onSubmit?: (filters?: Partial<Filters>) => void;
    emptyData?: Partial<T>;
    errorOnInit?: boolean;
    customData?: T;
    onChangeDispatch?: ActionCreatorWithPayload<any, string>;
    apiTriggers?: FilterNames[];
    apiTriggersOnEnter?: FilterNames[];
}) => {
    data: T;
    handleChange: (key: keyof T, extraKeyValue?: {
        key: keyof T;
        value: any;
    }) => (e: UseFormChangeEvent) => void;
    handleFilterApply: (key: keyof T, mainValue: any, extraKeyValue?: {
        key: keyof T;
        value: any;
    }[], extras?: {
        isCheckBox: boolean;
        pattern: boolean;
        isValid: boolean;
    }) => void;
    handleSubmit: (e: FormEvent<HTMLFormElement>) => void;
    handleKeyDown: (key: keyof T, e: KeyboardEvent) => void;
    checkErrors: (formData?: T, customValidations?: Validations<T>) => void;
    resetForm: () => void;
    errors: Partial<Record<keyof T, string>>;
};
export {};
