import { ModuleResolutionOptions } from './module-resolver';
import { ModuleLoadOptions, LoadedModule } from './module-loader';
import { ModuleMetadata } from './module-registry';
import { CompilerOptions } from '../config';
import { ModuleSystemStats, SystemHealth } from './metrics';
export interface ModuleSystemOptions {
    resolution?: ModuleResolutionOptions;
    loading?: ModuleLoadOptions;
    compilation?: CompilerOptions;
    metrics?: boolean;
    circuitBreakers?: boolean;
    logger?: boolean;
    managementServer?: boolean;
    managementPort?: number;
}
export interface CompilationResult {
    modules: Map<string, string>;
    entryPoint: string;
    dependencies: string[];
    errors: Error[];
    warnings: string[];
}
export interface BundleOptions {
    entryPoint: string;
    outputPath?: string;
    format?: 'commonjs' | 'esm' | 'umd';
    minify?: boolean;
    sourceMaps?: boolean;
    externals?: string[];
    force?: boolean;
}
export declare class ModuleSystem {
    private readonly resolver;
    private readonly loader;
    private readonly registry;
    private readonly codeGenerator;
    private readonly metrics?;
    private readonly circuitBreakers?;
    private readonly logger?;
    private readonly configManager?;
    private readonly managementServer?;
    constructor(options?: ModuleSystemOptions);
    /**
     * Load a module and all its dependencies
     */
    loadModule(specifier: string, fromFile: string): Promise<LoadedModule>;
    /**
     * Load module synchronously
     */
    loadModuleSync(specifier: string, fromFile: string): LoadedModule;
    /**
     * Compile a module and all its dependencies
     */
    compile(entryPoint: string, externals?: string[]): Promise<CompilationResult>;
    /**
     * Bundle modules into a single file
     */
    bundle(options: BundleOptions): Promise<string>;
    /**
     * Resolve a module specifier
     */
    resolve(specifier: string, fromFile: string): string;
    /**
     * Get module metadata
     */
    getModule(moduleId: string): ModuleMetadata | undefined;
    /**
     * Get all loaded modules
     */
    getAllModules(): ModuleMetadata[];
    /**
     * Get dependency graph
     */
    getDependencyGraph(): Map<string, string[]>;
    /**
     * Get module statistics
     */
    getStatistics(): {
        totalModules: number;
        totalDependencies: number;
        averageDependencies: number;
        maxDependencyDepth: number;
        circularDependencies: number;
    };
    /**
     * Clear all caches
     */
    clearCache(): void;
    /**
     * Update module system options
     */
    updateOptions(options: ModuleSystemOptions): void;
    /**
     * Gracefully shutdown the module system
     */
    shutdown(): Promise<void>;
    private registerAllLoadedModules;
    private generateCommonJSBundle;
    private generateESMBundle;
    private generateUMDBundle;
    private minify;
    /**
     * Start management server for production monitoring
     */
    startManagementServer(port?: number): Promise<number | null>;
    /**
     * Stop management server
     */
    stopManagementServer(): Promise<void>;
    /**
     * Get production metrics
     */
    getMetrics(): ModuleSystemStats | null;
    /**
     * Get system health status
     */
    getHealth(): Promise<SystemHealth>;
    /**
     * Watch for file changes and reload modules
     */
    watch(): void;
    /**
     * Validate module system integrity
     */
    validate(): {
        isValid: boolean;
        errors: string[];
    };
}
//# sourceMappingURL=module-system.d.ts.map