export default I18N; declare function I18N(): I18N; declare class I18N { defaultLocaleSlug: string | undefined; defaultPluralForms: ((n: any) => 1 | 0) | undefined; state: { tannin: undefined; locale: undefined; localeSlug: undefined; localeVariant: undefined; textDirection: undefined; translations: any; } | undefined; componentUpdateHooks: any[] | undefined; translateHooks: any[] | undefined; subscribers: Set | undefined; subscribe(callback: any): () => boolean; emitChange(): void; /** * Returns a browser-safe locale string that can be used with `Intl.NumberFormat`. * @returns {string} The locale string */ getBrowserSafeLocale(): string; configure(options: any): void; setLocale(localeData: any): void; getLocale(): undefined; /** * Get the current locale slug. * @returns {string} The string representing the currently loaded locale */ getLocaleSlug(): string; /** * Get the current locale variant. That's set for some special locales that don't have a * standard ISO code, like `de_formal` or `sr_latin`. * @returns {string|undefined} The string representing the currently loaded locale's variant */ getLocaleVariant(): string | undefined; /** * Get the current text direction, left-to-right (LTR) or right-to-left (RTL). * @returns {boolean} `true` in case the current locale has RTL text direction */ isRtl(): boolean; /** * Adds new translations to the locale data, overwriting any existing translations with a matching key. * @param {Object} localeData Locale data */ addTranslations(localeData: Object): void; /** * Checks whether the given original has a translation. * @returns {boolean} whether a translation exists */ hasTranslation(...args: any[]): boolean; /** * Returns `newCopy` if given `text` is translated or locale is English, otherwise returns the `oldCopy`. * ------------------ * Important - Usage: * ------------------ * `newCopy` prop should be an actual `i18n.translate()` call from the consuming end. * This is the only way currently to ensure that it is picked up by our string extraction mechanism * and propagate into GlotPress for translation. * ------------------ * @param {Object} options * @param {string} options.text - The text to check for translation. * @param {string | Object} options.newCopy - The translation to return if the text is translated. * @param {string | Object | undefined } options.oldCopy - The fallback to return if the text is not translated. * @param {Object} options.translationOptions - The options to pass to the `hasTranslation` method, e.g. translation context. */ fixMe({ text, newCopy, oldCopy, translationOptions }: { text: string; newCopy: string | Object; oldCopy: string | Object | undefined; translationOptions: Object; }): string | Object | null | undefined; /** * Exposes single translation method. * See sibling README * @returns {string | Object | undefined} translated text or an object containing React children that can be inserted into a parent component */ translate(...args: any[]): string | Object | undefined; /** * Causes i18n to re-render all translations. * * This can be necessary if an extension makes changes that i18n is unaware of * and needs those changes manifested immediately (e.g. adding an important * translation hook, or modifying the behaviour of an existing hook). * * If at all possible, react components should try to use the more local * updateTranslation() function inherited from the mixin. */ reRenderTranslations(): void; registerComponentUpdateHook(callback: any): void; registerTranslateHook(callback: any): void; } declare namespace I18N { let throwErrors: boolean; } //# sourceMappingURL=i18n.d.ts.map