0.0.35 • Published 6 months ago

@types/javascript-astar v0.0.35

Weekly downloads
14
License
MIT
Repository
github
Last release
6 months ago

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

// Type definitions for javascript-astar
// Project: https://github.com/bgrins/javascript-astar
// Definitions by: brian ridley <https://github.com/ptlis>, Mike Lazer-Walker <https://github.com/lazerwalker>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare class Graph {
    grid: Array<Array<GridNode>>;
    constructor(grid: Array<Array<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
        }
    ): Array<GridNode>;
    var heuristics: Heuristics;
}

Additional Details

  • Last updated: Thu, 08 Jul 2021 14:23:24 GMT
  • Dependencies: none
  • Global values: Graph, GridNode, astar

Credits

These definitions were written by brian ridley, and Mike Lazer-Walker.

0.0.32

8 months ago

0.0.33

7 months ago

0.0.34

6 months ago

0.0.35

6 months ago

0.0.31

3 years ago

0.0.30

5 years ago

0.0.29

7 years ago

0.0.28

8 years ago

0.0.27

8 years ago

0.0.26-alpha

8 years ago

0.0.25-alpha

8 years ago

0.0.24-alpha

8 years ago

0.0.23-alpha

8 years ago

0.0.22-alpha

8 years ago

0.0.21-alpha

8 years ago

0.0.20-alpha

8 years ago

0.0.15-alpha

8 years ago

0.0.14-alpha

8 years ago