/** * 密码校验选项接口 */ export interface PasswordValidationOptions { /** 最小长度,默认8 */ minLength?: number; /** 是否要求大写字母,默认true */ requireUppercase?: boolean; /** 是否要求小写字母,默认true */ requireLowercase?: boolean; /** 是否要求数字,默认true */ requireNumbers?: boolean; /** 是否要求特殊字符,默认true */ requireSpecialChars?: boolean; } /** * 密码校验结果接口 */ export interface PasswordValidationResult { /** 是否通过校验 */ isValid: boolean; /** 密码强度(弱/中/强) */ strength: '弱' | '中' | '强'; /** 错误消息数组 */ messages: string[]; } /** * 校验函数声明 */ export declare function isNumber(value: string | number): boolean; export declare function isInteger(value: string | number): boolean; export declare function isDecimal(value: string | number, decimalPlaces?: number): boolean; export declare function isPositiveInteger(value: string | number): boolean; export declare function isMobilePhone(phone: string): boolean; export declare function isInternationalPhone(phone: string): boolean; export declare function isLandlinePhone(phone: string): boolean; export declare function isEmail(email: string): boolean; export declare function isEmailStrict(email: string): boolean; export declare function isChineseIDCard(idCard: string): boolean; export declare function isURL(url: string): boolean; export declare function validatePassword( password: string, options?: PasswordValidationOptions ): PasswordValidationResult; export declare function isChineseName(name: string): boolean; export declare function isLicensePlate(plate: string): boolean; /** * 校验工具模块默认导出接口 */ export interface ValidatorModule { isNumber: typeof isNumber; isInteger: typeof isInteger; isDecimal: typeof isDecimal; isPositiveInteger: typeof isPositiveInteger; isMobilePhone: typeof isMobilePhone; isInternationalPhone: typeof isInternationalPhone; isLandlinePhone: typeof isLandlinePhone; isEmail: typeof isEmail; isEmailStrict: typeof isEmailStrict; isChineseIDCard: typeof isChineseIDCard; isURL: typeof isURL; validatePassword: typeof validatePassword; isChineseName: typeof isChineseName; isLicensePlate: typeof isLicensePlate; } /** * 默认导出 */ declare const validator: ValidatorModule; export default validator;