Skip to main content

@fluidframework/merge-tree Package

Interfaces

Interface Alerts Modifiers Description
AdjustParams Legacy Used to define per key adjustments in an IMergeTreeAnnotateAdjustMsg
IAttributionCollection Legacy
IAttributionCollectionSerializer Legacy sealed
IAttributionCollectionSpec Legacy
IJSONMarkerSegment Legacy
IJSONSegment Legacy
IJSONTextSegment Legacy
IMarkerDef Legacy
IMergeTreeAnnotateAdjustMsg Legacy
IMergeTreeAnnotateMsg Legacy
IMergeTreeDelta Legacy
IMergeTreeDeltaCallbackArgs Legacy
IMergeTreeDeltaOpArgs Legacy
IMergeTreeGroupMsg Deprecated, Legacy
IMergeTreeInsertMsg Legacy
IMergeTreeMaintenanceCallbackArgs Legacy
IMergeTreeObliterateMsg Deprecated, Legacy
IMergeTreeObliterateSidedMsg Legacy
IMergeTreeOptions Legacy
IMergeTreeRemoveMsg Legacy
IMergeTreeSegmentDelta Legacy
InteriorSequencePlace Legacy

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

See SequencePlace for additional context.

IRelativePosition Legacy A position specified relative to a segment.
ISegment Legacy A segment representing a portion of the merge tree. Segments are leaf nodes of the merge tree and contain data.
ISegmentAction Legacy
ITrackingGroup Legacy
LocalReferencePosition Legacy sealed
MapLike Legacy Any mapping from a string to values of type T
MergeTreeRevertibleDriver Legacy
ReferencePosition Legacy 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.
SequenceOffsets Legacy
SerializedAttributionCollection Legacy

Classes

Class Alerts Description
BaseSegment Legacy
Marker Legacy

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.

TextSegment Legacy
TrackingGroup Legacy
TrackingGroupCollection Legacy A collection of ITrackingGroup.

Enumerations

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

Types

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

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 Dictates the preferential direction for a ReferencePosition to slide in a merge-tree
Trackable Legacy

Functions

Function Alerts Return Type Description
appendToMergeTreeDeltaRevertibles(deltaArgs, revertibles) Legacy void Appends a merge tree delta to the list of revertibles.
discardMergeTreeDeltaRevertible(revertibles) Legacy void Removes all revertibles from the list of revertibles.
endpointPosAndSide(start, end) Legacy { 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 string[] | undefined Gets the tile labels stored in the given reference position.
refHasTileLabel(refPos, label) Legacy boolean Determines if a reference position has the given tile label.
revertMergeTreeDeltaRevertibles(driver, revertibles) Legacy void Reverts all operations in the list of revertibles.
segmentIsRemoved(segment) Legacy boolean Determine if a segment has been removed.

Variables

Variable Alerts Modifiers Type Description
MergeTreeDeltaType Legacy readonly { readonly INSERT: 0; readonly REMOVE: 1; readonly ANNOTATE: 2; readonly GROUP: 3; readonly OBLITERATE: 4; readonly OBLITERATE_SIDED: 5; }
MergeTreeMaintenanceType Legacy 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 readonly The special-cased property key that tracks the id of a Marker.
SlidingPreference Legacy 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[]

segmentIsRemoved

Determine if a segment has been removed.

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 segmentIsRemoved(segment: ISegment): boolean;

Parameters

Parameter Type Description
segment ISegment

Returns

Return type: boolean

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; }