Installation
npm install --save @types/javascript-astar
Summary
This package contains type definitions for javascript-astar (https://github.com/bgrins/javascript-astar).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/javascript-astar.
index.d.ts
declare class Graph {
grid: GridNode[][];
constructor(grid: number[][], options?: { diagonal?: boolean | undefined });
}
declare class GridNode {
x: number;
y: number;
}
interface Heuristic {
(pos0: { x: number; y: number }, pos1: { x: number; y: number }): number;
}
interface Heuristics {
manhattan: Heuristic;
diagonal: Heuristic;
}
declare namespace astar {
function search(
graph: Graph,
start: { x: number; y: number },
end: { x: number; y: number },
options?: {
closest?: boolean | undefined;
heuristic?: Heuristic | undefined;
},
): GridNode[];
var heuristics: Heuristics;
}
Additional Details
- Last updated: Mon, 20 Nov 2023 23:36:24 GMT
- Dependencies: none
Credits
These definitions were written by brian ridley, and Mike Lazer-Walker.