import { App } from 'vue'; import { LocaleMessageObject, I18n as VueI18n } from 'vue-i18n'; import { AnyMessages, Device, I18nOptions, Locale } from './i18n.types'; /** * I18n settings manager. * * @public */ export declare class I18n { vueI18n: VueI18n, Record, Record, Locale, false>; protected locale: Locale; protected device: Device; protected messages: Record>; protected currentMessages: LocaleMessageObject; protected fallbackLocale: Locale; /** * Constructs a new {@link I18n} instance with the passed {@link I18nOptions | i18n options}. * * @param options - The new {@link I18nOptions | i18n options}. * @param options.locale - i18n locale. * @param options.messages - i18n messages. * @param options.device - i18n device. * @param options.fallbackLocale - i18n fallbackLocale. */ constructor({ locale, messages, device, fallbackLocale }: I18nOptions); /** * Creates a new {@link I18n} instance. * * @param options - The new {@link I18nOptions | i18n options}. * * @returns The new instance. */ static create(options: I18nOptions): Promise>; /** * Installs VueI18n plugin. * * @param vue - The Vue instance. */ install(vue: App): void; /** * Tries to get a value from the messages object accessing it key by key. * When a key fails, takes the remaining key parts and tries to access the message * joining them into a single key. * * @param path - A dot separated key to access the message object. * @returns The message corresponding to the provided key, or empty string if it doesn't exist. */ protected getMessageWithDotsInKey(path: string): string | null; /** * Sets the new locale and updates the messages accordingly. * * @param newLocale - The new locale. * * @returns The new messages. */ setLocale(newLocale: Locale): Promise; /** * Sets the new device and updates the messages accordingly. * * @param newDevice - The new device. * * @returns The new messages. */ setDevice(newDevice: Device): Promise; /** * Updates the current messages based on the new locale and/or device. */ protected changeMessages(): Promise; /** * Retrieves the corresponding messages for the set locale and device. * * @remarks By default, it merges `base` messages with the specific `device` ones. If there are * no messages for the current locale, the fallback locale is used instead. * * @returns The messages for the current locale and device. */ protected getCurrentMessages(): Promise; }