UNPKG

repox-countries

Version:

Provides up-to-date country, state, city, language, currency, phone code, and postal code data, sourced daily from the GeoNames API. Integrate easily into forms or use for data verification. Updated versions are released when changes occur.

27 lines (26 loc) 1.68 kB
import { Option, Country, State, City, CountryStateCity, PhoneCode, Currency, Language } from '../types'; export declare const getCountries: () => Country[]; export declare const getStates: typeof import("./../metadata").getStates; export declare const getCities: typeof import("./../metadata").getCities; export declare const getPhoneCodes: () => PhoneCode[]; export declare const getCurrencies: () => Currency[]; export declare const getLanguages: () => Language[]; export declare const CountryOptions: () => Promise<Option[]>; export declare const CountryById: (id: number) => Country | undefined; export declare const CountryByCode: (code: string) => Country | undefined; export declare const StatesByCountryId: (countryId: number) => State[]; export declare const StatesByCountryCode: (countryCode: string) => State[]; export declare const CitiesByStateCode: (countryCode: string, stateCode: string) => City[]; /** * Get all info contains country, states and cities of specific country code. */ export declare const CountryStateCities: (countryCode: string) => CountryStateCity | undefined; export declare const CountryStateCitiesByCountryId: (countryId: number) => CountryStateCity | undefined; export declare const PhoneCodeByCountryCode: (countryCode: string) => PhoneCode | undefined; export declare const CurrencyByCountryCode: (countryCode: string) => Currency | undefined; export declare const CurrencyByCode: (code: string) => Currency | undefined; export declare const LanguageByCode: (code: string) => Language | undefined; /** * Normalize a string by removing diacritics and converting to lowercase. */ export declare const normalize: (str: string) => string;