import { ManifestProgram, CompilationError } from './types'; /** * Abstraction over filesystem operations, enabling in-memory testing. */ export interface ResolverHost { readFile(absPath: string): Promise; resolvePath(fromDir: string, relativePath: string): string; fileExists(absPath: string): Promise; } export interface ResolvedFile { absPath: string; source: string; program: ManifestProgram; /** Absolute paths of direct dependencies (from `use` declarations) */ dependencies: string[]; } export interface ResolutionDiagnostic { message: string; severity: 'error' | 'warning'; file?: string; } export interface ResolutionResult { /** Files in topological order (dependencies first) */ order: ResolvedFile[]; files: Map; diagnostics: ResolutionDiagnostic[]; } type ParseFn = (source: string) => { program: ManifestProgram; errors: CompilationError[]; }; /** * Resolves the module dependency graph from a set of entry files. * * Algorithm: * 1. BFS from entries: read → parse → extract uses → resolve to absolute → recurse * 2. Cycle detection via DFS coloring (white/grey/black) * 3. Topological sort via Kahn's algorithm with deterministic tie-breaking (sorted path) */ export declare function resolveModuleGraph(entryPaths: string[], host: ResolverHost, parse: ParseFn): Promise; export {}; //# sourceMappingURL=module-resolver.d.ts.map