import { FormHook } from './form-hook';
import { LanguageKeys, MultiLingual } from "../multi-lingual/index";
import { FormHookInterface } from './interface';
import { AnyObjectSchema } from 'yup';
export type FormLanguageChange = {
    form: FormHook<any>;
    locale: Record<string, any>;
    localeLanguage: LanguageKeys;
    structure: Record<string, any>;
};
export declare const formLanguageChange: (formContext: FormLanguageChange, newLanguage: LanguageKeys) => Promise<void>;
export type FormErrorHandler = {
    errorMessage: string;
    locale: Record<string, any>;
    errorCallback?: (error: any, message: string) => Promise<void | boolean>;
};
export declare const formErrorHandler: (formContext: FormErrorHandler, error: any) => Promise<void>;
export type FormLoadingHandler = {
    isLoading: boolean;
    loadingChanges?: (loading: boolean) => void;
};
export declare const formLoadingHandler: (formContext: FormLoadingHandler, isLoading: boolean) => Promise<void>;
export type FormSuccessHandler = {
    el: HTMLElement;
    isLoading: boolean;
    form: FormHook<any>;
    locale: Record<string, any>;
    disableScrollToTop?: boolean;
    loadingChanges?: (loading: boolean) => void;
    successCallback?: (data: any, message?: string) => Promise<void | boolean>;
};
export declare const formSuccessHandler: (formContext: FormSuccessHandler, data: any) => Promise<void>;
export type FormDidLoadHandler<B> = {
    gistId?: string;
    form: FormHook<B>;
    structureUrl?: string;
    isMobileForm: boolean;
    language: LanguageKeys;
    localeLanguage: LanguageKeys;
    structure: Record<string, any>;
    changeLanguage: (newLanguage: LanguageKeys) => Promise<void>;
};
export declare const formDidLoadHandler: <T, B>(formContext: FormDidLoadHandler<B> & FormHookInterface<B>, validator: AnyObjectSchema) => Promise<void>;
export type FormGetFormHandler = {
    form: FormHook<any>;
};
export declare const formGetFormHandler: (formContext: FormGetFormHandler) => Promise<FormHook<any>>;
export type HandleFormSubmit = {
    form: FormHook<any>;
};
export declare const handleFormSubmit: (formContext: HandleFormSubmit) => Promise<void>;
export type FormStructureRenderedHandler = {
    formReadyCallback?: () => void;
};
export declare const formStructureRenderedHandler: (formContext: FormStructureRenderedHandler, isRendered: boolean) => Promise<void>;
export type OnFormSubmit<T> = {
    formValues: T;
    afterSuccess?: (payload: object, header: object) => void;
    context: FormHookInterface<T> & MultiLingual & {
        form: FormHook<any>;
    };
    middleware?: (payload: object, header: object, url: string) => {
        header: object;
        payload: object;
        url: string;
    };
};
export declare const getMarketingValues: (structure?: FormHookInterface<any>["structure"]) => Record<string, any>;
export declare const onFormSubmit: <T>({ context, formValues, middleware, afterSuccess }: OnFormSubmit<T>) => Promise<void>;
export declare const functionHooks: {
    formLanguageChange: (formContext: FormLanguageChange, newLanguage: LanguageKeys) => Promise<void>;
    formErrorHandler: (formContext: FormErrorHandler, error: any) => Promise<void>;
    handleFormSubmit: (formContext: HandleFormSubmit) => Promise<void>;
    formLoadingHandler: (formContext: FormLoadingHandler, isLoading: boolean) => Promise<void>;
    formSuccessHandler: (formContext: FormSuccessHandler, data: any) => Promise<void>;
    formDidLoadHandler: <T, B>(formContext: FormDidLoadHandler<B> & FormHookInterface<B>, validator: AnyObjectSchema) => Promise<void>;
    formGetFormHandler: (formContext: FormGetFormHandler) => Promise<FormHook<any>>;
    onFormSubmit: <T>({ context, formValues, middleware, afterSuccess }: OnFormSubmit<T>) => Promise<void>;
    formStructureRenderedHandler: (formContext: FormStructureRenderedHandler, isRendered: boolean) => Promise<void>;
};
