mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
added definitions for phone
This commit is contained in:
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
// Type definitions for phone 1.0.8
|
||||
// Project: https://github.com/aftership/phone
|
||||
// Definitions by: Hagai Cohen <https://github.com/DxCx>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export default function phone(phoneNumber: string, countryCode?: string): Array<string>;
|
||||
@@ -0,0 +1,12 @@
|
||||
import phone from 'phone';
|
||||
|
||||
phone('+852 6569-8900'); // return ['+85265698900', 'HKG']
|
||||
phone('(817) 569-8900'); // return ['+18175698900, 'USA']
|
||||
phone('(817) 569-8900', ''); // return ['+18175698900, 'USA']
|
||||
phone('(817) 569-8900', 'USA'); // return ['+18175698900', 'USA']
|
||||
phone('(817) 569-8900', 'HKG'); // return []
|
||||
phone('+1(817) 569-8900', 'HKG'); // return [], as it is not a valid HKG mobile phone number
|
||||
phone('+1(817) 569-8900', ''); // return ['+18175698900', 'USA']
|
||||
phone('(817) 569-8900', ''); // return ['+18175698900', 'USA']
|
||||
phone('6123-6123', ''); // return [], as default country is USA
|
||||
phone('6123-6123', 'HKG'); // return ['+85261236123', 'HKG']
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"phone-tests.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user