import { AbstractControl, AsyncValidatorFn, ValidationErrors, ValidatorFn } from '@angular/forms'; /** 验证器 */ export declare class DtRules { /** 是否必填 */ static required(enable: any, errorMsg?: string): ValidationErrors | null; /** 最小值 */ static min(min: number, errorMsg?: string): ValidatorFn; /** 最大值 */ static max(max: number, errorMsg?: string): ValidatorFn; /** 最小长度 */ static minLength(minLength: number, errorMsg?: string): ValidatorFn; /** 最大长度 */ static maxLength(maxLength: number, errorMsg?: string): ValidatorFn; /** 验证是否为true,常见于复选框验证 */ static requiredTrue(errorMsg?: string): ValidatorFn | null; /** 邮箱 */ static email(errorMsg?: string): ValidationErrors | null; static pattern(pattern: string | RegExp): ValidatorFn; /** * @description * Validator that performs no operation. */ static nullValidator(): ValidationErrors | null; /** * @description * Compose multiple validators into a single function that returns the union * of the individual error maps for the provided control. * * @returns A validator function that returns an error map with the * merged error maps of the validators if the validation check fails, otherwise `null`. */ static compose(validators: null): null; static compose(validators: (ValidatorFn | null | undefined)[]): ValidatorFn | null; /** * @description * Compose multiple async validators into a single function that returns the union * of the individual error objects for the provided control. * * @returns A validator function that returns an error map with the * merged error objects of the async validators if the validation check fails, otherwise `null`. */ static composeAsync(validators: (AsyncValidatorFn | null)[]): AsyncValidatorFn | null; /** 是否为数字 */ static num(control: AbstractControl): ValidationErrors | null; /** 是否为整数 */ static int(control: AbstractControl): ValidationErrors | null; /** 是否为小数 */ static decimal(control: AbstractControl): ValidationErrors | null; /** 是否为身份证 */ static idCard(control: AbstractControl): ValidationErrors | null; /** 是否为手机号 */ static mobile(control: AbstractControl): ValidationErrors | null; /** 是否URL地址 */ static url(control: AbstractControl, errorMsg?: string): ValidationErrors | null; /** 非零开头的最多带两位小数的数字 */ static twoDecimal(control: AbstractControl): ValidationErrors | null; /** 中文、英文、数字包括下划线: */ static language(control: AbstractControl): ValidationErrors | null; /** 中文、英文、数字但不包括下划线等符号 */ static noLanguage(control: AbstractControl): ValidationErrors | null; /** 英文和数字:^[A-Za-z0-9]+$ 或 ^[A-Za-z0-9]{4,40}$ */ static figures(control: AbstractControl): ValidationErrors | null; /** 域名 */ static domain(control: AbstractControl): ValidationErrors | null; /** 国内电话号码 */ static teplphone(control: AbstractControl): ValidationErrors | null; /** 短身份证号码(数字、字母x结尾) */ static short(control: AbstractControl): ValidationErrors | null; /** 帐号是否合法(字母开头,允许5-16字节,允许字母数字下划线) */ static legality(control: AbstractControl): ValidationErrors | null; /** 强密码(必须包含大小写字母和数字的组合,不能使用特殊字符,长度在8-10之间) */ static strongCipher(control: AbstractControl): ValidationErrors | null; /** 特殊字符 */ static specialCharacter(control: AbstractControl): ValidationErrors | null; /** 中国邮政编码:[1-9]\d{5}(?!\d) (中国邮政编码为6位数字) */ static postal(control: AbstractControl): ValidationErrors | null; /** 提取Color Hex Codes */ static extraction(control: AbstractControl): ValidationErrors | null; /** 长度为3-20的所有字符 */ static allCharacter(control: AbstractControl): ValidationErrors | null; /** 5-18位的数字: */ static digits(control: AbstractControl): ValidationErrors | null; /** 为汉字 */ static chinese(control: AbstractControl): ValidationErrors | null; /** 由26个英文字母组成的字符串 */ static letters(control: AbstractControl): ValidationErrors | null; /** 腾讯QQ号 */ static tencent(control: AbstractControl): ValidationErrors | null; /** 数字在15-200之间 */ static size(control: AbstractControl): ValidationErrors | null; /** 首尾空白字符的正则表达式 */ static blank(control: AbstractControl): ValidationErrors | null; /** 验证货币可以带逗号或者为带元符号 */ static comma(control: AbstractControl): ValidationErrors | null; /** 是否为日期 */ static dateline(control: AbstractControl): ValidationErrors | null; /** 网址 */ static web(control: AbstractControl): ValidationErrors | null; /** ip地址 */ static ip(enable: boolean, errorMsg?: string): ValidationErrors | null; }