type I18nInstance = { _: (...args: any[]) => unknown; locale: string; }; type ServerI18nGetter = () => T | undefined; type RegisteredMessages = Record>; type InitializableClientI18n = I18nInstance & { activate(locale: string): unknown; load(locale: string, messages: Record): unknown; }; type RegisteredMessageLoader = () => Promise>; type ServerI18nScope = { run(i18n: T, callback: () => Result): Result; activate(i18n: T): T; get(): T | undefined; }; type CreateServerI18nScopeOptions = { /** * A framework adapter's stable request/render identity. The provider ID * replaces an earlier registration from the same adapter during dev HMR. */ requestKeyProvider?: { get(): object | undefined; id: symbol; }; }; /** * Classify the current runtime consistently across Palamedes packages. * Browser workers are client environments even though they do not expose a * `window` global. */ declare function isServerEnvironment(): boolean; /** * Register compiled messages at module-evaluation time. Generated message * sidecar modules (experimental graph splitting) call this so messages travel * with the code chunks that use them: registration loads into the active * client instance immediately when one is installed, and buffers otherwise so * `setClientI18n` can flush before the first render. * * Each registered map is buffered and loaded as-is, never copied or merged: * generated catalogs carry the compiled-catalog brand, and the parser-free * runtime rejects unbranded copies. Merging across registrations is the * instance's `load()` responsibility. * * Registrations are module-evaluation facts, not instance state. They survive * `resetI18nRuntime()` because the registering modules will not evaluate a * second time. * * `key` is the optional stable identity of the registering module. It is what * makes re-evaluation idempotent: dev-server SSR re-runs an invalidated * generated module in the same process, and without a key every catalog edit * would buffer another full copy and keep serving removed message ids from the * older ones. Re-registering a key replaces its entry in place, so buffer size * and load order stay stable. Keyless registrations always append. */ declare function registerMessages(catalogs: RegisteredMessages, key?: string): void; /** * Register locale-specific message loaders for one generated source-module * sidecar. Server adapters use these lazy resources so the ESM graph * determines message membership while each request materializes only its * active locale. * * `key` is stable across rebuilds. Re-registering it replaces the prior * loaders and their resources, which keeps development HMR from retaining a * stale sidecar forever. */ declare function registerMessageLoaders(key: string, loaders: Record): () => void; /** * Replace every lazy sidecar registration owned by a generated source module. * The returned release function only removes this exact registration, so an * old HMR module cannot unregister the replacement that evaluated after it. */ declare function registerMessageLoaderGroup(key: string, loaderGroups: ReadonlyArray>): () => void; /** * Load every message fragment currently present in the server module graph for * `locale` into a request-local i18n instance. Resources are deduplicated * across concurrent and later requests; loading into the instance remains * additive and preserves each generated compiled-catalog object as-is. */ declare function loadRegisteredMessages(i18n: T, locale: string): Promise; declare function setClientI18n(i18n: T): T; /** * Create the shared parser-free client instance used by graph-split modules. * Multiple modules can bootstrap concurrently; the first one installs the * instance and every later module reuses it before loading its own fragment. */ declare function initializeClientI18n(locale: string, createI18n: () => T): T; declare function setServerI18nGetter(getter: ServerI18nGetter): void; /** * Enter the request scope created by `@palamedes/runtime/server` from an * isomorphic SSR bundle that cannot import the Node-only server subpath. */ declare function activateServerI18n(i18n: T): T; declare function getI18n(): T; declare function resetI18nRuntime(): void; export { activateServerI18n, getI18n, initializeClientI18n, isServerEnvironment, loadRegisteredMessages, registerMessageLoaderGroup, registerMessageLoaders, registerMessages, resetI18nRuntime, setClientI18n, setServerI18nGetter }; export type { CreateServerI18nScopeOptions, I18nInstance, RegisteredMessageLoader, RegisteredMessages, ServerI18nScope };