Skip to content

Instantly share code, notes, and snippets.

@bertrandk
Last active February 19, 2016 08:26
Show Gist options
  • Save bertrandk/e3854938475fdff83fe3 to your computer and use it in GitHub Desktop.
Save bertrandk/e3854938475fdff83fe3 to your computer and use it in GitHub Desktop.
Typescript Phoneformat.js
interface PhoneFormat {
countryForE164Number(phoneNumber: string): string;
formatNumberForMobileDialing(countryCode: string, phoneNumber: string): string;
isValidNumber(phoneNumber: string, countryCode: string): boolean;
formatE164(countryCode: string, phoneNumber: string): string;
formatInternational(countryCode: string, phoneNumber: string): string;
formatLocal(countryCode: string, phoneNumber: string): string;
exampleLandlineNumber(countryCode: string): string;
exampleMobileNumber(countryCode: string): string;
cleanPhone(phoneNumber: string): string;
countryCodeToName(countryCode: string): string;
}
declare var phoneFormat: PhoneFormat;
declare module 'phoneformat.js' {
export = phoneFormat;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment