UNPKG

25.8 kBTypeScriptView Raw
1// Type definitions for validator.js v10.9.0
2// Project: https://github.com/chriso/validator.js
3// Definitions by: tgfjt <https://github.com/tgfjt>
4// Ilya Mochalov <https://github.com/chrootsu>
5// Ayman Nedjmeddine <https://github.com/IOAyman>
6// Louy Alakkad <https://github.com/louy>
7// Kacper Polak <https://github.com/kacepe>
8// Bonggyun Lee <https://github.com/deptno>
9// Naoto Yokoyama <https://github.com/builtinnya>
10// Philipp Katz <https://github.com/qqilihq>
11// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
12
13declare namespace ValidatorJS {
14 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" | "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" | "fr-FR" | "hu-HU" | "it-IT" | "nb-NO" | "nl-NL" | "nn-NO" | "pl-PL" | "pt-BR" | "pt-PT" | "ru-RU" | "sk-SK" | "sr-RS" | "sr-RS@latin" | "sv-SE" | "tr-TR" | "uk-UA";
15 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" | "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" | "fr-FR" | "hu-HU" | "it-IT" | "nb-NO" | "nl-NL" | "nn-NO" | "pl-PL" | "pt-BR" | "pt-PT" | "ru-RU" | "sk-SK" | "sr-RS" | "sr-RS@latin" | "sv-SE" | "tr-TR" | "uk-UA";
16 type DecimalLocale = "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" | "bg-BG" | "cs-CZ" | "da-DK" | "de-DE" | "en-AU" | "en-GB" | "en-HK" | "en-IN" | "en-NZ" | "en-US" | "en-ZA" | "en-ZM" | "es-ES" | "fr-FR" | "hu-HU" | "it-IT" | "nb-NO" | "nl-NL" | "nn-NO" | "pl-PL" | "pt-BR" | "pt-PT" | "ru-RU" | "sr-RS" | "sr-RS@latin" | "sv-SE" | "tr-TR" | "uk-UA";
17 type FloatLocale = "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" | "bg-BG" | "cs-CZ" | "da-DK" | "de-DE" | "en-AU" | "en-GB" | "en-HK" | "en-IN" | "en-NZ" | "en-US" | "en-ZA" | "en-ZM" | "es-ES" | "fr-FR" | "hu-HU" | "it-IT" | "nb-NO" | "nl-NL" | "nn-NO" | "pl-PL" | "pt-BR" | "pt-PT" | "ru-RU" | "sr-RS" | "sr-RS@latin" | "sv-SE" | "tr-TR" | "uk-UA";
18 type MobilePhoneLocale = "ar-AE" | "ar-DZ" | "ar-EG" | "ar-JO" | "ar-SA" | "ar-SY" | "be-BY" | "bg-BG" | "cs-CZ" | "de-DE" | "da-DK" | "el-GR" | "en-AU" | "en-GB" | "en-HK" | "en-IN" | "en-KE" | "en-NG" | "en-NZ" | "en-UG" | "en-RW" | "en-SG" | "en-TZ" | "en-PK" | "en-US" | "en-CA" | "en-ZA" | "en-ZM" | "es-ES" | "fa-IR" | "fi-FI" | "fo-FO" | "fr-FR" | "he-IL" | "hu-HU" | "id-ID" | "it-IT" | "ja-JP" | "kk-KZ" | "kl-GL" | "ko-KR" | "lt-LT" | "ms-MY" | "nb-NO" | "nn-NO" | "pl-PL" | "pt-PT" | "ro-RO" | "ru-RU" | "sk-SK" | "sr-RS" | "th-TH" | "tr-TR" | "uk-UA" | "vi-VN" | "zh-CN" | "zh-HK" | "zh-TW" | "any";
19 type PostalCodeLocale = "AT" | "AU" | "BE" | "BG" | "CA" | "CH" | "CZ" | "DE" | "DK" | "DZ" | "ES" | "FI" | "FR" | "GB" | "GR" | "IL" | "IN" | "IS" | "IT" | "JP" | "KE" | "LI" | "MX" | "NL" | "NO" | "PL" | "PT" | "RO" | "RU" | "SA" | "SE" | "TW" | "US" | "ZA" | "ZM" | "any"
20 type HashAlgorithm = "md4" | "md5" | "sha1" | "sha256" | "sha384" | "sha512" | "ripemd128" | "ripemd160" | "tiger128" | "tiger160" | "tiger192" | "crc32" | "crc32b";
21
22 interface ValidatorStatic {
23
24 // **************
25 // * Validators *
26 // **************
27
28 // check if the string contains the seed.
29 contains(str: string, elem: any): boolean;
30
31 // check if the string matches the comparison.
32 equals(str: string, comparison: string): boolean;
33
34 // check if the string is a date that's after the specified date (defaults to now).
35 isAfter(str: string, date?: string): boolean;
36
37 // check if the string contains only letters (a-zA-Z). Locale is one of ['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG',
38 // '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',
39 // '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',
40 // 'es-ES', 'fr-FR', 'hu-HU', 'it-IT', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'sk-SK', 'sr-RS',
41 // 'sr-RS@latin', 'sv-SE', 'tr-TR', 'uk-UA']) and defaults to en-US
42 isAlpha(str: string, locale?: AlphaLocale): boolean;
43
44 // check if the string contains only letters and numbers. Locale is one of ['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG',
45 // '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',
46 // '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',
47 // 'es-ES', 'fr-FR', 'hu-HU', 'it-IT', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'sk-SK', 'sr-RS',
48 // 'sr-RS@latin', 'sv-SE', 'tr-TR', 'uk-UA']) and defaults to en-US
49 isAlphanumeric(str: string, locale?: AlphanumericLocale): boolean;
50
51 // check if the string contains ASCII chars only.
52 isAscii(str: string): boolean;
53
54 // check if a string is base64 encoded.
55 isBase64(str: string): boolean;
56
57 // check if the string is a date that's before the specified date.
58 isBefore(str: string, date?: string): boolean;
59
60 // check if a string is a boolean.
61 isBoolean(str: string): boolean;
62
63 // check if the string's length (in bytes) falls in a range.
64 isByteLength(str: string, options: IsByteLengthOptions): boolean;
65 isByteLength(str: string, min: number, max?: number): boolean;
66
67 // check if the string is a credit card.
68 isCreditCard(str: string): boolean;
69
70 // check if the string is a valid currency amount.
71 isCurrency(str: string, options?: IsCurrencyOptions): boolean;
72
73 // check if the string is a data uri format (https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs)
74 isDataURI(str: string): boolean;
75
76 // check if the string represents a decimal number, such as 0.1, .3, 1.1, 1.00003, 4.0, etc.
77 isDecimal(str: string, options?: IsDecimalOptions): boolean;
78
79 // check if the string is a number that's divisible by another.
80 isDivisibleBy(str: string, number: number): boolean;
81
82 // check if the string is an email.
83 isEmail(str: string, options?: IsEmailOptions): boolean;
84
85 // check if the string has a length of zero.
86 isEmpty(str: string, options?: IsEmptyOptions): boolean;
87
88 // check if the string is a fully qualified domain name (e.g. domain.com).
89 isFQDN(str: string, options?: IsFQDNOptions): boolean;
90
91 // check if the string is a float.
92 isFloat(str: string, options?: IsFloatOptions): boolean;
93
94 // check if the string contains any full-width chars.
95 isFullWidth(str: string): boolean;
96
97 // check if the string contains any half-width chars.
98 isHalfWidth(str: string): boolean;
99
100 // check if the string is a hash of type algorithm.
101 // Algorithm is one of ['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128',
102 // 'tiger160', 'tiger192', 'crc32', 'crc32b']
103 isHash(str: string, algorithm: HashAlgorithm): boolean;
104
105 // check if the string is a hexadecimal color.
106 isHexColor(str: string): boolean;
107
108 // check if the string is a hexadecimal number.
109 isHexadecimal(str: string): boolean;
110
111 // check if the string is an IP (version 4 or 6).
112 isIP(str: string, version?: number): boolean;
113
114 // check if the string is an ISBN (version 10 or 13).
115 isISBN(str: string, version?: number): boolean;
116
117 // check if the string is an ISSN (https://en.wikipedia.org/wiki/International_Standard_Serial_Number).
118 isISSN(str: string, options?: IsISSNOptions): boolean;
119
120 // check if the string is an ISIN (https://en.wikipedia.org/wiki/International_Securities_Identification_Number)
121 // (stock/security identifier).
122 isISIN(str: string): boolean;
123
124 // check if the string is a valid ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601) date.
125 isISO8601(str: string, options?: IsISO8601Options): boolean;
126
127 // check if the string is a valid ISO 3166-1 alpha-2 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) officially assigned
128 // country code.
129 isISO31661Alpha2(str: string): boolean;
130
131 // check if the string is a ISRC (https://en.wikipedia.org/wiki/International_Standard_Recording_Code).
132 isISRC(str: string): boolean;
133
134 // check if the string is in a array of allowed values.
135 isIn(str: string, values: any[]): boolean;
136
137 // check if the string is an integer.
138 isInt(str: string, options?: IsIntOptions): boolean;
139
140 // check if the string is valid JSON (note: uses JSON.parse).
141 isJSON(str: string): boolean;
142
143 // check if the string is a valid latitude-longitude coordinate in the format lat,long or lat, long.
144 isLatLong(str: string): boolean;
145
146 // check if the string's length falls in a range.
147 // Note: this function takes into account surrogate pairs.
148 isLength(str: string, options: IsLengthOptions): boolean;
149 isLength(str: string, min: number, max?: number): boolean;
150
151 // check if the string is lowercase.
152 isLowercase(str: string): boolean;
153
154 // check if the string is a MAC address.
155 isMACAddress(str: string): boolean;
156
157 // check if the string is a MD5 hash.
158 isMD5(str: string): boolean;
159
160 // check if the string matches to a valid MIME type (https://en.wikipedia.org/wiki/Media_type) format
161 isMimeType(str: string): boolean;
162
163 // check if the string is a mobile phone number, (locale is one of
164 // ['ar-AE', ar-DZ', 'ar-EG', 'ar-JO', 'ar-SA', 'ar-SY', 'be-BY', 'bg-BG', 'cs-CZ', 'de-DE',
165 // 'da-DK', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-KE', 'en-NG', 'en-NZ', 'en-UG',
166 // 'en-RW', 'en-SG', 'en-TZ', 'en-PK', 'en-US', 'en-CA', 'en-ZA', 'en-ZM', 'es-ES', 'fa-IR',
167 // 'fi-FI', 'fo-FO', 'fr-FR', 'he-IL', 'hu-HU', 'id-ID', 'it-IT', 'ja-JP', 'kk-KZ', 'kl-GL',
168 // 'ko-KR', 'lt-LT', 'ms-MY', 'nb-NO', 'nn-NO', 'pl-PL', 'pt-PT', 'ro-RO', 'ru-RU', 'sk-SK',
169 // 'sr-RS', 'th-TH', 'tr-TR', 'uk-UA', 'vi-VN', 'zh-CN', 'zh-HK', 'zh-TW']).
170 isMobilePhone(str: string, locale: MobilePhoneLocale, options?: IsMobilePhoneOptions): boolean;
171
172 // check if the string is a valid hex-encoded representation of a MongoDB ObjectId
173 // (http://docs.mongodb.org/manual/reference/object-id/).
174 isMongoId(str: string): boolean;
175
176 // check if the string contains one or more multibyte chars.
177 isMultibyte(str: string): boolean;
178
179 // check if the string contains only numbers.
180 isNumeric(str: string, options?: IsNumericOptions): boolean;
181
182 // check if the string is a valid port number.
183 isPort(str: string): boolean;
184
185 // check if the string is a postal code, (locale is one of
186 // [ 'AT', 'AU', 'BE', 'BG', 'CA', 'CH', 'CZ', 'DE', 'DK', 'DZ', 'ES', 'FI', 'FR', 'GB', 'GR',
187 // 'IL', 'IN', 'IS', 'IT', 'JP', 'KE', 'LI', 'MX', 'NL', 'NO', 'PL', 'PT', 'RO', 'RU', 'SA',
188 // 'SE', 'TW', 'US', 'ZA', 'ZM' ]) OR 'any'. If 'any' is used, function will check if any of the
189 // locales match).
190 isPostalCode(str: string, locale: PostalCodeLocale): boolean;
191
192 // check if the string contains any surrogate pairs chars.
193 isSurrogatePair(str: string): boolean;
194
195 // check if the string is an URL.
196 isURL(str: string, options?: IsURLOptions): boolean;
197
198 // check if the string is a UUID. Must be one of ['3', '4', '5', 'all'], default is all.
199 isUUID(str: string, version?: 3|4|5|"3"|"4"|"5"|"all"): boolean;
200
201 // check if the string is uppercase.
202 isUppercase(str: string): boolean;
203
204 // check if the string contains a mixture of full and half-width chars.
205 isVariableWidth(str: string): boolean;
206
207 // checks characters if they appear in the whitelist.
208 isWhitelisted(str: string, chars: string | string[]): boolean;
209
210 // check if string matches the pattern.
211 matches(str: string, pattern: RegExp | string, modifiers?: string): boolean;
212
213 // **************
214 // * Sanitizers *
215 // **************
216
217 // remove characters that appear in the blacklist. The characters are used in a RegExp and so you will need
218 // to escape some chars, e.g. blacklist(input, '\\[\\]').
219 blacklist(input: string, chars: string): string;
220
221 // replace <, >, &, ', " and / with HTML entities.
222 escape(input: string): string;
223
224 // replaces HTML encoded entities with <, >, &, ', " and /.
225 unescape(input: string): string;
226
227 // trim characters from the left-side of the input.
228 ltrim(input: string, chars?: string): string;
229
230 // canonicalize an email address.
231 normalizeEmail(email: string, options?: NormalizeEmailOptions): string | false;
232
233 // trim characters from the right-side of the input.
234 rtrim(input: string, chars?: string): string;
235
236 // remove characters with a numerical value < 32 and 127, mostly control characters. If keep_new_lines is true,
237 // newline characters are preserved (\n and \r, hex 0xA and 0xD). Unicode-safe in JavaScript.
238 stripLow(input: string, keep_new_lines?: boolean): string;
239
240 // convert the input to a boolean. Everything except for '0', 'false' and '' returns true. In strict mode only '1'
241 // and 'true' return true.
242 toBoolean(input: string, strict?: boolean): boolean;
243
244 // convert the input to a date, or null if the input is not a date.
245 toDate(input: string): Date; // Date or null
246
247 // convert the input to a float, or NaN if the input is not a float.
248 toFloat(input: string): number; // number or NaN
249
250 // convert the input to an integer, or NaN if the input is not an integer.
251 toInt(input: string, radix?: number): number; // number or NaN
252
253 // trim characters (whitespace by default) from both sides of the input.
254 trim(input: string, chars?: string): string;
255
256 // remove characters that do not appear in the whitelist. The characters are used in a RegExp and so you will
257 // need to escape some chars, e.g. whitelist(input, '\\[\\]').
258 whitelist(input: string, chars: string): string;
259
260 toString(input: any | any[]): string;
261
262 version: string;
263
264 // **************
265 // * Extensions *
266 // **************
267
268 // add your own validators.
269 // Note: that the first argument will be automatically coerced to a string.
270 extend<T extends Function>(name: string, fn: T): void;
271 }
272
273 // options for IsByteLength
274 interface IsByteLengthOptions {
275 min?: number;
276 max?: number;
277 }
278
279 // options for IsCurrency
280 interface IsCurrencyOptions {
281 symbol?: string;
282 require_symbol?: boolean;
283 allow_space_after_symbol?: boolean;
284 symbol_after_digits?: boolean;
285 allow_negatives?: boolean;
286 parens_for_negatives?: boolean;
287 negative_sign_before_digits?: boolean;
288 negative_sign_after_digits?: boolean;
289 allow_negative_sign_placeholder?: boolean;
290 thousands_separator?: string;
291 decimal_separator?: string;
292 allow_decimal?: boolean;
293 require_decimal?: boolean;
294 digits_after_decimal?: number[];
295 allow_space_after_digits?: boolean;
296 }
297
298 // options for isDecimal
299 interface IsDecimalOptions {
300 force_decimal?: boolean;
301 decimal_digits?: string;
302 locale?: DecimalLocale;
303 }
304
305 // options for isEmail
306 interface IsEmailOptions {
307 allow_display_name?: boolean;
308 require_display_name?: boolean;
309 allow_utf8_local_part?: boolean;
310 require_tld?: boolean;
311 }
312
313 // options for isEmpty
314 interface IsEmptyOptions {
315 ignore_whitespace?: boolean;
316 }
317
318 // options for isFQDN
319 interface IsFQDNOptions {
320 require_tld?: boolean;
321 allow_underscores?: boolean;
322 allow_trailing_dot?: boolean;
323 }
324
325 // options for IsFloat
326 interface IsFloatOptions {
327 min?: number;
328 max?: number;
329 gt?: number;
330 lt?: number;
331 locale?: FloatLocale;
332 }
333
334 // options for isISSN
335 interface IsISSNOptions {
336 case_sensitive?: boolean;
337 require_hyphen?: boolean;
338 }
339
340 // options for IsInt
341 interface IsIntOptions {
342 min?: number;
343 max?: number;
344 allow_leading_zeroes?: boolean;
345 lt?: number;
346 gt?: number;
347 }
348
349 // options for isISO8601
350 interface IsISO8601Options {
351 strict?: boolean;
352 }
353
354 // options for IsLength
355 interface IsLengthOptions {
356 min?: number;
357 max?: number;
358 }
359
360 // options for isMobilePhone
361 interface IsMobilePhoneOptions {
362 strictMode?: boolean;
363 }
364
365 // options for isURL
366 interface IsURLOptions {
367 protocols?: string[];
368 require_tld?: boolean;
369 require_protocol?: boolean;
370 require_host?: boolean;
371 require_valid_protocol?: boolean;
372 allow_underscores?: boolean;
373 host_whitelist?: (string | RegExp)[];
374 host_blacklist?: (string | RegExp)[];
375 allow_trailing_dot?: boolean;
376 allow_protocol_relative_urls?: boolean;
377 disallow_auth?: boolean;
378 }
379
380 // options for normalizeEmail
381 interface NormalizeEmailOptions {
382 all_lowercase?: boolean;
383 gmail_lowercase?: boolean;
384 gmail_remove_dots?: boolean;
385 gmail_remove_subaddress?: boolean;
386 gmail_convert_googlemaildotcom?: boolean;
387 outlookdotcom_lowercase?: boolean;
388 outlookdotcom_remove_subaddress?: boolean;
389 yahoo_lowercase?: boolean;
390 yahoo_remove_subaddress?: boolean;
391 icloud_lowercase?: boolean;
392 icloud_remove_subaddress?: boolean;
393 }
394
395 /**
396 * Options for isNumeric
397 */
398 interface IsNumericOptions {
399 no_symbols?: boolean;
400 }
401}
402
403/**
404 * MODULES
405 */
406declare var validator: ValidatorJS.ValidatorStatic;
407
408declare module "validator" {
409 export = validator;
410}
411
412declare module "validator/lib/blacklist" {
413 const blacklist: typeof validator.blacklist;
414 export = blacklist;
415}
416
417declare module "validator/lib/contains" {
418 const contains: typeof validator.contains;
419 export = contains;
420}
421
422declare module "validator/lib/equals" {
423 const equals: typeof validator.equals;
424 export = equals;
425}
426
427declare module "validator/lib/escape" {
428 const escape: typeof validator.escape;
429 export = escape;
430}
431
432declare module "validator/lib/isAfter" {
433 const isAfter: typeof validator.isAfter;
434 export = isAfter;
435}
436
437declare module "validator/lib/isAlpha" {
438 const isAlpha: typeof validator.isAlpha;
439 export = isAlpha;
440}
441
442declare module "validator/lib/isAlphanumeric" {
443 const isAlphanumeric: typeof validator.isAlphanumeric;
444 export = isAlphanumeric;
445}
446
447declare module "validator/lib/isAscii" {
448 const isAscii: typeof validator.isAscii;
449 export = isAscii;
450}
451
452declare module "validator/lib/isBase64" {
453 const isBase64: typeof validator.isBase64;
454 export = isBase64;
455}
456
457declare module "validator/lib/isBefore" {
458 const isBefore: typeof validator.isBefore;
459 export = isBefore;
460}
461
462declare module "validator/lib/isBoolean" {
463 const isBoolean: typeof validator.isBoolean;
464 export = isBoolean;
465}
466
467declare module "validator/lib/isByteLength" {
468 const isByteLength: typeof validator.isByteLength;
469 export = isByteLength;
470}
471
472declare module "validator/lib/isCreditCard" {
473 const isCreditCard: typeof validator.isCreditCard;
474 export = isCreditCard;
475}
476
477declare module "validator/lib/isCurrency" {
478 const isCurrency: typeof validator.isCurrency;
479 export = isCurrency;
480}
481
482declare module "validator/lib/isDataURI" {
483 const isDataURI: typeof validator.isDataURI;
484 export = isDataURI;
485}
486
487declare module "validator/lib/isDecimal" {
488 const isDecimal: typeof validator.isDecimal;
489 export = isDecimal;
490}
491
492declare module "validator/lib/isDivisibleBy" {
493 const isDivisibleBy: typeof validator.isDivisibleBy;
494 export = isDivisibleBy;
495}
496
497declare module "validator/lib/isEmail" {
498 const isEmail: typeof validator.isEmail;
499 export = isEmail;
500}
501
502declare module "validator/lib/isEmpty" {
503 const isEmpty: typeof validator.isEmpty;
504 export = isEmpty;
505}
506
507declare module "validator/lib/isFQDN" {
508 const isFQDN: typeof validator.isFQDN;
509 export = isFQDN;
510}
511
512declare module "validator/lib/isFloat" {
513 const isFloat: typeof validator.isFloat;
514 export = isFloat;
515}
516
517declare module "validator/lib/isFullWidth" {
518 const isFullWidth: typeof validator.isFullWidth;
519 export = isFullWidth;
520}
521
522declare module "validator/lib/isHalfWidth" {
523 const isHalfWidth: typeof validator.isHalfWidth;
524 export = isHalfWidth;
525}
526
527declare module "validator/lib/isHash" {
528 const isHash: typeof validator.isHash;
529 export = isHash;
530}
531
532declare module "validator/lib/isHexColor" {
533 const isHexColor: typeof validator.isHexColor;
534 export = isHexColor;
535}
536
537declare module "validator/lib/isHexadecimal" {
538 const isHexadecimal: typeof validator.isHexadecimal;
539 export = isHexadecimal;
540}
541
542declare module "validator/lib/isIP" {
543 const isIP: typeof validator.isIP;
544 export = isIP;
545}
546
547declare module "validator/lib/isISBN" {
548 const isISBN: typeof validator.isISBN;
549 export = isISBN;
550}
551
552declare module "validator/lib/isISSN" {
553 const isISSN: typeof validator.isISSN;
554 export = isISSN;
555}
556
557declare module "validator/lib/isISIN" {
558 const isISIN: typeof validator.isISIN;
559 export = isISIN;
560}
561
562declare module "validator/lib/isISO8601" {
563 const isISO8601: typeof validator.isISO8601;
564 export = isISO8601;
565}
566
567declare module "validator/lib/isISO31661Alpha2" {
568 const isISO31661Alpha2: typeof validator.isISO31661Alpha2;
569 export = isISO31661Alpha2;
570}
571
572declare module "validator/lib/isISRC" {
573 const isISRC: typeof validator.isISRC;
574 export = isISRC;
575}
576
577declare module "validator/lib/isIn" {
578 const isIn: typeof validator.isIn;
579 export = isIn;
580}
581
582declare module "validator/lib/isInt" {
583 const isInt: typeof validator.isInt;
584 export = isInt;
585}
586
587declare module "validator/lib/isJSON" {
588 const isJSON: typeof validator.isJSON;
589 export = isJSON;
590}
591
592declare module "validator/lib/isLatLong" {
593 const isLatLong: typeof validator.isLatLong;
594 export = isLatLong;
595}
596
597declare module "validator/lib/isLength" {
598 const isLength: typeof validator.isLength;
599 export = isLength;
600}
601
602declare module "validator/lib/isLowercase" {
603 const isLowercase: typeof validator.isLowercase;
604 export = isLowercase;
605}
606
607declare module "validator/lib/isMACAddress" {
608 const isMACAddress: typeof validator.isMACAddress;
609 export = isMACAddress;
610}
611
612declare module "validator/lib/isMD5" {
613 const isMD5: typeof validator.isMD5;
614 export = isMD5;
615}
616
617declare module "validator/lib/isMimeType" {
618 const isMimeType: typeof validator.isMimeType;
619 export = isMimeType;
620}
621
622declare module "validator/lib/isMobilePhone" {
623 const isMobilePhone: typeof validator.isMobilePhone;
624 export = isMobilePhone;
625}
626
627declare module "validator/lib/isPostalCode" {
628 const isPostalCode: typeof validator.isPostalCode;
629 export = isPostalCode;
630}
631
632declare module "validator/lib/isMongoId" {
633 const isMongoId: typeof validator.isMongoId;
634 export = isMongoId;
635}
636
637declare module "validator/lib/isMultibyte" {
638 const isMultibyte: typeof validator.isMultibyte;
639 export = isMultibyte;
640}
641
642declare module "validator/lib/isNumeric" {
643 const isNumeric: typeof validator.isNumeric;
644 export = isNumeric;
645}
646
647declare module "validator/lib/isPort" {
648 const isPort: typeof validator.isPort;
649 export = isPort;
650}
651
652declare module "validator/lib/isSurrogatePair" {
653 const isSurrogatePair: typeof validator.isSurrogatePair;
654 export = isSurrogatePair;
655}
656
657declare module "validator/lib/isURL" {
658 const isURL: typeof validator.isURL;
659 export = isURL;
660}
661
662declare module "validator/lib/isUUID" {
663 const isUUID: typeof validator.isUUID;
664 export = isUUID;
665}
666
667declare module "validator/lib/isUppercase" {
668 const isUppercase: typeof validator.isUppercase;
669 export = isUppercase;
670}
671
672declare module "validator/lib/isVariableWidth" {
673 const isVariableWidth: typeof validator.isVariableWidth;
674 export = isVariableWidth;
675}
676
677declare module "validator/lib/isWhitelisted" {
678 const isWhitelisted: typeof validator.isWhitelisted;
679 export = isWhitelisted;
680}
681
682declare module "validator/lib/ltrim" {
683 const ltrim: typeof validator.ltrim;
684 export = ltrim;
685}
686
687declare module "validator/lib/matches" {
688 const matches: typeof validator.matches;
689 export = matches;
690}
691
692declare module "validator/lib/normalizeEmail" {
693 const normalizeEmail: typeof validator.normalizeEmail;
694 export = normalizeEmail;
695}
696
697declare module "validator/lib/rtrim" {
698 const rtrim: typeof validator.rtrim;
699 export = rtrim;
700}
701
702declare module "validator/lib/stripLow" {
703 const stripLow: typeof validator.stripLow;
704 export = stripLow;
705}
706
707declare module "validator/lib/toBoolean" {
708 const toBoolean: typeof validator.toBoolean;
709 export = toBoolean;
710}
711
712declare module "validator/lib/toDate" {
713 const toDate: typeof validator.toDate;
714 export = toDate;
715}
716
717declare module "validator/lib/toFloat" {
718 const toFloat: typeof validator.toFloat;
719 export = toFloat;
720}
721
722declare module "validator/lib/toInt" {
723 const toInt: typeof validator.toInt;
724 export = toInt;
725}
726
727declare module "validator/lib/trim" {
728 const trim: typeof validator.trim;
729 export = trim;
730}
731
732declare module "validator/lib/unescape" {
733 const unescape: typeof validator.unescape;
734 export = unescape;
735}
736
737declare module "validator/lib/whitelist" {
738 const whitelist: typeof validator.whitelist;
739 export = whitelist;
740}
741
742// deprecated interfaces for backward compatibility, please use ValidatorJS.* instead the ones
743interface IValidatorStatic extends ValidatorJS.ValidatorStatic { }
744interface IURLoptions extends ValidatorJS.IsURLOptions { }
745interface IFQDNoptions extends ValidatorJS.IsFQDNOptions { }
746interface IEmailoptions extends ValidatorJS.NormalizeEmailOptions { }