// generated by diplomat-tool import type { Brush } from "./Brush.mjs" import type { CellularSdfConfig } from "./CellularSdfConfig.mjs" import type { GeneratedChunk } from "./GeneratedChunk.mjs" import type { GeneratedChunkOverlayMode } from "./GeneratedChunkOverlayMode.mjs" import type { GeneratedWorldStream } from "./GeneratedWorldStream.mjs" import type { NucleationError } from "./NucleationError.mjs" import type { Sdf } from "./Sdf.mjs" import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; /** * An immutable native chunk source graph. * * Generated bindings expose concrete source constructors rather than host * callbacks, so SDF evaluation and block placement stay entirely in Rust. */ export class WorldGenerator { /** @internal */ get ffiValue(): pointer; /** @internal */ constructor(); /** * Create an SDF-backed source evaluated at voxel centers over the inclusive * Y range. `source_id` and `version` become chunk provenance/cache metadata. */ static sdf(volume: Sdf, material: Brush, minY: number, maxY: number, sourceId: string, version: string): WorldGenerator; /** * Create a sparse infinite source by placing a bounded SDF motif once per * deterministically transformed cell. Reuse `config` across layers to keep * terrain, water, vegetation, paths, and structures coordinated. */ static cellularSdf(volume: Sdf, material: Brush, minY: number, maxY: number, config: CellularSdfConfig, sourceId: string, version: string): WorldGenerator; /** * Create a sparse source from projected building footprints, including * caller-projected OSM-derived data. * `buildings_json` uses the same schema as `Geo.extrude_footprints`: * `[{"polygon":[[x,z],...],"height":40,"min_y":1, * "block":"minecraft:bricks"}]`. `height` is the absolute top Y, matching * `Geo.extrude_footprints`. Fetching and lat/lon projection stay * caller-controlled; this source rasterizes only requested chunks. */ static projectedFootprints(buildingsJson: string, baseBlock: string, sourceId: string, version: string): WorldGenerator; /** * Create an initially empty ordered source composition. */ static composite(sourceId: string, version: string): WorldGenerator; /** * Append a source to a composite. Later `Replace` layers win at occupied * voxels; `KeepExisting` layers only fill air. Errors on non-composites. * * Streams already created from this generator keep the layer list they * were built with; only later `generate`/`stream` calls see the addition. */ addLayer(source: WorldGenerator, mode: GeneratedChunkOverlayMode): void; /** * Generate one random-access chunk. */ generate(cx: number, cz: number): GeneratedChunk; /** * Traverse an inclusive chunk rectangle lazily in canonical region-major * order. The stream snapshots the generator's sources at creation, so * later `add_layer` calls do not affect a stream already in flight. */ stream(minCx: number, minCz: number, maxCx: number, maxCz: number): GeneratedWorldStream; }