# @types/bintrees

> TypeScript definitions for bintrees

Latest version **1.0.6** (published 2023-11-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/bintrees
pnpm add @types/bintrees
yarn add @types/bintrees
bun add @types/bintrees
```

## 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.6 |
| Published | 2023-11-06 |
| First published | 2016-11-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51418 |
| Maintainers | types |

## Links

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

## Recent versions

- 1.0.6 (latest) — 2023-11-06
- 1.0.3 (ts3.4) — 2021-02-17
- 1.0.2 (ts2.0) — 2017-07-20
- 1.0.5 — 2023-10-17
- 1.0.4 — 2023-09-15
- 1.0.1 — 2017-02-07
- 1.0.0 — 2016-11-30

## README

# Installation
> `npm install --save @types/bintrees`

# Summary
This package contains type definitions for bintrees (https://github.com/vadimg/js_bintrees).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bintrees.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bintrees/index.d.ts)
````ts
declare module "bintrees" {
    type Callback<T> = (item: T) => void;
    type Comparator<T> = (a: T, b: T) => number;

    class Iterator<T> {
        constructor(tree: TreeBase<T>);

        data(): T | null;

        next(): T | null;

        prev(): T | null;
    }

    class TreeBase<T> {
        size: number;

        clear(): void;

        find(data: T): T | null;

        findIter(data: T): Iterator<T> | null;

        lowerBound(item: T): Iterator<T>;

        upperBound(item: T): Iterator<T>;

        min(): T | null;

        max(): T | null;

        iterator(): Iterator<T>;

        each(cb: Callback<T>): void;

        reach(cb: Callback<T>): void;
    }

    export class RBTree<T> extends TreeBase<T> {
        constructor(comparator: Comparator<T>);

        insert(item: T): boolean;

        remove(item: T): boolean;
    }

    export class BinTree<T> extends TreeBase<T> {
        constructor(comparator: Comparator<T>);

        insert(item: T): boolean;

        remove(item: T): boolean;
    }
}

````

### Additional Details
 * Last updated: Mon, 06 Nov 2023 22:41:04 GMT
 * Dependencies: none

# Credits
These definitions were written by [Cayle Sharrock](https://github.com/CjS77).

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