1+ declare type NodeId = string ;
2+ declare type EdgeWeight = number ;
3+ declare type EncodedEdge = string ;
4+ interface Serialized {
5+ nodes : {
6+ id : NodeId ;
7+ } [ ] ;
8+ links : {
9+ source : NodeId ;
10+ target : NodeId ;
11+ weight : EdgeWeight ;
12+ } [ ] ;
13+ }
14+ declare function Graph ( serialized ?: Serialized ) : {
15+ addNode : ( node : string ) => any ;
16+ removeNode : ( node : string ) => any ;
17+ nodes : ( ) => string [ ] ;
18+ adjacent : ( node : string ) => string [ ] ;
19+ addEdge : ( u : string , v : string , weight : number ) => any ;
20+ removeEdge : ( u : string , v : string ) => any ;
21+ setEdgeWeight : ( u : string , v : string , weight : number ) => any ;
22+ getEdgeWeight : ( u : string , v : string ) => number ;
23+ indegree : ( node : string ) => number ;
24+ outdegree : ( node : string ) => number ;
25+ depthFirstSearch : ( sourceNodes ?: string [ ] | undefined , includeSourceNodes ?: boolean ) => string [ ] ;
26+ lowestCommonAncestors : ( node1 : string , node2 : string ) => string [ ] ;
27+ topologicalSort : ( sourceNodes : string [ ] , includeSourceNodes ?: boolean ) => string [ ] ;
28+ shortestPath : ( source : string , destination : string ) => string [ ] & {
29+ weight ?: number | undefined ;
30+ } ;
31+ serialize : ( ) => Serialized ;
32+ deserialize : ( serialized : Serialized ) => any ;
33+ } ;
34+ //# sourceMappingURL=index.d.ts.map
0 commit comments