import type { ComputedRef, ExtractPropTypes, InjectionKey, PropType, Ref } from 'vue';
export interface FormField {
    name: Ref<string | undefined>;
    modelValue: Ref;
    validate?: () => Promise<string[]>;
    reset?: () => void;
    resetValidation?: () => void;
}
export interface FormInstance {
    items: Map<string | number, FormField>;
    isDisabled: ComputedRef<boolean>;
    isReadonly: ComputedRef<boolean>;
    isValidating: Ref<boolean>;
    register: (id: number | string, item: FormField) => void;
    unregister: (id: number | string) => void;
}
export declare const FormKey: InjectionKey<FormInstance>;
export declare const makeFormProps: <Defaults extends {
    disabled?: unknown;
    fastFail?: unknown;
    lazyValidation?: unknown;
    readonly?: unknown;
    valid?: unknown;
    modelValue?: unknown;
    defaultValue?: unknown;
} = {}>(defaults?: Defaults | undefined) => {
    disabled: unknown extends Defaults["disabled"] ? BooleanConstructor : {
        type: PropType<unknown extends Defaults["disabled"] ? boolean : boolean | Defaults["disabled"]>;
        default: unknown extends Defaults["disabled"] ? boolean : boolean | Defaults["disabled"];
    };
    fastFail: unknown extends Defaults["fastFail"] ? BooleanConstructor : {
        type: PropType<unknown extends Defaults["fastFail"] ? boolean : boolean | Defaults["fastFail"]>;
        default: unknown extends Defaults["fastFail"] ? boolean : boolean | Defaults["fastFail"];
    };
    lazyValidation: unknown extends Defaults["lazyValidation"] ? BooleanConstructor : {
        type: PropType<unknown extends Defaults["lazyValidation"] ? boolean : boolean | Defaults["lazyValidation"]>;
        default: unknown extends Defaults["lazyValidation"] ? boolean : boolean | Defaults["lazyValidation"];
    };
    readonly: unknown extends Defaults["readonly"] ? BooleanConstructor : {
        type: PropType<unknown extends Defaults["readonly"] ? boolean : boolean | Defaults["readonly"]>;
        default: unknown extends Defaults["readonly"] ? boolean : boolean | Defaults["readonly"];
    };
    valid: unknown extends Defaults["valid"] ? {
        type: PropType<boolean | null>;
        default: null;
    } : Omit<{
        type: PropType<boolean | null>;
        default: null;
    }, "type" | "default"> & {
        type: PropType<unknown extends Defaults["valid"] ? boolean | null : NonNullable<boolean | null> | Defaults["valid"]>;
        default: unknown extends Defaults["valid"] ? boolean | null : NonNullable<boolean | null> | Defaults["valid"];
    };
    modelValue: unknown extends Defaults["modelValue"] ? PropType<Record<string, any>> : {
        type: PropType<unknown extends Defaults["modelValue"] ? Record<string, any> : Record<string, any> | Defaults["modelValue"]>;
        default: unknown extends Defaults["modelValue"] ? Record<string, any> : Record<string, any> | Defaults["modelValue"];
    };
    defaultValue: unknown extends Defaults["defaultValue"] ? PropType<Record<string, any>> : {
        type: PropType<unknown extends Defaults["defaultValue"] ? Record<string, any> : Record<string, any> | Defaults["defaultValue"]>;
        default: unknown extends Defaults["defaultValue"] ? Record<string, any> : Record<string, any> | Defaults["defaultValue"];
    };
};
export declare function provideForm(props: ExtractPropTypes<ReturnType<typeof makeFormProps>> & {
    'onUpdate:valid': ((val: boolean | null) => void) | undefined;
    'onUpdate:modelValue': ((val: Record<string, any>) => void) | undefined;
}): {
    errorMessages: Ref<{
        id: string | number;
        errorMessages: string[];
    }[]>;
    isDisabled: ComputedRef<boolean>;
    isReadonly: ComputedRef<boolean>;
    isValidating: Ref<boolean>;
    items: Map<string | number, FormField>;
    submit: (e: Event) => Promise<void>;
    reset: (e: Event) => Promise<void>;
    resetValidation: () => Promise<void>;
};
export declare function useForm(): FormInstance | null;
