import { MaybeRef } from '../utils';
import { PropType, ComputedRef, Ref } from 'vue';
export type TValidationResult = string | boolean;
export type TValidationRule = TValidationResult | PromiseLike<TValidationResult> | ((value: any) => TValidationResult) | ((value: any) => PromiseLike<TValidationResult>);
export type TValidationOn = typeof allowedValidationOn[number];
export interface IValidationProps {
    disabled: boolean;
    error: boolean;
    errorMessages: string | string[];
    focused: boolean;
    maxErrors: string | number;
    name: string | undefined;
    label: string | undefined;
    readonly: boolean;
    rules: TValidationRule[];
    modelValue: any;
    validateOn?: TValidationOn;
    validationValue: any;
    hideMessages: boolean;
}
export interface IUseValidation {
    errorMessages: ComputedRef<string[]>;
    isDisabled: ComputedRef<boolean>;
    isReadonly: ComputedRef<boolean>;
    isDirty: ComputedRef<boolean>;
    isPure: Ref<boolean>;
    isValid: ComputedRef<boolean | null>;
    isValidating: Ref<boolean>;
    validate: () => Promise<string[]>;
    reset: () => void;
    resetValidation: () => void;
    validationClasses: ComputedRef<Record<string, boolean>>;
}
export declare const allowedValidationOn: readonly ["blur", "input", "submit"];
export declare const makeValidationProps: <Defaults extends {
    error?: unknown;
    errorMessages?: unknown;
    maxErrors?: unknown;
    name?: unknown;
    rules?: unknown;
    modelValue?: unknown;
    validateOn?: unknown;
    validationValue?: unknown;
    hideMessages?: unknown;
} = {}>(defaults?: Defaults | undefined) => import('../utils').AppendDefault<{
    /**
     * Состояние ошибки
     */
    error: {
        type: PropType<boolean>;
        default: boolean;
    };
    /**
     * Сообщения об ошибках
     */
    errorMessages: {
        type: PropType<string | string[]>;
        default: () => never[];
    };
    /**
     * Максимально количество выводимых ошибок
     */
    maxErrors: {
        type: PropType<string | number>;
        default: number;
    };
    /**
     * Имя поля
     */
    name: {
        type: PropType<string | undefined>;
        default: undefined;
    };
    /**
     * Правила валидации
     */
    rules: {
        type: PropType<TValidationRule[]>;
        default: () => never[];
    };
    /**
     * Значение модели
     */
    modelValue: {
        type: PropType<any>;
        default: null;
    };
    /**
     * Событие для валидации
     */
    validateOn: {
        type: PropType<TValidationOn>;
        default: string;
        available: readonly ["blur", "input", "submit"];
        validator: (value: TValidationOn) => boolean;
    };
    /**
     * Значение для валидации
     */
    validationValue: {
        type: PropType<any>;
        default: undefined;
    };
    /**
     * Убирает слот для сообщений об ошибках
     */
    hideMessages: {
        type: PropType<boolean>;
        default: boolean;
    };
}, Defaults>;
export declare function useValidation(props: IValidationProps, name: string, id?: MaybeRef<string | number>): IUseValidation;
