mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
31 lines
857 B
TypeScript
31 lines
857 B
TypeScript
// Type definitions for nanp v0.3.0
|
|
// Project: https://github.com/weisjohn/nanp
|
|
// Definitions by: Karn Saheb <https://github.com/karn>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
interface Nanp {
|
|
|
|
/**
|
|
* Test if a string is a North American Number Plan (phone) number.
|
|
*
|
|
* @param {string} phoneNumber The phone number being tested.
|
|
* @returns {boolean} True if the given phoneNumber is a NANP number.
|
|
*/
|
|
(string: string): boolean;
|
|
|
|
/**
|
|
* Removes all parenthesis, dashes, dots, spaces.
|
|
* Removes leading `1` or `+1` only on strings longer than 10 digits
|
|
*
|
|
* @param {string} phoneNumber The phone number that is being stripped.
|
|
* @returns {string}
|
|
*/
|
|
strip(phoneNumber: string): string;
|
|
}
|
|
|
|
declare var nanp: Nanp;
|
|
|
|
declare module "nanp" {
|
|
export = nanp;
|
|
}
|