export declare type Validity = true | {
    valid: false | undefined;
    message: string;
};
export declare type FormValue = Record<string, any>;
interface Callbacks<S> {
    onValue?: (values: Partial<S>) => void;
}
export interface FormMiddlewareApi<S> {
    value: {
        (): Partial<S>;
        (values: S): S;
        (values: Partial<S>): Partial<S>;
    };
    submit: {
        (callback: (values: Partial<S>) => void): void;
        (callback: (values: S) => void, defaults: S): void;
    };
    onValue(callback: (values: Partial<S>) => void): void;
    disabled(disabled?: boolean): boolean;
    valid(): boolean;
    reset(): void;
    field<K extends keyof S>(name: K, required?: boolean): Field<S, K>;
}
export interface FormMiddleware<S> extends FormMiddlewareApi<S> {
    <S>(): FormMiddlewareApi<S>;
}
export interface Field<S, K extends keyof S> {
    value: {
        (newValue: S[K]): S[K];
        (): S[K] | undefined;
    };
    valid(valid?: boolean, message?: string): Validity;
    required(required?: boolean): boolean;
    disabled(required?: boolean): boolean;
    name: string;
}
export interface State<S> {
    callbacks: Callbacks<S>;
    required: Record<string, boolean>;
    values: Partial<S>;
    valid: Record<string, Validity>;
    disabled: Record<string, boolean>;
    formDisabled: boolean;
}
export declare const createFormMiddleware: <S extends Record<string, any> = any>() => import("@dojo/framework/core/interfaces").MiddlewareResultFactory<import("@dojo/framework/core/interfaces").WidgetProperties, import("@dojo/framework/core/interfaces").DNode<any>[], {
    icache: import("@dojo/framework/core/interfaces").MiddlewareResultFactory<import("@dojo/framework/core/interfaces").WidgetProperties, import("@dojo/framework/core/interfaces").DNode<any>[], {
        invalidator: import("@dojo/framework/core/interfaces").MiddlewareResultFactory<import("@dojo/framework/core/interfaces").WidgetProperties, import("@dojo/framework/core/interfaces").DNode<any>[], import("@dojo/framework/core/interfaces").MiddlewareMap<() => {
            api: {};
            properties: {};
        }>, () => void>;
        destroy: import("@dojo/framework/core/interfaces").MiddlewareResultFactory<import("@dojo/framework/core/interfaces").WidgetProperties, import("@dojo/framework/core/interfaces").DNode<any>[], import("@dojo/framework/core/interfaces").MiddlewareMap<() => {
            api: {};
            properties: {};
        }>, (destroyFunction: () => void) => void>;
    }, import("@dojo/framework/core/middleware/icache").ICacheResult<State<S>>>;
}, FormMiddleware<S>>;
export default createFormMiddleware;
