type InternalModularContainer = Record & { $logs?: string[]; }; interface IOCModule { main: (modularContainer: InternalModularContainer, moduleDeclarationNames: string[]) => Promise | unknown; dependencies?: string[] | ((moduleDeclarationNames: string[]) => string[]); order?: number; skip?: boolean; } interface ModuleDeclaration { name: string; fullName: string; main: (modularContainer: InternalModularContainer, moduleDeclarationNames: string[]) => Promise | unknown; dependencies: string[]; order: number; skip?: boolean; } interface CompiledModuleGraph { sortedDeclarations: ModuleDeclaration[]; resolvedDepsMap: Map; fullNameToModuleMap: Map; moduleDeclarationNames: string[]; } /** * 编译模块依赖图 (纯同步执行)。 * 提取全名/短名映射,解析并映射依赖关系,运行 DFS 循环依赖检测并生成拓扑排序。 * * @param modules - 模块加载器列表,每个包含 key 和 getter * @returns 编译后的静态模块依赖图 */ declare const compileModuleGraph: (modules: { key: string; getter: () => IOCModule; }[]) => CompiledModuleGraph; /** * 基于已编译的依赖图,动态实例化模块容器。 * * @param compiledGraph - 编译后的静态依赖图描述 * @param modularContainer - 需要填充实例的容器对象 */ declare const instantiateModuleContainer: (compiledGraph: CompiledModuleGraph, modularContainer: Record & { $logs?: string[]; }) => Promise; /** * 无锁反应式模块化初始化函数 (兼容包壳)。 * 底层逻辑已拆分为 compileModuleGraph (静态图纯同步编译) 与 instantiateModuleContainer (动态实例填充)。 * * @param modules - 模块加载器列表,每个包含 key 和 getter * @param modularContainer - 依赖查找与拓扑解构容器 (ModularContainer) */ declare const initialize: (modules: { key: string; getter: () => IOCModule; }[], modularContainer: Record & { $logs?: string[]; }) => Promise; declare const getModuleDeclarations: (moduleDeclarationNames: string[], filter: (name: string) => boolean) => string[]; declare const getModuleNameByPrefix: (moduleDeclarationNames: string[], prefix: string) => string[]; export { type CompiledModuleGraph, type IOCModule, compileModuleGraph, getModuleDeclarations, getModuleNameByPrefix, initialize, instantiateModuleContainer };