diff --git a/index.d.ts b/index.d.ts index 2989496..895fc9e 100644 --- a/index.d.ts +++ b/index.d.ts @@ -8,12 +8,12 @@ export type LocaleData = { }; export function registerLocale(localeData: LocaleData): void; -export function alpha2ToAlpha3(alpha2: string): string; -export function alpha2ToNumeric(alpha2: string): number; -export function alpha3ToAlpha2(alpha3: string): string; -export function alpha3ToNumeric(alpha3: string): number; -export function numericToAlpha2(numeric: number | string): string; -export function numericToAlpha3(numeric: number | string): string; +export function alpha2ToAlpha3(alpha2: string): string | undefined; +export function alpha2ToNumeric(alpha2: string): number | undefined; +export function alpha3ToAlpha2(alpha3: string): string | undefined; +export function alpha3ToNumeric(alpha3: string): number | undefined; +export function numericToAlpha2(numeric: number | string): string | undefined; +export function numericToAlpha3(numeric: number | string): string | undefined; /** * Returns object map where key is alpha 2 code and value is alpha 3 code */ @@ -26,13 +26,13 @@ export function getAlpha3Codes(): { [alpha3Key: string]: string }; * Returns object map where key is numeric code and value is alpha 2 code */ export function getNumericCodes(): { [numericKey: number]: string }; -export function getName(alpha2orAlpha3orNumeric: string | number, lang: string): string; +export function getName(alpha2orAlpha3orNumeric: string | number, lang: string): string | undefined; export function getNames(lang: string): LocalizedNationalityNames; -export function toAlpha3(alpha2orNumeric: number | string): string; -export function toAlpha2(alpha3orNumeric: number | string): string; -export function getAlpha2Code(name: string, lang: string): string; -export function getSimpleAlpha2Code(name: string, lang: string): string; -export function getAlpha3Code(name: string, lang: string): string; -export function getSimpleAlpha3Code(name: string, lang: string): string; +export function toAlpha3(alpha2orNumeric: number | string): string | undefined; +export function toAlpha2(alpha3orNumeric: number | string): string | undefined; +export function getAlpha2Code(name: string, lang: string): string | undefined; +export function getSimpleAlpha2Code(name: string, lang: string): string | undefined; +export function getAlpha3Code(name: string, lang: string): string | undefined; +export function getSimpleAlpha3Code(name: string, lang: string): string | undefined; export function langs(): string[]; export function isValid(alpha2orAlpha3orNumeric: string | number): boolean; \ No newline at end of file