import type { ILocalization, LocaleStrings, StringsDataSource } from './abstractions.js'; import type { AnyObject } from '../types/misc.js'; import { type EventHandler } from '../observing/event.js'; export declare class LocalizationManager implements ILocalization { private readonly _dataSource; private _currentLocale; private _currentStrings; private readonly _localeUpdatedEvent; private readonly _firstInit; constructor(_dataSource: StringsDataSource, locale: TLocaleType, fallbackStrings?: TStrings | null); get Locale(): TLocaleType; get Current(): TStrings; get firstInitialized(): Promise; get localeUpdated(): import("../observing/event.js").IEvent>; /** * Updates locale synchronously, and then loads corresponding strings from datasource. * If loader for the locale is sync, this method updates instantly and returns resolved Promise. * Otherwise, strings will be updated asynchronously. */ useLocale(locale: TLocaleType): Promise; /** * Subscribes `handler` to `this.localUpdated` event and also calls it immeditately. * * @returns unsubscribe function */ synchronizeLocale(handler: EventHandler>): () => void; protected doUpdateStrings(locale: TLocaleType, strings: TStrings | null, revert?: () => void): Promise; }