/**** * Distributed transform cache read/write operations. * * Handles reading from and writing to the distributed (Redis/API) transform cache, * including validation of cached entries for the current environment. * * @module transforms/mdx/esm-module-loader/module-fetcher/distributed-cache */ import type { Logger } from "../../../../utils/index.js"; import { getDistributedTransformBackend } from "../../../esm/transform-cache.js"; /** * Bound keys against the final API representation, including the transform * backend prefix and allowed charset. The complete identity is retained in the * SHA-256 input. */ export declare function resolveMdxDistributedTransformCacheKey(cacheKey: string): Promise; /** Return type for getDistributedTransformBackend */ type DistributedCache = NonNullable>>; /** * Result of attempting to read from the distributed cache. * * Always returns the `distributedCache` handle (if available) so it can be * reused for writing after transform, even when the read was a miss. */ interface DistributedCacheReadResult { /** The validated module code, or null if cache miss / validation failure */ code: string | null; /** The distributed cache backend (for subsequent writes) */ distributedCache: DistributedCache; } /** * Attempt to read and validate a module from the distributed transform cache. * * Performs multiple validation checks: * 1. Bundle manifest validation (if manifest ID exists) * 2. HTTP bundle existence (fallback if no manifest) * 3. Framework path compatibility * 4. Unresolved /_vf_modules/ import check * 5. Missing local file:// dependency check * 6. Legacy HTTP import conversion to file:// paths * * Returns null only if no distributed cache backend is available. * Otherwise returns `{ code, distributedCache }` where `code` may be null (cache miss). */ export declare function readDistributedCache(transformCacheKey: string, projectId: string, contentSourceId: string | undefined, normalizedPath: string, projectSlug: string, projectDir: string, reactVersion: string | undefined, log: Logger, serverExternalPackages?: readonly string[]): Promise; /** * Write a fully-resolved module to the distributed transform cache. * * Tokenizes all cache paths for cross-environment portability and creates * a bundle manifest companion key for atomic validation. * * This is fire-and-forget: errors are logged but do not propagate. */ export declare function writeDistributedCache(distributedCache: DistributedCache, transformCacheKey: string, projectId: string, contentSourceId: string, moduleCode: string, normalizedPath: string, log: Logger): void; export {}; //# sourceMappingURL=distributed-cache.d.ts.map