import { ReactNode } from "react"; export interface LocaleDefinition { code: string; label: string; icon?: ReactNode; } export declare type Language = Language; export declare type Region = Region; export declare type LocaleList = Locale[]; export declare type ImgMap = Record; export interface Locale { language?: Language; region?: Region; encoding?: string; modifiers?: string[]; } export interface i18nClientOptions { locales: LocaleList; /** @deprecated Will be removed in 1.0.0. Please use locales */ localeList?: LocaleList; locale?: Locale; imgMap?: ImgMap; } /** * @deprecated Please use i18nClientOptions */ export declare type LocalizationApiOptions = i18nClientOptions; export declare class I18nClient { /** * constructs the i18n API and sets the current local from local storage, or default locale * * @param locale the default locale for the application, will default to current locale if set. * @param localeList the list of locales Available in the application * @param imgMap A object that maps the region to a path to the img scr */ constructor({ locale, locales, localeList }: i18nClientOptions); /** * Default locale of localization api * @type Locale */ locale: Locale; /** * Locale list of localization api * @type LocaleList */ locales: LocaleList; /** * Default imgMap * @type ImgMap * @deprecated No longer supported in 0.3.0 */ imgMap: ImgMap; /** * Gets formatted locale * @returns formatted locale for l10n or i18n */ getLocaleString(l10n?: boolean): string; /** * Sets locale and stores it in locale storage */ setLocale(locale: Locale): void; /** * Gets locale from memory */ getLocale(): Locale; /** * @deprecated Please use getLocaleString */ localeToString(currentLocal: Locale): string; private getCachedData; private setCachedData; } /** * @deprecated * Preferred use case of API class is as I18nClient alias */ export declare const LocalizationApi: typeof I18nClient; /** * converts a given locale to a formatted i18n string * @param locale the given locale * @returns the formatted string */ export declare function getI18nStringFromLocale(locale: Locale): string; /** * converts a given locale to a formatted i10n string * @param locale the given locale * @returns the formatted string */ export declare function getl10nStringFromLocale(locale: Locale): string; /** * Gets the code from a language or region definition, irregardless of shape * @param languageOrRegion */ export declare function getCode(languageOrRegion: Language | Region | undefined): string | undefined; /** * Gets the label from a language or region definition, irregardless of shape * @param languageOrRegion */ export declare function getLabel(languageOrRegion: Language | Region | undefined): string | undefined;