/** * @module runtime/module-loader * @description Module loader with dependency injection and lifecycle management */ import type { GlobalContext } from './types/context.js'; import type { Module, ModuleLoaderConfig } from './types/module.js'; /** * Module loader with dependency injection */ export declare class ModuleLoader { private registry; private config; private initializingModules; constructor(config?: ModuleLoaderConfig); /** * Register a module * * @param module - Module to register * @param gctx - Global context (required if autoInit is true) * @throws {ModuleError} If module already registered */ register(module: Module, gctx?: GlobalContext): Promise; /** * Initialize a module and its dependencies * * @param name - Module name to initialize * @param gctx - Global context * @param dependencyChain - Internal tracking for circular dependency detection * @throws {ModuleNotFoundError} If module not found * @throws {CircularDependencyError} If circular dependency detected * @throws {ModuleInitializationError} If initialization fails */ initialize(name: string, gctx: GlobalContext, dependencyChain?: string[]): Promise; /** * Get module exports * * @param name - Module name * @param gctx - Global context (for lazy initialization) * @returns Module exports * @throws {ModuleNotFoundError} If module not found * @throws {ModuleError} If module not initialized and can't auto-initialize */ get(name: string, gctx?: GlobalContext): Promise; /** * Get module exports synchronously (only works for initialized modules) * * @param name - Module name * @returns Module exports * @throws {ModuleNotFoundError} If module not found * @throws {ModuleError} If module not initialized */ getSync(name: string): T; /** * Shutdown a module * * @param name - Module name * @throws {ModuleNotFoundError} If module not found */ shutdown(name: string): Promise; /** * Shutdown all modules */ shutdownAll(): Promise; /** * Check if a module is registered * * @param name - Module name * @returns true if module is registered */ has(name: string): boolean; /** * Get all registered module names * * @returns Array of module names */ getModuleNames(): string[]; /** * Get module statistics * * @returns Statistics object */ getStatistics(): { total: number; initialized: number; uninitialized: number; initializing: number; error: number; shutdown: number; totalUsage: number; }; /** * Run health checks on all modules * * @returns Map of module name to health status */ healthCheck(): Promise>; } /** * Create a new module loader * * @param config - Module loader configuration * @returns New module loader instance */ export declare function createModuleLoader(config?: ModuleLoaderConfig): ModuleLoader; //# sourceMappingURL=module-loader.d.ts.map