@types/kdbush
Version:
TypeScript definitions for kdbush
47 lines (38 loc) • 1.36 kB
Markdown
# Installation
> `npm install --save @types/kdbush`
# Summary
This package contains type definitions for kdbush (https://github.com/mourner/kdbush).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/kdbush.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/kdbush/index.d.ts)
````ts
type Points = number[][];
type Get<T> = (point: T) => number;
type ArrayType =
| typeof Int8Array
| typeof Int16Array
| typeof Int32Array
| typeof Float32Array
| typeof Float64Array
| typeof Uint8Array
| typeof Uint16Array
| typeof Uint32Array
| typeof Array;
declare class KDBush<T> {
constructor(points: Points);
constructor(points: T[], getX: Get<T>, getY: Get<T>, nodeSize?: number, ArrayType?: ArrayType);
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[];
}
export = KDBush;
export as namespace KDBush;
````
### Additional Details
* Last updated: Tue, 07 Nov 2023 20:08:00 GMT
* Dependencies: none
# Credits
These definitions were written by [DenisCarriere](https://github.com/DenisCarriere), and [SangYeob Bono Yu](https://github.com/deminoth).