import { type StyleValue, type Ref } from 'vue';
import { type Validator, type Rule } from './Validator';
import { type ScrollIntoViewOptions } from '../../utils';
import { type DefaultProps } from '../config';
export interface FormRules {
    [key: PropertyKey]: Rule | Rule[] | FormRules;
}
export type FieldName = string | number | (string | number)[];
export type ValidateState = '' | 'success' | 'error' | 'validating';
export type TriggerType = 'change' | 'blur' | ('change' | 'blur')[];
export interface FieldValidateError {
    name: FieldName;
    value: any;
    message: string;
}
export interface FormProps {
    rootStyle?: StyleValue;
    rootClass?: string;
    model?: Record<string, any>;
    rules?: FormRules;
    validateTrigger?: TriggerType;
    validateOnRuleChange?: boolean;
    direction?: 'horizontal' | 'vertical';
    labelWidth?: string;
    labelAlign?: 'start' | 'center' | 'end';
    labelValign?: 'start' | 'center' | 'end';
    starPosition?: 'left' | 'right';
    contentPosition?: 'left' | 'right';
    hideStar?: boolean;
    showError?: boolean;
    scrollToFirstError?: boolean;
    scrollIntoViewOptions?: ScrollIntoViewOptions;
    scrollDuration?: number;
    disabled?: boolean;
    readonly?: boolean;
    card?: boolean;
}
export declare const defaultFormProps: () => DefaultProps<FormProps>;
export interface FormSlots {
    default?(props: {
        context: FormContext;
    }): any;
}
export interface FormExpose {
    validate: (nameList?: FieldName[]) => Promise<void>;
    reset: (nameList?: FieldName[]) => Promise<void>;
    clearValidate: (nameList?: FieldName[]) => Promise<void>;
    scrollToField: (name: FieldName) => void;
}
export interface FormItemProps {
    context?: FormContext;
    rootStyle?: StyleValue;
    rootClass?: string;
    direction?: 'horizontal' | 'vertical';
    labelWidth?: string;
    labelAlign?: 'start' | 'center' | 'end';
    labelValign?: 'start' | 'center' | 'end';
    starPosition?: 'left' | 'right';
    label?: string;
    hideStar?: boolean;
    contentPosition?: 'left' | 'right';
    required?: boolean | undefined;
    name?: FieldName;
    rules?: Rule | Rule[];
    validateTrigger?: TriggerType;
    error?: string;
    showError?: boolean;
    inlaid?: boolean;
}
export declare const defaultFormItemProps: () => DefaultProps<FormItemProps>;
export interface FormItemSlots {
    default?(props: Record<string, never>): any;
    label?(props: Record<string, never>): any;
    validate?(props: {
        state: ValidateState;
    }): any;
    error?(props: {
        message: string;
        showError: boolean;
    }): any;
}
export interface FormItemExpose {
    validate: (trigger?: string | string[]) => Promise<void>;
    reset: () => Promise<void>;
    clearValidate: () => void;
    scrollToField: () => void;
    validateMessage: Ref<string>;
    validateState: Ref<ValidateState>;
}
export interface FormContext {
    model: FormProps['model'];
    rules: FormProps['rules'];
    validateTrigger: FormProps['validateTrigger'];
    direction: FormProps['direction'];
    labelWidth: FormProps['labelWidth'];
    labelAlign: FormProps['labelAlign'];
    labelValign: FormProps['labelValign'];
    starPosition: FormProps['starPosition'];
    contentPosition: FormProps['contentPosition'];
    hideStar: FormProps['hideStar'];
    showError: FormProps['showError'];
    scrollIntoViewOptions: FormProps['scrollIntoViewOptions'];
    disabled: FormProps['disabled'];
    readonly: FormProps['readonly'];
    addField: (context: FormItemContext) => void;
    removeField: (context: FormItemContext) => void;
    validator: Validator;
    scrollDuration: number;
}
export interface FormItemContext {
    name: FormItemProps['name'];
    validateMessage: string;
    validateState: ValidateState;
    validate: (trigger?: string | string[]) => Promise<void>;
    reset: () => Promise<void>;
    clearValidate: () => void;
    scrollToField: () => void;
    onBlur: () => void;
    onChange: () => void;
}
export declare const formContextSymbol: unique symbol;
export declare const formItemContextSymbol: unique symbol;
export declare function useFormContext(): FormContext | null;
export declare function useFormItemContext(): FormItemContext | null;
