Files
DefinitelyTyped/types/kdbush/index.d.ts
Denis e4e4d4223f Publish kdbush definition (#16107)
* Publish kdbush definition

* Definition changes based on comments
@andy-ms

* Add semi-colon
2017-04-25 10:53:46 -07:00

27 lines
806 B
TypeScript

// Type definitions for kdbush 1.0
// Project: https://github.com/mourner/kdbush
// Definitions by: DenisCarriere <https://github.com/DenisCarriere>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
type Points = number[][];
type Get<T> = (point: T) => number;
type ArrayType = typeof Int32Array | typeof Array;
declare class KDBush<T> {
ids: number[];
coords: number[];
nodeSize: number;
points: T[];
range(minX: number, minY: number, maxX: number, maxY: number): number[];
within(x: number, y: number, r: number): number[];
}
interface KDBushStatic {
(points: Points): KDBush<Points>;
<T>(points: T[], getX: Get<T>, getY: Get<T>, nodeSize?: number, ArrayType?: ArrayType): KDBush<T>;
}
declare const kdbush: KDBushStatic;
declare namespace kdbush {}
export = kdbush;