// generated by diplomat-tool import type { NucleationError } from "./NucleationError.mjs" import type { WorldChunkView } from "./WorldChunkView.mjs" import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; /** * A world writer. `finish` is consuming (PORTING rule 11): the inner sink is * held in an `Option` and taken on `finish`; every method afterwards returns * `AlreadyConsumed`. Dropping the handle without `finish` abandons the sink. */ export class WorldSink { /** @internal */ get ffiValue(): pointer; /** @internal */ constructor(); /** * Create a new world sink that writes fresh chunk data to `dir`. * `options_json` is a serialized `WorldExportOptions` (empty string = * defaults). */ static create(dir: string, optionsJson: string): WorldSink; /** * Open an existing world directory for patching via `put_chunk`. */ static openExisting(dir: string): WorldSink; /** * Write (append) a chunk view into the sink. The view is not consumed. */ writeChunk(view: WorldChunkView): void; /** * Overwrite the chunk at (`view.cx`, `view.cz`) of the sink's world with * the supplied view's block data. Only valid on sinks opened with * `open_existing`; errors with `Io` on a create-mode sink. The view is * not consumed. */ putChunk(view: WorldChunkView): void; /** * Finalise and flush all pending writes. Consuming (PORTING rule 11): * afterwards every method on this sink returns `AlreadyConsumed`. */ finish(): void; }