import type { Reducer } from 'preact/hooks';
import type { FormatRules, ValidationRuleResult, ValidatorMode } from '../../utils/validation/types';
import type { TriggerAsyncValidation } from '../useAsyncValidator';
import type { TriggerStaticValidation } from '../useStaticValidator/useStaticValidator';
import type { FieldValue, FormState } from './types';
export interface InitOptions<FormSchema> {
    schema: (keyof FormSchema)[];
    staticValidate: TriggerStaticValidation<FormSchema>;
    asyncValidate: TriggerAsyncValidation<FormSchema>;
    defaultData?: FormSchema;
    obscuredFields?: (keyof FormSchema)[];
    optionalFields?: (keyof FormSchema)[];
    trustedFields?: string[];
    fieldProblems?: Partial<Record<keyof FormSchema, boolean>>;
    formatters?: FormatRules<FormSchema>;
}
/**
 * Processes default data and sets initial state
 */
export declare function init<FormSchema>({ schema, defaultData, fieldProblems, obscuredFields, optionalFields, trustedFields, formatters, staticValidate, asyncValidate, }: InitOptions<FormSchema>): FormState<FormSchema>;
type ReducerActionType = 'setData' | 'setValid' | 'setErrors' | 'setFieldProblems' | 'updateField' | 'mergeForm' | 'setSchema' | 'validateForm';
interface ReducerAction<FormSchema> {
    type: ReducerActionType;
    key?: keyof FormSchema;
    mode?: ValidatorMode;
    value?: FieldValue<FormSchema> | ValidationRuleResult | boolean | null;
    schema?: (keyof FormSchema)[];
    defaultData?: FormSchema;
    formValue?: FormState<FormSchema>;
    selectedSchema?: (keyof FormSchema)[];
    fieldProblems?: Partial<Record<keyof FormSchema, boolean>>;
}
interface GetReducerOptions<FormSchema> {
    staticValidate: TriggerStaticValidation<FormSchema>;
    asyncValidate: TriggerAsyncValidation<FormSchema>;
    obscuredFields?: (keyof FormSchema)[];
    optionalFields?: (keyof FormSchema)[];
    trustedFields?: string[];
    formatters?: FormatRules<FormSchema>;
}
export type GetReducerResults<FormSchema> = Reducer<FormState<FormSchema>, ReducerAction<FormSchema>>;
export declare function reducer<FormSchema>({ staticValidate, asyncValidate, obscuredFields, optionalFields, trustedFields, formatters, }: GetReducerOptions<FormSchema>): GetReducerResults<FormSchema>;
export {};
