import { LatLng, type LatLngBoundsLike, type LatLngLike } from "../geo.js"; export type SpatialId = string | number; export interface SpatialRecord { id: TId; position: LatLng; value: TValue; } interface StoredRecord extends SpatialRecord { cell: number; prev: TId | null; next: TId | null; } export declare class SpatialGridIndex { #private; readonly cellSize: number; readonly records: Map>; /** Packed cell id → linked-list head id. */ readonly cells: Map; readonly xCellCount: number; readonly yCellCount: number; constructor(cellSize?: number); get size(): number; get cellCount(): number; set(id: TId, position: LatLngLike, value: TValue): this; /** Skip `latLng()` parsing — used for 100k–1M point ingest. */ setLatLng(id: TId, latitude: number, longitude: number, value: TValue): this; get(id: TId): SpatialRecord | undefined; has(id: TId): boolean; delete(id: TId): boolean; clear(): void; values(): Array>; search(value: LatLngBoundsLike, predicate?: (record: SpatialRecord) => boolean): Array>; searchIds(value: LatLngBoundsLike, predicate?: (id: TId, value: TValue) => boolean): TId[]; } export declare function spatialGridIndex(cellSize?: number): SpatialGridIndex; export {}; //# sourceMappingURL=spatial-grid-index.d.ts.map