/** * Transform-cache and retry phase for the SSR module loader. * * @module rendering/orchestrator/module-loader/module-transform-cache */ import type { RuntimeAdapter } from "../../../platform/adapters/base.js"; import { initializeTransformCache, setCachedTransformAsync, type TransformCachedEntryValidator } from "../../../transforms/esm/transform-cache.js"; import { getHttpBundleCacheDir } from "../../../utils/cache-dir.js"; import type { TransformProgressListener } from "../../../transforms/progress.js"; import type { DependencyPinningSourceInput } from "../../../transforms/esm/package-registry.js"; import { type DependencyResolutionObservation } from "../../../transforms/import-rewriter/dependency-resolution.js"; /** Pattern to detect unresolved /_vf_modules/ imports that will fail at runtime. */ export declare const UNRESOLVED_VF_MODULES_RE: RegExp; export interface ModuleTransformCacheResult { code: string; cacheKey: string; contentHash: string; } interface TransformCacheResult { code: string; cacheHit: boolean; bundleManifestId?: string; dependencyResolutionObservations?: ReadonlyArray; } interface BundleValidationResult { valid: boolean; failedHashes: string[]; reason?: string; source: string; } interface TransformOptions { projectId: string; dev: boolean; ssr: boolean; reactVersion?: string; moduleServerOrigin?: string; serverExternalPackages?: readonly string[]; dependencyPinningCacheKey?: string; dependencyPinningDependencies?: Readonly>; dependencyPinningSource?: DependencyPinningSourceInput; onDependencyResolutionObserved?: (observation: DependencyResolutionObservation) => void; onProgress?: TransformProgressListener; abortSignal?: AbortSignal; } interface PipelineResult { code: string; } export interface ModuleTransformCacheDeps { initializeTransformCache: typeof initializeTransformCache; getOrComputeTransform: (key: string, compute: (reportProgress?: TransformProgressListener, abortSignal?: AbortSignal) => Promise, ttlSeconds: number, onProgress?: TransformProgressListener, signal?: AbortSignal, validateCachedEntry?: TransformCachedEntryValidator, getDependencyResolutionObservations?: () => ReadonlyArray) => Promise; transformToESM: (code: string, filePath: string, projectDir: string, adapter: RuntimeAdapter, options: TransformOptions) => Promise; validateCachedBundlesByManifestOrCode: (code: string, bundleManifestId: string | undefined, cacheDir: string) => Promise; findMissingFrameworkBundlePaths: (code: string) => Promise; getHttpBundleCacheDir: typeof getHttpBundleCacheDir; setCachedTransformAsync: typeof setCachedTransformAsync; runPipeline: (code: string, filePath: string, projectDir: string, options: TransformOptions) => Promise; } export interface TransformModuleCodeWithCacheInput { fileContent: string; filePath: string; projectDir: string; effectiveProjectId: string; mode: "development" | "production"; adapter: RuntimeAdapter; reactVersion?: string; moduleServerOrigin?: string; serverExternalPackages?: readonly string[]; dependencyPinningCacheKey?: string; dependencyPinningDependencies?: Readonly>; dependencyPinningSource?: DependencyPinningSourceInput; ttlSeconds?: number; onProgress?: TransformProgressListener; signal?: AbortSignal; deps?: ModuleTransformCacheDeps; } /** Transform module source through the shared cache and stale-cache retry checks. */ export declare function transformModuleCodeWithCache(input: TransformModuleCodeWithCacheInput): Promise; export {}; //# sourceMappingURL=module-transform-cache.d.ts.map