@fluidframework/merge-tree Package

Packages > @fluidframework/merge-tree

Interfaces

Interface Alerts Modifiers Description
AttributionPolicy Deprecated, Legacy, Alpha sealed Implements policy dictating which kinds of operations should be attributed and how.
IAttributionCollection Legacy, Alpha
IAttributionCollectionSerializer Legacy, Alpha sealed
IAttributionCollectionSpec Legacy, Alpha
IClientEvents Deprecated, Legacy, Alpha Emitted before this client's merge-tree normalizes its segments on reconnect, potentially ordering them. Useful for DDS-like consumers built atop the merge-tree to compute any information they need for rebasing their ops on reconnection.
IJSONMarkerSegment Legacy, Alpha
IJSONSegment Legacy, Alpha
IJSONTextSegment Legacy, Alpha
IMarkerDef Legacy, Alpha
IMergeNodeCommon Legacy, Alpha Common properties for a node in a merge tree.
IMergeTreeAnnotateMsg Legacy, Alpha
IMergeTreeAttributionOptions Deprecated, Legacy, Alpha
IMergeTreeDelta Legacy, Alpha
IMergeTreeDeltaCallbackArgs Legacy, Alpha
IMergeTreeDeltaOpArgs Legacy, Alpha
IMergeTreeGroupMsg Deprecated, Legacy, Alpha
IMergeTreeInsertMsg Legacy, Alpha
IMergeTreeMaintenanceCallbackArgs Legacy, Alpha
IMergeTreeObliterateMsg Deprecated, Legacy, Alpha
IMergeTreeObliterateSidedMsg Legacy, Alpha
IMergeTreeOptions Legacy, Alpha
IMergeTreeRemoveMsg Legacy, Alpha
IMergeTreeSegmentDelta Legacy, Alpha
IMergeTreeTextHelper Deprecated, Legacy, Alpha
IMoveInfo Legacy, Alpha

Tracks information about when and where this segment was moved to.

Note that merge-tree does not currently support moving and only supports obliterate. The fields below include "move" in their names to avoid renaming in the future, when moves _are_ supported.

InteriorSequencePlace Legacy, Alpha

A sequence place that does not refer to the special endpoint segments.

See SequencePlace for additional context.

IRelativePosition Legacy, Alpha A position specified relative to a segment.
IRemovalInfo Legacy, Alpha Contains removal information associated to an ISegment.
ISegment Legacy, Alpha A segment representing a portion of the merge tree. Segments are leaf nodes of the merge tree and contain data.
ISegmentAction Legacy, Alpha
ITrackingGroup Legacy, Alpha
LocalReferencePosition Legacy, Alpha sealed
MapLike Legacy, Alpha Any mapping from a string to values of type T
MergeTreeRevertibleDriver Legacy, Alpha
ObliterateInfo Deprecated, Legacy, Alpha
ReferencePosition Legacy, Alpha Represents a reference to a place within a merge tree. This place conceptually remains stable over time by referring to a particular segment and offset within that segment. Thus, this reference's character position changes as the tree is edited.
SegmentGroup Deprecated, Legacy, Alpha
SequenceOffsets Legacy, Alpha
SerializedAttributionCollection Legacy, Alpha

Classes

Class Alerts Modifiers Description
BaseSegment Legacy, Alpha
Client Deprecated, Legacy, Alpha
CollaborationWindow Deprecated, Legacy, Alpha
LocalReferenceCollection Legacy, Alpha sealed Represents a collection of LocalReferencePositions associated with one segment in a merge-tree. Represents a collection of LocalReferencePositions associated with one segment in a merge-tree.
Marker Legacy, Alpha

Markers are a special kind of segment that do not hold any content.

Markers with a reference type of Tile support spatially accelerated queries for finding the next marker to the left or right of it in sub-linear time. This is useful, for example, in the case of jumping from the start of a paragraph to the end, assuming a paragraph is bound by markers at the start and end.

MergeNode Deprecated, Legacy, Alpha
PropertiesManager Deprecated, Legacy, Alpha
SegmentGroupCollection Deprecated, Legacy, Alpha
TextSegment Legacy, Alpha
TrackingGroup Legacy, Alpha
TrackingGroupCollection Legacy, Alpha A collection of ITrackingGroup.

Enumerations

Enum Alerts Description
PropertiesRollback Deprecated, Legacy, Alpha
ReferenceType Legacy, Alpha Flags enum that dictates behavior of a ReferencePosition
Side Legacy, Alpha Defines a side relative to a character in a sequence.

Types

TypeAlias Alerts Description
IMergeTreeDeltaOp Legacy, Alpha
IMergeTreeOp Legacy, Alpha
MergeTreeDeltaOperationType Legacy, Alpha
MergeTreeDeltaOperationTypes Legacy, Alpha
MergeTreeDeltaRevertible Legacy, Alpha
MergeTreeDeltaType Legacy, Alpha
MergeTreeMaintenanceType Legacy, Alpha
PropertySet Legacy, Alpha A loosely-typed mapping from strings to any value.
SequencePlace Legacy, Alpha

Defines a position and side relative to a character in a sequence.

For this purpose, sequences look like:

{start} - {character 0} - {character 1} - ... - {character N} - {end}

Each {value} in the diagram is a character within a sequence. Each - in the above diagram is a position where text could be inserted. Each position between a {value} and a - is a SequencePlace.

The special endpoints {start} and {end} refer to positions outside the contents of the string.

This gives us 2N + 2 possible positions to refer to within a string, where N is the number of characters.

If the position is specified with a bare number, the side defaults to Side.Before.

If a SequencePlace is the endpoint of a range (e.g. start/end of an interval or search range), the Side value means it is exclusive if it is nearer to the other position and inclusive if it is farther. E.g. the start of a range with Side.After is exclusive of the character at the position.

SlidingPreference Legacy, Alpha Dictates the preferential direction for a ReferencePosition to slide in a merge-tree
Trackable Legacy, Alpha

Functions

Function Alerts Return Type Description
appendToMergeTreeDeltaRevertibles(deltaArgs, revertibles) Legacy, Alpha void Appends a merge tree delta to the list of revertibles.
discardMergeTreeDeltaRevertible(revertibles) Legacy, Alpha void Removes all revertibles from the list of revertibles.
endpointPosAndSide(start, end) Legacy, Alpha { startSide: Side | undefined; endSide: Side | undefined; startPos: number | "start" | "end" | undefined; endPos: number | "start" | "end" | undefined; } Returns the position and side of the start and end of a sequence.
refGetTileLabels(refPos) Legacy, Alpha string[] | undefined Gets the tile labels stored in the given reference position.
refHasTileLabel(refPos, label) Legacy, Alpha boolean Determines if a reference position has the given tile label.
revertMergeTreeDeltaRevertibles(driver, revertibles) Legacy, Alpha void Reverts all operations in the list of revertibles.

Variables

Variable Alerts Modifiers Type Description
MergeTreeDeltaType Legacy, Alpha readonly { readonly INSERT: 0; readonly REMOVE: 1; readonly ANNOTATE: 2; readonly GROUP: 3; readonly OBLITERATE: 4; readonly OBLITERATE_SIDED: 5; }
MergeTreeMaintenanceType Legacy, Alpha readonly { readonly APPEND: -1; readonly SPLIT: -2; readonly UNLINK: -3; readonly ACKNOWLEDGED: -4; }

Enum-like constant defining the types of "maintenance" events on a merge tree. Maintenance events correspond to structural segment changes or acks of pending segments.

Note: these values are assigned negative integers to avoid clashing with MergeTreeDeltaType.

reservedMarkerIdKey Legacy, Alpha readonly The special-cased property key that tracks the id of a Marker.
SlidingPreference Legacy, Alpha readonly { readonly BACKWARD: 0; readonly FORWARD: 1; } Dictates the preferential direction for a ReferencePosition to slide in a merge-tree

Function Details

appendToMergeTreeDeltaRevertibles

Appends a merge tree delta to the list of revertibles.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/merge-tree/legacy.

For more information about our API support guarantees, see here .

Signature

export declare function appendToMergeTreeDeltaRevertibles(deltaArgs: IMergeTreeDeltaCallbackArgs, revertibles: MergeTreeDeltaRevertible[]): void;

Parameters

Parameter Type Description
deltaArgs IMergeTreeDeltaCallbackArgs
revertibles MergeTreeDeltaRevertible[]

discardMergeTreeDeltaRevertible

Removes all revertibles from the list of revertibles.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/merge-tree/legacy.

For more information about our API support guarantees, see here .

Signature

export declare function discardMergeTreeDeltaRevertible(revertibles: MergeTreeDeltaRevertible[]): void;

Parameters

Parameter Type Description
revertibles MergeTreeDeltaRevertible[]

endpointPosAndSide

Returns the position and side of the start and end of a sequence.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/merge-tree/legacy.

For more information about our API support guarantees, see here .

Signature

export declare function endpointPosAndSide(start: SequencePlace | undefined, end: SequencePlace | undefined): {
    startSide: Side | undefined;
    endSide: Side | undefined;
    startPos: number | "start" | "end" | undefined;
    endPos: number | "start" | "end" | undefined;
};

Parameters

Parameter Type Description
start SequencePlace | undefined
end SequencePlace | undefined

Returns

Return type: { startSide: Side | undefined; endSide: Side | undefined; startPos: number | “start” | “end” | undefined; endPos: number | “start” | “end” | undefined; }

refGetTileLabels

Gets the tile labels stored in the given reference position.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/merge-tree/legacy.

For more information about our API support guarantees, see here .

Signature

refGetTileLabels: (refPos: ReferencePosition) => string[] | undefined

Parameters

Parameter Type Description
refPos ReferencePosition

Returns

Return type: string[] | undefined

refHasTileLabel

Determines if a reference position has the given tile label.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/merge-tree/legacy.

For more information about our API support guarantees, see here .

Signature

export declare function refHasTileLabel(refPos: ReferencePosition, label: string): boolean;

Parameters

Parameter Type Description
refPos ReferencePosition
label string

Returns

Return type: boolean

revertMergeTreeDeltaRevertibles

Reverts all operations in the list of revertibles.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/merge-tree/legacy.

For more information about our API support guarantees, see here .

Signature

export declare function revertMergeTreeDeltaRevertibles(driver: MergeTreeRevertibleDriver, revertibles: MergeTreeDeltaRevertible[]): void;

Parameters

Parameter Type Description
driver MergeTreeRevertibleDriver
revertibles MergeTreeDeltaRevertible[]

Variable Details

MergeTreeDeltaType

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/merge-tree/legacy.

For more information about our API support guarantees, see here .

Signature

MergeTreeDeltaType: {
    readonly INSERT: 0;
    readonly REMOVE: 1;
    readonly ANNOTATE: 2;
    readonly GROUP: 3;
    readonly OBLITERATE: 4;
    readonly OBLITERATE_SIDED: 5;
}

Type: { readonly INSERT: 0; readonly REMOVE: 1; readonly ANNOTATE: 2; readonly GROUP: 3; readonly OBLITERATE: 4; readonly OBLITERATE_SIDED: 5; }

MergeTreeMaintenanceType

Enum-like constant defining the types of “maintenance” events on a merge tree. Maintenance events correspond to structural segment changes or acks of pending segments.

Note: these values are assigned negative integers to avoid clashing with MergeTreeDeltaType.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/merge-tree/legacy.

For more information about our API support guarantees, see here .

Signature

MergeTreeMaintenanceType: {
    readonly APPEND: -1;
    readonly SPLIT: -2;
    readonly UNLINK: -3;
    readonly ACKNOWLEDGED: -4;
}

Type: { readonly APPEND: -1; readonly SPLIT: -2; readonly UNLINK: -3; readonly ACKNOWLEDGED: -4; }

reservedMarkerIdKey

The special-cased property key that tracks the id of a Marker .

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/merge-tree/legacy.

For more information about our API support guarantees, see here .

Signature

reservedMarkerIdKey = "markerId"

Remarks

In general, marker ids should be accessed using the inherent method Marker.getId. Marker ids should not be updated after creation.

SlidingPreference

Dictates the preferential direction for a ReferencePosition to slide in a merge-tree

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/merge-tree/legacy.

For more information about our API support guarantees, see here .

Signature

SlidingPreference: {
    readonly BACKWARD: 0;
    readonly FORWARD: 1;
}

Type: { readonly BACKWARD: 0; readonly FORWARD: 1; }