Expand all

ve.dm.RebaseServer

Constructor

new ve.dm.RebaseServer([logCallback]) #

DataModel rebase server

Parameters:

Name Type Attributes Description
logCallback function optional
Source:
DataModel rebase server

Methods

applyChange(doc, authorId, backtrack, change) → {ve.dm.Change} #

Attempt to rebase and apply a change to a document.

The change can be a new change, or a continued change. A continuated change means one that follows on immediately from the author's last submitted change, other than possibly being rebased onto some more recent committed history.

Parameters:

Name Type Description
doc string

Document name

authorId number

Author ID

backtrack number

How many transactions are backtracked from the previous submission

change ve.dm.Change

Change to apply

Source:

Returns:

Accepted change (or initial segment thereof), as rebased

Type
ve.dm.Change
Attempt to rebase and apply a change to a document.

clearDocState(doc) #

Forget all history for a document

Parameters:

Name Type Description
doc string

Name of a document

Source:
Forget all history for a document

getDocState(doc) → {ve.dm.RebaseDocState} #

Get the state of a document by name.

Parameters:

Name Type Description
doc string

Name of a document

Source:

Returns:

Document state

Type
ve.dm.RebaseDocState
Get the state of a document by name.

updateDocState(doc, authorId, [newHistory], [authorDataChanges]) #

Update document history

Parameters:

Name Type Attributes Description
doc string

Name of a document

authorId number | null

Author ID

newHistory ve.dm.Change optional

New history to append

authorDataChanges Object optional

New values for author data (modified keys only)

Source:
Update document history