-
Notifications
You must be signed in to change notification settings - Fork 187
/
index.d.ts
29 lines (20 loc) · 1.23 KB
/
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
28
29
// 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
import { Graph, Link, Node, NodeId } from "ngraph.graph"
declare module "ngraph.path" {
interface PathFinderOptions<NodeData, LinkData> {
oriented?: boolean
quitFast?: boolean
heuristic?: (from: Node<NodeData>, to: Node<NodeData>) => number
distance?: (from: Node<NodeData>, to: Node<NodeData>, link: Link<LinkData>) => number
blocked?: (from: Node<NodeData>, to: Node<NodeData>, link: Link<LinkData>) => boolean
}
interface PathFinder<NodeData> {
find: (from: NodeId, to: NodeId) => Node<NodeData>[]
}
export function aStar<NodeData, LinkData>(graph: Graph<NodeData, LinkData>, options?: PathFinderOptions<NodeData, LinkData>): PathFinder<NodeData>
export function aGreedy<NodeData, LinkData>(graph: Graph<NodeData, LinkData>, options?: PathFinderOptions<NodeData, LinkData>): PathFinder<NodeData>
export function nba<NodeData, LinkData>(graph: Graph<NodeData, LinkData>, options?: PathFinderOptions<NodeData, LinkData>): PathFinder<NodeData>
}