InitialRoot

typealias InitialRoot = Map<String, suspend JsonObject.(key: String) -> Unit>

Initializers for missing root keys when attaching a Document.

Each map key is authoritative: its initializer receives that key and is invoked only when the server-provided root does not contain it. The absence guard checks only the mapped key itself — an initializer is expected to write only that key; writes to other keys are not guarded against and are not part of the documented contract. Initial values become ordinary Yorkie changes but are history-exempt via skipHistory, so they never enter the undo/redo history. Concurrent first attachments may both initialize a missing key and converge through normal CRDT conflict resolution.

The initializer is a suspend JsonObject.(key: String) -> Unit lambda, which is awkward to construct from Java; Java consumers should prefer the no-initialRoot attachDocument overload instead.