11export declare type DelimiterType = string
2- export const DefaultPhoneDelimiter : DelimiterType = '-'
3- export const DefaultPhonePattern : number [ ] = [ 3 , 3 , 4 ]
2+ export declare const DefaultPhoneDelimiter : '-'
3+ export declare const DefaultPhonePattern : readonly [ 3 , 3 , 4 ]
44
55export interface FormatPhoneOptions {
66 delimiter ?: string
@@ -10,32 +10,32 @@ export interface FormatPhoneOptions {
1010 format ?: 'national' | 'international'
1111}
1212
13- export const DefaultPhoneRegion = 'US'
13+ export declare const DefaultPhoneRegion : 'US'
1414
15- const PHONE_PATTERNS : Record < string , number [ ] > = {
16- US : [ 3 , 3 , 4 ] ,
17- GB : [ 4 , 3 , 3 ] ,
18- FR : [ 2 , 2 , 2 , 2 , 2 ] ,
19- DE : [ 3 , 2 , 2 , 2 ] ,
20- JP : [ 3 , 4 , 4 ] ,
21- CN : [ 3 , 4 , 4 ] ,
22- IN : [ 4 , 3 , 3 ] ,
23- BR : [ 2 , 4 , 4 ] ,
24- AU : [ 4 , 3 , 3 ] ,
25- CA : [ 3 , 3 , 4 ] ,
26- } as const
15+ declare const PHONE_PATTERNS : {
16+ readonly US : readonly [ 3 , 3 , 4 ]
17+ readonly GB : readonly [ 4 , 3 , 3 ]
18+ readonly FR : readonly [ 2 , 2 , 2 , 2 , 2 ]
19+ readonly DE : readonly [ 3 , 2 , 2 , 2 ]
20+ readonly JP : readonly [ 3 , 4 , 4 ]
21+ readonly CN : readonly [ 3 , 4 , 4 ]
22+ readonly IN : readonly [ 4 , 3 , 3 ]
23+ readonly BR : readonly [ 2 , 4 , 4 ]
24+ readonly AU : readonly [ 4 , 3 , 3 ]
25+ readonly CA : readonly [ 3 , 3 , 4 ]
26+ }
2727
28- const COUNTRY_CODES : Record < string , string > = {
29- US : '+1' ,
30- GB : '+44' ,
31- FR : '+33' ,
32- DE : '+49' ,
33- JP : '+81' ,
34- CN : '+86' ,
35- IN : '+91' ,
36- BR : '+55' ,
37- AU : '+61' ,
38- CA : '+1' ,
28+ declare const COUNTRY_CODES : {
29+ readonly US : '+1'
30+ readonly GB : '+44'
31+ readonly FR : '+33'
32+ readonly DE : '+49'
33+ readonly JP : '+81'
34+ readonly CN : '+86'
35+ readonly IN : '+91'
36+ readonly BR : '+55'
37+ readonly AU : '+61'
38+ readonly CA : '+1'
3939}
4040declare function handleFormat ( { value, delimiter, pattern, region, includeCountryCode, format } : {
4141 value : string
0 commit comments