UNPKG

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