UNPKG

@andreasnicolaou/country-kit

Version:

A comprehensive package for working with country data. Includes ISO codes, names in multiple languages, capitals, currencies, continents and more.

38 lines (37 loc) 1.25 kB
import { Country, CountryType } from './countries'; export declare class CountryKit { /** * Get all countries. * @returns countries * @memberof CountryKit */ static getAllCountries(): Record<string, Country>; /** * Get countries within a specific continent. * @param continent - The continent name * @returns Array of countries in the continent * @memberof CountryKit */ static getCountriesByContinent(continent: string): Country[]; /** * Get countries using a specific currency. * @param currencyCode - ISO 4217 currency code * @returns Array of countries using the currency * @memberof CountryKit */ static getCountriesByCurrency(currencyCode: string): Country[]; /** * Get countries using a specific language. * @param language * @returns Array of countries using the language * @memberof CountryKit */ static getCountriesByLanguage(language: string): Country[]; /** * Find a country by its ISO code. * @param code - The country code (ISO 3166-1 alpha-2) * @returns Country object or undefined * @memberof CountryKit */ static getCountryByCode(code: CountryType): Country | undefined; }