Validator Types
Read this section from bottom to top; the basic building blocks live near the end, and the composite aliases appear first.
String Formats
ValidatorFormats
String-based format validators. Register custom formats via registerValidateFormats when needed.
ts
export type
= | 'url'
| 'email'
| 'ipv6'
| 'ipv4'
| 'number'
| 'integer'
| 'idcard'
| 'qq'
| 'phone'
| 'money'
| 'zh'
| 'date'
| 'zip'
| (string & {})Object Validators
IValidateResult
ts
export interface IValidateResult {
: 'error' | 'warning' | 'success' | (string & {})
: string
}IValidatorRules
ts
export interface < = any> {
?: 'onInput' | 'onFocus' | 'onBlur' | (string & {})
?:
?: <>
?: boolean
?: RegExp | string
?: number
?: number
?: number
?: number
?: number
?: number
?: number
?: number
?: number
?: number
?: number
?: boolean
?: any[]
?: any
?: number
?: boolean
?: number
?: number
?: string
[: string]: any
}Function Validators
ValidatorFunctionResponse
ts
export type
= | null
| string
| boolean
| IValidateResultValidatorFunction
ts
export type < = any> = (
: any,
: <>,
: ,
: (: string, ?: any) => string,
) => | <> | nullValidatorDescription
ts
export type < = any>
= |
| <>
| <>MultiValidator
ts
export type < = any> = <>[]FieldValidator
ts
export type < = any>
= | <>
| <>