import { ControlTreeNode } from '../../components/crud/crud-form/crud-form.component';
import { Filter } from '../../models/grid-info';
import { UserService } from '../../public-api';
import { BaseService } from '../../services/base.service';
import { EventData, Operator } from '../form-schema';
export interface IValidator {
    validate(event: EventData): Promise<boolean> | boolean;
    getError(): string;
}
export declare class RequiredValidator implements IValidator {
    private _label;
    validate(event: EventData): boolean;
    getError(): string;
}
export declare class RequiredFieldsValidator implements IValidator {
    _requiredFields: string[];
    _message: string;
    constructor(requiredFields: string[], message: string);
    getRequiredFields(): string[];
    getMessage(): string;
    validate(event: EventData): boolean;
    getError(): string;
}
export declare class EmailValidator implements IValidator {
    validate(event: EventData): boolean;
    getError(): string;
}
export declare class NameValidator implements IValidator {
    validate(event: EventData): boolean;
    getError(): string;
}
export declare class PhoneValidator implements IValidator {
    validate(event: EventData): boolean;
    getError(): string;
}
export declare class CccdValidator implements IValidator {
    validate(event: EventData): boolean;
    getError(): string;
}
export declare class PassportValidator implements IValidator {
    message: string;
    constructor(message?: string);
    validate(event: EventData): boolean;
    getError(): string;
}
export declare class LengthValidator implements IValidator {
    private _error;
    private _min;
    private _max;
    constructor(max: any, min?: number);
    validate(event: EventData): boolean;
    getError(): any;
}
export declare class PhoneNumberValidator implements IValidator {
    validate(event: EventData): boolean;
    getError(): string;
}
export declare class NumberOnlyValidator implements IValidator {
    validate(event: EventData): boolean;
    getError(): string;
}
export declare class AtLeastOneRowTableValidator implements IValidator {
    validate(event: EventData): boolean;
    getError(): string;
}
export declare class TaxCodeValidator implements IValidator {
    validate(event: EventData): boolean;
    getError(): string;
}
export interface ICompareValidator {
    compareUniqueField: string;
    getOperatorCompare(): Operator;
}
/**
 * So sanh 2 thuộc tính trong form.
 */
export declare class CompareValidator implements IValidator, ICompareValidator {
    private _operator;
    private _compareControl;
    compareUniqueField: string;
    constructor(operator: Operator, compareUniqueField: string);
    getOperatorCompare(): Operator;
    getFieldOperator(): Operator;
    getValueCompare(value: any): any;
    validate(event: EventData): boolean;
    getError(controlTreeNode?: ControlTreeNode): string;
}
export declare class DateCompareValidator extends CompareValidator {
    constructor(operator: Operator, field: string);
    getValueCompare(value: any): Date;
}
export declare class NumberCompareValidator extends CompareValidator {
    constructor(operator: Operator, field: string);
    getValueCompare(value: any): number;
}
/**
 * Kiểm tra giá trị một cột đã tồn tại trong db.
 */
export declare class CheckDuplicateValidator implements IValidator {
    private _label;
    private _value;
    private _baseService;
    private readonly _defaultFilters;
    constructor(defaultFilters?: Filter[]);
    setBaseService(baseService: BaseService): void;
    validate(event: EventData): Promise<boolean>;
    getError(): string;
}
/**
 * Kiểm tra bộ gái trị của nhiều cột đã tồn tại trong db.
 */
export declare class CheckDuplicateFieldsValidator implements IValidator {
    _duplicateFields: string[];
    _message: string;
    _oldMessage: string;
    _baseService: BaseService;
    _dicValue: any;
    private readonly _defaultFilters;
    constructor(duplicateFields: string[], message: string, defaultFilters?: Filter[]);
    setBaseService(baseService: BaseService): void;
    getDuplicateFields(): string[];
    getDefaultFilters(): Filter[];
    getMessage(): string;
    validate(event: EventData): Promise<boolean>;
    private getValue;
    getError(): string;
}
export declare class UniqueFieldInTableValidator implements IValidator {
    private _field;
    constructor(field: any);
    validate(event: EventData): boolean;
    getError(): string;
}
export declare class ExactOneValueInTableValidator implements IValidator {
    private _field;
    private _value;
    private _label;
    constructor(field: any, value: any, label?: any);
    validate(event: EventData): boolean;
    getError(): string;
}
export declare class SameValueValidator implements IValidator {
    _sameFields: string[];
    _message: string;
    constructor(duplicateFields: string[], message: string);
    getSameFields(): string[];
    getMessage(): string;
    validate(event: EventData): Promise<boolean>;
    getError(): string;
}
export declare enum ValueType {
    date = "date",
    datetime = "datetime",
    int = "int",
    decimal = "decimal",
    boolean = "boolean",
    string = "string"
}
export declare class CodeValidator implements IValidator {
    validate(event: EventData): boolean;
    getError(): string;
}
export declare class ScalarValueValidator implements IValidator {
    private _operator;
    private _scalarValue;
    private _type;
    private _operatorText;
    constructor(_operator: Operator, _scalarValue: any, _type?: ValueType);
    getError(): string;
    validate(event: EventData): Promise<boolean> | boolean;
    private compareValue;
    private getValue;
}
export declare class PasswordValidator implements IValidator {
    private _message;
    private _userService;
    constructor();
    setBaseService(userService: UserService): void;
    validate(event: EventData): Promise<boolean>;
    getError(): string;
}
//# sourceMappingURL=validators.d.ts.map