mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Added types for node-dijkstra * Removed default export * Changed name type to String and parameter renamed * Fixed string types.
13 lines
277 B
TypeScript
13 lines
277 B
TypeScript
import Graph = require('node-dijkstra');
|
|
|
|
const graph = new Graph();
|
|
const graph2 = new Graph([{A: {B: 1}}]);
|
|
|
|
graph
|
|
.addNode('A', {B: 1})
|
|
.removeNode('C');
|
|
|
|
graph2.path('A', 'B');
|
|
graph.path('A', 'B', {cost: false, reverse: true});
|
|
graph.path('A', 'B', {cost: true});
|