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.

22 lines (21 loc) 771 B
import { Country, CountryState, StateCity } from '../types'; /** * Crawl countries from the API. * Then map the response to the Country type. * Write the list of countries to the /metadata/countries.json file. */ export declare const crawlCountries: () => Promise<Country[]>; /** * Crawl states from the API. * Then map the response to the CountryState type. * Write the list of states to the /metadata/states.json file. */ export declare const crawlStates: (countries: Country[]) => Promise<CountryState[]>; /** * Crawl cities and save them separately per state */ export declare const crawlCities: (countryStates: CountryState[]) => Promise<StateCity[]>; /** * Execute all crawling steps sequentially. */ export declare const crawling: () => Promise<void>;