# @types/kd-tree-javascript

> TypeScript definitions for kd-tree-javascript

Latest version **1.0.3** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/kd-tree-javascript
pnpm add @types/kd-tree-javascript
yarn add @types/kd-tree-javascript
bun add @types/kd-tree-javascript
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2023-11-07 |
| First published | 2020-01-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51431 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/kd-tree-javascript
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/kd-tree-javascript
- npm.io page: https://npm.io/package/@types/kd-tree-javascript

## Recent versions

- 1.0.3 (latest) — 2023-11-07
- 1.0.1 (ts3.8) — 2021-12-24
- 1.0.0 (ts2.8) — 2020-01-16
- 1.0.2 — 2023-10-18

## README

# Installation
> `npm install --save @types/kd-tree-javascript`

# Summary
This package contains type definitions for kd-tree-javascript (https://github.com/ubilabs/kd-tree-javascript#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/kd-tree-javascript.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/kd-tree-javascript/index.d.ts)
````ts
export class kdTree<T> {
    // Create a new tree from a list of points, a distance function, and a
    // list of dimensions.
    constructor(points: T[], distance: (a: T, b: T) => number, dimensions: Array<keyof T>);

    // Query the nearest *count* neighbors to a point, with an optional
    // maximal search distance.
    // Result is an array with *count* elements.
    // Each element is an array with two components: the searched point and
    // the distance to it.
    nearest(point: T, count: number, maxDistance?: number): Array<[T, number]>;

    // Insert a new point into the tree.  Must be consistent with previous
    // contents.
    insert(point: T): void;

    // Remove a point from the tree by reference.
    remove(point: T): void;

    // Get an approximation of how unbalanced the tree is.
    // The higher this number, the worse query performance will be.
    // It indicates how many times worse it is than the optimal tree.
    // Minimum is 1. Unreliable for small trees.
    balanceFactor(): number;
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:38 GMT
 * Dependencies: none

# Credits
These definitions were written by .

---
_Source: https://npm.io/package/@types/kd-tree-javascript · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
