import { type EagerRouteComponentFilesByEntry } from '@modern-js/utils'; export { collectRouteComponentFiles, type EagerRouteComponentFilesByEntry, normalizeModulePath, type RouteComponentFileCollection, } from '@modern-js/utils'; type ModuleLike = { resource?: string; }; type LazyCompilationTestFn = (m: ModuleLike) => boolean; /** Matches Rspack's `LazyCompilationOptions['test']`. */ type LazyCompilationTest = RegExp | LazyCompilationTestFn | undefined; export type EagerRouteComponentInfo = { files: Set; /** Specifiers that could not be resolved, keyed by entry name. */ unresolvedByEntry: Map; }; /** * Aggregate the per-entry route component data (collected by the router plugin * during route generation and threaded in as * `BuilderOptions.eagerRouteComponentFilesByEntry`) into the flat shape * {@link planSSRLazyCompilation} expects: one Set of all route files plus the * unresolved specifiers keyed by entry. */ export declare function aggregateEagerRouteComponentFiles(byEntry: EagerRouteComponentFilesByEntry | undefined): EagerRouteComponentInfo; /** * Build a `lazyCompilation.test` that forces route component modules to compile * eagerly (so SSR first-screen chunk/CSS injection has the assets it needs at * render time), while delegating all other modules to the user's `test` * (defaulting to lazy when the user did not provide one). */ export declare function buildSSRLazyCompilationTest(eagerRouteFiles: Set, userTest?: LazyCompilationTest): LazyCompilationTestFn; export type SSRLazyPlan = { apply: false; unresolvedByEntry?: Map; } | { apply: true; lazyCompilation: Record; }; /** * Decide whether to apply the route-eager lazy compilation for an SSR project. * Checks unresolved route components FIRST: if any exist we cannot guarantee * they are eager, so we skip the optimization (and surface them so the caller * can warn) rather than silently leaving a route lazy. `current` is the * existing `dev.lazyCompilation` value (lazy must be enabled for this to apply). */ export declare function planSSRLazyCompilation(current: unknown, info: EagerRouteComponentInfo): SSRLazyPlan;