export declare class Node { readonly id: string; value: T; incomingNeighbors: string[]; constructor(id: string, value: T); } export declare enum SearchAlgorithmNodeBehavior { continue = 0, break = 1 } export type OnNodeFn = (node: Node, cost?: number) => SearchAlgorithmNodeBehavior; export type OnNodeFnAsync = (node: Node, cost?: number) => Promise; export interface Options { weighted?: boolean; } export interface NodeDistance { [nodeId: string]: number; } export declare class Graph { private _nodes; private _nodesById; private _edges; readonly weighted: boolean; constructor({ weighted }?: Options); private getNodeById; addNode(value: Node): void; addEdge(node1: Node, node2: Node, weight?: number): void; removeNode(node: Node): void; removeEdge(node1: Node, node2: Node): void; isEmpty(): boolean; getNeighbors(node: Node): Array>; kahnTopologicalSort(): Array>; bfs(onNode: OnNodeFn, initialNode?: Node): void; bfsAsync(onNode: OnNodeFnAsync, initialNode?: Node): Promise; dfs(onNode: OnNodeFn, initialNode?: Node): void; dfsAsync(onNode: OnNodeFnAsync, initialNode?: Node): Promise; dijkstra(originalNode: Node): NodeDistance; }