maz-ui
Version:
A standalone components library for Vue.Js 3 & Nuxt.Js 3
63 lines (62 loc) • 1.6 kB
TypeScript
import type { CountryCallingCode, CountryCode, NationalNumber, NumberType } from 'libphonenumber-js';
import type { defaultLocales } from './default-locales';
export interface Results {
isValid: boolean;
isPossible?: boolean;
countryCode?: CountryCode | undefined | null;
parsedCountryCode?: CountryCode | undefined | null;
countryCallingCode?: CountryCallingCode;
nationalNumber?: NationalNumber;
type?: NumberType;
formatInternational?: string;
formatNational?: string;
uri?: string;
e164?: string;
rfc3966?: string;
possibleCountries?: CountryCode[];
phoneNumber?: string | undefined | null;
}
export type Translations = typeof defaultLocales;
export interface Country {
iso2: CountryCode;
dialCode: CountryCallingCode;
name: string;
}
export interface IpWhoResponse {
ip: string;
success: true;
type?: string;
continent?: string;
continent_code?: string;
country?: string;
country_code?: string;
region?: string;
region_code?: string;
city?: string;
latitude?: number;
longitude?: number;
is_eu: true;
postal?: string;
calling_code?: string;
capital?: string;
borders?: string;
flag: {
img?: string;
emoji?: string;
emoji_unicode?: string;
};
connection: {
asn?: number;
org?: string;
isp?: string;
domain?: string;
};
timezone: {
id?: string;
abbr?: string;
is_dst: false;
offset?: number;
utc?: string;
current_time?: string;
};
}