/** * The one way the CLI reads and writes a project's `src/work/world.json`. * * Three commands rewrite that file — `generate` (apply-patches), `forge` / the dev editor * (apply-modifications) and `upgrade` (legacy default-asset repoint) — and each used to carry its * own copy of the same read → parse → guard → temp-file → rename block. The temp file's NAME is a * contract, not a detail: `editor/watch.ts` ignores `.world.json.*.tmp` so a half-written file * never triggers a rebuild, and the two-space + trailing-newline form is what every reader and * every reviewable diff expects. One module, so the next change to either lands once. */ export type JsonObject = Record; export declare function isJsonObject(value: unknown): value is JsonObject; /** * Read and parse a world.json, throwing a CliError that names the file for every failure mode — * missing, unreadable, not JSON, not an object. Every caller today wants exactly that: an * operation on a world it cannot read must stop before it changes anything. */ export declare function readWorldJson(worldPath: string): JsonObject; /** * Write the whole document, two-space indent, trailing newline, through a temp file in the same * directory renamed over the original — so an interrupted write cannot leave a truncated * world.json behind. If the write itself fails the temp file is removed rather than left as a * stray dot-file the next `bitmagic upgrade`'s clean-tree gate would trip over. */ export declare function writeWorldJsonAtomic(worldPath: string, world: JsonObject): void;