Skip to main content

@fluidframework/merge-tree Package

Interfaces

InterfaceAlertsModifiersDescription
AdjustParamsLegacyUsed to define per key adjustments in an IMergeTreeAnnotateAdjustMsg
IAttributionCollectionLegacy
IAttributionCollectionSerializerLegacysealed
IAttributionCollectionSpecLegacy
IJSONMarkerSegmentLegacy
IJSONSegmentLegacy
IJSONTextSegmentLegacy
IMarkerDefLegacy
IMergeTreeAnnotateAdjustMsgLegacy
IMergeTreeAnnotateMsgLegacy
IMergeTreeDeltaLegacy
IMergeTreeDeltaCallbackArgsLegacy
IMergeTreeDeltaOpArgsLegacy
IMergeTreeGroupMsgDeprecated, Legacy
IMergeTreeInsertMsgLegacy
IMergeTreeMaintenanceCallbackArgsLegacy
IMergeTreeObliterateMsgDeprecated, Legacy
IMergeTreeObliterateSidedMsgLegacy
IMergeTreeOptionsLegacy
IMergeTreeRemoveMsgLegacy
IMergeTreeSegmentDeltaLegacy
InteriorSequencePlaceLegacy

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

See SequencePlace for additional context.

IRelativePositionLegacyA position specified relative to a segment.
ISegmentLegacyA segment representing a portion of the merge tree. Segments are leaf nodes of the merge tree and contain data.
ISegmentActionLegacy
ITrackingGroupLegacy
LocalReferencePositionLegacysealed
MapLikeLegacyAny mapping from a string to values of type T
MergeTreeRevertibleDriverLegacy
ReferencePositionLegacyRepresents 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.
SequenceOffsetsLegacy
SerializedAttributionCollectionLegacy

Classes

ClassAlertsDescription
BaseSegmentLegacy
MarkerLegacy

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.

TextSegmentLegacy
TrackingGroupLegacy
TrackingGroupCollectionLegacyA collection of ITrackingGroup.

Enumerations

EnumAlertsDescription
ReferenceTypeLegacyFlags enum that dictates behavior of a ReferencePosition
SideLegacyDefines a side relative to a character in a sequence.

Types

TypeAliasAlertsDescription
IMergeTreeDeltaOpLegacy
IMergeTreeOpLegacy
MergeTreeDeltaOperationTypeLegacy
MergeTreeDeltaOperationTypesLegacy
MergeTreeDeltaRevertibleLegacy
MergeTreeDeltaTypeLegacy
MergeTreeMaintenanceTypeLegacy
PropertySetLegacyA loosely-typed mapping from strings to any value.
SequencePlaceLegacy

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.

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

Functions

FunctionAlertsReturn TypeDescription
appendToMergeTreeDeltaRevertibles(deltaArgs, revertibles)LegacyvoidAppends a merge tree delta to the list of revertibles.
discardMergeTreeDeltaRevertible(revertibles)LegacyvoidRemoves 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)Legacystring[] | undefinedGets the tile labels stored in the given reference position.
refHasTileLabel(refPos, label)LegacybooleanDetermines if a reference position has the given tile label.
revertMergeTreeDeltaRevertibles(driver, revertibles)LegacyvoidReverts all operations in the list of revertibles.
segmentIsRemoved(segment)LegacybooleanDetermine if a segment has been removed.

Variables

VariableAlertsModifiersTypeDescription
MergeTreeDeltaTypeLegacyreadonly{ readonly INSERT: 0; readonly REMOVE: 1; readonly ANNOTATE: 2; readonly GROUP: 3; readonly OBLITERATE: 4; readonly OBLITERATE_SIDED: 5; }
MergeTreeMaintenanceTypeLegacyreadonly{ 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.

reservedMarkerIdKeyLegacyreadonlyThe special-cased property key that tracks the id of a Marker.
SlidingPreferenceLegacyreadonly{ 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

ParameterTypeDescription
deltaArgsIMergeTreeDeltaCallbackArgs
revertiblesMergeTreeDeltaRevertible[]

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

ParameterTypeDescription
revertiblesMergeTreeDeltaRevertible[]

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

ParameterTypeDescription
startSequencePlace | undefined
endSequencePlace | 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

ParameterTypeDescription
refPosReferencePosition

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

ParameterTypeDescription
refPosReferencePosition
labelstring

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

ParameterTypeDescription
driverMergeTreeRevertibleDriver
revertiblesMergeTreeDeltaRevertible[]

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

ParameterTypeDescription
segmentISegment

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