import ValidatorErrorList from "./ValidatorErrorList"; interface ValidatorFieldFn { (item: any): any; } export default class ValidatorField { protected required: boolean; protected default: any; protected message: string | null; protected errorsEnabled: boolean; protected queue: ValidatorFieldFn[]; protected errors: ValidatorErrorList; constructor(); protected addQueue(fn: ValidatorFieldFn): this; /** * Заменяет стандартные сообщения об ошибках */ setCustomErrors(errors?: ValidatorErrorList): void; /** * Устанавливает дефолтное значение */ setDefault(def: any): this; /** * Помечает поле обязательным */ setRequired(): this; /** * Устанавливает актуальное Сообщение об ошибке */ protected setMessage(message: string): this; /** * Сбрасывает актуальное сообщение об ошибке */ protected clearMessage(): this; /** * NO ERRORS мод */ errNo(): this; /** * Значние является строкой */ isString(): this; /** * Значение является числом */ isNumeric(): this; /** * Значение является целым числом */ isInt(): this; /** * Значение является булевым */ isBoolean(): this; /** * Проверка длинны строки */ length(min: number, max: number): this; /** * Проверка числа */ range(min: number, max: number): this; /** * Число больше или равно */ min(min: number): this; /** * Число меньше или равно */ max(max: number): this; /** * Число больше */ after(min: number): this; /** * Число меньше */ before(max: number): this; /** * Валидная карта */ isCreditCard(): this; /** * Преобразование в дату */ isDate(format?: string): this; /** * Корректный E-mail */ isEmail(): this; /** * Валидный json */ isJSON(parse?: boolean): this; /** * Нижний регистр */ isLowerCase(): this; /** * Верхний регистр */ isUpperCase(): this; /** * Обрезает пробельные символы строки */ trim(): this; /** * Является массивом */ isArray(): this; isObject(): this; /** * Значение одно из */ in(values: any[]): this; /** * Значение НЕ одно из */ notIn(values: any[]): this; /** * Тест регуляркой */ regex(reg: RegExp): this; /** * Поиск по регулярке */ regexSearch(reg: RegExp): this; /** * Удаление тегов */ stripTags(): this; /** * Экранирует специальные символы HTML */ encodeHtmlChars(): this; /** * Декодирует URL-компонент */ urlDecode(): this; /** * Строка является ключем в объекте */ inObjectKeys(obj: any): this; try(message: string, fn: (field: this) => void): this; assert(fn: (item: any) => boolean, message?: string | null): this; custom(fn: (item: any) => any): this; validate(value: any): any; } export {};