import type { AnalysisContext, DependencyEdge, ModuleRecord, ResolvedOptions, StronglyConnectedComponent } from "./types.js"; export interface GraphBuildResult { components: StronglyConnectedComponent[]; reachable: Set; maybeReachable: Set; hasReachableUnknownDynamicBoundary: boolean; usedExports: Set; /** Export usage inferred from a package.json public entry point is deliberately low confidence. */ usedExportConfidence: Map; usedMembers: Set; } export interface ImportUsage { consumers: Set; names: Set; memberAccess: Map>; wildcard: boolean; reExportOnly: boolean; } /** * Resolve a concrete runtime import specifier using the same rules as the * static graph builder. Layer 4 calls this after its WASM sandbox evaluates a * dynamic import expression, including workspace package subpaths. */ export declare function resolveConcreteSpecifier(sourceFile: string, specifier: string, knownFiles: Set, options: ResolvedOptions): string | undefined; export declare function resolveDependencies(modules: Map, options: ResolvedOptions): void; export declare function edgeTargets(edge: DependencyEdge): string[]; /** Kosaraju with explicit stacks avoids stack overflows on deep graphs and cycles. */ export declare function stronglyConnectedComponents(modules: Map): StronglyConnectedComponent[]; /** * Traverse the graph iteratively. Pattern imports and edges extracted from malformed files * propagate `maybe` reachability. A reachable completely unknown dynamic boundary makes every * project module only maybe-reachable, preventing unsafe unreachable-file claims. */ export declare function calculateReachability(modules: Map, entryPoints: Set, ignoreUnknownImport?: boolean): Pick; export declare function buildImportUsage(modules: Map): Map; export declare function buildUsedExports(modules: Map, options: ResolvedOptions, publicApiEntryPoints?: ReadonlySet): { usedExports: Set; usedExportConfidence: Map; usedMembers: Set; }; /** * Refines component reachability. A component is reachable if at least one of its * modules is reachable from an entry point. */ export declare function calculateComponentReachability(components: StronglyConnectedComponent[], reachable: Set, maybeReachable: Set): void; export declare function buildGraph(modules: Map, entryPoints: Set, options: ResolvedOptions, publicApiEntryPoints?: ReadonlySet): GraphBuildResult; export declare function contextWithGraph(modules: Map, entryPoints: Set, options: ResolvedOptions, publicApiEntryPoints?: ReadonlySet): AnalysisContext;