import type { UmbLocalizationEntry } from './types/localization.js'; export type FunctionParams = T extends (...args: infer U) => string ? U : []; export interface UmbLocalizationSetBase { $code: string; $dir: 'ltr' | 'rtl'; } export type UmbLocalizationSetKey = string | number | symbol; export interface UmbLocalizationSet extends UmbLocalizationSetBase { [key: UmbLocalizationSetKey]: UmbLocalizationEntry; } /** * The non-generic contract the manager calls on each registered controller. Decoupled from * `UmbLocalizationController`'s generic so the manager's `Set` and consumer-registration * methods don't pick up variance from `term()`'s conditional types — and so the manager can't * accidentally start depending on the generic in future without amending the contract here. */ export interface UmbLocalizationConsumer { keysChanged(changedKeys: Set): void; documentUpdate(): void; } export declare const UMB_DEFAULT_LOCALIZATION_CULTURE = "en"; export declare class UmbLocalizationManager { #private; /** * Internal registry of controllers the manager dispatches `keysChanged` / `documentUpdate` to. * Use `appendConsumer` / `removeConsumer` to mutate this set — external code should not iterate * it directly or assume the stored values are full `UmbLocalizationController` instances. The * element type was relaxed from `UmbLocalizationController` to the * smaller `UmbLocalizationConsumer` contract in v18.1 so that the manager doesn't pick up * variance from the controller's generic `term()` signature. */ connectedControllers: Set; localizations: Map; /** * The currently active language and direction. Read-only from a consumer perspective — * to change the active language, call `umbLocalizationRegistry.loadLanguage(locale)`. * The fields stay publicly writable for the registry's pipeline; consumers writing here * directly will only sync the field without loading the matching dictionaries. */ documentDirection: 'ltr' | 'rtl'; documentLanguage: string; get fallback(): UmbLocalizationSet | undefined; appendConsumer(consumer: UmbLocalizationConsumer): void; removeConsumer(consumer: UmbLocalizationConsumer): void; /** * Registers one or more translations * @param {UmbLocalizationSetBase} t - the localization set to register. */ registerLocalization(t: UmbLocalizationSetBase): void; registerManyLocalizations(translations: Array): void; } export declare const umbLocalizationManager: UmbLocalizationManager;