import type { Reducer } from 'preact/hooks';
import type { FormatRules, ValidationRuleResult, ValidatorMode } from '../../utils/validation/types';
import { ValidationResult } from '../../utils/validation/validationResult';
import type { FieldValue, FormState, MultiFormState, NestedSchema } from './types';
import type { TriggerStaticValidation } from './useMultiFormStaticValidator';
export interface MultiFormInitOptions<T> {
    requiredFields?: {
        [InnerFormName in keyof T]: Array<keyof T[InnerFormName]>;
    };
    staticValidate: TriggerStaticValidation<T>;
    defaultData?: T;
    data?: T;
    asyncErrors?: {
        [InnerFormName in keyof T]: {
            [FieldName in keyof T[InnerFormName]]: ValidationResult;
        };
    };
    obscuredFields?: {
        [InnerFormName in keyof T]: Array<keyof T[InnerFormName]>;
    };
    optionalFields?: {
        [InnerFormName in keyof T]: Array<keyof T[InnerFormName]>;
    };
    trustedFields?: {
        [InnerFormName in keyof T]: Array<keyof T[InnerFormName]>;
    };
    fieldProblems?: {
        [InnerFormName in keyof T]: {
            [FieldName in keyof T[InnerFormName]]: boolean;
        };
    };
    formatters?: {
        [InnerFormName in keyof T]: FormatRules<T[InnerFormName]>;
    };
}
/**
 * The function takes in the below params and spits out an initial state, by running the validations
 * across all forms and fields. It makes sure all validations are done and only sets the validity
 * instead of the errors, this is to avoid users seeing error immaturely on initial load.
 *
 * @param requiredFields
 * @param staticValidate
 * @param asyncValidate
 * @param defaultData
 * @param obscuredFields
 * @param optionalFields
 * @param trustedFields
 * @param fieldProblems
 * @param formatters
 * @param data
 */
export declare function init<FormSchema>({ requiredFields, staticValidate, defaultData, obscuredFields, optionalFields, trustedFields, fieldProblems, formatters, data, asyncErrors, }: MultiFormInitOptions<FormSchema>): MultiFormState<FormSchema>;
type ReducerActionType = 'setData' | 'setFormData' | 'setValid' | 'setErrors' | 'updateField' | 'setInnerFormRequiredFields' | 'setRequiredFields' | 'validateForm' | 'setAsyncErrors';
interface ReducerAction<FormSchema> {
    type: ReducerActionType;
    key?: keyof NestedSchema<FormSchema>;
    mode?: ValidatorMode;
    value?: FieldValue<NestedSchema<FormSchema>> | ValidationRuleResult | boolean | null;
    formData?: NestedSchema<FormSchema>;
    formName?: keyof FormSchema;
    innerFormFields?: (keyof NestedSchema<FormSchema>)[];
    requiredFields?: {
        [InnerFormName in keyof FormSchema]: Array<keyof FormSchema[InnerFormName]>;
    };
    optionalFields?: {
        [InnerFormName in keyof FormSchema]: Array<keyof FormSchema[InnerFormName]>;
    };
    defaultData?: FormSchema;
    selectedSchema?: (keyof NestedSchema<FormSchema>)[];
    formValue?: FormState<NestedSchema<FormSchema>>;
    asyncValidationResults?: Record<keyof NestedSchema<FormSchema>, ValidationResult>;
}
interface GetReducerOptions<T> {
    staticValidate: TriggerStaticValidation<T>;
    obscuredFields?: {
        [InnerFormName in keyof T]: Array<keyof T[InnerFormName]>;
    };
    optionalFields?: {
        [InnerFormName in keyof T]: Array<keyof T[InnerFormName]>;
    };
    trustedFields?: {
        [InnerFormName in keyof T]: Array<keyof T[InnerFormName]>;
    };
    formatters?: {
        [InnerFormName in keyof T]: FormatRules<T[InnerFormName]>;
    };
    defaultData?: T;
}
export type GetReducerResults<FormSchema> = Reducer<MultiFormState<FormSchema>, ReducerAction<FormSchema>>;
export declare function reducer<FormSchema>({ staticValidate, obscuredFields, optionalFields, trustedFields, formatters, defaultData, }: GetReducerOptions<FormSchema>): GetReducerResults<FormSchema>;
export {};
