/** * ImportResolverBridge — cross-language import resolution for call graph enrichment. * * Builds a per-file map of { localName → resolvedSourceFilePath } so that Pass 2 * of CallGraphBuilder.build() can prefer the imported file when multiple candidates * share the same function name. * * TypeScript / JavaScript / Python are handled via import-parser.ts (existing). * Go, Rust, Ruby, Java get lightweight regex parsers here. */ import type { FileAnalysis } from './import-parser.js'; /** filePath → Map */ export type ImportMap = Map>; /** * Build an ImportMap from in-memory file sources, for base-class resolution inside * CallGraphBuilder.build() (Pass 7, buildClassNodes). When a class extends a base whose * simple name is also declared elsewhere, the import the child actually wrote is the * decisive evidence for which declaration is the real base — it must outrank the * same-directory / global-unique fallbacks, otherwise a same-named class in the child's * own directory is wired as a false base (a precision regression, since CHA's stated bias * is false-negatives over false-positives). * * Unlike {@link buildImportMap} (which absolutizes the source via resolve() and so can * never prefix-match the repo-relative filePaths the call graph keys on), this preserves * the caller's path style with a posix join+normalize, yielding an extensionless, * repo-relative target (e.g. `widgets/sphere.ts` importing `../shapes/base` → `shapes/base`) * that prefix-matches the class node's `shapes/base.ts`. * * Scope: relative TS/JS/Python imports — the languages with a content-level import parser. * Non-relative (package) imports and other languages are skipped; resolution then falls * through to the same-directory / global-unique layers exactly as before (additive — this * can only recover a correct base, never introduce a new wrong one). */ export declare function buildBaseImportMap(files: Array<{ path: string; content: string; language: string; }>): ImportMap; /** Build an ImportMap from TS/JS/Python FileAnalysis objects (from import-parser). */ export declare function buildImportMap(analyses: FileAnalysis[]): ImportMap; /** * Given a caller file and a callee name, return the source file the name was * imported from (if known), or undefined. */ export declare function findCalleeFileViaImport(importMap: ImportMap, callerFilePath: string, calleeName: string): string | undefined; export declare function parseGoImports(filePath: string, content: string, allFilePaths: string[]): Map; export declare function parseRustImports(_filePath: string, content: string, allFilePaths: string[]): Map; export declare function parseRubyImports(filePath: string, content: string, allFilePaths: string[]): Map; export declare function parseJavaImports(content: string, allFilePaths: string[]): Map; //# sourceMappingURL=import-resolver-bridge.d.ts.map