Package-level declarations

Types

Link copied to clipboard
data class CollabConfig(val startVersion: Int = 0, val clientID: String? = null, val sharedEffects: (Transaction) -> List<StateEffect<*>>? = null)

Configuration for the collaborative editing extension.

Link copied to clipboard
data class SendableUpdate(val changes: ChangeSet, val clientID: String, val effects: List<StateEffect<*>> = emptyList(), val origin: Transaction)

A sendable update that also carries the originating transaction.

Link copied to clipboard
data class Update(val changes: ChangeSet, val clientID: String, val effects: List<StateEffect<*>> = emptyList())

An update is a set of changes and effects.

Functions

Link copied to clipboard
fun collab(config: CollabConfig = CollabConfig()): Extension

Create an instance of the collaborative editing plugin.

Link copied to clipboard

Get this editor's collaborative editing client ID.

Link copied to clipboard

Get the version up to which the collab plugin has synced with the central authority.

Link copied to clipboard
fun rebaseUpdates(updates: List<Update>, over: List<Update>): List<Update>

Rebase and deduplicate an array of client-submitted updates that came in with an out-of-date version number. over should hold the updates that were accepted since the given version. Will return an array of updates that has updates already accepted filtered out, and has been moved over the other changes so that they apply to the current document version.

Link copied to clipboard

Create a transaction that represents a set of new updates received from the authority. Applying this transaction moves the state forward to adjust to the authority's view of the document.

Link copied to clipboard

Returns the set of locally made updates that still have to be sent to the authority.