mirror of
https://github.com/anvaka/ngraph.path.git
synced 2026-01-18 15:13:12 +00:00
Merge pull request #7 from CorayThan/master
Adding embedded type definition file.
This commit is contained in:
commit
7dfd70af46
27
index.d.ts
vendored
Normal file
27
index.d.ts
vendored
Normal file
@ -0,0 +1,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
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user