forked from DefinitelyTyped/DefinitelyTyped
/
index.d.ts
1373 lines (1237 loc) · 36.3 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Type definitions for validator.js 13.7
// Project: https://github.com/validatorjs/validator.js
// Definitions by: tgfjt <https://github.com/tgfjt>
// Ilya Mochalov <https://github.com/chrootsu>
// Ayman Nedjmeddine <https://github.com/IOAyman>
// Louay Alakkad <https://github.com/louy>
// Bonggyun Lee <https://github.com/deptno>
// Naoto Yokoyama <https://github.com/builtinnya>
// Philipp Katz <https://github.com/qqilihq>
// Jace Warren <https://github.com/keatz55>
// Munif Tanjim <https://github.com/MunifTanjim>
// Vlad Poluch <https://github.com/vlapo>
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Matteo Nista <https://github.com/Mattewn99>
// Roman Babiak <https://github.com/Almost-Infinity>
// Daniel Freire <https://github.com/dcfreire>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as _isBoolean from './lib/isBoolean';
import * as _isEmail from './lib/isEmail';
import * as _isFQDN from './lib/isFQDN';
import * as _isIBAN from './lib/isIBAN';
import * as _isISO31661Alpha2 from './lib/isISO31661Alpha2';
import * as _isISO4217 from './lib/isISO4217';
import * as _isURL from './lib/isURL';
import * as _isTaxID from './lib/isTaxID';
declare namespace validator {
const version: string;
/******************
*** Validators ***
******************/
interface ContainsOptions {
/**
* @default false
*/
ignoreCase?: boolean | undefined;
/**
* @default 1
*/
minOccurrences?: number | undefined;
}
/**
* Check if the string contains the seed.
*
* @param seed - Seed
*/
function contains(str: string, seed: any, options?: ContainsOptions): boolean;
/**
* Check if the string matches the comparison.
*
* @param comparison - String to compare
*/
function equals(str: string, comparison: string): boolean;
/**
* Check if the string is a date that's after the specified date.
*
* @param [date] - Date string (defaults to now)
*/
function isAfter(str: string, date?: string): boolean;
type AlphaLocale =
| 'en-US'
| 'bg-BG'
| 'cs-CZ'
| 'da-DK'
| 'de-DE'
| 'el-GR'
| 'es-AR'
| 'es-ES'
| 'fr-FR'
| 'it-IT'
| 'nb-NO'
| 'nl-NL'
| 'nn-NO'
| 'hu-HU'
| 'pl-PL'
| 'pt-PT'
| 'ru-RU'
| 'sl-SI'
| 'sk-SK'
| 'sr-RS@latin'
| 'sr-RS'
| 'sv-SE'
| 'tr-TR'
| 'uk-UA'
| 'ku-IQ'
| 'ar'
| 'he'
| 'fa-IR'
| 'en-AU'
| 'en-GB'
| 'en-HK'
| 'en-IN'
| 'en-NZ'
| 'en-ZA'
| 'en-ZM'
| 'ar-AE'
| 'ar-BH'
| 'ar-DZ'
| 'ar-EG'
| 'ar-IQ'
| 'ar-JO'
| 'ar-KW'
| 'ar-LB'
| 'ar-LY'
| 'ar-MA'
| 'ar-QM'
| 'ar-QA'
| 'ar-SA'
| 'ar-SD'
| 'ar-SY'
| 'ar-TN'
| 'ar-YE'
| 'pt-BR'
| 'pl-Pl';
const isAlphaLocales: AlphaLocale[];
interface IsAlphaOptions {
/**
* @default undefined
*/
ignore?: string | RegExp | undefined;
}
/**
* Check if the string contains only letters (a-zA-Z).
*
* @param [locale] - AlphaLocale
* @param [options] - IsAlphaOptions
*/
function isAlpha(str: string, locale?: AlphaLocale, options?: IsAlphaOptions): boolean;
type AlphanumericLocale =
| 'en-US'
| 'bg-BG'
| 'cs-CZ'
| 'da-DK'
| 'de-DE'
| 'el-GR'
| 'es-AR'
| 'es-ES'
| 'fr-FR'
| 'it-IT'
| 'hu-HU'
| 'nb-NO'
| 'nl-NL'
| 'nn-NO'
| 'pl-PL'
| 'pt-PT'
| 'ru-RU'
| 'sl-SI'
| 'sk-SK'
| 'sr-RS@latin'
| 'sr-RS'
| 'sv-SE'
| 'tr-TR'
| 'uk-UA'
| 'ku-IQ'
| 'ar'
| 'he'
| 'fa-IR'
| 'en-AU'
| 'en-GB'
| 'en-HK'
| 'en-IN'
| 'en-NZ'
| 'en-ZA'
| 'en-ZM'
| 'ar-AE'
| 'ar-BH'
| 'ar-DZ'
| 'ar-EG'
| 'ar-IQ'
| 'ar-JO'
| 'ar-KW'
| 'ar-LB'
| 'ar-LY'
| 'ar-MA'
| 'ar-QM'
| 'ar-QA'
| 'ar-SA'
| 'ar-SD'
| 'ar-SY'
| 'ar-TN'
| 'ar-YE'
| 'pt-BR'
| 'pl-Pl';
const isAlphanumericLocales: AlphanumericLocale[];
interface IsAlphanumericOptions {
/**
* @default undefined
*/
ignore?: string | RegExp | undefined;
}
/**
* Check if the string contains only letters and numbers.
*
* @param [locale] - AlphanumericLocale
* @param [options] - IsAlphanumericOptions
*/
function isAlphanumeric(str: string, locale?: AlphanumericLocale, options?: IsAlphanumericOptions): boolean;
/**
* Check if the string contains ASCII chars only.
*/
function isAscii(str: string): boolean;
/**
* Check if a string is base32 encoded.
*/
function isBase32(str: string): boolean;
/**
* check if a string is base58 encoded
*/
function isBase58(str: string): boolean;
interface IsBase64Options {
/**
* @default false
*/
urlSafe?: boolean | undefined;
}
/**
* Check if a string is base64 encoded.
*
* @param [options] - Options
*/
function isBase64(str: string, options?: IsBase64Options): boolean;
/**
* Check if the string is a date that's before the specified date.
*
* @param [date] - Date string (defaults to now)
*/
function isBefore(str: string, date?: string): boolean;
const isIBAN: typeof _isIBAN.default;
const ibanLocales: typeof _isIBAN.locales;
/**
* Check if a string is a BIC (Bank Identification Code) or SWIFT code.
*/
function isBIC(str: string): boolean;
const isBoolean: typeof _isBoolean.default;
interface IsByteLengthOptions {
/**
* @default 0
*/
min?: number | undefined;
/**
* @default undefined
*/
max?: number | undefined;
}
/**
* Check if the string's length (in UTF-8 bytes) falls in a range.
*
* @param [options] - Options
*/
function isByteLength(str: string, options?: IsByteLengthOptions): boolean;
interface IsCreditCardOptions {
/**
* @default undefined
*/
provider?: 'amex' | 'dinersclub' | 'discover' | 'jcb' | 'mastercard' | 'unionpay' | 'visa' | '';
}
/**
* Check if the string is a credit card.
*/
function isCreditCard(str: string, options?: IsCreditCardOptions): boolean;
interface IsCurrencyOptions {
/**
* @default '$'
*/
symbol?: string | undefined;
/**
* @default false
*/
require_symbol?: boolean | undefined;
/**
* @default false
*/
allow_space_after_symbol?: boolean | undefined;
/**
* @default false
*/
symbol_after_digits?: boolean | undefined;
/**
* @default true
*/
allow_negatives?: boolean | undefined;
/**
* @default false
*/
parens_for_negatives?: boolean | undefined;
/**
* @default false
*/
negative_sign_before_digits?: boolean | undefined;
/**
* @default false
*/
negative_sign_after_digits?: boolean | undefined;
/**
* @default false
*/
allow_negative_sign_placeholder?: boolean | undefined;
/**
* @default ','
*/
thousands_separator?: string | undefined;
/**
* @default '.'
*/
decimal_separator?: string | undefined;
/**
* @default true
*/
allow_decimal?: boolean | undefined;
/**
* @default false
*/
require_decimal?: boolean | undefined;
/**
* The array `digits_after_decimal` is filled with the exact number of digits allowed not a range, for example a range `1` to `3` will be given as `[1, 2, 3]`.
*
* @default [2]
*/
digits_after_decimal?: number[] | undefined;
/**
* @default false
*/
allow_space_after_digits?: boolean | undefined;
}
/**
* Check if the string is a valid currency amount.
*
* @param [options] - Options
*/
function isCurrency(str: string, options?: IsCurrencyOptions): boolean;
/**
* Check if the string is an [Ethereum](https://ethereum.org/) address using basic regex. Does not validate address checksums.
*/
function isEthereumAddress(str: string): boolean;
/**
* Check if the string is a valid BTC address.
*/
function isBtcAddress(str: string): boolean;
/**
* Check if the string is a [data uri format](https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs).
*/
function isDataURI(str: string): boolean;
interface IsDateOptions {
/**
* @default false
*/
format?: string | undefined;
/**
* If strictMode is set to true,
* the validator will reject inputs different from format.
*
* @default false
*/
strictMode?: boolean | undefined;
/**
* `delimiters` is an array of allowed date delimiters
*
* @default ['/', '-']
*/
delimiters?: string[] | undefined;
}
/**
* Check if the string is a valid date.
*/
function isDate(str: string, options?: IsDateOptions): boolean;
type DecimalLocale = FloatLocale;
interface IsDecimalOptions {
/**
* @default false
*/
force_decimal?: boolean | undefined;
/**
* `decimal_digits` is given as a range like `'1,3'`,
* a specific value like `'3'` or min like `'1,'`
*
* @default '1,'
*/
decimal_digits?: string | undefined;
/**
* DecimalLocale
*
* @default 'en-US'
*/
locale?: DecimalLocale | undefined;
}
/**
* Check if the string represents a decimal number,
* such as `0.1`, `.3`, `1.1`, `1.00003`, `4.0` etc.
*
* @param [options] - Options
*/
function isDecimal(str: string, options?: IsDecimalOptions): boolean;
/**
* Check if the string is a number that's divisible by another.
*
* @param number - Divider number
*/
function isDivisibleBy(str: string, number: number): boolean;
type IsEmailOptions = _isEmail.IsEmailOptions;
const isEmail: typeof _isEmail.default;
interface IsEmptyOptions {
/**
* @default false
*/
ignore_whitespace?: boolean | undefined;
}
/**
* Check if the string has a length of zero.
*
* @param [options] - Options
*/
function isEmpty(str: string, options?: IsEmptyOptions): boolean;
type FloatLocale =
| 'en-US'
| 'ar'
| 'en-AU'
| 'en-GB'
| 'en-HK'
| 'en-IN'
| 'en-NZ'
| 'en-ZA'
| 'en-ZM'
| 'ar-AE'
| 'ar-BH'
| 'ar-DZ'
| 'ar-EG'
| 'ar-IQ'
| 'ar-JO'
| 'ar-KW'
| 'ar-LB'
| 'ar-LY'
| 'ar-MA'
| 'ar-QM'
| 'ar-QA'
| 'ar-SA'
| 'ar-SD'
| 'ar-SY'
| 'ar-TN'
| 'ar-YE'
| 'bg-BG'
| 'cs-CZ'
| 'da-DK'
| 'de-DE'
| 'el-GR'
| 'es-ES'
| 'fr-FR'
| 'it-IT'
| 'ku-IQ'
| 'hu-HU'
| 'nb-NO'
| 'nn-NO'
| 'nl-NL'
| 'pl-PL'
| 'pt-PT'
| 'ru-RU'
| 'sl-SI'
| 'sr-RS@latin'
| 'sr-RS'
| 'sv-SE'
| 'tr-TR'
| 'uk-UA'
| 'pt-BR'
| 'pl-Pl';
const isFloatLocales: FloatLocale[];
interface IsFloatOptions {
/**
* less or equal
*/
min?: number | undefined;
/**
* greater or equal
*/
max?: number | undefined;
/**
* greater than
*/
gt?: number | undefined;
/**
* less than
*/
lt?: number | undefined;
/**
* FloatLocale
*/
locale?: FloatLocale | undefined;
}
/**
* Check if the string is a float.
*
* @param [options] - Options
*/
function isFloat(str: string, options?: IsFloatOptions): boolean;
type IsFQDNOptions = _isFQDN.IsFQDNOptions;
const isFQDN: typeof _isFQDN.default;
/**
* Check if the string contains any full-width chars.
*/
function isFullWidth(str: string): boolean;
/**
* Check if the string contains any half-width chars.
*/
function isHalfWidth(str: string): boolean;
type HashAlgorithm =
| 'md4'
| 'md5'
| 'sha1'
| 'sha256'
| 'sha384'
| 'sha512'
| 'ripemd128'
| 'ripemd160'
| 'tiger128'
| 'tiger160'
| 'tiger192'
| 'crc32'
| 'crc32b';
/**
* Check if the string is a hash of type algorithm.
*
* @param algorithm - HashAlgorithm
*/
function isHash(str: string, algorithm: HashAlgorithm): boolean;
/**
* Check if the string is a hexadecimal number.
*/
function isHexadecimal(str: string): boolean;
/**
* Check if the string is a hexadecimal color.
*/
function isHexColor(str: string): boolean;
/**
* Check if the string is an HSL (hue, saturation, lightness, optional alpha) color based on CSS Colors Level 4 specification.
* Comma-separated format supported. Space-separated format supported with the exception of a few edge cases (ex: hsl(200grad+.1%62%/1)).
*/
function isHSL(str: string): boolean;
/**
* Check if the string is a rgb or rgba color.
*
* @param [includePercentValues=true] - If you don't want to allow to set rgb or rgba values with percents, like rgb(5%,5%,5%), or rgba(90%,90%,90%,.3), then set it to false. (defaults to true)
*/
function isRgbColor(str: string, includePercentValues?: boolean): boolean;
type IdentityCardLocale = 'ES' | 'he-IL' | 'zh-TW' | 'zh-CN';
/**
* Check if the string is a valid identity card code.
*
* @param [locale="any"] - IdentityCardLocale
*/
function isIdentityCard(str: string, locale?: 'any' | IdentityCardLocale): boolean;
interface IsIMEIOptions {
/**
* This value is `false` by default. Set to `true` to allow IMEI with hyphens.
*/
allow_hyphens?: boolean | undefined;
}
/**
* Check if the string is a valid IMEI.
* Non-hyphenated (`###############`) only is supported by default.
* Use the `options` param to enable hyphenated (`##-######-######-#`) support.
*
* @param [options] - Options
*/
function isIMEI(str: string, options?: IsIMEIOptions): boolean;
/**
* Check if the string is in a array of allowed values.
*
* @param values - Allowed values.
*/
function isIn(str: string, values: any[]): boolean;
interface IsIntOptions {
/**
* to check the integer min boundary
*/
min?: number | undefined;
/**
* to check the integer max boundary
*/
max?: number | undefined;
/**
* if `false`, will disallow integer values with leading zeroes
* @default true
*/
allow_leading_zeroes?: boolean | undefined;
/**
* enforce integers being greater than the value provided
*/
lt?: number | undefined;
/**
* enforce integers being less than the value provided
*/
gt?: number | undefined;
}
/**
* Check if the string is an integer.
*
* @param [options] - Options
*/
function isInt(str: string, options?: IsIntOptions): boolean;
type IPVersion = '4' | '6' | 4 | 6;
/**
* Check if the string is an IP (version 4 or 6).
*
* @param [version] - IP Version
*/
function isIP(str: string, version?: IPVersion): boolean;
/**
* Check if the string is an IP Range (version 4 or 6).
*/
function isIPRange(str: string, version?: IPVersion): boolean;
type ISBNVersion = '10' | '13' | 10 | 13;
/**
* Check if the string is an ISBN (version 10 or 13).
*
* @param [version] - ISBN Version
*/
function isISBN(str: string, version?: ISBNVersion): boolean;
/**
* Check if the string is an EAN (European Article Number).
*/
function isEAN(str: string): boolean;
/**
* Check if the string is an [ISIN](https://en.wikipedia.org/wiki/International_Securities_Identification_Number) (stock/security identifier).
*/
function isISIN(str: string): boolean;
const isISO31661Alpha2: typeof _isISO31661Alpha2.default;
/**
* Check if the string is a valid [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) officially assigned country code.
*/
function isISO31661Alpha3(str: string): boolean;
interface IsISO8601Options {
/**
* If `strict` is `true`, performs additional checks for valid dates,
* e.g. invalidates dates like `2009-02-29`.
*
* @default false
*/
strict?: boolean | undefined;
/**
* If `strictSeparator` is true, date strings with date and time separated
* by anything other than a T will be invalid
*
*/
strictSeparator?: boolean | undefined;
}
/**
* Check if the string is a valid [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date.
*
* @param [options] - Options
*/
function isISO8601(str: string, options?: IsISO8601Options): boolean;
interface IsISSNOptions {
/**
* If `case_sensitive` is `true`, ISSNs with a lowercase `x` as the check digit are rejected.
*
* @default false
*/
case_sensitive?: boolean | undefined;
/**
* @default false
*/
require_hyphen?: boolean | undefined;
}
/**
* Check if the string is an [ISSN](https://en.wikipedia.org/wiki/International_Standard_Serial_Number).
*
* @param [options] - Options
*/
function isISSN(str: string, options?: IsISSNOptions): boolean;
const isISO4217: typeof _isISO4217.default;
/**
* Check if the string is a [ISRC](https://en.wikipedia.org/wiki/International_Standard_Recording_Code).
*/
function isISRC(str: string): boolean;
/**
* Check if the string is a valid [RFC 3339](https://tools.ietf.org/html/rfc3339) date.
*/
function isRFC3339(str: string): boolean;
/**
* Check if the string is valid JSON (note: uses `JSON.parse`).
*/
function isJSON(str: string): boolean;
/**
* Check if the string is valid JWT token.
*/
function isJWT(str: string): boolean;
/**
* Check if the string is a valid latitude-longitude coordinate in the format:
*
* `lat,long` or `lat, long`.
*/
function isLatLong(str: string): boolean;
interface IsLengthOptions {
/**
* @default 0
*/
min?: number | undefined;
/**
* @default undefined
*/
max?: number | undefined;
}
/**
* Check if the string's length falls in a range.
*
* Note: this function takes into account surrogate pairs.
*
* @param [options] - Options
*/
function isLength(str: string, options?: IsLengthOptions): boolean;
/**
* Check if the string is a locale.
*/
function isLocale(str: string): boolean;
/**
* Check if the string is lowercase.
*/
function isLowercase(str: string): boolean;
interface IsMACAddressOptions {
/**
* If `no_colons` is `true`, the validator will allow MAC addresses without the colons.
* Also, it allows the use of hyphens or spaces.
*
* e.g. `01 02 03 04 05 ab` or `01-02-03-04-05-ab`.
*
* @default false
*/
no_colons?: boolean | undefined;
}
/**
* Check if the string is a MAC address.
*
* @param [options] - Options
*/
function isMACAddress(str: string, options?: IsMACAddressOptions): boolean;
/**
* Check if the string is a [magnet uri format](https://en.wikipedia.org/wiki/Magnet_URI_scheme).
*/
function isMagnetURI(str: string): boolean;
/**
* Check if the string is a MD5 hash.
*/
function isMD5(str: string): boolean;
/**
* Check if the string matches to a valid [MIME type](https://en.wikipedia.org/wiki/Media_type) format.
*/
function isMimeType(str: string): boolean;
type MobilePhoneLocale = PhoneLocale | PhoneLocaleAlias;
type PhoneLocale =
| 'am-AM'
| 'ar-AE'
| 'ar-BH'
| 'ar-DZ'
| 'ar-LB'
| 'ar-EG'
| 'ar-IQ'
| 'ar-JO'
| 'ar-KW'
| 'ar-LY'
| 'ar-MA'
| 'ar-OM'
| 'ar-SA'
| 'ar-SY'
| 'ar-TN'
| 'az-AZ'
| 'bs-BA'
| 'be-BY'
| 'bg-BG'
| 'bn-BD'
| 'ca-AD'
| 'cs-CZ'
| 'da-DK'
| 'de-DE'
| 'de-AT'
| 'de-CH'
| 'de-LU'
| 'el-GR'
| 'en-AU'
| 'en-GB'
| 'en-GG'
| 'en-GH'
| 'en-HK'
| 'en-MO'
| 'en-IE'
| 'en-IN'
| 'en-KE'
| 'en-MT'
| 'en-MU'
| 'en-NG'
| 'en-NZ'
| 'en-PK'
| 'en-PH'
| 'en-RW'
| 'en-SG'
| 'en-SL'
| 'en-TZ'
| 'en-UG'
| 'en-US'
| 'en-ZA'
| 'en-ZM'
| 'en-ZW'
| 'es-AR'
| 'es-BO'
| 'es-CO'
| 'es-CL'
| 'es-CR'
| 'es-DO'
| 'es-HN'
| 'es-EC'
| 'es-ES'
| 'es-PE'
| 'es-MX'
| 'es-PA'
| 'es-PY'
| 'es-UY'
| 'es-VE'
| 'et-EE'
| 'fa-IR'
| 'fi-FI'
| 'fj-FJ'
| 'fo-FO'
| 'fr-FR'
| 'fr-GF'
| 'fr-GP'
| 'fr-MQ'
| 'fr-RE'
| 'he-IL'
| 'hu-HU'
| 'id-ID'
| 'it-IT'
| 'it-SM'
| 'ja-JP'
| 'ka-GE'
| 'kk-KZ'
| 'kl-GL'
| 'ko-KR'
| 'lt-LT'
| 'lv-LV'
| 'ms-MY'
| 'mz-MZ'
| 'nb-NO'
| 'ne-NP'
| 'nl-BE'
| 'nl-NL'
| 'nn-NO'
| 'pl-PL'
| 'pt-BR'
| 'pt-PT'
| 'pt-AO'
| 'ro-RO'
| 'ru-RU'
| 'si-LK'
| 'sl-SI'
| 'sk-SK'
| 'sq-AL'
| 'sr-RS'
| 'sv-SE'
| 'th-TH'
| 'tr-TR'
| 'uk-UA'
| 'uz-UZ'
| 'vi-VN'
| 'zh-CN'
| 'zh-TW';
type PhoneLocaleAlias = 'en-CA' | 'fr-CA' | 'fr-BE' | 'zh-HK' | 'zh-MO' | 'ga-IE' | 'fr-CH' | 'it-CH';
const isMobilePhoneLocales: MobilePhoneLocale[];
interface IsMobilePhoneOptions {
/**
* If this is set to `true`, the mobile phone number must be supplied with the country code and therefore must start with `+`.
*
* @default false
*/
strictMode?: boolean | undefined;
}
/**
* Check if the string is a mobile phone number.
*
* @param [locale] - MobilePhoneLocale(s)
* @param [options] - Options
*/
function isMobilePhone(
str: string,
locale?: 'any' | MobilePhoneLocale | MobilePhoneLocale[],
options?: IsMobilePhoneOptions,
): boolean;
/**
* Check if the string is a valid hex-encoded representation of a [MongoDB ObjectId](http://docs.mongodb.org/manual/reference/object-id/).
*/
function isMongoId(str: string): boolean;
/**
* Check if the string contains one or more multibyte chars.
*/
function isMultibyte(str: string): boolean;
interface IsNumericOptions {
/**
* If `no_symbols` is true, the validator will reject numeric strings that feature a symbol (e.g. `+`, `-`, or `.`).
*
* @default false
*/
no_symbols?: boolean | undefined;
locale?: AlphaLocale | undefined;
}
/**
* Check if the string contains only numbers.
*
* @param [options] - Options