UNPKG

10.6 kBTypeScriptView Raw
1export declare type URLProtocol = 'http' | 'https' | 'ftp' | string;
2export declare type UUIDVersion = 3 | 4 | 5 | '3' | '4' | '5' | 'all';
3export declare type IPVersion = 4 | 6;
4export declare type AlphaLocale = 'ar' | 'ar-AE' | 'ar-BH' | 'ar-DZ' | 'ar-EG' | 'ar-IQ' | 'ar-JO' | 'ar-KW' | 'ar-LB' | 'ar-LY' | 'ar-MA' | 'ar-QA' | 'ar-QM' | 'ar-SA' | 'ar-SD' | 'ar-SY' | 'ar-TN' | 'ar-YE' | 'az-AZ' | 'bg-BG' | 'cs-CZ' | 'da-DK' | 'de-DE' | 'el-GR' | 'en-AU' | 'en-GB' | 'en-HK' | 'en-IN' | 'en-NZ' | 'en-US' | 'en-ZA' | 'en-ZM' | 'es-ES' | 'fa-AF' | 'fa-IR' | 'fr-FR' | 'he' | 'hu-HU' | 'id-ID' | 'it-IT' | 'ku-IQ' | 'nb-NO' | 'nl-NL' | 'nn-NO' | 'pl-PL' | 'pt-BR' | 'pt-PT' | 'ru-RU' | 'sk-SK' | 'sl-SI' | 'sr-RS' | 'sr-RS@latin' | 'sv-SE' | 'th-TH' | 'tr-TR' | 'uk-UA' | 'vi-VN';
5export declare type AlphanumericLocale = 'ar' | 'ar-AE' | 'ar-BH' | 'ar-DZ' | 'ar-EG' | 'ar-IQ' | 'ar-JO' | 'ar-KW' | 'ar-LB' | 'ar-LY' | 'ar-MA' | 'ar-QA' | 'ar-QM' | 'ar-SA' | 'ar-SD' | 'ar-SY' | 'ar-TN' | 'ar-YE' | 'az-AZ' | 'bg-BG' | 'cs-CZ' | 'da-DK' | 'de-DE' | 'el-GR' | 'en-AU' | 'en-GB' | 'en-HK' | 'en-IN' | 'en-NZ' | 'en-US' | 'en-ZA' | 'en-ZM' | 'es-ES' | 'fa-AF' | 'fa-IR' | 'fr-FR' | 'fr-BE' | 'he' | 'hu-HU' | 'it-IT' | 'id-ID' | 'ku-IQ' | 'nb-NO' | 'nl-BE' | 'nl-NL' | 'nn-NO' | 'pl-PL' | 'pt-BR' | 'pt-PT' | 'ru-RU' | 'sk-SK' | 'sl-SI' | 'sr-RS' | 'sr-RS@latin' | 'sv-SE' | 'th-TH' | 'tr-TR' | 'uk-UA' | 'vi-VN';
6export declare type MobilePhoneLocale = 'any' | 'am-AM' | 'ar-AE' | 'ar-BH' | 'ar-DZ' | 'ar-EG' | 'ar-IQ' | 'ar-JO' | 'ar-KW' | 'ar-LB' | 'ar-LY' | 'ar-MA' | 'ar-OM' | 'ar-SA' | 'ar-SY' | 'ar-TN' | 'az-AZ' | 'be-BY' | 'bg-BG' | 'bn-BD' | 'bs-BA' | 'cs-CZ' | 'de-AT' | 'de-CH' | 'de-DE' | 'de-LU' | 'da-DK' | 'el-GR' | 'en-AU' | 'en-CA' | 'en-GB' | 'en-GG' | 'en-GH' | 'en-HK' | 'en-HN' | 'en-IE' | 'en-IN' | 'en-KE' | 'en-MT' | 'en-MU' | 'en-NG' | 'en-NZ' | 'en-PH' | 'en-PK' | 'en-RW' | 'en-SG' | 'en-SL' | 'en-TZ' | 'en-UG' | 'en-US' | 'en-ZA' | 'en-ZM' | 'en-ZW' | 'es-AR' | 'es-BO' | 'es-CL' | 'es-CO' | 'es-CR' | 'es-DO' | 'es-EC' | 'es-ES' | 'es-MX' | 'es-PA' | 'es-PE' | 'es-PY' | 'es-UY' | 'et-EE' | 'fa-IR' | 'fi-FI' | 'fj-FJ' | 'fo-FO' | 'fr-BE' | 'fr-CH' | 'fr-FR' | 'fr-GF' | 'fr-GP' | 'fr-MQ' | 'fr-RE' | 'ga-IE' | 'he-IL' | 'hu-HU' | 'id-ID' | 'it-CH' | 'it-IT' | 'it-SM' | 'ja-JP' | 'ka-GE' | 'kk-KZ' | 'kl-GL' | 'lt-LT' | 'lv-LV' | 'ms-MY' | 'mz-MZ' | 'nb-NO' | 'nl-NL' | 'ne-NP' | 'nn-NO' | 'pl-PL' | 'pt-AO' | 'pt-BR' | 'pt-PT' | 'ro-RO' | 'ru-RU' | 'sk-SK' | 'sl-SI' | 'sq-AL' | 'sr-RS' | 'sv-SE' | 'th-TH' | 'tr-TR' | 'uk-UA' | 'uz-Uz' | 'vi-VN' | 'zh-CN' | 'zh-HK' | 'zh-TW';
7export declare type PostalCodeLocale = 'any' | 'AD' | 'AT' | 'AU' | 'AZ' | 'BE' | 'BG' | 'BR' | 'BY' | 'CA' | 'CH' | 'CN' | 'CZ' | 'DE' | 'DK' | 'DO' | 'DZ' | 'EE' | 'ES' | 'FI' | 'FR' | 'GB' | 'GR' | 'HR' | 'HT' | 'HU' | 'ID' | 'IL' | 'IN' | 'IS' | 'IR' | 'IT' | 'JP' | 'KE' | 'KR' | 'LI' | 'LT' | 'LU' | 'LV' | 'MT' | 'MX' | 'MY' | 'NL' | 'NO' | 'NP' | 'NZ' | 'PL' | 'PR' | 'PT' | 'RO' | 'RU' | 'SA' | 'SE' | 'SG' | 'SI' | 'TH' | 'TN' | 'TW' | 'UA' | 'US' | 'ZA' | 'ZM';
8export declare type HashAlgorithm = 'md4' | 'md5' | 'sha1' | 'sha256' | 'sha384' | 'sha512' | 'ripemd128' | 'ripemd160' | 'tiger128' | 'tiger160' | 'tiger192' | 'crc32' | 'crc32b';
9export declare type IdentityCardLocale = 'any' | 'ar-LY' | 'ar-TN' | 'ES' | 'he-IL' | 'IN' | 'IT' | 'IR' | 'MZ' | 'NO' | 'zh-CN' | 'zh-TW';
10export declare type PassportCountryCode = 'AM' | 'AR' | 'AT' | 'AU' | 'BE' | 'BG' | 'BY' | 'BR' | 'CA' | 'CH' | 'CN' | 'CY' | 'CZ' | 'DE' | 'DK' | 'DZ' | 'EE' | 'ES' | 'FI' | 'FR' | 'GB' | 'GR' | 'HR' | 'HU' | 'IE' | 'IN' | 'IR' | 'IS' | 'IT' | 'JP' | 'KR' | 'LT' | 'LU' | 'LV' | 'LY' | 'MT' | 'MY' | 'MZ' | 'NL' | 'PO' | 'PT' | 'RO' | 'RU' | 'SE' | 'SL' | 'SK' | 'TR' | 'UA' | 'US';
11export declare type IsLicensePlateLocale = 'de-DE' | 'de-LI' | 'pt-BR' | 'pt-PT' | 'sq-AL' | 'any';
12export declare type TaxIDLocale = 'bg-BG' | 'cs-CZ' | 'de-AT' | 'de-DE' | 'dk-DK' | 'el-CY' | 'el-GR' | 'en-GB' | 'en-IE' | 'en-US' | 'es-ES' | 'et-EE' | 'fi-FI' | 'fr-BE' | 'fr-FR' | 'fr-LU' | 'hr-HR' | 'hu-HU' | 'it-IT' | 'lb-LU' | 'lt-LT' | 'lv-LV' | 'mt-MT' | 'nl-BE' | 'nl-NL' | 'pl-PL' | 'pt-BR' | 'pt-PT' | 'ro-RO' | 'sk-SK' | 'sl-SI' | 'sv-SE';
13export declare type VATCountryCode = 'GB' | 'IT';
14export interface MinMaxOptions {
15 min?: number;
16 max?: number;
17}
18export interface MinMaxExtendedOptions extends MinMaxOptions {
19 lt?: number;
20 gt?: number;
21}
22/**
23 * defaults to
24 * {
25 * ignoreCase: false
26 * }
27 */
28export interface ContainsOptions {
29 ignoreCase?: boolean;
30}
31export interface IsAlphaOptions {
32 ignore?: string | string[] | RegExp;
33}
34export interface IsAlphanumericOptions {
35 ignore?: string | RegExp;
36}
37/**
38 * defaults to
39 * {
40 * urlSafe: false
41 * }
42 */
43export interface IsBase64Options {
44 urlSafe?: boolean;
45}
46/**
47 * defaults to
48 * {
49 * strict: false
50 * }
51 */
52export interface IsBooleanOptions {
53 strict?: boolean;
54}
55/**
56 * defaults to
57 * {
58 * symbol: '$',
59 * require_symbol: false,
60 * allow_space_after_symbol: false,
61 * symbol_after_digits: false,
62 * allow_negatives: true,
63 * parens_for_negatives: false,
64 * negative_sign_before_digits: false,
65 * negative_sign_after_digits: false,
66 * allow_negative_sign_placeholder: false,
67 * thousands_separator: ',',
68 * decimal_separator: '.',
69 * allow_space_after_digits: false
70 * }
71 */
72export interface IsCurrencyOptions {
73 symbol?: string;
74 require_symbol?: boolean;
75 allow_space_after_symbol?: boolean;
76 symbol_after_digits?: boolean;
77 allow_negatives?: boolean;
78 parens_for_negatives?: boolean;
79 negative_sign_before_digits?: boolean;
80 negative_sign_after_digits?: boolean;
81 allow_negative_sign_placeholder?: boolean;
82 thousands_separator?: string;
83 decimal_separator?: string;
84 allow_decimal?: boolean;
85 require_decimal?: boolean;
86 digits_after_decimal?: number[];
87 allow_space_after_digits?: boolean;
88}
89/**
90 * defaults to
91 * {
92 * format: 'YYYY/MM/DD',
93 * delimiters: ['/', '-'],
94 * strictMode: false
95 * }
96 */
97export interface IsDateOptions {
98 format?: string;
99 delimiters?: string[];
100 strictMode?: boolean;
101}
102export interface IsDecimalOptions {
103 decimal_digits?: string;
104 force_decimal?: boolean;
105 locale?: AlphanumericLocale;
106 blacklisted_chars?: string;
107}
108export interface IsEmailOptions {
109 allow_display_name?: boolean;
110 allow_utf8_local_part?: boolean;
111 require_tld?: boolean;
112 ignore_max_length?: boolean;
113 allow_ip_domain?: boolean;
114 domain_specific_validation?: boolean;
115 blacklisted_chars?: string;
116}
117/**
118 * defaults to
119 * {
120 * ignore_whitespace: false
121 * }
122 */
123export interface IsEmptyOptions {
124 ignore_whitespace: boolean;
125}
126export interface IsFloatOptions extends MinMaxExtendedOptions {
127 locale?: AlphanumericLocale;
128}
129/**
130 * defaults to
131 * {
132 * require_tld: true,
133 * allow_underscores: false,
134 * allow_trailing_dot: false,
135 * allow_numeric_tld: false
136 * }
137 */
138export interface IsFQDNOptions {
139 require_tld?: boolean;
140 allow_underscores?: boolean;
141 allow_trailing_dot?: boolean;
142 allow_numeric_tld?: false;
143}
144export interface IsIntOptions extends MinMaxExtendedOptions {
145 allow_leading_zeroes?: boolean;
146}
147/**
148 * defaults to
149 * {
150 * allow_primitives: false
151 * }
152 */
153export interface IsJSONOptions {
154 allow_primitives?: boolean;
155}
156/**
157 * defaults to
158 * {
159 * checkDMS: false
160 * }
161 */
162export interface IsLatLongOptions {
163 checkDMS?: boolean;
164}
165/**
166 * defaults to
167 * {
168 * allow_hyphens: false
169 * }
170 */
171export interface IsIMEIOptions {
172 allow_hyphens?: boolean;
173}
174/**
175 * defaults to
176 * {
177 * strict: false,
178 * strictSeparator: false
179 * }
180 */
181export interface IsISO8601Options {
182 strict?: boolean;
183 strictSeparator?: boolean;
184}
185/**
186 * defaults to
187 * {
188 * case_sensitive: false,
189 * require_hyphen: false
190 * }
191 */
192export interface IsISSNOptions {
193 case_sensitive?: boolean;
194 require_hyphen?: boolean;
195}
196/**
197 * defaults to
198 * ```js
199 * {
200 * no_separators: false
201 * }
202 * ```
203 */
204export interface IsMACAddressOptions {
205 no_separators?: boolean;
206 /**
207 * @deprecated use `no_separators` instead
208 */
209 no_colons?: boolean;
210}
211export interface IsMobilePhoneOptions {
212 strictMode?: boolean;
213}
214/**
215 * defaults to
216 * {
217 * no_symbols: false
218 * }
219 */
220export interface IsNumericOptions {
221 no_symbols: boolean;
222 locale?: AlphanumericLocale;
223}
224/**
225 * defaults to
226 * {
227 * minLength: 8,
228 * minLowercase: 1,
229 * minUppercase: 1,
230 * minNumbers: 1,
231 * minSymbols: 1,
232 * returnScore: false,
233 * pointsPerUnique: 1,
234 * pointsPerRepeat: 0.5,
235 * pointsForContainingLower: 10,
236 * pointsForContainingUpper: 10,
237 * pointsForContainingNumber: 10,
238 * pointsForContainingSymbol: 10
239 * }
240 */
241export interface IsStrongPasswordOptions {
242 minLength?: number;
243 minLowercase?: number;
244 minUppercase?: number;
245 minNumbers?: number;
246 minSymbols?: number;
247 returnScore?: boolean;
248 pointsPerUnique?: number;
249 pointsPerRepeat?: number;
250 pointsForContainingLower?: number;
251 pointsForContainingUpper?: number;
252 pointsForContainingNumber?: number;
253 pointsForContainingSymbol?: number;
254}
255/**
256 * defaults to
257 * {
258 * protocols: ['http','https','ftp'],
259 * require_tld: true,
260 * require_protocol: false,
261 * require_host: true,
262 * require_port: false;
263 * require_valid_protocol: true,
264 * allow_underscores: false,
265 * host_whitelist: false,
266 * host_blacklist: false,
267 * allow_trailing_dot: false,
268 * allow_protocol_relative_urls: false,
269 * validate_length: true
270 * }
271 */
272export interface IsURLOptions {
273 protocols?: URLProtocol[];
274 require_tld?: boolean;
275 require_protocol?: boolean;
276 require_host?: boolean;
277 require_port?: boolean;
278 require_valid_protocol?: boolean;
279 allow_underscores?: boolean;
280 host_whitelist?: (string | RegExp)[];
281 host_blacklist?: (string | RegExp)[];
282 allow_trailing_dot?: boolean;
283 allow_protocol_relative_urls?: boolean;
284 disallow_auth?: boolean;
285 validate_length?: boolean;
286}
287export interface NormalizeEmailOptions {
288 all_lowercase?: boolean;
289 gmail_lowercase?: boolean;
290 gmail_remove_dots?: boolean;
291 gmail_remove_subaddress?: boolean;
292 gmail_convert_googlemaildotcom?: boolean;
293 outlookdotcom_lowercase?: boolean;
294 outlookdotcom_remove_subaddress?: boolean;
295 yahoo_lowercase?: boolean;
296 yahoo_remove_subaddress?: boolean;
297 icloud_lowercase?: boolean;
298 icloud_remove_subaddress?: boolean;
299}