forked from anvaka/ngraph.path
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
27 lines (19 loc) · 874 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Type definitions for ngraph.path v1.0.2
// Project: https://github.com/anvaka/ngraph.path
// Definitions by: Nathan Westlake <https://github.com/CorayThan>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "ngraph.path" {
import { Graph, Link, Node, NodeId } from "ngraph.graph"
interface PathFinderOptions {
oriented?: boolean
quitFast?: boolean
heuristic?: (from: NodeId, to: NodeId) => number
distance?: (from: NodeId, to: NodeId, link: Link) => number
}
interface PathFinder {
find: (from: NodeId, to: NodeId) => Node[]
}
export function aStar(graph: Graph, options?: PathFinderOptions): PathFinder
export function aGreedy(graph: Graph, options?: PathFinderOptions): PathFinder
export function nba(graph: Graph, options?: PathFinderOptions): PathFinder
}