| |
| |
| |
| |
| |
| |
| export declare function isGraphAvailable(): boolean; |
| export interface Node { |
| id: string; |
| labels: string[]; |
| properties: Record<string, any>; |
| } |
| export interface Edge { |
| id?: string; |
| from: string; |
| to: string; |
| type: string; |
| properties?: Record<string, any>; |
| } |
| export interface Hyperedge { |
| id?: string; |
| nodes: string[]; |
| type: string; |
| properties?: Record<string, any>; |
| } |
| export interface CypherResult { |
| columns: string[]; |
| rows: any[][]; |
| } |
| export interface PathResult { |
| nodes: Node[]; |
| edges: Edge[]; |
| length: number; |
| } |
| |
| |
| |
| export declare class CodeGraph { |
| private inner; |
| private storagePath?; |
| constructor(options?: { |
| storagePath?: string; |
| inMemory?: boolean; |
| }); |
| |
| |
| |
| createNode(id: string, labels: string[], properties?: Record<string, any>): Node; |
| |
| |
| |
| getNode(id: string): Node | null; |
| |
| |
| |
| updateNode(id: string, properties: Record<string, any>): boolean; |
| |
| |
| |
| deleteNode(id: string): boolean; |
| |
| |
| |
| findNodesByLabel(label: string): Node[]; |
| |
| |
| |
| createEdge(from: string, to: string, type: string, properties?: Record<string, any>): Edge; |
| |
| |
| |
| getOutgoingEdges(nodeId: string, type?: string): Edge[]; |
| |
| |
| |
| getIncomingEdges(nodeId: string, type?: string): Edge[]; |
| |
| |
| |
| deleteEdge(edgeId: string): boolean; |
| |
| |
| |
| createHyperedge(nodes: string[], type: string, properties?: Record<string, any>): Hyperedge; |
| |
| |
| |
| getHyperedges(nodeId: string, type?: string): Hyperedge[]; |
| |
| |
| |
| cypher(query: string, params?: Record<string, any>): CypherResult; |
| |
| |
| |
| shortestPath(from: string, to: string, maxDepth?: number): PathResult | null; |
| |
| |
| |
| allPaths(from: string, to: string, maxDepth?: number, maxPaths?: number): PathResult[]; |
| |
| |
| |
| neighbors(nodeId: string, depth?: number): Node[]; |
| |
| |
| |
| pageRank(iterations?: number, dampingFactor?: number): Map<string, number>; |
| |
| |
| |
| connectedComponents(): string[][]; |
| |
| |
| |
| communities(): Map<string, number>; |
| |
| |
| |
| betweennessCentrality(): Map<string, number>; |
| |
| |
| |
| save(): void; |
| |
| |
| |
| load(): void; |
| |
| |
| |
| clear(): void; |
| |
| |
| |
| stats(): { |
| nodes: number; |
| edges: number; |
| hyperedges: number; |
| }; |
| } |
| |
| |
| |
| export declare function createCodeDependencyGraph(storagePath?: string): CodeGraph; |
| export default CodeGraph; |
| |