import { LitElement, PropertyDeclarations, TemplateResult } from 'lit-element'; import { StringMap, TOptions } from 'i18next'; import { FetchEvent } from '../NucleonElement/FetchEvent'; import { Gateways } from './types'; declare const I18n_base: typeof LitElement & import("lit-element").Constructor & { inferredProperties: string[]; } & import("lit-element").Constructor & { defaultNS: string; }; /** * Custom element for effortless localization with i18next. * * @fires I18n#fetch - Instance of `I18n.FetchEvent`. Emitted before each translation request. * * @element foxy-i18n * @since 1.1.0 */ export declare class I18n extends I18n_base { /** Instances of this event are dispatched on an element before each translation request. */ static readonly FetchEvent: typeof FetchEvent; /** Shared [i18next](https://www.i18next.com) instance for all I18n elements. */ static readonly i18next: import("i18next").i18n; /** * Registers a joint event listener for all i18next events that indicate * the availability of new translations. If you're using `I18n.i18next` to localize * your components, this function will call the provided handler every time an update is needed. * * @param handler Callback to invoke when translation changes. * @example const unsubscribe = I18n.onTranslationChange(triggerUpdate); */ static onTranslationChange(handler: () => void): () => void; /** * Registers a global event listener that calls `handler` every time an i18next resource * is downloaded by `foxy-i18n`. Allows devs to specify resource location and/or fetch it * via a different channel (e.g. web sockets or using a localization SaaS). * * @param handler Callback to invoke on resource fetch. * @example const unsubscribe = I18n.onResourceFetch((ns, lang) => fetch(`path/to/${ns}/${lang}`)); */ static onResourceFetch(handler: (ns: string, lang: string) => Promise): () => void; /** * Adds payment gateway names to the i18next store. Fetch `fx:hosted_payment_gateways` * and `fx:payment_gateways` and call this method to make gateway names available to * elements like `foxy-payment-card`. * * @param param0 `fx:hosted_payment_gateways` or `fx:payment_gateways` * @example I18n.setGateways({ values: { authorize: { name: 'Authorize.Net' }}}) * @deprecated */ static setGateways({ values }: Gateways): void; /** @readonly */ static get properties(): PropertyDeclarations; /** * Optional i18next translation function * [options](https://www.i18next.com/translation-function/essentials#overview-options). */ options: TOptions; /** * Optional key to translate. Empty by default (renders nothing). * See [i18next docs](https://www.i18next.com/translation-function/essentials#accessing-keys) for more info. */ key: string; private __unsubscribe?; /** @readonly */ connectedCallback(): void; /** @readonly */ render(): TemplateResult; /** @readonly */ disconnectedCallback(): void; } export {};