namereadonly | string | — | — |
load | () => EditorDocument | — | The current document materialized from CRDT state. |
applyLocal | (tr: Transaction) => void | — | Translate a local transaction's steps into CRDT ops and apply them. |
applyUpdate | (bytes: Uint8Array, origin?: unknown) => void | — | Merge a remote update (encoded ops) into the CRDT. |
encodeStateVector | () => Uint8Array | — | Encode this replica's version vector for a sync handshake. |
encodeDelta | (remoteStateVector?: Uint8Array) => Uint8Array | — | Encode ops a remote is missing (by its state vector); omit for a full snapshot. |
onLocalOps | (listener: (bytes: Uint8Array) => void) => () => void | — | Subscribe to locally-produced op batches (to broadcast). Returns unsubscribe. |
onRemoteApplied | (listener: () => void) => () => void | — | Subscribe to "remote ops were applied" (to reflect into editor state). Returns unsubscribe. |
setLocalSelection | (selection: Selection | null) => void | — | Publish the local selection as presence (anchored to char ids). |
onLocalAwareness | (listener: (bytes: Uint8Array) => void) => () => void | — | Subscribe to locally-produced awareness frames (to broadcast). Returns unsubscribe. |
applyAwareness | (bytes: Uint8Array) => void | — | Merge a remote awareness frame. |
onAwareness | (listener: (cursors: RemoteCursor[]) => void) => () => void | — | Subscribe to the resolved set of remote cursors. Returns unsubscribe. |
gc | (stableStateVector?: Uint8Array) => { blocks: number; chars: number; } | — | Compact tombstones and removed blocks covered by `stableStateVector` (or this
replica's version when omitted). Safe only at quiescence — all peers fully
synced, nothing in flight. Returns how much was dropped. |
destroy | () => void | — | — |