import React from 'react';

type RuleWithMessage<T> = T | {
    value: T;
    message?: string;
};
type ValidationRule = {
    required?: boolean | {
        value: boolean;
        message?: string;
    };
    minLength?: number | {
        value: number;
        message?: string;
    };
    maxLength?: number | {
        value: number;
        message?: string;
    };
    pattern?: RegExp | {
        value: RegExp;
        message?: string;
    };
    custom?: (value: any) => string | null;
    async?: (value: any) => Promise<string | null>;
};
type ValidationSchema = Record<string, ValidationRule>;
type Errors$1 = Record<string, string | null>;
type Language = "en" | "hi";
type ValidationMessages = {
    required: string;
    minLength: (num: number) => string;
    maxLength: (num: number) => string;
    pattern: string;
    custom?: string;
    async?: string;
};

type Errors = Record<string, string | null>;
declare const useAutoValidator: (manualSchema?: Record<string, ValidationRule>, language?: Language) => {
    register: (name: string) => {
        name: string;
        ref: React.RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null>;
        onBlur: () => Promise<void>;
        onChange: () => void;
    };
    errors: Errors;
    validateForm: (values: Record<string, string>) => Promise<boolean>;
    resetErrors: () => void;
};

interface ErrorMessageProps {
    name: string;
    errors: Record<string, string | null>;
}
declare const ErrorMessage: React.FC<ErrorMessageProps>;

export { ErrorMessage, type Errors$1 as Errors, type Language, type RuleWithMessage, type ValidationMessages, type ValidationRule, type ValidationSchema, useAutoValidator };
