import { AsyncLocalStorage } from "node:async_hooks"; //#region src/internal/context.d.ts interface RequestContext { authToken: string; } /** * AsyncLocalStorage instance for request-scoped context. * Each async execution flow gets its own isolated store. */ declare const requestContext: AsyncLocalStorage; /** * Get the auth token for the current request context. * Returns undefined if called outside of a runWithAuth context. */ declare function getAuthToken(): string | undefined; /** * Run a function with the given auth token in the request context. * All async operations within `fn` will have access to this token. */ declare function runWithAuth(authToken: string, fn: () => T): T; //#endregion export { type RequestContext, getAuthToken, requestContext, runWithAuth };