import { FormEvent } from 'react';
import { ValidateOption, $FieldSetValue, FormStrategy, FormBuilder, IForm, IValidateResult } from './formulr';
import { Subject } from 'rxjs';
import { UnknownFieldSetModelChildren, UnknownFieldSetBuilderChildren } from './formulr/utils';
export interface IFormAction {
    type: 'SUBMIT_START' | 'SUBMIT_SUCCESS' | 'SUBMIT_ERROR';
}
export interface IFormState {
    submitting: boolean;
    submitFailed: boolean;
    submitSucceeded: boolean;
}
export declare class ZentForm<T extends UnknownFieldSetModelChildren> implements IForm<T> {
    readonly inner: IForm<T>;
    state: IFormState;
    private dispatch;
    submit$: Subject<FormEvent<Element>>;
    reset$: Subject<FormEvent<HTMLFormElement>>;
    constructor(inner: IForm<T>, state: IFormState, dispatch: (action: IFormAction) => void);
    get isSubmitting(): boolean;
    get isSubmitFailed(): boolean;
    get isSubmitSucceeded(): boolean;
    get ctx(): import("./formulr").IFormContext;
    get model(): import("./formulr/models/form").FormModel<T>;
    submit: (e?: React.SyntheticEvent) => void;
    validate(option?: ValidateOption): Promise<IValidateResult<any> | IValidateResult<any>[]>;
    isValid(): boolean;
    isValidating(): boolean;
    getValue(): $FieldSetValue<T>;
    getSubmitValue(): any;
    initialize(value: $FieldSetValue<T>): void;
    patchValue(value: Partial<$FieldSetValue<T>>): void;
    resetValue(): void;
    reset(e: FormEvent<HTMLFormElement>): void;
    clear(): void;
    submitStart(): void;
    submitSuccess(): void;
    submitError(): void;
}
export declare function useForm<T extends UnknownFieldSetBuilderChildren>(arg: FormStrategy.View | FormBuilder<T>): ZentForm<import("./formulr").$FieldSetBuilderChildren<T>>;
export declare function useFormValue<T extends UnknownFieldSetModelChildren>(form: ZentForm<T>, defaultValue?: $FieldSetValue<T>): $FieldSetValue<T>;
export declare function useFormValid<T extends UnknownFieldSetModelChildren>(form: ZentForm<T>): boolean;
