From 1c7a094acfcd5e150797264447218f82ede89549 Mon Sep 17 00:00:00 2001 From: Nathan Westlake Date: Thu, 6 Dec 2018 14:18:35 -0800 Subject: [PATCH] Adding embedded type definition file. --- index.d.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..13190ef --- /dev/null +++ b/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for ngraph.path v1.0.2 +// Project: https://github.com/anvaka/ngraph.path +// Definitions by: Nathan Westlake +// 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 + +}