import type { ReactiveControllerHost } from 'lit'; import type { LoquixTranslations } from './types.js'; /** * Global singleton registry that stores locale overrides and notifies * subscribed components when translations change. * * SECURITY NOTE: The `term()` method returns plain strings intended for * use in Lit templates (text nodes, attributes). Lit auto-escapes HTML, * so XSS is impossible as long as the result is NEVER passed to * `unsafeHTML()` or `innerHTML`. * * Limitations: * - Singleton — one locale per page; concurrent locales are not supported. * - SSR — call `resetLocale()` before each render request to avoid * locale leakage between requests. * - Tests — call `resetLocale()` in `afterEach` / `setup` to isolate tests. */ declare class I18nRegistry { private _overrides; private _subscribers; private _pendingNotify; /** Replace all overrides at once. */ setLocale(translations: Partial): void; /** Merge additional overrides into the current locale. */ updateLocale(translations: Partial): void; /** Clear all overrides, reverting to the default English locale. */ resetLocale(): void; /** Return a shallow copy of the current overrides. */ getLocale(): Partial; /** * Resolve a translation key with optional `{variable}` interpolation. * Priority: override > default English. */ term(key: keyof LoquixTranslations, values?: Record): string; /** Subscribe a host to locale change notifications. */ subscribe(host: ReactiveControllerHost): void; /** Unsubscribe a host from locale change notifications. */ unsubscribe(host: ReactiveControllerHost): void; /** * Microtask-batched notification — multiple calls to `setLocale` / * `updateLocale` within the same microtask only trigger a single * `requestUpdate()` per component. */ private _scheduleNotify; } export declare const registry: I18nRegistry; export {}; //# sourceMappingURL=registry.d.ts.map