/// <reference types="react" />
import { OneUIContextSpecs } from "../../context/OneUIProvider";
import { AnswerAction, AnswerByField, FormField, FormFieldTypes, FormFieldView, FormMode } from "./FormField/FormField.types";
import { AnswersMap } from "./Form.types";
export declare function useFormAnswers<A extends AnswersMap<any> = AnswersMap>(defaultAnswers: A, mode: FormMode): {
    answers: A;
    setAnswers: import("react").Dispatch<import("react").SetStateAction<A>>;
};
export declare function useFormState<Q extends FormFieldView[]>(currentQuestions: Q, { answers, setAnswers }: ReturnType<typeof useFormAnswers<AnswersMap<Q>>>): {
    answers: Partial<{ [questionId in Q[number]["id"]]: AnswerByField<Q[number] & {
        id: questionId;
    }>; }>;
    isQuestionsAnswered: boolean;
    isFilesUploaded: boolean;
    onAnswerAction: <T extends FormFieldTypes>(questionType: T, id: string, answer: AnswerAction<{
        type: T;
    }> | undefined) => void;
    questions: Q;
};
export declare function useForm<Q extends FormFieldView[]>(currentQuestions: Q, defaultAnswers: AnswersMap, mode: FormMode): {
    answers: Partial<{ [questionId in Q[number]["id"]]: AnswerByField<Q[number] & {
        id: questionId;
    }>; }>;
    isQuestionsAnswered: boolean;
    isFilesUploaded: boolean;
    onAnswerAction: <T extends FormFieldTypes>(questionType: T, id: string, answer: AnswerAction<{
        type: T;
    }> | undefined) => void;
    questions: Q;
};
export declare function useFieldErrors<Q extends Readonly<Pick<FormField, "type" | "id" | "optional" | "validator">[]>>(currentQuestions: Q, answers: AnswersMap, showAllErrors: boolean): { [k in Q[number]["id"]]: string; };
export declare function areAllQuestionsAnswered(currentQuestions: FormField[], answers: AnswersMap, requiredLabel: string, extensions: OneUIContextSpecs["component"]["form"]["extensions"]): {
    isValid: boolean;
};
export declare const isValidated: (_answer: AnswerByField<{
    type: FormFieldTypes;
}>, isOptional: boolean, validator: ((val: any) => string | boolean) | undefined, requiredFieldLabel: string) => {
    isValid: any;
    error: any;
};
