import type { Stringifiable } from '..'; /** The kind of input required to store a vector for proper indexing */ export interface KDKV { x: number; y: number; data: T; } /** Represents a vector store or an array */ export interface KDStore { push: (value: KDKV) => void; get: (index: number) => KDKV; getRange: (indexStart: number, indexEnd: number) => KDKV[]; length: number; values: () => Generator>; sort: () => void; [Symbol.iterator]: () => Generator>; close: () => void; } /** A constructor for a vector store */ export type KDStoreConstructor = new (nodeSize: number) => KDStore; /** A local KD key-value store */ export declare class KDSpatialIndex implements KDStore { #private; private readonly nodeSize; /** * @param nodeSize - the size of each kd-tree node */ constructor(nodeSize?: number); /** @returns the length of the store */ get length(): number; /** * Push a value into the store * @param value - the value to store */ push(value: KDKV): void; /** * Get a value at index * @param index - the position in the store to get the value from * @returns the value */ get(index: number): KDKV; /** * Get a range of values within an index range * @param indexStart - the start index * @param indexEnd - the end index * @returns the values */ getRange(indexStart: number, indexEnd: number): KDKV[]; /** * iterate through the values * @yields an iterator */ values(): Generator>; /** Sort the store in place */ sort(): void; /** * iterate through the values * @returns an iterator */ [Symbol.iterator](): Generator>; /** Closes the store */ close(): void; } //# sourceMappingURL=index.d.ts.map