codn_ts
Version:
智能代码分析工具 - 支持语义搜索、调用链分析和代码结构可视化,对大模型/AI agent 友好
44 lines (43 loc) • 1.26 kB
TypeScript
import { ReferenceTriple } from "./utils/reference_analyzer";
export interface CallChainOptions {
from?: string[];
to?: string[];
maxDepth?: number;
format?: "text" | "dot" | "mermaid" | "json-graph";
includeExternal?: boolean;
showCycles?: boolean;
minCalls?: number;
filter?: string;
exclude?: string;
}
export interface CallChainNode {
id: string;
name: string;
file: string;
line: number;
column: number;
calls: number;
depth: number;
isExternal: boolean;
}
export interface CallChainEdge {
from: string;
to: string;
calls: number;
locations: string[];
}
export interface CallChainResult {
nodes: CallChainNode[];
edges: CallChainEdge[];
cycles: string[][];
statistics: {
totalNodes: number;
totalEdges: number;
maxDepth: number;
cyclesCount: number;
externalCalls: number;
};
}
export declare function generateCallChain(references: ReferenceTriple[], options?: CallChainOptions): Promise<CallChainResult>;
export declare function displayCallChain(result: CallChainResult, format?: string): void;
export declare function writeCallChainToFile(result: CallChainResult, filePath: string, format: string): Promise<void>;