Merge pull request #7 from CorayThan/master

Adding embedded type definition file.
This commit is contained in:
Andrei Kashcha 2018-12-06 19:26:28 -08:00 committed by GitHub
commit 7dfd70af46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

27
index.d.ts vendored Normal file
View 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
}