forked from perliedman/geojson-path-finder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
24 lines (19 loc) · 872 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
declare module 'geojson-path-finder' {
import {Feature, FeatureCollection, GeoJsonProperties, LineString, Point, Position} from 'geojson';
export type Weight = number | { forward?: number, backward?: number }
export type PathFinderOptions<A, G> = {
weightFn?: (a: Position, b: Position, options: PathFinderOptions<A, G>) => Weight,
precision?: number,
edgeDataReduceFn?: (left: A | undefined, right: A | G) => A,
edgeDataSeed?: A | -1
}
export type Route<A> = {
path: Position[],
edgeDatas?: [{ reducedEdge: A }],
weight: number
}
export default class PathFinder<A = undefined, G = GeoJsonProperties> {
constructor(geoJson: FeatureCollection<LineString, G>, options?: PathFinderOptions<A, G>)
findPath(start: Feature<Point>, finish: Feature<Point>): Route<A>
}
}