/** * SSR Module Loader Class * * Loads and transforms React components for server-side rendering. * * @module module-system/react-loader/ssr-module-loader/loader */ import type * as React from "react"; import type { ModuleCacheEntry, SSRModuleLoaderOptions } from "./types.js"; declare function deleteInProgressTransformIfCurrent(key: string, transformPromise: Promise): boolean; declare function registerInProgressTransformObservers(key: string, transformPromise: Promise): AbortSignal; declare function inProgressTransformObserverCount(transformPromise: Promise): number; declare function shouldRetryRejectedInProgressTransform(rejectedLeaderCount: number): boolean; declare function scheduleStaleInProgressTransformEviction(key: string, transformPromise: Promise, filePath: string): ReturnType; declare function publishTransformCacheIfCurrent(input: { inProgressKey: string; transformPromise: Promise; staleEvictionTimer: ReturnType; contentCacheKey: string; filePathCacheKey: string; entry: ModuleCacheEntry; publishDistributed?: () => void; }): boolean; /** Keep a failed singleflight reserved until its abandoned transform settles. */ declare function retainInProgressTransformUntilSettled(key: string, leader: Promise, transformSettlement: Promise, error: unknown): Promise | null; declare function getMdxEsmCacheVariant(options: Pick): string | undefined; /** * Start compilation before walking dependencies, then join both results. * * Compiler settlement handlers are attached immediately, so dependency * resolution can retain its historical error precedence without draining a * compiler that cannot be aborted. */ declare function runTransformAndDependencies(transform: () => Promise, dependencies: () => Promise, onDependencyFailure?: (error: unknown, transformSettlement: Promise) => void): Promise<{ transformed: T; dependencies: D; }>; /** Internal test seam for the singleflight timeout lifecycle. */ export declare const __ssrModuleLoaderInternals: { deleteInProgressTransformIfCurrent: typeof deleteInProgressTransformIfCurrent; getMdxEsmCacheVariant: typeof getMdxEsmCacheVariant; inProgressTransformObserverCount: typeof inProgressTransformObserverCount; publishTransformCacheIfCurrent: typeof publishTransformCacheIfCurrent; registerInProgressTransformObservers: typeof registerInProgressTransformObservers; retainInProgressTransformUntilSettled: typeof retainInProgressTransformUntilSettled; runTransformAndDependencies: typeof runTransformAndDependencies; scheduleStaleInProgressTransformEviction: typeof scheduleStaleInProgressTransformEviction; shouldRetryRejectedInProgressTransform: typeof shouldRetryRejectedInProgressTransform; waitForInProgressTransform: typeof waitForInProgressTransform; }; declare function waitForInProgressTransform(transformPromise: Promise, filePath: string, signal?: AbortSignal): Promise; /** * Shorten a path for a log line without letting it read as a real one. * * The bare `slice(-40)` this replaces emitted entries like * `veryfront/esm/src/react/context/index.js` and * `/veryfront/esm/src/react/router/index.js`: two different files whose tails * differ only by a leading slash. Reading those side by side, one failure of * two distinct modules looks like two modules colliding on one cache key, * which is a materially different bug. The marker keeps the entry short while * making the truncation visible. * * @internal exported for tests */ export declare function logPath(filePath: string): string; /** * SSR Module Loader with Redis Support. * * Loads and transforms React components for server-side rendering. * Supports Redis caching to share transformed modules across pods. */ export declare class SSRModuleLoader { private options; private cache; private circuitBreaker; private depValidator; constructor(options: SSRModuleLoaderOptions); private withTransformCapacity; private importModuleFromCacheEntry; private invalidateMdxEsmCacheEntry; private throwMissingDependencies; private getRetryableStaleCacheErrorMessage; loadRawModule(filePath: string, source: string): Promise>; loadModule(filePath: string, source: string): Promise>>; private transformCrossProjectImport; private transformWithDependencies; private doTransformWithDependencies; } export {}; //# sourceMappingURL=loader.d.ts.map