import { FormConfigTextPrevention } from '../helpers/input-preventions/prevent-input-types';
import { CustomErrorsKeys, ErrorsKeys } from '../helpers/validators/valid-input/validate-input-errors';
import { FormConfigValidation } from '../helpers/validators/valid-input/validate-input-types.ts';
import { CaseReducerActions } from '@reduxjs/toolkit';
import { default as React, Dispatch, MutableRefObject, SetStateAction } from 'react';
import { CombinedState } from 'redux';
import { AllRootStates } from '../rootReducer';
/**
 * Types
 */
export type FormFieldType = 'InputBase' | 'Input' | 'InputNumber' | 'Textarea' | 'Autocomplete' | 'Select' | 'Checkbox' | 'RadioButtonGroup' | 'Slider' | 'ColorPicker';
export type FormConfigElement<T = any> = {
    fieldType?: FormFieldType;
    arrayPosition?: number;
    isArray?: boolean;
    valueMappers?: {
        toPrimitive: <U>(value: any) => string | boolean | number;
        toObject: <U>(value: string | boolean | number) => Partial<any>;
    };
    _autocompleteRef?: MutableRefObject<any>;
    _inputRef?: MutableRefObject<any>;
    _onChange?: (event?: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
    _onBlur?: (event?: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
    validateOn?: 'change' | 'blur';
    stateFieldName?: string;
    stateValue?: any;
    setStateValue?: any;
    setStateValueArray?: any;
    setInternalInputs?: any;
    getValue?: () => any;
    initialValue?: any;
    getInitialValue?: () => string;
    validation?: FormConfigValidation;
    errorMatching?: Record<string, any>[];
    serverSideErrorsField?: {
        stateErrorFieldName: string;
    };
    prevention?: FormConfigTextPrevention;
    hasError?: boolean;
    setHasError?: Dispatch<SetStateAction<boolean>>;
    errors?: (ErrorsKeys | CustomErrorsKeys)[] | null;
    setErrors?: Dispatch<SetStateAction<(ErrorsKeys | CustomErrorsKeys)[]>>;
    isDirty?: boolean;
    setIsDirty?: Dispatch<SetStateAction<boolean>>;
    passError?: string | Array<string | undefined | null>;
};
export type FormConfig<T> = Partial<Record<keyof T, FormConfigElement<T>>>;
type Options<T> = {
    reducer?: (state: AllRootStates) => CombinedState<any>;
    validateOn?: 'change' | 'blur';
    slice?: CaseReducerActions<any>;
    debugDisplayBeErrors?: boolean;
    inputs: Partial<FormConfig<T>>;
    stateErrorsConfig?: {
        errorsStateFieldName: string;
    };
};
/**
 * Hook
 * ---------------------------------------------------------------------------------------------------------------------
 */
export declare function useFormConfig<T>(config: Options<T>): {
    formConfig: Partial<FormConfig<T>>;
    isValid: () => boolean;
    getData: () => Partial<T>;
    getChangedData: () => Partial<T>;
    resetForm: () => void;
    validateFromState: () => void;
};
export {};
