import { type TsconfigPaths } from './tsconfig-paths.js';
/**
 * File-level import graph.
 *
 * A directed edge `a → b` means "file a imports something from file b". The
 * graph is used by the dead-module detector to find files unreachable from
 * any entry point.
 *
 * Edges and node identities are workspace-relative POSIX paths so the graph
 * is stable across machines and easy to serialise.
 */
export interface ImportGraph {
    /** All workspace files known to the graph. */
    nodes: Set<string>;
    /** Outgoing edges keyed by source file. */
    outgoing: Map<string, Set<string>>;
    /** Incoming edges keyed by target file. */
    incoming: Map<string, Set<string>>;
}
export interface ImportRecord {
    /** Source file (workspace-relative). */
    source: string;
    /** Logical workspace name of the source file in multi-workspace mode. */
    sourceWorkspace?: string;
    /** Resolved target file (workspace-relative) if the specifier resolved to a workspace path, else null. */
    target: string | null;
    /** Workspace name of the resolved target when the import crossed a workspace boundary. */
    targetWorkspace?: string;
    /** Raw specifier as written in the import (e.g. `'./utils'`, `'fs'`, `'@org/pkg'`). */
    specifier: string;
    /** Named imports (`import { a, b as c }` → ['a', 'c']). Aliases recorded as the local name. */
    namedImports: string[];
    /** Default import local name (`import Foo from ...`). */
    defaultImport?: string;
    /** Namespace alias (`import * as ns from ...`). When set, every export of the target is consumed. */
    namespaceAlias?: string;
    /** True when this record came from `export ... from '...'` (re-export). */
    isReExport: boolean;
    /** True for `export * from '...'` — every export of the target propagates. */
    isStarReExport: boolean;
    /** Original exported names mentioned in the re-export (`export { a as b } from` → ['a']). */
    reExportNames?: string[];
    /**
     * Final names published by this re-export (`export { a as b } from` → ['b']).
     * Parallel to `reExportNames`. Used by re-export-shadow to detect ambiguous
     * exits from the barrel: two re-exports can land on the same RHS name even
     * when their LHS origins differ.
     */
    reExportLocalNames?: string[];
}
export declare function buildImportGraph(records: ImportRecord[]): ImportGraph;
export declare function resolveImport(workspaceRoot: string, sourceFile: string, specifier: string, tsconfigPaths?: TsconfigPaths | null): string | null;
/** BFS reachability from a set of entry-point files. Returns the reachable set. */
export declare function reachableFrom(graph: ImportGraph, entryPoints: Iterable<string>): Set<string>;
//# sourceMappingURL=import-graph.d.ts.map