import type { ICallGraphReader, ICallGraphWriter, IFunctionIndexReader, IImportResolver, ILanguageParser, ITypeGraphReader, LanguageConventions } from "../types/interfaces.js"; import type { CallGraph, CallGraphEntry } from "../types/index.js"; export declare class CallGraphManager implements ICallGraphReader, ICallGraphWriter { private importResolver; private parsers; private conventions; private graph; private selfKeywords; private typeGraph?; private affectedCallerIds; private localVarTypes; constructor(importResolver: IImportResolver, parsers: ILanguageParser[], typeGraph: ITypeGraphReader | undefined, conventions: LanguageConventions); build(index: IFunctionIndexReader, projectRoot: string): Promise; buildForFiles(files: string[], index: IFunctionIndexReader, projectRoot: string): Promise; removeByFile(filePath: string, _index: IFunctionIndexReader): void; getEntry(id: string): CallGraphEntry | undefined; getTransitive(startId: string, direction: "downstream" | "upstream", maxDepth: number, bridgeNode?: (id: string) => string[]): { nodes: Array<{ id: string; depth: number; }>; cycles: string[][]; }; getStats(): { nodes: number; edges: number; cycles: number; }; saveToDisk(cacheDir: string, index: IFunctionIndexReader): Promise; loadFromDisk(cacheDir: string, index: IFunctionIndexReader): Promise; /** * Parse files and create forward-edge entries in the graph. * Shared by build() and buildForFiles() to avoid duplication. */ private processFiles; private resolveCallTarget; /** * Resolve call target IDs from file paths + names to concrete record IDs. * When scope is provided, only processes those entries (incremental path). * Without scope, processes the entire graph (full rebuild). */ private resolveTargetIds; /** * Resolve interface-based calls using the type graph. * Pattern 1: this.field.method() — explicit self-reference (e.g., this.repo.save()) * Pattern 2: param.method() — function parameter injection (e.g., repo.save() where repo is a param) * Pattern 3: field.method() — implicit this (e.g., Java's repo.save() where repo is a class field) */ private resolveViaTypeGraph; /** * Walk a chain of member accesses through the type graph. * E.g., for chain ["vectorDb", "vectorSearch"] starting from "HybridSearchPipeline": * HybridSearchPipeline.members["vectorDb"] → "IVectorDatabase" * findImplementorMethod("IVectorDatabase", "vectorSearch") → LanceDBStore.vectorSearch */ private resolveTypeChain; /** * Find a method on a type or its implementors/extenders. */ private findImplementorMethod; /** * Add reverse edges (calledBy) for specific entries only. * Used by incremental path — avoids clearing and rebuilding the entire reverse graph. * The alreadyTracked check prevents duplicates when processing affected callers * that already have reverse edges for their non-nullified calls. */ private addReverseEdgesForEntries; /** * Build the complete reverse graph from scratch. * Used by full rebuild only — clears all calledBy arrays and rebuilds from forward edges. */ private buildReverseGraph; clear(): void; } //# sourceMappingURL=call-graph.d.ts.map