import * as THREE from 'three'; /** Populates chunk `(cx, cz)` by adding content to the pooled `Group`; may be async (chunk streaming). */ export type ChunkBuilder = (cx: number, cz: number, chunk: THREE.Group) => void | Promise; /** Options for {@link createChunkManager}: chunk size, view radius in chunks, origin-rebase threshold, and the `build` callback. */ export interface ChunkManagerOptions { chunkSize: number; viewRadius: number; rebaseThreshold?: number; build: ChunkBuilder; } /** Infinite-world chunk streamer. Call `update(cameraWorldPos)` each frame (or on movement); `dispose()` releases every chunk. */ export interface ChunkManager { root: THREE.Group; update(cameraWorldPos: THREE.Vector3): Promise; dispose(): void; readonly loadedCount: number; readonly pooledCount: number; } /** * Infinite-world chunk manager: keeps a `viewRadius` ring of chunks built * around the camera, pooling and recycling `Group` instances on movement, * and rebases the world origin past `rebaseThreshold` to dodge float32 * precision rot. * * @param options - Chunk size, view radius, rebase threshold (default 4096), * and the chunk `build` callback. * @returns A {@link ChunkManager}; add `root` to the scene. * @throws Error when `chunkSize` is missing or zero. * @remarks `update` is async — builds may stream in over multiple frames; * recycled chunks are cleared and reused, not disposed, until `dispose()`. */ export declare function createChunkManager({ chunkSize, viewRadius, rebaseThreshold, build, }: ChunkManagerOptions): ChunkManager; //# sourceMappingURL=chunk-manager.d.ts.map