libphonenumber-geo-carrier
Version:
This library includes the geocoding, carrier mapping and timezone mapping functionalities that are available in some of googles libphonenumber libraries but not in libphonenumber-js (a port of libphonenumber).
26 lines (25 loc) • 1.28 kB
TypeScript
import { PhoneNumber } from 'libphonenumber-js';
import { GeocoderLocale, CarrierLocale } from './locales';
/**
* Provides geographical information related to the phone number
*
* @param phonenumber The phone number
* @param locale The preferred locale to use (falls back to `en` if there are no localized carrier infos for the given locale)
*/
export declare const geocoder: (phonenumber: PhoneNumber | undefined, locale?: GeocoderLocale) => Promise<string | null>;
/**
* Maps the phone number to the original carrier
*
* **Note:** This method cannot provide data about the current carrier of the phone number,
* only the original carrier who is assigned to the corresponding range.
* @see https://github.com/google/libphonenumber#mapping-phone-numbers-to-original-carriers
*
* @param phonenumber The phone number
* @param locale The preferred locale to use (falls back to `en` if there are no localized carrier infos for the given locale)
*/
export declare const carrier: (phonenumber: PhoneNumber | undefined, locale?: CarrierLocale) => Promise<string | null>;
/**
* Provides all timezones related to the phone number
* @param phonenumber The phone number
*/
export declare const timezones: (phonenumber: PhoneNumber | undefined) => Promise<string[] | null>;