/** * Isomorphic locale accessor (spec §6.4 / §6.7). * * Read by `_()` (the active dictionary) and `buildUrl` (the locale context), on BOTH * server and client — so this module is bundled to the browser and MUST stay free of * server-only imports (no Node async-context store). It has no imports at all. * * - Server: the per-render context is set by `setSSRContext` immediately before the * synchronous `renderToString` and reset after (safe because SSR is synchronous). * - Client: read once from `window.eContext` and memoized. * * The server-only request-scoped store lives in `localeContext.ts`; `applyLocalePrefix` * lives HERE (pure, isomorphic) so the isomorphic `buildUrl` can reuse it without * dragging the server-only async-context store into the client bundle. */ export interface IsoLocaleContext { locale: string; defaultLocale: string; isAdmin: boolean; } /** * Server-only: set the per-render locale context + dictionary immediately before the * synchronous `renderToString`, and reset after. No-op-safe to call with empties. */ export declare function setSSRContext(ctx: IsoLocaleContext, dict: Record): void; /** The dictionary `_()` reads: the page slice on the server (per-render) / the page's dict on the client. */ export declare function getActiveDictionary(): Record; /** The locale context `buildUrl` reads, isomorphically. */ export declare function getLocaleContextIso(): IsoLocaleContext; /** * Shared, pure prefix logic (spec §6.10 / §6.18) — used by `buildUrl` (isomorphic) and * by `localizeUrl` (server, in `localeContext.ts`). Prepends `/` only when the * target route is not admin, the current context is not admin, and the locale is not * the default. Lives in this isomorphic module on purpose (stays client-safe). */ export declare function applyLocalePrefix(url: string, ctx: IsoLocaleContext | undefined, targetIsAdmin?: boolean): string;