import { DataOptions } from '../algorithm/types.js'; import { NodeData, EdgeData, GraphNode, GraphEdge, GraphData, Graph } from '../types/data.js'; import { ID } from '../types/id.js'; declare class GraphLib { nodeMap: Map>; edgeMap: Map>; private degreeCache?; private inAdjacencyCache?; private outAdjacencyCache?; private bothAdjacencyCache?; private nodeIndexCache?; private indexNodeCache?; private edgeIdCounter; constructor(data: GraphData, options?: DataOptions); data(): Graph; replace(result: Graph): void; nodes(): GraphNode[]; node(id: ID): GraphNode | undefined; nodeAt(index: number): GraphNode | undefined; nodeIndexOf(id: ID): number; firstNode(): GraphNode | undefined; forEachNode(callback: (node: GraphNode, index: number) => void): void; originalNode(id: ID): N | undefined; nodeCount(): number; edges(): GraphEdge[]; edge(id: ID): GraphEdge | undefined; firstEdge(): GraphEdge | undefined; forEachEdge(callback: (edge: GraphEdge, index: number) => void): void; originalEdge(id: ID): E | undefined; edgeCount(): number; getEdgeId(edge: E): string; degree(nodeId: ID, direction?: 'in' | 'out' | 'both'): number; neighbors(nodeId: ID, direction?: 'in' | 'out' | 'both'): ID[]; successors(nodeId: ID): ID[]; predecessors(nodeId: ID): ID[]; setNodeOrder(nodes: GraphNode[]): void; clearCache(): void; private buildDegreeCache; private buildAdjacencyCache; private buildNodeIndexCache; destroy(): void; } declare function initNodePosition(model: GraphLib, width: number, height: number, dimensions?: 2 | 3): void; export { GraphLib, initNodePosition };