/** * Browser fallback for {@link LogContext}. The browser has no * `node:async_hooks` / AsyncLocalStorage, so this keeps a single module-level * `current` object and swaps it synchronously around `with`. * * LIMITATION: there is NO async isolation here. `with` only holds the context * for the synchronous portion of `fn`; anything that runs after an `await` or a * deferred callback ( unless wrapped with {@link LogContextImpl.bind} ) will not * see it. This mirrors the Node API surface so callers write the same code, but * on the browser ambient context is best-effort and synchronous only. */ declare class LogContextImpl { private current; /** * The current ambient store. */ active(): Record; /** * Synchronously set the context to `{ ...current, ...vars }` for the duration * of `fn`, restoring the previous value afterwards. No async isolation. */ with(vars: Record, fn: () => T): T; /** * Mutate the current store in place ( late-bound values ). */ set(key: string, value: unknown): void; /** * Capture the current store and restore it around each invocation of the * returned function. */ bind(fn: (...a: A) => R): (...a: A) => R; } /** * Shared ambient log context ( browser, synchronous fallback ). */ export declare const LogContext: LogContextImpl; /** * Projects only primitive scalar values ( string / number / boolean / bigint ) * from an ambient-context object, dropping objects, arrays, Dates, functions, * null and undefined. Ambient context is meant for correlation ids ( requestId, * traceId, ... ) that belong on every log line; structured payloads should be * passed explicitly per call ( log.info({ obj }, ... ) ), not via ambient context. */ export declare function scalarContext(ctx: Record): Record; export {}; //# sourceMappingURL=context.browser.d.ts.map