import BaseFoundation from '../base/foundation';
import { Options as ScrollIntoViewOptions } from 'scroll-into-view-if-needed';
import { BaseFormAdapter, FormState, CallOpts, FieldState, FieldStaff, ComponentProps, setValuesConfig, ArrayFieldStaff } from './interface';
export type { BaseFormAdapter };
type ScrollToErrorOpts = {
    field?: string;
    index?: number;
    scrollOpts?: ScrollIntoViewOptions;
};
export default class FormFoundation extends BaseFoundation<BaseFormAdapter> {
    data: FormState;
    fields: Map<string, FieldStaff>;
    registered: Record<string, boolean>;
    registeredArrayField: Map<string, ArrayFieldStaff>;
    constructor(adapter: BaseFormAdapter);
    init(): void;
    getField(field: string): FieldStaff | undefined;
    register(field: string, fieldState: FieldState, fieldStuff: FieldStaff): void;
    unRegister(field: string): void;
    registerArrayField(arrayFieldPath: string, val: any): void;
    unRegisterArrayField(arrayField: string): void;
    getArrayField(arrayField: string): ArrayFieldStaff;
    updateArrayField(arrayField: string, updateValue: any): void;
    validate(fieldPaths?: Array<string>): Promise<unknown>;
    _formValidate(): Promise<unknown>;
    _fieldsValidate(fieldPaths: Array<string>): Promise<unknown>;
    submit(e?: any): void;
    /**
     * Case A：
     *      All fields: a[0]、a[1]、b.type、b.name[2]、b.name[0]
     *      input => output:
     *           a  => a[0]、a[1]
     *           b  => b.type、b.name[0]、b.name[2]
     *
     * Case B：
     *      All fields: activity.a[0]、activity.a[1]、activity.c、activity.d、other
     *      input => output:
     *           activity.a => activity.a[0]、activity.a[1]
     *
     */
    _getNestedField(path: string): Map<string, FieldStaff>;
    _getOperateFieldMap(fieldPaths?: Array<string>): Map<string, FieldStaff>;
    reset(fieldPaths?: Array<string>): void;
    _resetArrayField(): void;
    injectErrorToField(errors: any): void;
    getValue(field: string | undefined, opts?: CallOpts): any;
    setValues(values: any, { isOverride }: {
        isOverride?: boolean;
    }): void;
    updateStateValue(field: string, value: any, opts: CallOpts, callback?: () => void): void;
    getTouched(field?: string): boolean | Record<string, any> | undefined;
    updateStateTouched(field: string, isTouched: boolean, opts?: CallOpts, callback?: () => void): void;
    getError(field?: string): any;
    updateStateError(field: string, error: any, opts: CallOpts, callback?: () => void): void;
    getFieldSetterApi(): {
        setValue: (field: string, value: any, opts: CallOpts) => void;
        setError: (field: string, error: any, opts: CallOpts) => void;
        setTouched: (field: string, isTouched: boolean, opts: CallOpts) => void;
    };
    getModifyFormStateApi(): {
        register: (field: string, fieldState: FieldState, fieldStuff: FieldStaff) => void;
        unRegister: (field: string) => void;
        updateStateValue: (field: string, value: any, opts: CallOpts, callback?: () => void) => void;
        updateStateError: (field: string, error: any, opts: CallOpts, callback?: () => void) => void;
        updateStateTouched: (field: string, isTouched: boolean, opts?: CallOpts, callback?: () => void) => void;
        getValue: (field: string | undefined, opts?: CallOpts) => any;
        getError: (field?: string) => any;
        getTouched: (field?: string) => boolean | Record<string, any> | undefined;
        getInitValues: () => any;
        getInitValue: (field?: string) => any;
        getFormProps: (keys?: Array<string>) => ComponentProps;
        getField: (field: string) => FieldStaff | undefined;
        registerArrayField: (arrayFieldPath: string, val: any) => void;
        unRegisterArrayField: (arrayField: string) => void;
        getArrayField: (arrayField: string) => ArrayFieldStaff;
        updateArrayField: (arrayField: string, updateValue: any) => void;
    };
    getFormApi(): {
        reset: (fields?: Array<string>) => void;
        validate: (fields?: Array<string>) => Promise<unknown>;
        getValue: (field?: string) => any;
        getValues: () => any;
        getFormState: () => FormState<any>;
        getFormProps: (props?: Array<string>) => ComponentProps;
        getInitValue: (field: string) => any;
        getInitValues: () => any;
        getTouched: (field?: string) => boolean | Record<string, any>;
        getError: (field?: string) => any;
        setValues: (values: any, opts?: setValuesConfig) => void;
        submitForm: () => void;
        getFieldExist: (field: string) => boolean;
        scrollToField: (field: string, scrollOpts?: ScrollIntoViewOptions) => void;
        scrollToError: (opts?: ScrollToErrorOpts) => void;
        setValue: (field: string, value: any, opts: CallOpts) => void;
        setError: (field: string, error: any, opts: CallOpts) => void;
        setTouched: (field: string, isTouched: boolean, opts: CallOpts) => void;
    };
    getFormState(needClone?: boolean): FormState;
    _isValid(targetFields: Map<string, FieldStaff>): boolean;
    getInitValues(): any;
    getInitValue(field?: string): any;
    getFormProps(keys?: Array<string>): ComponentProps;
    getFieldExist(field: string): boolean;
    _autoScroll(timeout?: boolean | number): void;
    _getErrorFieldAndScroll(scrollOpts?: ScrollIntoViewOptions | boolean): void;
    scrollToField(field: string, scrollOpts?: ScrollIntoViewOptions): void;
    scrollToError(config?: ScrollToErrorOpts): void;
}
