import { MaybeAsyncMap, MaybeAsyncMapBatch } from '../map.js'; import { RangeQueryOptions, RangeQueryable } from '../query.js'; import { SyncMapBatchAdapter } from './batchmap.js'; /** An in-memory B-tree structure that implements the Map interface. */ export declare class BTreeMap extends SyncMapBatchAdapter implements MaybeAsyncMap, MaybeAsyncMapBatch, Map, RangeQueryable, Iterable<[K, V]> { /** Order of the tree, which is the maximum branching factor / number of children of a node. Must be >= 2. */ readonly order: number; /** Function that defines the sort order of keys. */ protected readonly compare: (a: K, b: K) => number; protected children: BTreeMap[]; protected nodeKeys: K[]; protected nodeValues: V[]; constructor( /** Order of the tree, which is the maximum branching factor / number of children of a node. Must be >= 2. */ order: number, /** Function that defines the sort order of keys. */ compare?: (a: K, b: K) => number); /** * Returns the number of elements in the tree. * Note that this is an O(N) operation that counts the number of elements in each tree node. */ get size(): number; clear(): void; delete(key: K): boolean; forEach(callbackfn: (value: V, key: K, tree: BTreeMap) => void, thisArg?: unknown): void; get(key: K): V | undefined; has(key: K): boolean; set(key: K, value: V): this; /** Queries entries in this map. */ entries(options?: RangeQueryOptions): IterableIterator<[K, V]>; /** Queries keys in this map. */ keys(options?: RangeQueryOptions): IterableIterator; /** Queries values in this map. */ values(options?: RangeQueryOptions): IterableIterator; [Symbol.iterator](): IterableIterator<[K, V]>; get [Symbol.toStringTag](): string; /** * Returns the number of elements in the current node. */ get nodeSize(): number; /** Returns the minimum number of keys for a non-root node. */ protected get minKeys(): number; /** Assigns RHS to this tree. */ protected assign(rhs: BTreeMap): void; /** * Finds the index at this node that given key should be inserted at, * and whether there is an existing `match`ing key at node. */ protected findKeyIndex(key: K): [index: number, match: boolean]; /** Splits node if it exceeds the max number of keys (order - 1). */ protected splitIfFull(node?: BTreeMap): boolean; /** Iterates through given bounds */ protected iterate(lower: K | undefined, upper: K | undefined, lowerInclusive: boolean, upperInclusive: boolean, limit: number): IterableIterator<[K, V]>; /** Reverse iterates through given bounds */ protected reverseIterate(lower: K | undefined, upper: K | undefined, lowerInclusive: boolean, upperInclusive: boolean, limit: number): IterableIterator<[K, V]>; } //# sourceMappingURL=btreemap.d.ts.map