import type { CountryData as CountryDataBase } from './base/country-utils-base'; import PowerduckState from '../../app/powerduck-state'; import CountryUtilsBase from './base/country-utils-base'; export interface CountryData extends CountryDataBase { }; let localizedCountryList: CountryData[] = null; export default class CountryUtils { static getCountryCodeArr(): CountryData[] { if (localizedCountryList != null) { return localizedCountryList; } localizedCountryList = CountryUtilsBase.getCountryCodeArr(PowerduckState.getCurrentLanguage()); return localizedCountryList; } static buildBasicCountryCodeArr(): Array> { return CountryUtilsBase.buildBasicCountryCodeArr(); } static getByThreeLetterCode(threeLetterCode: string): CountryData { return CountryUtilsBase.getByThreeLetterCode(threeLetterCode, PowerduckState.getCurrentLanguage()); } static getByTwoLetterCode(twoLetterCode: string): CountryData { return CountryUtilsBase.getByTwoLetterCode(twoLetterCode, PowerduckState.getCurrentLanguage()); } static getTwoLetterCodeFromThreeLetterCode(threeLetterCode: string): string { return CountryUtilsBase.getTwoLetterCodeFromThreeLetterCode(threeLetterCode, PowerduckState.getCurrentLanguage()); } static getThreeLetterCodeFromTwoLetterCode(twoLetterCode: string): string { return CountryUtilsBase.getThreeLetterCodeFromTwoLetterCode(twoLetterCode, PowerduckState.getCurrentLanguage()); } }