Members
-
constant addChangedTypeToTransaction
-
If
type.parentwas added in current transaction,typetechnically did not change, it was just added and we should not fire events fortype. -
constant callTypeObservers
-
Call event listeners with an event. This will also add an event to all parents (for
.observeDeephandlers). -
constant contentRefs :Array.<function(AbstractUpdateDecoder): AbstractContent>
-
A lookup map for reading Item content.
-
constant createSnapshot
-
-
constant decodeRelativePosition
-
-
constant decodeSnapshot
-
-
constant decodeSnapshotV2
-
-
constant encodeRelativePosition
-
-
constant encodeSnapshot
-
-
constant encodeSnapshotV2
-
-
constant equalSnapshots
-
-
constant findIndexCleanStart
-
-
constant findMarker
-
Search marker help us to find positions in the associative array faster.
They speed up the process of finding a position without much bookkeeping.
A maximum of
maxSearchMarkerobjects are created.This function always returns a refreshed marker (updated timestamp)
-
constant followRedone
-
- To Do:
-
- This should return several items
-
constant getTypeChildren
-
Accumulate all (list) children of a type and return them as an Array.
-
globalSearchMarkerTimestamp :number
-
A unique timestamp that identifies each marker.
Time is relative,.. this is more like an ever-increasing clock.
-
constant keepItem
-
Make sure that neither item nor any of its parents is ever deleted.
This property does not persist when storing it into a database or when sending it to other peers
-
constant logType
-
Convenient helper to log type information.
Do not use in productive systems as the output can be immense!
-
constant mergeDeleteSets
-
-
constant readContentAny
-
-
constant readContentBinary
-
-
constant readContentFormat
-
-
constant readItemContent
-
-
constant snapshot
-
-
constant splitSnapshotAffectedStructs
-
-
constant tryGc
-
-
constant updateMarkerChanges
-
Update markers when a change happened.
This should be called before doing a deletion!
-
constant writeUpdateMessageFromTransaction
-
Methods
-
cleanupTransactions(transactionCleanups, i)
-
Parameters:
Name Type Description transactionCleanupsArray.<Transaction> inumber -
compareIDs(a, b) → {boolean}
-
Returns:
boolean -
compareRelativePositions(a, b)
-
Parameters:
Name Type Description aRelativePosition | null bRelativePosition | null -
createAbsolutePosition(type, index)
-
Parameters:
Name Type Description typeAbstractType.<any> indexnumber -
createAbsolutePositionFromRelativePosition(rpos, doc) → {AbsolutePosition|null}
-
Parameters:
Name Type Description rposRelativePosition docDoc -
createRelativePosition(type, item)
-
Parameters:
Name Type Description typeAbstractType.<any> itemID | null -
createRelativePositionFromJSON(json) → {RelativePosition}
-
Parameters:
Name Type Description jsonany Returns:
RelativePosition -
createRelativePositionFromTypeIndex(type, index) → {RelativePosition}
-
Create a relativePosition based on a absolute position.
Parameters:
Name Type Description typeAbstractType.<any> The base type (e.g. YText or YArray).
indexnumber The absolute position.
Returns:
RelativePosition -
getState(store, client) → {number}
-
Parameters:
Name Type Description storeStructStore clientnumber Returns:
number -
getStateVector(store) → {Map.<number, number>}
-
Return the states as a Map<client,clock>. Note that clock refers to the next expected clock id.
Parameters:
Name Type Description storeStructStore Returns:
Map.<number, number> -
protected isVisible(item, snapshot)
-
-
iterateDeletedStructs(transaction, ds)
-
Iterate over all structs that the DeleteSet gc's.
Parameters:
Name Type Description transactionTransaction dsDeleteSet -
iterateStructs(transaction, structs, clockStart, len)
-
Iterate over a range of structs
Parameters:
Name Type Description transactionTransaction structsArray.<(Item|GC)> clockStartnumber Inclusive start
lennumber -
markPosition(searchMarker, p, index)
-
Parameters:
Name Type Description searchMarkerArray.<ArraySearchMarker> pItem indexnumber -
overwriteMarker(marker, p, index)
-
This is rather complex so this function is the only thing that should overwrite a marker
Parameters:
Name Type Description markerArraySearchMarker pItem indexnumber -
popStackItem(undoManager, stack, eventType) → nullable {StackItem}
-
Parameters:
Name Type Description undoManagerUndoManager stackArray.<StackItem> eventTypestring Returns:
StackItem -
readRelativePosition(decoder) → {RelativePosition|null}
-
Parameters:
Name Type Description decoderdecoding.Decoder -
readYXmlElement(decoder) → {YXmlElement}
-
Parameters:
Name Type Description decoderAbstractUpdateDecoder Returns:
YXmlElement -
refreshMarkerTimestamp(marker)
-
Parameters:
Name Type Description markerArraySearchMarker -
transact(doc, f, originopt)
-
Implements the functionality of
y.transact(()=>{..})Parameters:
Name Type Attributes Default Description docDoc ffunction originany <optional>
true -
tryGcDeleteSet(ds, store, gcFilter)
-
Parameters:
Name Type Description dsDeleteSet storeStructStore gcFilterfunction -
tryMergeDeleteSet(ds, store)
-
Parameters:
Name Type Description dsDeleteSet storeStructStore -
tryToMergeWithLeft(structs, pos)
-
Parameters:
Name Type Description structsArray.<AbstractStruct> posnumber -
writeRelativePosition(encoder, rpos)
-
Parameters:
Name Type Description encoderencoding.Encoder rposRelativePosition
Type Definitions
-
UndoManagerOptions
-
Properties:
Name Type Attributes Default Description UndoManagerOptions.captureTimeoutnumber <optional>
500 UndoManagerOptions.deleteFilterfunction <optional>
()=>true Sometimes it is necessary to filter whan an Undo/Redo operation can delete. If this filter returns false, the type/item won't be deleted even it is in the undo/redo scope.
UndoManagerOptions.trackedOriginsSet.<any> <optional>
new Set([null])