import type { Vector3Like } from "three"; import { VoxelLayer, type VoxelLayerConfigurableOptions } from "./VoxelLayer.ts"; import { VoxelChunk } from "./VoxelChunk.ts"; import type { VoxelEntry, VoxelCoord } from "./types.ts"; import type { FACE } from "../utils/math.ts"; import type { VoxelObjectJSON, VoxelObjectLayerJSON } from "../serialization/VoxelSerializer.ts"; export type IterableLayerChunk = { layer: VoxelLayer; chunk: VoxelChunk; }; /** * Top-level container for layered voxel data. * * Layers are composited top-to-bottom: when multiple layers contain a voxel at * the same world position, the one with the highest `order` value wins. * This allows decorative layers to override base terrain non-destructively. */ export declare class VoxelWorld { #private; readonly chunkSize: number; constructor(chunkSize?: number); addLayer(name: string, options?: VoxelLayerConfigurableOptions): VoxelLayer; updateLayer(name: string, options: Partial): boolean; removeLayer(name: string): boolean; moveLayer(name: string, direction: "up" | "down"): void; setLayerVisible(name: string, visible: boolean): void; setLayerOffset(name: string, offset: VoxelCoord): void; translateLayer(name: string, delta: VoxelCoord): void; getLayers(): readonly VoxelLayer[]; getLayer(name: string): VoxelLayer | undefined; addObjectLayer(name: string, options?: Partial>): VoxelObjectLayerJSON; removeObjectLayer(name: string): boolean; getObjectLayer(name: string): VoxelObjectLayerJSON | undefined; getObjectLayers(): readonly VoxelObjectLayerJSON[]; updateObjectLayer(name: string, patch: Partial>): boolean; addObjectToLayer(layerName: string, object: VoxelObjectJSON): boolean; removeObjectFromLayer(layerName: string, objectId: string): boolean; updateObjectInLayer(layerName: string, objectId: string, patch: Partial): boolean; /** * Returns the voxel entry at (x, y, z) from the highest-priority visible * layer that has data there. Returns undefined for air. * * This is the function the mesh builder always calls for neighbour lookups, * giving it transparent cross-chunk and cross-layer visibility. */ getVoxelAt(position: Vector3Like): VoxelEntry | undefined; getVoxelNeighbour(position: Vector3Like, face: FACE): VoxelEntry | undefined; setVoxelAt(layerName: string, position: Vector3Like, entry: VoxelEntry): void; removeVoxelAt(layerName: string, position: Vector3Like): void; getAllDirtyChunks(): IterableIterator; getAllChunks(): IterableIterator; getAllChunksToBeRemoved(): IterableIterator; clear(): void; } //# sourceMappingURL=VoxelWorld.d.ts.map