import type { Constructor, LitElement, PropertyDeclarations } from 'lit-element'; import type { StringMap, TFunction, i18n } from 'i18next'; import type { InferrableMixinHost } from './inferrable'; import { Themeable } from './themeable'; /** * One of the base classes for each rel-specific element in the collection, * providing internationalization capabilities to the derived components. * This class MUST NOT be used on its own (hence the `abstract` keyword) or * referenced externally (outside of the package). * * @deprecated */ export declare abstract class Translatable extends Themeable { static get properties(): PropertyDeclarations; /** * i18next formatter that converts given value to lowecase. * @see https://www.i18next.com/translation-function/formatting */ private static __fLowercase; /** * i18next formatter that presents an array of serializable items * as `[0], [1], [...] and [length - 1]`. For example, given an array like * the following: `['a', 'b', 'c']`, it will output `'a, b and c'`. * @see https://www.i18next.com/translation-function/formatting */ private static __fList; /** * Chooses the right i18next formatter for the given template. * @see https://www.i18next.com/translation-function/formatting */ private static __f; private static __whenI18NReady; private static __isI18NReady; private static __i18n; private __lang; private __ns; /** * Creates class instance and starts loading missing translations * in background. Triggers render when ready. * * @param defaultNS Name of the folder translations for this component are stored in. Usually a node name without vendor prefix. */ constructor(defaultNS?: string); /** * Contains the language this component presents its translatable * content in. Assigning a value to this property will load new * translations in background and trigger a render afterwards. * * **Example:** `"en"` */ get lang(): string; set lang(value: string); /** * The namespace to look for the translations in. We use this property to * sync namespace settings with the parent element and it's highly unlikely * that you'll ever need to set or read it in your code. * * **Example:** `"admin"` */ get ns(): string; set ns(value: string); private static __initI18N; protected get _i18n(): i18n; protected get _whenI18nReady(): Promise; protected get _isI18nReady(): boolean; protected get _t(): TFunction; } declare type Base = Constructor & Constructor & { properties?: PropertyDeclarations; inferredProperties: string[]; }; declare type Translator = (key: string, options?: StringMap) => string; export declare class TranslatableMixinHost { /** * If true, this element won't attempt to load separate files for nested namespaces. * For example, if `ns` is set to `foo bar`, this element will only load `foo` and * expect that file to contain all translations for the `bar` namespace. */ simplifyNsLoading: boolean; /** Optional ISO 639-1 code describing the language element content is written in. */ lang: string; /** * Namespace used by this element. * @since 1.4.0 */ ns: string; /** * Translation function from i18next fixed to the current language and element namespace. * @since 1.4.0 */ get t(): Translator; } export declare const TranslatableMixin: (BaseElement: T, defaultNS?: string) => T & Constructor & { defaultNS: string; }; export {};