//#region src/services/vite/ssr/requestContext.d.ts type SsrRequestContextStore = { /** Mint at most one nonce for this request, then reuse it. */ getCspNonce: () => string; /** Return the minted nonce if one was requested; otherwise `undefined`. */ peekCspNonce: () => string | undefined; }; type ContextStorage = { getStore: () => SsrRequestContextStore | undefined; run: (context: SsrRequestContextStore, fn: () => T) => T; }; /** * Install AsyncLocalStorage-backed request context. Server-only — the shared * `requestContext` module is imported by client route code via `getCspNonce` * from `sku/runtime`, so it must not statically import `node:async_hooks` (Vite's * browser external throws on any export access). */ declare const installSsrRequestContextStorage: (next: ContextStorage) => void; /** * Returns the per-request CSP nonce for the current SSR request. * First call mints a single value for the request; later calls reuse it. * Available in React Router loaders/actions while sku is rendering. * Express middleware should use `req.getCspNonce()` instead (same store). * Returns `undefined` in the browser (client navigations / hydration). */ declare const getCspNonce: () => string | undefined; /** Returns the request nonce only if one was already requested. */ declare const peekCspNonce: () => string | undefined; declare const runWithSsrRequestContext: (context: SsrRequestContextStore, fn: () => T) => T; //#endregion export { SsrRequestContextStore, getCspNonce, installSsrRequestContextStorage, peekCspNonce, runWithSsrRequestContext };