country-list-with-dial-code-and-flag
Version:
Country list with dial code and flag
80 lines (79 loc) • 2.33 kB
TypeScript
import { Country } from './country';
import { CountryInterface, FilterOption, GroupedCountries } from './types';
declare class App {
phoneNumberUtil: any;
/**
* find one by ISO 3166-1 alpha-2 eg. US, MM
*
* @param {string} code
* @returns {Country | undefined}
*/
findOneByCountryCode(code: string): Country | undefined;
/**
* find one by phone dial code eg. +1, +95
*
* @param {string} dialCode
* @returns {Country | undefined}
*/
findOneByDialCode(dialCode: string): Country | undefined;
/**
* Find list of countries by country code code
*
* @param {string} code
* @returns {Array<Country>}
*/
findByCountryCode(code: string, option?: FilterOption): Array<Country>;
/**
* Find list of countries by phone dial code eg. +1, +95
*
* @param {string} dialCode
* @returns {Array<Country>}
*/
findByDialCode(dialCode: string): Array<Country>;
/**
* Find list of countries by keyword, eg. United, Myanmar, India
*
* @param {string} keyword
* @returns {Array<Country>}
*/
findByKeyword(keyword: string, option?: FilterOption): Array<Country>;
/**
* Find list of countries by currency code, eg. USD, TRY, EUR
*
* @param {string} code
* @returns {Array<Country>}
*/
findByCurrencyCode(code: string, option?: FilterOption): Array<Country>;
/**
* find one by currency code, eg. USD, TRY, EUR
*
* @param {string} currencyCode
* @returns {Country | undefined}
*/
findOneByCurrencyCode(currencyCode: string): Country | undefined;
/**
* get all countries
*
* @returns {Array<Country>}
*/
getAll(option?: FilterOption): Array<Country>;
/**
* Group countries by the first letter of their name
* @param array
* @returns {GroupedCountries}
*/
groupCountriesByFirstLetter(array?: Country[] | CountryInterface[]): GroupedCountries;
/**
* set phone number util to use phone number formatter
* @param phoneNumberUtil
*/
setPhoneNumberUtil(phoneNumberUtil: any): void;
}
declare const CountryList: App;
declare global {
interface Window {
CountryList: App;
}
}
export default CountryList;
export { Country, FilterOption };