Skip to content

CollaborationDocument

Confirmed ordering and optimistic text have independent engines and snapshot ownership.

new CollaborationDocument(options, undo?): CollaborationDocument

CollaborationDocumentOptions

UndoOptions

CollaborationDocument

readonly engine: TextbufferEngine


readonly genesis: Checkpoint


readonly participant: Participant<TextbufferSnapshot>

apply(record): boolean

Confirmation<Envelope>

boolean

DocumentEngine.apply


applyBatch(records): boolean

Applies the valid prefix and publishes its projection once, including on failure.

readonly Confirmation<Envelope>[]

boolean

DocumentEngine.applyBatch


authoredEffects(): readonly object[]

readonly object[]


checkpoint(): Checkpoint

Checkpoint

DocumentEngine.checkpoint


confirmedSnapshot(): TextbufferSnapshot

TextbufferSnapshot


exportHistory(from): readonly Confirmation<Envelope>[] | undefined

Checkpoint

readonly Confirmation<Envelope>[] | undefined

DocumentEngine.exportHistory


historyIdentity(): string

Bind local effect state and retain every already-known foreign identity.

string


install(history, recovered?): void

readonly Confirmation<Envelope>[]

readonly Envelope[]

void

DocumentEngine.install


matchesHistoryIdentity(saved): boolean

string

boolean


outcome(id): Outcome | undefined

EditId

Outcome | undefined

DocumentEngine.outcome


sequence(edit, rejection?): Confirmation<Envelope>

Envelope

string

Confirmation<Envelope>

DocumentEngine.sequence


sequenceBatch(edits): readonly Confirmation<Envelope>[]

readonly object[]

readonly Confirmation<Envelope>[]

DocumentEngine.sequenceBatch


subscribeConfirmed(observer): () => void

(reset, remote) => void

() => void


uniquePending(history): readonly Envelope[]

readonly Confirmation<Envelope>[]

readonly Envelope[]

DocumentEngine.uniquePending


verify(history, tip): boolean

readonly Confirmation<Envelope>[]

Checkpoint

boolean

DocumentEngine.verify