import { Bounds, BoundedObject } from './utils/bounds'; export declare class Quadtree { private readonly _config; private readonly _baseBounds; private _root; constructor(bounds: Bounds, config?: Partial); /** * Clears the quadtree. * * @timeComplexity `O(1)` */ clear(): void; /** * Inserts an item into the quadtree. * * @param item The item to insert. * * @timeComplexity `O(n)` / `Ω(log(n))` */ insert(item: T): void; /** * Retrieves all objects that is inside the specified bounds. * * @param location The location of the object to retrieve from. * * @timeComplexity `O(n)` / `Ω(log(n))` * * @returns An array of objects that are inside the specified bounds. */ retrieve(location: T | Bounds | BoundedObject): T[]; config(): { /** * The minimum width of a node before it can be split. * @default 48 */ minWidth: number; /** * The minimum height of a node before it can be split. * @default 48 */ minHeight: number; /** * The maximum depth of the quadtree. * @default 8 */ maxDepth: number; /** * The maximum number of objects a node can hold before it splits. * @default 12 */ maxObjects: number; }; root(): QuadtreeNode; } declare class QuadtreeNode { private readonly _quadtree; private readonly _bounds; private readonly _depth; private _objects; private _nodes; constructor(quadtree: Quadtree, bounds: Bounds, depth?: number); clear(): void; insert(item: T): void; retrieve(location: T | Bounds | BoundedObject): T[]; private _getQuadrantIndices; private _split; } declare const defaultQuadtreeConfig: { /** * The minimum width of a node before it can be split. * @default 48 */ minWidth: number; /** * The minimum height of a node before it can be split. * @default 48 */ minHeight: number; /** * The maximum depth of the quadtree. * @default 8 */ maxDepth: number; /** * The maximum number of objects a node can hold before it splits. * @default 12 */ maxObjects: number; }; export type QuadtreeConfig = typeof defaultQuadtreeConfig; export {};