import type { BuildExecutor } from '../../build/build-adapter.js'; import type { EcoBuildPlugin } from '../../build/contracts/build-types.js'; import type { AppModuleLoader } from './app-module-loader.service.js'; import { type PageModuleBuildImportOptions } from './page-module-import.service.js'; import type { SourceModuleLoaderFactory } from './module-loading-types.js'; export type ServerModuleTranspilerOptions = Omit; export type ServerModuleImportDependency = Pick; /** * Immutable execution context for one server-transpiler instance. * * @remarks * Callers own when and why a new transpiler is created. This service only owns * applying the supplied root/build-executor pair consistently to every module * load that passes through it. */ export type ServerModuleTranspilerBootstrapArgs = { rootDir: string; getBuildExecutor?: () => BuildExecutor | undefined; canLoadSourceModuleFromHost?: (filePath: string) => boolean; getHostModuleLoader?: SourceModuleLoaderFactory; invalidateModules?: (changedFiles?: string[]) => void; pageModuleImportService?: ServerModuleImportDependency; /** Factory evaluated on each importModule call to produce plugins applied to every load. */ getDefaultPlugins?: () => EcoBuildPlugin[]; }; /** * App-owned boundary for server-side source module loading. * * @remarks * This service centralizes server-side module transpilation and import behind * an explicit caller-owned root and build executor. */ export declare class ServerModuleTranspiler { private readonly pageModuleImportService; private readonly getRootDir; private readonly getBuildExecutor; private readonly invalidateModules; private readonly getDefaultPlugins; /** * Creates one explicit server-transpiler boundary for a given execution * context. */ constructor(args: ServerModuleTranspilerBootstrapArgs); /** * Loads a server-side source module through the caller-owned transpile * context. */ importModule(options: ServerModuleTranspilerOptions): Promise; /** * Invalidates cached module state for development reloads. */ invalidate(changedFiles?: string[]): void; /** * Releases transpiler-owned resources. * * @remarks * The current implementation delegates cache ownership to lower-level module * loading services, so disposal is intentionally a no-op for now. */ dispose(): Promise; }