@types/javascript-astar
TypeScript icon, indicating that this package has built-in type declarations

0.0.35 • Public • Published

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.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @types/javascript-astar

      Weekly Downloads

      5

      Version

      0.0.35

      License

      MIT

      Unpacked Size

      4.18 kB

      Total Files

      5

      Last publish

      Collaborators

      • types