import { FormInput } from '../models/form-input';
declare type Metadata = {
    el: FormInput;
    tag: string;
    [custom: string]: any;
};
declare type Translator = (ctx: TranslatorContext) => Promise<string>;
interface TranslatorContext {
    readonly args: string[];
    readonly message: string;
    readonly meta: Metadata;
    readonly rule: string;
    readonly value: FormInput['value'];
}
declare type ValidatorResult = boolean | {
    valid: boolean;
    message: string;
};
declare type ValidatorFunc = (value: FormInput['value'] | number, args: string[], meta: Metadata) => Promise<ValidatorResult>;
export declare type ValidatorError = {
    rule: string;
    message: string;
    meta: Metadata;
};
declare class Validator {
    readonly rules: Map<string, ValidatorFunc>;
    translator?: Translator;
    validate(validation: string, el: FormInput, meta?: Omit<Metadata, 'el'>): Promise<ValidatorError[]>;
    validateRule(rule: string, args: string[], value: FormInput['value'], meta: Metadata): Promise<{
        rule: string;
        message: string;
        meta: Metadata;
    }>;
}
export declare const validator: Validator;
export {};
