/** Read a metadata object, tolerating a missing/empty/corrupt file as `null` * (never throws). Callers that reindex/revive the whole canvas must not crash on * one damaged node. Read only while holding {@link withMetaLock} for any * read-modify-write that races other writers. */ export declare function readMetaObject(path: string): Record | null; /** Serialize every read-modify-write to one node's meta.json behind a single * cross-process lock, so a migration and a normal identity update can never * interleave into a lost write or a restored-legacy-prefix. The lock is NOT * re-entrant — the operation must use {@link writeMetaObjectLocked}, never the * lock-taking {@link writeJsonFileDurably}. */ export declare function withMetaLock(path: string, operation: () => T): T; /** Collision-free durable write (fsync file + parent dir), assuming the caller * already holds {@link withMetaLock} for `path`. */ export declare function writeMetaObjectLocked(path: string, value: unknown): void; /** Serialize a normal identity write with migrations and use a collision-free durable temp file. */ export declare function writeJsonFileDurably(path: string, value: unknown): void; /** Transform one metadata object in place while holding the same lock normal * writes honor. The transform MUTATES the passed object and returns whether it * changed anything; only a `true` return persists the mutated object. */ export declare function updateJsonFileDurably(path: string, transform: (value: Record) => boolean): boolean;