@fluidframework/merge-tree 2.12.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/MergeTreeTextHelper.d.ts.map +1 -1
- package/dist/MergeTreeTextHelper.js +0 -2
- package/dist/MergeTreeTextHelper.js.map +1 -1
- package/dist/attributionPolicy.d.ts.map +1 -1
- package/dist/attributionPolicy.js +6 -16
- package/dist/attributionPolicy.js.map +1 -1
- package/dist/client.d.ts +3 -4
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +39 -28
- package/dist/client.js.map +1 -1
- package/dist/endOfTreeSegment.d.ts +2 -1
- package/dist/endOfTreeSegment.d.ts.map +1 -1
- package/dist/endOfTreeSegment.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/mergeTree.d.ts +8 -7
- package/dist/mergeTree.d.ts.map +1 -1
- package/dist/mergeTree.js +190 -216
- package/dist/mergeTree.js.map +1 -1
- package/dist/mergeTreeNodeWalk.d.ts.map +1 -1
- package/dist/mergeTreeNodeWalk.js +3 -2
- package/dist/mergeTreeNodeWalk.js.map +1 -1
- package/dist/mergeTreeNodes.d.ts +76 -162
- package/dist/mergeTreeNodes.d.ts.map +1 -1
- package/dist/mergeTreeNodes.js +100 -112
- package/dist/mergeTreeNodes.js.map +1 -1
- package/dist/mergeTreeTracking.d.ts.map +1 -1
- package/dist/mergeTreeTracking.js +0 -2
- package/dist/mergeTreeTracking.js.map +1 -1
- package/dist/partialLengths.d.ts +2 -2
- package/dist/partialLengths.d.ts.map +1 -1
- package/dist/partialLengths.js +28 -26
- package/dist/partialLengths.js.map +1 -1
- package/dist/perspective.d.ts +3 -2
- package/dist/perspective.d.ts.map +1 -1
- package/dist/perspective.js +11 -4
- package/dist/perspective.js.map +1 -1
- package/dist/referencePositions.d.ts.map +1 -1
- package/dist/referencePositions.js +4 -1
- package/dist/referencePositions.js.map +1 -1
- package/dist/revertibles.d.ts.map +1 -1
- package/dist/revertibles.js +10 -11
- package/dist/revertibles.js.map +1 -1
- package/dist/segmentGroupCollection.d.ts +4 -4
- package/dist/segmentGroupCollection.d.ts.map +1 -1
- package/dist/segmentGroupCollection.js +0 -6
- package/dist/segmentGroupCollection.js.map +1 -1
- package/dist/segmentInfos.d.ts +257 -0
- package/dist/segmentInfos.d.ts.map +1 -0
- package/dist/segmentInfos.js +166 -0
- package/dist/segmentInfos.js.map +1 -0
- package/dist/snapshotLoader.d.ts.map +1 -1
- package/dist/snapshotLoader.js +38 -44
- package/dist/snapshotLoader.js.map +1 -1
- package/dist/snapshotV1.d.ts.map +1 -1
- package/dist/snapshotV1.js +9 -12
- package/dist/snapshotV1.js.map +1 -1
- package/dist/snapshotlegacy.d.ts +2 -2
- package/dist/snapshotlegacy.d.ts.map +1 -1
- package/dist/snapshotlegacy.js +5 -3
- package/dist/snapshotlegacy.js.map +1 -1
- package/dist/sortedSegmentSet.d.ts.map +1 -1
- package/dist/sortedSegmentSet.js +5 -8
- package/dist/sortedSegmentSet.js.map +1 -1
- package/dist/test/beastTest.spec.d.ts +0 -2
- package/dist/test/beastTest.spec.d.ts.map +1 -1
- package/dist/test/beastTest.spec.js +1 -5
- package/dist/test/beastTest.spec.js.map +1 -1
- package/dist/test/client.annotateMarker.spec.js.map +1 -1
- package/dist/test/client.applyMsg.spec.js +15 -12
- package/dist/test/client.applyMsg.spec.js.map +1 -1
- package/dist/test/client.attributionFarm.spec.js.map +1 -1
- package/dist/test/client.getPosition.spec.js +3 -2
- package/dist/test/client.getPosition.spec.js.map +1 -1
- package/dist/test/client.localReference.spec.js +6 -6
- package/dist/test/client.localReference.spec.js.map +1 -1
- package/dist/test/client.localReferenceFarm.spec.js.map +1 -1
- package/dist/test/client.rollback.spec.js.map +1 -1
- package/dist/test/dirname.cjs +0 -1
- package/dist/test/dirname.cjs.map +1 -1
- package/dist/test/index.d.ts +1 -1
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/index.js +2 -4
- package/dist/test/index.js.map +1 -1
- package/dist/test/mergeTree.annotate.spec.js +3 -0
- package/dist/test/mergeTree.annotate.spec.js.map +1 -1
- package/dist/test/mergeTree.insertingWalk.spec.js +1 -1
- package/dist/test/mergeTree.insertingWalk.spec.js.map +1 -1
- package/dist/test/mergeTree.markRangeRemoved.spec.js +2 -0
- package/dist/test/mergeTree.markRangeRemoved.spec.js.map +1 -1
- package/dist/test/mergeTree.walk.spec.js.map +1 -1
- package/dist/test/mergeTreeOperationRunner.d.ts.map +1 -1
- package/dist/test/mergeTreeOperationRunner.js +2 -3
- package/dist/test/mergeTreeOperationRunner.js.map +1 -1
- package/dist/test/obliterate.spec.js.map +1 -1
- package/dist/test/propertyManager.spec.js.map +1 -1
- package/dist/test/reconnectHelper.d.ts +2 -1
- package/dist/test/reconnectHelper.d.ts.map +1 -1
- package/dist/test/reconnectHelper.js.map +1 -1
- package/dist/test/resetPendingSegmentsToOp.spec.js.map +1 -1
- package/dist/test/revertibleFarm.spec.js.map +1 -1
- package/dist/test/segmentGroupCollection.spec.js +15 -3
- package/dist/test/segmentGroupCollection.spec.js.map +1 -1
- package/dist/test/snapshot.utils.d.ts +2 -2
- package/dist/test/snapshot.utils.d.ts.map +1 -1
- package/dist/test/snapshot.utils.js.map +1 -1
- package/dist/test/sortedSegmentSet.spec.js +4 -3
- package/dist/test/sortedSegmentSet.spec.js.map +1 -1
- package/dist/test/testClient.d.ts +8 -6
- package/dist/test/testClient.d.ts.map +1 -1
- package/dist/test/testClient.js +29 -27
- package/dist/test/testClient.js.map +1 -1
- package/dist/test/testClientLogger.d.ts.map +1 -1
- package/dist/test/testClientLogger.js +6 -4
- package/dist/test/testClientLogger.js.map +1 -1
- package/dist/test/testUtils.d.ts +2 -2
- package/dist/test/testUtils.d.ts.map +1 -1
- package/dist/test/testUtils.js +32 -8
- package/dist/test/testUtils.js.map +1 -1
- package/dist/test/text.d.ts +2 -2
- package/dist/test/text.d.ts.map +1 -1
- package/dist/test/text.js +12 -6
- package/dist/test/text.js.map +1 -1
- package/dist/test/tracking.spec.js.map +1 -1
- package/dist/test/wordUnitTests.spec.js +1 -1
- package/dist/test/wordUnitTests.spec.js.map +1 -1
- package/dist/zamboni.d.ts.map +1 -1
- package/dist/zamboni.js +8 -7
- package/dist/zamboni.js.map +1 -1
- package/lib/MergeTreeTextHelper.d.ts.map +1 -1
- package/lib/MergeTreeTextHelper.js +0 -2
- package/lib/MergeTreeTextHelper.js.map +1 -1
- package/lib/attributionPolicy.d.ts.map +1 -1
- package/lib/attributionPolicy.js +6 -16
- package/lib/attributionPolicy.js.map +1 -1
- package/lib/client.d.ts +3 -4
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +40 -29
- package/lib/client.js.map +1 -1
- package/lib/endOfTreeSegment.d.ts +2 -1
- package/lib/endOfTreeSegment.d.ts.map +1 -1
- package/lib/endOfTreeSegment.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/mergeTree.d.ts +8 -7
- package/lib/mergeTree.d.ts.map +1 -1
- package/lib/mergeTree.js +177 -205
- package/lib/mergeTree.js.map +1 -1
- package/lib/mergeTreeNodeWalk.d.ts.map +1 -1
- package/lib/mergeTreeNodeWalk.js +3 -2
- package/lib/mergeTreeNodeWalk.js.map +1 -1
- package/lib/mergeTreeNodes.d.ts +76 -162
- package/lib/mergeTreeNodes.d.ts.map +1 -1
- package/lib/mergeTreeNodes.js +95 -108
- package/lib/mergeTreeNodes.js.map +1 -1
- package/lib/mergeTreeTracking.d.ts.map +1 -1
- package/lib/mergeTreeTracking.js +0 -2
- package/lib/mergeTreeTracking.js.map +1 -1
- package/lib/partialLengths.d.ts +2 -2
- package/lib/partialLengths.d.ts.map +1 -1
- package/lib/partialLengths.js +25 -23
- package/lib/partialLengths.js.map +1 -1
- package/lib/perspective.d.ts +3 -2
- package/lib/perspective.d.ts.map +1 -1
- package/lib/perspective.js +11 -4
- package/lib/perspective.js.map +1 -1
- package/lib/referencePositions.d.ts.map +1 -1
- package/lib/referencePositions.js +4 -1
- package/lib/referencePositions.js.map +1 -1
- package/lib/revertibles.d.ts.map +1 -1
- package/lib/revertibles.js +8 -9
- package/lib/revertibles.js.map +1 -1
- package/lib/segmentGroupCollection.d.ts +4 -4
- package/lib/segmentGroupCollection.d.ts.map +1 -1
- package/lib/segmentGroupCollection.js +0 -6
- package/lib/segmentGroupCollection.js.map +1 -1
- package/lib/segmentInfos.d.ts +257 -0
- package/lib/segmentInfos.d.ts.map +1 -0
- package/lib/segmentInfos.js +145 -0
- package/lib/segmentInfos.js.map +1 -0
- package/lib/snapshotLoader.d.ts.map +1 -1
- package/lib/snapshotLoader.js +38 -44
- package/lib/snapshotLoader.js.map +1 -1
- package/lib/snapshotV1.d.ts.map +1 -1
- package/lib/snapshotV1.js +9 -12
- package/lib/snapshotV1.js.map +1 -1
- package/lib/snapshotlegacy.d.ts +2 -2
- package/lib/snapshotlegacy.d.ts.map +1 -1
- package/lib/snapshotlegacy.js +5 -3
- package/lib/snapshotlegacy.js.map +1 -1
- package/lib/sortedSegmentSet.d.ts.map +1 -1
- package/lib/sortedSegmentSet.js +5 -8
- package/lib/sortedSegmentSet.js.map +1 -1
- package/lib/test/beastTest.spec.d.ts +0 -2
- package/lib/test/beastTest.spec.d.ts.map +1 -1
- package/lib/test/beastTest.spec.js +0 -3
- package/lib/test/beastTest.spec.js.map +1 -1
- package/lib/test/client.annotateMarker.spec.js.map +1 -1
- package/lib/test/client.applyMsg.spec.js +15 -12
- package/lib/test/client.applyMsg.spec.js.map +1 -1
- package/lib/test/client.attributionFarm.spec.js.map +1 -1
- package/lib/test/client.getPosition.spec.js +3 -2
- package/lib/test/client.getPosition.spec.js.map +1 -1
- package/lib/test/client.localReference.spec.js +1 -1
- package/lib/test/client.localReference.spec.js.map +1 -1
- package/lib/test/client.localReferenceFarm.spec.js.map +1 -1
- package/lib/test/client.rollback.spec.js +1 -1
- package/lib/test/client.rollback.spec.js.map +1 -1
- package/lib/test/dirname.cjs +0 -1
- package/lib/test/dirname.cjs.map +1 -1
- package/lib/test/index.d.ts +1 -1
- package/lib/test/index.d.ts.map +1 -1
- package/lib/test/index.js +1 -1
- package/lib/test/index.js.map +1 -1
- package/lib/test/mergeTree.annotate.spec.js +3 -0
- package/lib/test/mergeTree.annotate.spec.js.map +1 -1
- package/lib/test/mergeTree.insertingWalk.spec.js +2 -2
- package/lib/test/mergeTree.insertingWalk.spec.js.map +1 -1
- package/lib/test/mergeTree.markRangeRemoved.spec.js +2 -0
- package/lib/test/mergeTree.markRangeRemoved.spec.js.map +1 -1
- package/lib/test/mergeTree.walk.spec.js.map +1 -1
- package/lib/test/mergeTreeOperationRunner.d.ts.map +1 -1
- package/lib/test/mergeTreeOperationRunner.js +1 -2
- package/lib/test/mergeTreeOperationRunner.js.map +1 -1
- package/lib/test/obliterate.spec.js.map +1 -1
- package/lib/test/propertyManager.spec.js.map +1 -1
- package/lib/test/reconnectHelper.d.ts +2 -1
- package/lib/test/reconnectHelper.d.ts.map +1 -1
- package/lib/test/reconnectHelper.js.map +1 -1
- package/lib/test/resetPendingSegmentsToOp.spec.js.map +1 -1
- package/lib/test/revertibleFarm.spec.js.map +1 -1
- package/lib/test/segmentGroupCollection.spec.js +15 -3
- package/lib/test/segmentGroupCollection.spec.js.map +1 -1
- package/lib/test/snapshot.utils.d.ts +2 -2
- package/lib/test/snapshot.utils.d.ts.map +1 -1
- package/lib/test/snapshot.utils.js.map +1 -1
- package/lib/test/sortedSegmentSet.spec.js +4 -3
- package/lib/test/sortedSegmentSet.spec.js.map +1 -1
- package/lib/test/testClient.d.ts +8 -6
- package/lib/test/testClient.d.ts.map +1 -1
- package/lib/test/testClient.js +30 -28
- package/lib/test/testClient.js.map +1 -1
- package/lib/test/testClientLogger.d.ts.map +1 -1
- package/lib/test/testClientLogger.js +5 -3
- package/lib/test/testClientLogger.js.map +1 -1
- package/lib/test/testUtils.d.ts +2 -2
- package/lib/test/testUtils.d.ts.map +1 -1
- package/lib/test/testUtils.js +9 -8
- package/lib/test/testUtils.js.map +1 -1
- package/lib/test/text.d.ts +2 -2
- package/lib/test/text.d.ts.map +1 -1
- package/lib/test/text.js +12 -6
- package/lib/test/text.js.map +1 -1
- package/lib/test/tracking.spec.js.map +1 -1
- package/lib/test/wordUnitTests.spec.js +1 -1
- package/lib/test/wordUnitTests.spec.js.map +1 -1
- package/lib/zamboni.d.ts.map +1 -1
- package/lib/zamboni.js +7 -6
- package/lib/zamboni.js.map +1 -1
- package/package.json +17 -17
- package/src/MergeTreeTextHelper.ts +2 -4
- package/src/attributionPolicy.ts +5 -13
- package/src/client.ts +55 -44
- package/src/endOfTreeSegment.ts +3 -3
- package/src/index.ts +4 -6
- package/src/mergeTree.ts +245 -282
- package/src/mergeTreeNodeWalk.ts +3 -2
- package/src/mergeTreeNodes.ts +190 -322
- package/src/mergeTreeTracking.ts +0 -3
- package/src/partialLengths.ts +42 -27
- package/src/perspective.ts +27 -4
- package/src/referencePositions.ts +4 -1
- package/src/revertibles.ts +19 -13
- package/src/segmentGroupCollection.ts +7 -18
- package/src/segmentInfos.ts +377 -0
- package/src/snapshotLoader.ts +60 -57
- package/src/snapshotV1.ts +14 -16
- package/src/snapshotlegacy.ts +12 -17
- package/src/sortedSegmentSet.ts +6 -8
- package/src/zamboni.ts +10 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeTreeNodeWalk.d.ts","sourceRoot":"","sources":["../src/mergeTreeNodeWalk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"mergeTreeNodeWalk.d.ts","sourceRoot":"","sources":["../src/mergeTreeNodeWalk.ts"],"names":[],"mappings":"AAA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copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
import { isMergeNodeInfo } from "./segmentInfos.js";
|
|
5
6
|
export const LeafAction = {
|
|
6
7
|
Exit: false,
|
|
7
8
|
};
|
|
@@ -96,7 +97,7 @@ export function depthFirstNodeWalk(startBlock, startChild, downAction, leafActio
|
|
|
96
97
|
* All segments past `node` are visited, regardless of their visibility.
|
|
97
98
|
*/
|
|
98
99
|
export function forwardExcursion(startNode, leafAction) {
|
|
99
|
-
if (startNode
|
|
100
|
+
if (!isMergeNodeInfo(startNode)) {
|
|
100
101
|
return true;
|
|
101
102
|
}
|
|
102
103
|
return depthFirstNodeWalk(startNode.parent,
|
|
@@ -110,7 +111,7 @@ export function forwardExcursion(startNode, leafAction) {
|
|
|
110
111
|
* All segments past `node` are visited, regardless of their visibility.
|
|
111
112
|
*/
|
|
112
113
|
export function backwardExcursion(startNode, leafAction) {
|
|
113
|
-
if (startNode
|
|
114
|
+
if (!isMergeNodeInfo(startNode)) {
|
|
114
115
|
return true;
|
|
115
116
|
}
|
|
116
117
|
return depthFirstNodeWalk(startNode.parent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeTreeNodeWalk.js","sourceRoot":"","sources":["../src/mergeTreeNodeWalk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,IAAI,EAAE,KAAK;CACF,CAAC;AAIX,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,QAAQ,EAAE,SAAS;IACnB,iDAAiD;IACjD,IAAI,EAAE,UAAU,CAAC,IAAI;IACrB,IAAI,EAAE,CAAC;CACE,CAAC;AAOX;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CACjC,UAAsB,EACtB,UAAkC,EAClC,UAA6C,EAC7C,kBAAsD,EACtD,QAAsC,EACtC,UAAmB,IAAI;IAEvB,MAAM,SAAS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C,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,EACrE,UAAU,CACV,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ISegmentLeaf, type MergeBlock, IMergeNode } from \"./mergeTreeNodes.js\";\n\nexport const LeafAction = {\n\tExit: false,\n} as const;\n\nexport type LeafAction = boolean | undefined | void;\n\nexport const NodeAction = {\n\tContinue: undefined,\n\t// exit is false to unify with leafActionOverride\n\tExit: LeafAction.Exit,\n\tSkip: 2,\n} as const;\n\n// we exclude true from, as we only want one continue value, undefined\nexport type NodeAction =\n\t| (typeof NodeAction)[keyof typeof NodeAction]\n\t| Exclude<LeafAction, true>;\n\n/**\n * Does a depth first walk of the tree from the specific start.\n *\n * @param startBlock - The block of the tree to start the walk from\n * @param startChild - The child of that block to start from\n * @param downAction - Called as we walk down the tree to the leaves.\n * @param leafActionOverride - Overrides downAction for leaves, generally used without downAction\n * @param upAction - Called after all the children of a block are walked.\n * @param forward - whether to walk forward or backward\n * @returns true if we naturally exit, false if exiting due to Exit action result\n */\nexport function depthFirstNodeWalk(\n\tstartBlock: MergeBlock,\n\tstartChild: IMergeNode | undefined,\n\tdownAction?: (node: IMergeNode) => NodeAction,\n\tleafActionOverride?: (seg: ISegmentLeaf) => LeafAction,\n\tupAction?: (block: MergeBlock) => void,\n\tforward: boolean = true,\n): boolean {\n\tconst increment = forward ? 1 : -1;\n\tconst leafAction = leafActionOverride ?? downAction;\n\tif (leafAction === undefined) {\n\t\treturn true;\n\t}\n\n\tlet block = startBlock;\n\tlet childCount = block.childCount;\n\tlet start: IMergeNode | undefined = startChild;\n\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\t// go down to the leaf level\n\t\tlet blockResult: NodeAction;\n\t\twhile (start?.isLeaf() === false) {\n\t\t\t// cast is safe due to isLeaf === false in while above\n\t\t\tblock = start as MergeBlock;\n\t\t\tchildCount = block.childCount;\n\t\t\tblockResult = downAction?.(block);\n\t\t\t// setting start undefined will skip the leaf walk\n\t\t\t// so if the block result isn't continue, set it\n\t\t\t// undefined\n\t\t\tstart =\n\t\t\t\tblockResult === NodeAction.Continue\n\t\t\t\t\t? block.children[forward ? 0 : childCount - 1]\n\t\t\t\t\t: undefined;\n\t\t}\n\n\t\tlet exit = blockResult === NodeAction.Exit;\n\n\t\t// walk the leaves if we reached them\n\t\tif (start !== undefined) {\n\t\t\tfor (let i = start.index; i !== -1 && i !== childCount; i += increment) {\n\t\t\t\t// the above loop ensures start is a leaf or undefined, so all children\n\t\t\t\t// will be leaves if start exits, so the cast is safe\n\t\t\t\tif (leafAction(block.children[i] as ISegmentLeaf) === LeafAction.Exit) {\n\t\t\t\t\texit = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if there is no upAction, we don't need to walk up before exiting\n\t\tif (upAction === undefined && exit) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// since we already enumerated the children\n\t\t// we walk up to the next level until there is a sibling\n\t\t// or all the way up if exit is true\n\t\tlet nextIndex = -1;\n\t\tdo {\n\t\t\t// if the blockAction was exit or skip\n\t\t\t// we shouldn't process that block again,\n\t\t\t// if there are subsequent parents while walking up\n\t\t\t// we will process those.\n\t\t\tif (blockResult === NodeAction.Continue) {\n\t\t\t\tupAction?.(block);\n\t\t\t} else {\n\t\t\t\tblockResult = NodeAction.Continue;\n\t\t\t}\n\t\t\tif (block.parent === undefined) {\n\t\t\t\treturn !exit;\n\t\t\t}\n\t\t\tstart = block;\n\t\t\tblock = block.parent;\n\t\t\tchildCount = block.childCount;\n\t\t\tnextIndex = start.index + increment;\n\t\t} while (exit || nextIndex === -1 || nextIndex === childCount);\n\t\t// the above loop ensured that siblings are possible\n\t\tstart = block.children[nextIndex];\n\t}\n}\n\n/**\n * Visit segments starting from node's right/far/forward siblings, then up to node's parent.\n * All segments past `node` are visited, regardless of their visibility.\n */\nexport function forwardExcursion(\n\tstartNode: IMergeNode,\n\tleafAction: (seg: ISegmentLeaf) => boolean | undefined,\n): boolean {\n\tif (startNode.parent === undefined) {\n\t\treturn true;\n\t}\n\n\treturn depthFirstNodeWalk(\n\t\tstartNode.parent,\n\t\t// this will either be the sibling, or undefined\n\t\t// either is fine, and will result in skipping\n\t\t// the startNode only\n\t\tstartNode.parent.children[startNode.index + 1],\n\t\tundefined /* downAction */,\n\t\tleafAction,\n\t);\n}\n\n/**\n * Visit segments starting from node's left/near/backwards siblings, then up to node's parent.\n * All segments past `node` are visited, regardless of their visibility.\n */\nexport function backwardExcursion(\n\tstartNode: IMergeNode,\n\tleafAction: (seg: ISegmentLeaf) => boolean | undefined,\n): boolean {\n\tif (startNode.parent === undefined) {\n\t\treturn true;\n\t}\n\treturn depthFirstNodeWalk(\n\t\tstartNode.parent,\n\t\t// this will either be the sibling, or undefined\n\t\t// either is fine, and will result in skipping\n\t\t// the startNode only\n\t\tstartNode.parent.children[startNode.index - 1],\n\t\tundefined /* downAction */,\n\t\tleafAction,\n\t\tundefined /* upAction */,\n\t\tfalse /* forward */,\n\t);\n}\n\n/**\n * Walks all segments below the specific start block\n * @param startBlock - The block to start the walk at\n * @param leafAction - The action to perform on the leaves\n * @returns true if we naturally exit, false if exiting due to leaf action result\n */\nexport function walkAllChildSegments(\n\tstartBlock: MergeBlock,\n\tleafAction: (segment: ISegmentLeaf) => boolean | undefined | void,\n): boolean {\n\tif (startBlock.childCount === 0) {\n\t\treturn true;\n\t}\n\n\t// undefined shouldn't actually be added, but this allows subsequent check for `node.parent` to typecheck\n\t// without further runtime work.\n\tconst ancestors = new Set<MergeBlock | undefined>();\n\tfor (let cur = startBlock.parent; cur !== undefined; cur = cur.parent) {\n\t\tancestors.add(cur);\n\t}\n\n\treturn depthFirstNodeWalk(\n\t\tstartBlock,\n\t\tstartBlock.children[0],\n\t\tancestors.size === 0\n\t\t\t? undefined\n\t\t\t: (node): false | undefined =>\n\t\t\t\t\tancestors.has(node.parent) ? NodeAction.Exit : NodeAction.Continue,\n\t\tleafAction,\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"mergeTreeNodeWalk.js","sourceRoot":"","sources":["../src/mergeTreeNodeWalk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,IAAI,EAAE,KAAK;CACF,CAAC;AAIX,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,QAAQ,EAAE,SAAS;IACnB,iDAAiD;IACjD,IAAI,EAAE,UAAU,CAAC,IAAI;IACrB,IAAI,EAAE,CAAC;CACE,CAAC;AAOX;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CACjC,UAAsB,EACtB,UAAkC,EAClC,UAA6C,EAC7C,kBAAsD,EACtD,QAAsC,EACtC,UAAmB,IAAI;IAEvB,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,UAAU,GAAG,kBAAkB,IAAI,UAAU,CAAC;IACpD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI,KAAK,GAAG,UAAU,CAAC;IACvB,IAAI,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;IAClC,IAAI,KAAK,GAA2B,UAAU,CAAC;IAE/C,iDAAiD;IACjD,OAAO,IAAI,EAAE,CAAC;QACb,4BAA4B;QAC5B,IAAI,WAAuB,CAAC;QAC5B,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,KAAK,EAAE,CAAC;YAClC,sDAAsD;YACtD,KAAK,GAAG,KAAmB,CAAC;YAC5B,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;YAC9B,WAAW,GAAG,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC;YAClC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AoB,CACnC,UAAsB,EACtB,UAAiE;IAEjE,IAAI,UAAU,CAAC,UAAU,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,yGAAyG;IACzG,gCAAgC;IAChC,MAAM,SAAS,GAAG,IAAI,GAAG,EAA0B,CAAC;IACpD,KAAK,IAAI,GAAG,GAAG,UAAU,CAAC,MAAM,EAAE,GAAG,KAAK,SAAS,EAAE,GAAG,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;QACvE,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,CAAC;IAED,OAAO,kBAAkB,CACxB,UAAU,EACV,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,EACtB,SAAS,CAAC,IAAI,KAAK,CAAC;QACnB,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,CAAC,IAAI,EAAqB,EAAE,CAC5B,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,EACrE,UAAU,CACV,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ISegmentLeaf, type MergeBlock, IMergeNode } from \"./mergeTreeNodes.js\";\nimport { isMergeNodeInfo } from \"./segmentInfos.js\";\n\nexport const LeafAction = {\n\tExit: false,\n} as const;\n\nexport type LeafAction = boolean | undefined | void;\n\nexport const NodeAction = {\n\tContinue: undefined,\n\t// exit is false to unify with leafActionOverride\n\tExit: LeafAction.Exit,\n\tSkip: 2,\n} as const;\n\n// we exclude true from, as we only want one continue value, undefined\nexport type NodeAction =\n\t| (typeof NodeAction)[keyof typeof NodeAction]\n\t| Exclude<LeafAction, true>;\n\n/**\n * Does a depth first walk of the tree from the specific start.\n *\n * @param startBlock - The block of the tree to start the walk from\n * @param startChild - The child of that block to start from\n * @param downAction - Called as we walk down the tree to the leaves.\n * @param leafActionOverride - Overrides downAction for leaves, generally used without downAction\n * @param upAction - Called after all the children of a block are walked.\n * @param forward - whether to walk forward or backward\n * @returns true if we naturally exit, false if exiting due to Exit action result\n */\nexport function depthFirstNodeWalk(\n\tstartBlock: MergeBlock,\n\tstartChild: IMergeNode | undefined,\n\tdownAction?: (node: IMergeNode) => NodeAction,\n\tleafActionOverride?: (seg: ISegmentLeaf) => LeafAction,\n\tupAction?: (block: MergeBlock) => void,\n\tforward: boolean = true,\n): boolean {\n\tconst increment = forward ? 1 : -1;\n\tconst leafAction = leafActionOverride ?? downAction;\n\tif (leafAction === undefined) {\n\t\treturn true;\n\t}\n\n\tlet block = startBlock;\n\tlet childCount = block.childCount;\n\tlet start: IMergeNode | undefined = startChild;\n\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\t// go down to the leaf level\n\t\tlet blockResult: NodeAction;\n\t\twhile (start?.isLeaf() === false) {\n\t\t\t// cast is safe due to isLeaf === false in while above\n\t\t\tblock = start as MergeBlock;\n\t\t\tchildCount = block.childCount;\n\t\t\tblockResult = downAction?.(block);\n\t\t\t// setting start undefined will skip the leaf walk\n\t\t\t// so if the block result isn't continue, set it\n\t\t\t// undefined\n\t\t\tstart =\n\t\t\t\tblockResult === NodeAction.Continue\n\t\t\t\t\t? block.children[forward ? 0 : childCount - 1]\n\t\t\t\t\t: undefined;\n\t\t}\n\n\t\tlet exit = blockResult === NodeAction.Exit;\n\n\t\t// walk the leaves if we reached them\n\t\tif (start !== undefined) {\n\t\t\tfor (let i = start.index; i !== -1 && i !== childCount; i += increment) {\n\t\t\t\t// the above loop ensures start is a leaf or undefined, so all children\n\t\t\t\t// will be leaves if start exits, so the cast is safe\n\t\t\t\tif (leafAction(block.children[i] as ISegmentLeaf) === LeafAction.Exit) {\n\t\t\t\t\texit = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if there is no upAction, we don't need to walk up before exiting\n\t\tif (upAction === undefined && exit) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// since we already enumerated the children\n\t\t// we walk up to the next level until there is a sibling\n\t\t// or all the way up if exit is true\n\t\tlet nextIndex = -1;\n\t\tdo {\n\t\t\t// if the blockAction was exit or skip\n\t\t\t// we shouldn't process that block again,\n\t\t\t// if there are subsequent parents while walking up\n\t\t\t// we will process those.\n\t\t\tif (blockResult === NodeAction.Continue) {\n\t\t\t\tupAction?.(block);\n\t\t\t} else {\n\t\t\t\tblockResult = NodeAction.Continue;\n\t\t\t}\n\t\t\tif (block.parent === undefined) {\n\t\t\t\treturn !exit;\n\t\t\t}\n\t\t\tstart = block;\n\t\t\tblock = block.parent;\n\t\t\tchildCount = block.childCount;\n\t\t\tnextIndex = start.index + increment;\n\t\t} while (exit || nextIndex === -1 || nextIndex === childCount);\n\t\t// the above loop ensured that siblings are possible\n\t\tstart = block.children[nextIndex];\n\t}\n}\n\n/**\n * Visit segments starting from node's right/far/forward siblings, then up to node's parent.\n * All segments past `node` are visited, regardless of their visibility.\n */\nexport function forwardExcursion(\n\tstartNode: IMergeNode,\n\tleafAction: (seg: ISegmentLeaf) => boolean | undefined,\n): boolean {\n\tif (!isMergeNodeInfo(startNode)) {\n\t\treturn true;\n\t}\n\n\treturn depthFirstNodeWalk(\n\t\tstartNode.parent,\n\t\t// this will either be the sibling, or undefined\n\t\t// either is fine, and will result in skipping\n\t\t// the startNode only\n\t\tstartNode.parent.children[startNode.index + 1],\n\t\tundefined /* downAction */,\n\t\tleafAction,\n\t);\n}\n\n/**\n * Visit segments starting from node's left/near/backwards siblings, then up to node's parent.\n * All segments past `node` are visited, regardless of their visibility.\n */\nexport function backwardExcursion(\n\tstartNode: IMergeNode,\n\tleafAction: (seg: ISegmentLeaf) => boolean | undefined,\n): boolean {\n\tif (!isMergeNodeInfo(startNode)) {\n\t\treturn true;\n\t}\n\treturn depthFirstNodeWalk(\n\t\tstartNode.parent,\n\t\t// this will either be the sibling, or undefined\n\t\t// either is fine, and will result in skipping\n\t\t// the startNode only\n\t\tstartNode.parent.children[startNode.index - 1],\n\t\tundefined /* downAction */,\n\t\tleafAction,\n\t\tundefined /* upAction */,\n\t\tfalse /* forward */,\n\t);\n}\n\n/**\n * Walks all segments below the specific start block\n * @param startBlock - The block to start the walk at\n * @param leafAction - The action to perform on the leaves\n * @returns true if we naturally exit, false if exiting due to leaf action result\n */\nexport function walkAllChildSegments(\n\tstartBlock: MergeBlock,\n\tleafAction: (segment: ISegmentLeaf) => boolean | undefined | void,\n): boolean {\n\tif (startBlock.childCount === 0) {\n\t\treturn true;\n\t}\n\n\t// undefined shouldn't actually be added, but this allows subsequent check for `node.parent` to typecheck\n\t// without further runtime work.\n\tconst ancestors = new Set<MergeBlock | undefined>();\n\tfor (let cur = startBlock.parent; cur !== undefined; cur = cur.parent) {\n\t\tancestors.add(cur);\n\t}\n\n\treturn depthFirstNodeWalk(\n\t\tstartBlock,\n\t\tstartBlock.children[0],\n\t\tancestors.size === 0\n\t\t\t? undefined\n\t\t\t: (node): false | undefined =>\n\t\t\t\t\tancestors.has(node.parent) ? NodeAction.Exit : NodeAction.Continue,\n\t\tleafAction,\n\t);\n}\n"]}
|
package/lib/mergeTreeNodes.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type { PartialSequenceLengths } from "./partialLengths.js";
|
|
|
11
11
|
import { PropertySet, type MapLike } from "./properties.js";
|
|
12
12
|
import { ReferencePosition } from "./referencePositions.js";
|
|
13
13
|
import { SegmentGroupCollection } from "./segmentGroupCollection.js";
|
|
14
|
+
import { type IInsertionInfo, type IMergeNodeInfo, type IMoveInfo, type IRemovalInfo, type SegmentWithInfo } from "./segmentInfos.js";
|
|
14
15
|
import { PropertiesManager } from "./segmentPropertiesManager.js";
|
|
15
16
|
/**
|
|
16
17
|
* Common properties for a node in a merge tree.
|
|
@@ -35,12 +36,15 @@ export interface IMergeNodeCommon {
|
|
|
35
36
|
* like sequence and matrix.
|
|
36
37
|
*
|
|
37
38
|
* We use tiered interface to control visibility of segment properties.
|
|
38
|
-
* This sits between ISegment and
|
|
39
|
+
* This sits between ISegment and ISegmentPrivate. It should only expose
|
|
39
40
|
* things tagged internal.
|
|
40
41
|
*
|
|
42
|
+
* Everything added here beyond ISegment should be optional to keep the ability
|
|
43
|
+
* to implicitly convert between the tiered interfaces.
|
|
44
|
+
*
|
|
41
45
|
* @internal
|
|
42
46
|
*/
|
|
43
|
-
export type ISegmentInternal = Omit<ISegment, keyof IRemovalInfo | keyof IMoveInfo> &
|
|
47
|
+
export type ISegmentInternal = Omit<ISegment, keyof IRemovalInfo | keyof IMoveInfo> & {
|
|
44
48
|
localRefs?: LocalReferenceCollection;
|
|
45
49
|
};
|
|
46
50
|
/**
|
|
@@ -48,11 +52,14 @@ export type ISegmentInternal = Omit<ISegment, keyof IRemovalInfo | keyof IMoveIn
|
|
|
48
52
|
* This is the lowest interface and is not exported, it site below ISegment and ISegmentInternal.
|
|
49
53
|
* It should only expose unexported things.
|
|
50
54
|
*
|
|
55
|
+
* Everything added here beyond ISegmentInternal should be optional to keep the ability
|
|
56
|
+
* to implicitly convert between the tiered interfaces.
|
|
57
|
+
*
|
|
51
58
|
* someday we may split tree leaves from segments, but for now they are the same
|
|
52
59
|
* this is just a convenience type that makes it clear that we need something that is both a segment and a leaf node
|
|
53
60
|
*/
|
|
54
|
-
export type
|
|
55
|
-
|
|
61
|
+
export type ISegmentPrivate = ISegmentInternal & // eslint-disable-next-line import/no-deprecated
|
|
62
|
+
Partial<IInsertionInfo & IMergeNodeInfo> & {
|
|
56
63
|
segmentGroups?: SegmentGroupCollection;
|
|
57
64
|
propertyManager?: PropertiesManager;
|
|
58
65
|
/**
|
|
@@ -61,100 +68,59 @@ export type ISegmentLeaf = ISegmentInternal & {
|
|
|
61
68
|
* then the segment is not obliterated because it is aware of the latest obliteration.
|
|
62
69
|
*/
|
|
63
70
|
prevObliterateByInserter?: ObliterateInfo;
|
|
71
|
+
/**
|
|
72
|
+
* Whether or not this segment is a special segment denoting the start or
|
|
73
|
+
* end of the tree
|
|
74
|
+
*
|
|
75
|
+
* Endpoint segments are imaginary segments positioned immediately before or
|
|
76
|
+
* after the tree. These segments cannot be referenced by regular operations
|
|
77
|
+
* and exist primarily as a bucket for local references to slide onto during
|
|
78
|
+
* deletion of regular segments.
|
|
79
|
+
*/
|
|
80
|
+
readonly endpointType?: "start" | "end";
|
|
64
81
|
};
|
|
65
|
-
export type IMergeNode = MergeBlock | ISegmentLeaf;
|
|
66
82
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
83
|
+
* Segment leafs are segments that have both IMergeNodeInfo and IInsertionInfo. This means they
|
|
84
|
+
* are inserted at a position, and bound via their parent MergeBlock to the merge tree. MergeBlocks'
|
|
85
|
+
* children are either a segment leaf, or another merge block for interior nodes of the tree. When working
|
|
86
|
+
* within the tree it is generally unnecessary to use type coercions methods common to the infos, and segment
|
|
87
|
+
* leafs, as the children of MergeBlocks are already well typed. However, when segments come from outside the
|
|
88
|
+
* merge tree, like via client's public methods, it becomes necessary to use the type coercions methods
|
|
89
|
+
* to ensure the passed in segment objects are correctly bound to the merge tree.
|
|
71
90
|
*/
|
|
72
|
-
export
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
removedSeq: number;
|
|
81
|
-
/**
|
|
82
|
-
* List of client IDs that have removed this segment.
|
|
83
|
-
* The client that actually removed the segment (i.e. whose removal op was sequenced first) is stored as the first
|
|
84
|
-
* client in this list. Other clients in the list have all issued concurrent ops to remove the segment.
|
|
85
|
-
* @remarks When this list has length \> 1, this is referred to as the "overlapping remove" case.
|
|
86
|
-
*/
|
|
87
|
-
removedClientIds: number[];
|
|
88
|
-
}
|
|
91
|
+
export type ISegmentLeaf = SegmentWithInfo<IMergeNodeInfo & IInsertionInfo>;
|
|
92
|
+
/**
|
|
93
|
+
* A type-guard which determines if the segment has segment leaf, and
|
|
94
|
+
* returns true if it does, along with applying strong typing.
|
|
95
|
+
* @param nodeLike - The segment-like object to check.
|
|
96
|
+
* @returns True if the segment is a segment leaf, otherwise false.
|
|
97
|
+
*/
|
|
98
|
+
export declare const isSegmentLeaf: (segmentLike: unknown) => segmentLike is ISegmentLeaf;
|
|
89
99
|
/**
|
|
90
|
-
*
|
|
100
|
+
* Converts a segment-like object to a segment leaf object if possible.
|
|
91
101
|
*
|
|
92
|
-
* @
|
|
102
|
+
* @param segmentLike - The segment-like object to convert.
|
|
103
|
+
* @returns The segment leaf if the conversion is possible, otherwise undefined.
|
|
93
104
|
*/
|
|
94
|
-
export declare
|
|
105
|
+
export declare const toSegmentLeaf: (segmentLike: unknown) => ISegmentLeaf | undefined;
|
|
95
106
|
/**
|
|
96
|
-
*
|
|
107
|
+
* Asserts that the segment is a segment leaf. Usage of this function should not produce a user facing error.
|
|
97
108
|
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* in the future, when moves _are_ supported.
|
|
101
|
-
* @legacy
|
|
102
|
-
* @alpha
|
|
103
|
-
* @deprecated - This interface will be removed in 2.20 with no replacement.
|
|
109
|
+
* @param segmentLike - The segment-like object to check.
|
|
110
|
+
* @throws Will throw an error if the segment is not a segment leaf.
|
|
104
111
|
*/
|
|
105
|
-
export
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
* concurrent moves this array will contain multiple seqs.
|
|
118
|
-
*
|
|
119
|
-
* The seq at `movedSeqs[i]` corresponds to the client id at `movedClientIds[i]`.
|
|
120
|
-
*
|
|
121
|
-
* The first element corresponds to the seq of the first move
|
|
122
|
-
*/
|
|
123
|
-
movedSeqs: number[];
|
|
124
|
-
/**
|
|
125
|
-
* A reference to the inserted destination segment corresponding to this
|
|
126
|
-
* segment's move.
|
|
127
|
-
*
|
|
128
|
-
* If undefined, the move was an obliterate.
|
|
129
|
-
*
|
|
130
|
-
* Currently this field is unused, as we only support obliterate operations
|
|
131
|
-
*/
|
|
132
|
-
moveDst?: ReferencePosition;
|
|
133
|
-
/**
|
|
134
|
-
* List of client IDs that have moved this segment.
|
|
135
|
-
*
|
|
136
|
-
* The client that actually moved the segment (i.e. whose move op was sequenced
|
|
137
|
-
* first) is stored as the first client in this list. Other clients in the
|
|
138
|
-
* list have all issued concurrent ops to move the segment.
|
|
139
|
-
*/
|
|
140
|
-
movedClientIds: number[];
|
|
141
|
-
/**
|
|
142
|
-
* If this segment was inserted into a concurrently moved range and
|
|
143
|
-
* the move op was sequenced before the insertion op. In this case,
|
|
144
|
-
* the segment is visible only to the inserting client
|
|
145
|
-
*
|
|
146
|
-
* `wasMovedOnInsert` only applies for acked obliterates. That is, if
|
|
147
|
-
* a segment inserted by a remote client is moved on insertion by a local
|
|
148
|
-
* and unacked obliterate, we do not consider it as having been moved
|
|
149
|
-
* on insert
|
|
150
|
-
*
|
|
151
|
-
* If a segment is moved on insertion, its length is only ever visible to
|
|
152
|
-
* the client that inserted the segment. This is relevant in partial length
|
|
153
|
-
* calculations
|
|
154
|
-
*/
|
|
155
|
-
wasMovedOnInsert: boolean;
|
|
156
|
-
}
|
|
157
|
-
export declare function toMoveInfo(maybe: Partial<IMoveInfo> | undefined): IMoveInfo | undefined;
|
|
112
|
+
export declare const assertSegmentLeaf: (segmentLike: unknown) => asserts segmentLike is ISegmentLeaf;
|
|
113
|
+
/**
|
|
114
|
+
* This type is used for building MergeBlocks from segments and other MergeBlocks. We need this
|
|
115
|
+
* type as segments may not yet be bound to the tree, so lack merge node info which is required for
|
|
116
|
+
* segment leafs.
|
|
117
|
+
*/
|
|
118
|
+
export type IMergeNodeBuilder = MergeBlock | SegmentWithInfo<IInsertionInfo>;
|
|
119
|
+
/**
|
|
120
|
+
* This type is used by MergeBlocks to define their children, which are either segments or other
|
|
121
|
+
* MergeBlocks.
|
|
122
|
+
*/
|
|
123
|
+
export type IMergeNode = MergeBlock | ISegmentLeaf;
|
|
158
124
|
/**
|
|
159
125
|
* A segment representing a portion of the merge tree.
|
|
160
126
|
* Segments are leaf nodes of the merge tree and contain data.
|
|
@@ -205,18 +171,6 @@ export interface ISegment {
|
|
|
205
171
|
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
206
172
|
*/
|
|
207
173
|
localSeq?: number;
|
|
208
|
-
/**
|
|
209
|
-
* Local seq at which this segment was removed. If this is defined, `removedSeq` will initially be set to
|
|
210
|
-
* UnassignedSequenceNumber. However, if another client concurrently removes the same segment, `removedSeq`
|
|
211
|
-
* will be updated to the seq at which that client removed this segment.
|
|
212
|
-
*
|
|
213
|
-
* Like {@link ISegment.localSeq}, this field is cleared once the local removal of the segment is acked.
|
|
214
|
-
*
|
|
215
|
-
* @privateRemarks
|
|
216
|
-
* See {@link CollaborationWindow.localSeq} for more information on the semantics of localSeq.
|
|
217
|
-
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
218
|
-
*/
|
|
219
|
-
localRemovedSeq?: number;
|
|
220
174
|
/**
|
|
221
175
|
* Seq at which this segment was inserted.
|
|
222
176
|
* If undefined, it is assumed the segment was inserted prior to the collab window's minimum sequence number.
|
|
@@ -253,6 +207,18 @@ export interface ISegment {
|
|
|
253
207
|
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
254
208
|
*/
|
|
255
209
|
ordinal: string;
|
|
210
|
+
/**
|
|
211
|
+
* Local seq at which this segment was removed. If this is defined, `removedSeq` will initially be set to
|
|
212
|
+
* UnassignedSequenceNumber. However, if another client concurrently removes the same segment, `removedSeq`
|
|
213
|
+
* will be updated to the seq at which that client removed this segment.
|
|
214
|
+
*
|
|
215
|
+
* Like {@link ISegment.localSeq}, this field is cleared once the local removal of the segment is acked.
|
|
216
|
+
*
|
|
217
|
+
* @privateRemarks
|
|
218
|
+
* See {@link CollaborationWindow.localSeq} for more information on the semantics of localSeq.
|
|
219
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
220
|
+
*/
|
|
221
|
+
localRemovedSeq?: number;
|
|
256
222
|
/**
|
|
257
223
|
* {@inheritDoc @fluidframework/merge-tree#IRemovalInfo.removedSeq}
|
|
258
224
|
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
@@ -300,12 +266,6 @@ export interface ISegment {
|
|
|
300
266
|
* @alpha
|
|
301
267
|
*/
|
|
302
268
|
export declare function segmentIsRemoved(segment: ISegment): boolean;
|
|
303
|
-
/**
|
|
304
|
-
* @internal
|
|
305
|
-
*/
|
|
306
|
-
export interface IMarkerModifiedAction {
|
|
307
|
-
(marker: Marker): void;
|
|
308
|
-
}
|
|
309
269
|
/**
|
|
310
270
|
* @legacy
|
|
311
271
|
* @alpha
|
|
@@ -313,46 +273,15 @@ export interface IMarkerModifiedAction {
|
|
|
313
273
|
export interface ISegmentAction<TClientData> {
|
|
314
274
|
(segment: ISegment, pos: number, refSeq: number, clientId: number, start: number, end: number, accum: TClientData): boolean;
|
|
315
275
|
}
|
|
316
|
-
/**
|
|
317
|
-
* @internal
|
|
318
|
-
*/
|
|
319
276
|
export interface ISegmentChanges {
|
|
320
|
-
next?:
|
|
321
|
-
replaceCurrent?:
|
|
277
|
+
next?: SegmentWithInfo<IInsertionInfo>;
|
|
278
|
+
replaceCurrent?: SegmentWithInfo<IInsertionInfo>;
|
|
322
279
|
}
|
|
323
|
-
/**
|
|
324
|
-
* @internal
|
|
325
|
-
*/
|
|
326
|
-
export interface BlockAction<TClientData> {
|
|
327
|
-
(block: MergeBlock, pos: number, refSeq: number, clientId: number, start: number | undefined, end: number | undefined, accum: TClientData): boolean;
|
|
328
|
-
}
|
|
329
|
-
/**
|
|
330
|
-
* @internal
|
|
331
|
-
*/
|
|
332
|
-
export interface NodeAction<TClientData> {
|
|
333
|
-
(node: IMergeNode, pos: number, refSeq: number, clientId: number, start: number | undefined, end: number | undefined, clientData: TClientData): boolean;
|
|
334
|
-
}
|
|
335
|
-
/**
|
|
336
|
-
* @internal
|
|
337
|
-
*/
|
|
338
280
|
export interface InsertContext {
|
|
339
|
-
candidateSegment?:
|
|
340
|
-
leaf: (segment:
|
|
281
|
+
candidateSegment?: SegmentWithInfo<IInsertionInfo>;
|
|
282
|
+
leaf: (segment: ISegmentLeaf | undefined, pos: number, ic: InsertContext) => ISegmentChanges;
|
|
341
283
|
continuePredicate?: (continueFromBlock: MergeBlock) => boolean;
|
|
342
284
|
}
|
|
343
|
-
/**
|
|
344
|
-
* @internal
|
|
345
|
-
*/
|
|
346
|
-
export interface SegmentActions<TClientData> {
|
|
347
|
-
leaf?: ISegmentAction<TClientData>;
|
|
348
|
-
shift?: NodeAction<TClientData>;
|
|
349
|
-
contains?: NodeAction<TClientData>;
|
|
350
|
-
pre?: BlockAction<TClientData>;
|
|
351
|
-
post?: BlockAction<TClientData>;
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* @internal
|
|
355
|
-
*/
|
|
356
285
|
export interface ObliterateInfo {
|
|
357
286
|
start: LocalReferencePosition;
|
|
358
287
|
end: LocalReferencePosition;
|
|
@@ -362,11 +291,8 @@ export interface ObliterateInfo {
|
|
|
362
291
|
localSeq: number | undefined;
|
|
363
292
|
segmentGroup: SegmentGroup | undefined;
|
|
364
293
|
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
*/
|
|
368
|
-
export interface SegmentGroup<S extends ISegmentInternal = ISegmentInternal> {
|
|
369
|
-
segments: S[];
|
|
294
|
+
export interface SegmentGroup {
|
|
295
|
+
segments: ISegmentLeaf[];
|
|
370
296
|
previousProps?: PropertySet[];
|
|
371
297
|
localSeq?: number;
|
|
372
298
|
refSeq: number;
|
|
@@ -377,13 +303,9 @@ export interface SegmentGroup<S extends ISegmentInternal = ISegmentInternal> {
|
|
|
377
303
|
* the MergeTree always inserts first, then checks for overflow and splits if the child count equals
|
|
378
304
|
* `MaxNodesInBlock`. (i.e., `MaxNodesInBlock` contains 1 extra slot for temporary storage to
|
|
379
305
|
* facilitate splits.)
|
|
380
|
-
* @internal
|
|
381
306
|
*/
|
|
382
307
|
export declare const MaxNodesInBlock = 8;
|
|
383
|
-
|
|
384
|
-
* @internal
|
|
385
|
-
*/
|
|
386
|
-
export declare class MergeBlock implements IMergeNodeCommon {
|
|
308
|
+
export declare class MergeBlock implements Partial<IMergeNodeInfo> {
|
|
387
309
|
childCount: number;
|
|
388
310
|
children: IMergeNode[];
|
|
389
311
|
needsScour?: boolean;
|
|
@@ -415,8 +337,8 @@ export declare class MergeBlock implements IMergeNodeCommon {
|
|
|
415
337
|
partialLengths?: PartialSequenceLengths;
|
|
416
338
|
constructor(childCount: number);
|
|
417
339
|
setOrdinal(child: IMergeNode, index: number): void;
|
|
418
|
-
assignChild(child: IMergeNode, index: number, updateOrdinal?: boolean): void;
|
|
419
340
|
}
|
|
341
|
+
export declare function assignChild<C extends IMergeNodeBuilder>(parent: MergeBlock, child: C, index: number, updateOrdinal?: boolean): asserts child is C & IMergeNodeInfo;
|
|
420
342
|
export declare function seqLTE(seq: number, minOrRefSeq: number): boolean;
|
|
421
343
|
/**
|
|
422
344
|
* @legacy
|
|
@@ -587,7 +509,7 @@ export declare class CollaborationWindow {
|
|
|
587
509
|
* { localSeq: 1, seq: UnassignedSequenceNumber, text: "C" },
|
|
588
510
|
* ]
|
|
589
511
|
* ```
|
|
590
|
-
* (note that
|
|
512
|
+
* (note that localSeq tracks the localSeq at which a segment was inserted)
|
|
591
513
|
*
|
|
592
514
|
* Suppose the client then disconnects and reconnects before any of its insertions are acked. The reconnect flow will necessitate
|
|
593
515
|
* that the client regenerates and resubmits ops based on its current segment state as well as the original op that was sent.
|
|
@@ -639,12 +561,4 @@ export declare const compareNumbers: (a: number, b: number) => number;
|
|
|
639
561
|
* Compares two strings.
|
|
640
562
|
*/
|
|
641
563
|
export declare const compareStrings: (a: string, b: string) => number;
|
|
642
|
-
/**
|
|
643
|
-
* Get a human-readable string for a given {@link Marker}.
|
|
644
|
-
*
|
|
645
|
-
* @remarks This function is intended for debugging only. The exact format of
|
|
646
|
-
* this string should not be relied upon between versions.
|
|
647
|
-
* @internal
|
|
648
|
-
*/
|
|
649
|
-
export declare function debugMarkerToString(marker: Marker): string;
|
|
650
564
|
//# sourceMappingURL=mergeTreeNodes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeTreeNodes.d.ts","sourceRoot":"","sources":["../src/mergeTreeNodes.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"mergeTreeNodes.d.ts","sourceRoot":"","sources":["../src/mergeTreeNodes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAE9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAOpE,OAAO,EAAE,wBAAwB,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEnE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAoB,KAAK,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAMN,KAAK,cAAc,EACnB,KAAK,cAAc,EAEnB,KAAK,SAAS,EAEd,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;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