@fluidframework/merge-tree 2.11.0 → 2.12.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 +41 -0
- package/api-report/merge-tree.legacy.alpha.api.md +50 -19
- package/dist/MergeTreeTextHelper.js.map +1 -1
- package/dist/attributionPolicy.d.ts.map +1 -1
- package/dist/attributionPolicy.js +2 -1
- package/dist/attributionPolicy.js.map +1 -1
- package/dist/client.js.map +1 -1
- package/dist/endOfTreeSegment.d.ts +3 -3
- package/dist/endOfTreeSegment.d.ts.map +1 -1
- package/dist/endOfTreeSegment.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +2 -1
- package/dist/localReference.d.ts +1 -0
- package/dist/localReference.d.ts.map +1 -1
- package/dist/localReference.js +1 -0
- package/dist/localReference.js.map +1 -1
- package/dist/mergeTree.d.ts.map +1 -1
- package/dist/mergeTree.js +19 -2
- package/dist/mergeTree.js.map +1 -1
- package/dist/mergeTreeNodeWalk.d.ts +5 -5
- package/dist/mergeTreeNodeWalk.d.ts.map +1 -1
- package/dist/mergeTreeNodeWalk.js.map +1 -1
- package/dist/mergeTreeNodes.d.ts +115 -7
- package/dist/mergeTreeNodes.d.ts.map +1 -1
- package/dist/mergeTreeNodes.js +25 -1
- package/dist/mergeTreeNodes.js.map +1 -1
- package/dist/partialLengths.d.ts +2 -2
- package/dist/partialLengths.d.ts.map +1 -1
- package/dist/partialLengths.js +5 -1
- package/dist/partialLengths.js.map +1 -1
- package/dist/perspective.d.ts +9 -9
- package/dist/perspective.d.ts.map +1 -1
- package/dist/perspective.js.map +1 -1
- package/dist/revertibles.d.ts.map +1 -1
- package/dist/revertibles.js +3 -0
- package/dist/revertibles.js.map +1 -1
- package/dist/snapshotLoader.js.map +1 -1
- 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.map +1 -1
- package/dist/sortedSegmentSet.d.ts +4 -4
- package/dist/sortedSegmentSet.d.ts.map +1 -1
- package/dist/sortedSegmentSet.js.map +1 -1
- package/dist/test/beastTest.spec.d.ts.map +1 -1
- package/dist/test/beastTest.spec.js.map +1 -1
- package/dist/test/client.applyMsg.spec.js.map +1 -1
- package/dist/test/client.attributionFarm.spec.d.ts.map +1 -1
- package/dist/test/client.attributionFarm.spec.js.map +1 -1
- package/dist/test/client.getPosition.spec.js.map +1 -1
- package/dist/test/client.localReference.spec.js.map +1 -1
- package/dist/test/client.localReferenceFarm.spec.js.map +1 -1
- package/dist/test/mergeTree.markRangeRemoved.spec.js.map +1 -1
- package/dist/test/mergeTreeOperationRunner.d.ts.map +1 -1
- package/dist/test/mergeTreeOperationRunner.js.map +1 -1
- package/dist/test/resetPendingSegmentsToOp.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.map +1 -1
- package/dist/test/testClient.d.ts +6 -6
- package/dist/test/testClient.d.ts.map +1 -1
- package/dist/test/testClient.js.map +1 -1
- 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.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.map +1 -1
- package/dist/test/tracking.spec.js.map +1 -1
- package/dist/test/wordUnitTests.spec.d.ts.map +1 -1
- package/dist/test/wordUnitTests.spec.js +3 -1
- package/dist/test/wordUnitTests.spec.js.map +1 -1
- package/dist/zamboni.js.map +1 -1
- package/lib/MergeTreeTextHelper.js.map +1 -1
- package/lib/attributionPolicy.d.ts.map +1 -1
- package/lib/attributionPolicy.js +2 -1
- package/lib/attributionPolicy.js.map +1 -1
- package/lib/client.js.map +1 -1
- package/lib/endOfTreeSegment.d.ts +3 -3
- package/lib/endOfTreeSegment.d.ts.map +1 -1
- package/lib/endOfTreeSegment.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +2 -1
- package/lib/localReference.d.ts +1 -0
- package/lib/localReference.d.ts.map +1 -1
- package/lib/localReference.js +1 -0
- package/lib/localReference.js.map +1 -1
- package/lib/mergeTree.d.ts.map +1 -1
- package/lib/mergeTree.js +22 -3
- package/lib/mergeTree.js.map +1 -1
- package/lib/mergeTreeNodeWalk.d.ts +5 -5
- package/lib/mergeTreeNodeWalk.d.ts.map +1 -1
- package/lib/mergeTreeNodeWalk.js.map +1 -1
- package/lib/mergeTreeNodes.d.ts +115 -7
- package/lib/mergeTreeNodes.d.ts.map +1 -1
- package/lib/mergeTreeNodes.js +23 -0
- package/lib/mergeTreeNodes.js.map +1 -1
- package/lib/partialLengths.d.ts +2 -2
- package/lib/partialLengths.d.ts.map +1 -1
- package/lib/partialLengths.js +5 -1
- package/lib/partialLengths.js.map +1 -1
- package/lib/perspective.d.ts +9 -9
- package/lib/perspective.d.ts.map +1 -1
- package/lib/perspective.js.map +1 -1
- package/lib/revertibles.d.ts.map +1 -1
- package/lib/revertibles.js +4 -1
- package/lib/revertibles.js.map +1 -1
- package/lib/snapshotLoader.js.map +1 -1
- 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.map +1 -1
- package/lib/sortedSegmentSet.d.ts +4 -4
- package/lib/sortedSegmentSet.d.ts.map +1 -1
- package/lib/sortedSegmentSet.js.map +1 -1
- package/lib/test/beastTest.spec.d.ts.map +1 -1
- package/lib/test/beastTest.spec.js.map +1 -1
- package/lib/test/client.applyMsg.spec.js.map +1 -1
- package/lib/test/client.attributionFarm.spec.d.ts.map +1 -1
- package/lib/test/client.attributionFarm.spec.js.map +1 -1
- package/lib/test/client.getPosition.spec.js.map +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/mergeTree.markRangeRemoved.spec.js.map +1 -1
- package/lib/test/mergeTreeOperationRunner.d.ts.map +1 -1
- package/lib/test/mergeTreeOperationRunner.js.map +1 -1
- package/lib/test/resetPendingSegmentsToOp.spec.js +1 -1
- package/lib/test/resetPendingSegmentsToOp.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.map +1 -1
- package/lib/test/testClient.d.ts +6 -6
- package/lib/test/testClient.d.ts.map +1 -1
- package/lib/test/testClient.js +1 -1
- package/lib/test/testClient.js.map +1 -1
- 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.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.map +1 -1
- package/lib/test/tracking.spec.js.map +1 -1
- package/lib/test/wordUnitTests.spec.d.ts.map +1 -1
- package/lib/test/wordUnitTests.spec.js +3 -1
- package/lib/test/wordUnitTests.spec.js.map +1 -1
- package/lib/zamboni.js.map +1 -1
- package/package.json +17 -17
- package/src/MergeTreeTextHelper.ts +2 -2
- package/src/attributionPolicy.ts +3 -1
- package/src/client.ts +1 -1
- package/src/endOfTreeSegment.ts +6 -3
- package/src/index.ts +1 -0
- package/src/localReference.ts +1 -0
- package/src/mergeTree.ts +19 -0
- package/src/mergeTreeNodeWalk.ts +6 -6
- package/src/mergeTreeNodes.ts +136 -9
- package/src/partialLengths.ts +9 -5
- package/src/perspective.ts +11 -11
- package/src/revertibles.ts +9 -11
- package/src/snapshotLoader.ts +7 -7
- package/src/snapshotV1.ts +4 -4
- package/src/snapshotlegacy.ts +6 -6
- package/src/sortedSegmentSet.ts +8 -9
- package/src/zamboni.ts +2 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { type MergeBlock, IMergeNode
|
|
5
|
+
import { type ISegmentLeaf, type MergeBlock, IMergeNode } from "./mergeTreeNodes.js";
|
|
6
6
|
export declare const LeafAction: {
|
|
7
7
|
readonly Exit: false;
|
|
8
8
|
};
|
|
@@ -24,22 +24,22 @@ export type NodeAction = (typeof NodeAction)[keyof typeof NodeAction] | Exclude<
|
|
|
24
24
|
* @param forward - whether to walk forward or backward
|
|
25
25
|
* @returns true if we naturally exit, false if exiting due to Exit action result
|
|
26
26
|
*/
|
|
27
|
-
export declare function depthFirstNodeWalk(startBlock: MergeBlock, startChild: IMergeNode | undefined, downAction?: (node: IMergeNode) => NodeAction, leafActionOverride?: (seg:
|
|
27
|
+
export declare function depthFirstNodeWalk(startBlock: MergeBlock, startChild: IMergeNode | undefined, downAction?: (node: IMergeNode) => NodeAction, leafActionOverride?: (seg: ISegmentLeaf) => LeafAction, upAction?: (block: MergeBlock) => void, forward?: boolean): boolean;
|
|
28
28
|
/**
|
|
29
29
|
* Visit segments starting from node's right/far/forward siblings, then up to node's parent.
|
|
30
30
|
* All segments past `node` are visited, regardless of their visibility.
|
|
31
31
|
*/
|
|
32
|
-
export declare function forwardExcursion(startNode: IMergeNode, leafAction: (seg:
|
|
32
|
+
export declare function forwardExcursion(startNode: IMergeNode, leafAction: (seg: ISegmentLeaf) => boolean | undefined): boolean;
|
|
33
33
|
/**
|
|
34
34
|
* Visit segments starting from node's left/near/backwards siblings, then up to node's parent.
|
|
35
35
|
* All segments past `node` are visited, regardless of their visibility.
|
|
36
36
|
*/
|
|
37
|
-
export declare function backwardExcursion(startNode: IMergeNode, leafAction: (seg:
|
|
37
|
+
export declare function backwardExcursion(startNode: IMergeNode, leafAction: (seg: ISegmentLeaf) => boolean | undefined): boolean;
|
|
38
38
|
/**
|
|
39
39
|
* Walks all segments below the specific start block
|
|
40
40
|
* @param startBlock - The block to start the walk at
|
|
41
41
|
* @param leafAction - The action to perform on the leaves
|
|
42
42
|
* @returns true if we naturally exit, false if exiting due to leaf action result
|
|
43
43
|
*/
|
|
44
|
-
export declare function walkAllChildSegments(startBlock: MergeBlock, leafAction: (segment:
|
|
44
|
+
export declare function walkAllChildSegments(startBlock: MergeBlock, leafAction: (segment: ISegmentLeaf) => boolean | undefined | void): boolean;
|
|
45
45
|
//# sourceMappingURL=mergeTreeNodeWalk.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeTreeNodeWalk.d.ts","sourceRoot":"","sources":["../src/mergeTreeNodeWalk.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,
|
|
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;AAErF,eAAO,MAAM,UAAU;;CAEb,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;AAEpD,eAAO,MAAM,UAAU;;;;CAKb,CAAC;AAGX,MAAM,MAAM,UAAU,GACnB,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,GAC5C,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AAE7B;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CACjC,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAA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IAAI,CAAC,CAAC,CAAC,kBAAU,CAAC,QAAQ,EACrE,UAAU,CACV,CAAC;AACH,CAAC;AAxBD,oDAwBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type MergeBlock, IMergeNode, ISegment } 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: ISegment) => 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 ISegment) === 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: ISegment) => 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: ISegment) => 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: ISegment) => 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.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;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,kBAAU,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAU,CAAC,QAAQ,EACrE,UAAU,CACV,CAAC;AACH,CAAC;AAxBD,oDAwBC","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"]}
|
package/dist/mergeTreeNodes.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { PropertiesManager } from "./segmentPropertiesManager.js";
|
|
|
16
16
|
* Common properties for a node in a merge tree.
|
|
17
17
|
* @legacy
|
|
18
18
|
* @alpha
|
|
19
|
+
* @deprecated - This interface will be removed in 2.20 with no replacement.
|
|
19
20
|
*/
|
|
20
21
|
export interface IMergeNodeCommon {
|
|
21
22
|
/**
|
|
@@ -39,7 +40,7 @@ export interface IMergeNodeCommon {
|
|
|
39
40
|
*
|
|
40
41
|
* @internal
|
|
41
42
|
*/
|
|
42
|
-
export type ISegmentInternal = ISegment & {
|
|
43
|
+
export type ISegmentInternal = Omit<ISegment, keyof IRemovalInfo | keyof IMoveInfo> & Partial<IMergeNodeCommon> & Partial<IRemovalInfo> & Partial<IMoveInfo> & {
|
|
43
44
|
localRefs?: LocalReferenceCollection;
|
|
44
45
|
};
|
|
45
46
|
/**
|
|
@@ -66,6 +67,7 @@ export type IMergeNode = MergeBlock | ISegmentLeaf;
|
|
|
66
67
|
* Contains removal information associated to an {@link ISegment}.
|
|
67
68
|
* @legacy
|
|
68
69
|
* @alpha
|
|
70
|
+
* @deprecated - This interface will be removed in 2.20 with no replacement.
|
|
69
71
|
*/
|
|
70
72
|
export interface IRemovalInfo {
|
|
71
73
|
/**
|
|
@@ -98,6 +100,7 @@ export declare function toRemovalInfo(maybe: Partial<IRemovalInfo> | undefined):
|
|
|
98
100
|
* in the future, when moves _are_ supported.
|
|
99
101
|
* @legacy
|
|
100
102
|
* @alpha
|
|
103
|
+
* @deprecated - This interface will be removed in 2.20 with no replacement.
|
|
101
104
|
*/
|
|
102
105
|
export interface IMoveInfo {
|
|
103
106
|
/**
|
|
@@ -158,7 +161,7 @@ export declare function toMoveInfo(maybe: Partial<IMoveInfo> | undefined): IMove
|
|
|
158
161
|
* @legacy
|
|
159
162
|
* @alpha
|
|
160
163
|
*/
|
|
161
|
-
export interface ISegment
|
|
164
|
+
export interface ISegment {
|
|
162
165
|
readonly type: string;
|
|
163
166
|
readonly trackingCollection: TrackingGroupCollection;
|
|
164
167
|
/**
|
|
@@ -169,6 +172,7 @@ export interface ISegment extends IMergeNodeCommon, Partial<IRemovalInfo>, Parti
|
|
|
169
172
|
* after the tree. These segments cannot be referenced by regular operations
|
|
170
173
|
* and exist primarily as a bucket for local references to slide onto during
|
|
171
174
|
* deletion of regular segments.
|
|
175
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
172
176
|
*/
|
|
173
177
|
readonly endpointType?: "start" | "end";
|
|
174
178
|
/**
|
|
@@ -198,6 +202,7 @@ export interface ISegment extends IMergeNodeCommon, Partial<IRemovalInfo>, Parti
|
|
|
198
202
|
*
|
|
199
203
|
* @privateRemarks
|
|
200
204
|
* See {@link CollaborationWindow.localSeq} for more information on the semantics of localSeq.
|
|
205
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
201
206
|
*/
|
|
202
207
|
localSeq?: number;
|
|
203
208
|
/**
|
|
@@ -209,19 +214,23 @@ export interface ISegment extends IMergeNodeCommon, Partial<IRemovalInfo>, Parti
|
|
|
209
214
|
*
|
|
210
215
|
* @privateRemarks
|
|
211
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.
|
|
212
218
|
*/
|
|
213
219
|
localRemovedSeq?: number;
|
|
214
220
|
/**
|
|
215
221
|
* Seq at which this segment was inserted.
|
|
216
222
|
* If undefined, it is assumed the segment was inserted prior to the collab window's minimum sequence number.
|
|
223
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
217
224
|
*/
|
|
218
225
|
seq?: number;
|
|
219
226
|
/**
|
|
220
227
|
* Short clientId for the client that inserted this segment.
|
|
228
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
221
229
|
*/
|
|
222
230
|
clientId: number;
|
|
223
231
|
/**
|
|
224
232
|
* Local references added to this segment.
|
|
233
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
225
234
|
*/
|
|
226
235
|
localRefs?: LocalReferenceCollection;
|
|
227
236
|
/**
|
|
@@ -233,7 +242,64 @@ export interface ISegment extends IMergeNodeCommon, Partial<IRemovalInfo>, Parti
|
|
|
233
242
|
append(segment: ISegment): void;
|
|
234
243
|
splitAt(pos: number): ISegment | undefined;
|
|
235
244
|
toJSONObject(): any;
|
|
245
|
+
isLeaf(): this is ISegment;
|
|
246
|
+
/**
|
|
247
|
+
* {@inheritDoc @fluidframework/merge-tree#IMergeNodeCommon.index}
|
|
248
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
249
|
+
*/
|
|
250
|
+
index: number;
|
|
251
|
+
/**
|
|
252
|
+
* {@inheritDoc @fluidframework/merge-tree#IMergeNodeCommon.ordinal}
|
|
253
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
254
|
+
*/
|
|
255
|
+
ordinal: string;
|
|
256
|
+
/**
|
|
257
|
+
* {@inheritDoc @fluidframework/merge-tree#IRemovalInfo.removedSeq}
|
|
258
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
259
|
+
*/
|
|
260
|
+
removedSeq?: number;
|
|
261
|
+
/**
|
|
262
|
+
* {@inheritDoc @fluidframework/merge-tree#IRemovalInfo.removedClientIds}
|
|
263
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
264
|
+
*/
|
|
265
|
+
removedClientIds?: number[];
|
|
266
|
+
/**
|
|
267
|
+
* {@inheritDoc @fluidframework/merge-tree#IMoveInfo.localMovedSeq}
|
|
268
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
269
|
+
*/
|
|
270
|
+
localMovedSeq?: number;
|
|
271
|
+
/**
|
|
272
|
+
* {@inheritDoc @fluidframework/merge-tree#IMoveInfo.movedSeq}
|
|
273
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
274
|
+
*/
|
|
275
|
+
movedSeq?: number;
|
|
276
|
+
/**
|
|
277
|
+
* {@inheritDoc @fluidframework/merge-tree#IMoveInfo.movedSeqs}
|
|
278
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
279
|
+
*/
|
|
280
|
+
movedSeqs?: number[];
|
|
281
|
+
/**
|
|
282
|
+
* {@inheritDoc @fluidframework/merge-tree#IMoveInfo.moveDst}
|
|
283
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
284
|
+
*/
|
|
285
|
+
moveDst?: ReferencePosition;
|
|
286
|
+
/**
|
|
287
|
+
* {@inheritDoc @fluidframework/merge-tree#IMoveInfo.movedClientIds}
|
|
288
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
289
|
+
*/
|
|
290
|
+
movedClientIds?: number[];
|
|
291
|
+
/**
|
|
292
|
+
* {@inheritDoc @fluidframework/merge-tree#IMoveInfo.wasMovedOnInsert}
|
|
293
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
294
|
+
*/
|
|
295
|
+
wasMovedOnInsert?: boolean;
|
|
236
296
|
}
|
|
297
|
+
/**
|
|
298
|
+
* Determine if a segment has been removed.
|
|
299
|
+
* @legacy
|
|
300
|
+
* @alpha
|
|
301
|
+
*/
|
|
302
|
+
export declare function segmentIsRemoved(segment: ISegment): boolean;
|
|
237
303
|
/**
|
|
238
304
|
* @internal
|
|
239
305
|
*/
|
|
@@ -251,8 +317,8 @@ export interface ISegmentAction<TClientData> {
|
|
|
251
317
|
* @internal
|
|
252
318
|
*/
|
|
253
319
|
export interface ISegmentChanges {
|
|
254
|
-
next?:
|
|
255
|
-
replaceCurrent?:
|
|
320
|
+
next?: ISegmentInternal;
|
|
321
|
+
replaceCurrent?: ISegmentInternal;
|
|
256
322
|
}
|
|
257
323
|
/**
|
|
258
324
|
* @internal
|
|
@@ -270,8 +336,8 @@ export interface NodeAction<TClientData> {
|
|
|
270
336
|
* @internal
|
|
271
337
|
*/
|
|
272
338
|
export interface InsertContext {
|
|
273
|
-
candidateSegment?:
|
|
274
|
-
leaf: (segment:
|
|
339
|
+
candidateSegment?: ISegmentInternal;
|
|
340
|
+
leaf: (segment: ISegmentInternal | undefined, pos: number, ic: InsertContext) => ISegmentChanges;
|
|
275
341
|
continuePredicate?: (continueFromBlock: MergeBlock) => boolean;
|
|
276
342
|
}
|
|
277
343
|
/**
|
|
@@ -337,7 +403,7 @@ export declare class MergeBlock implements IMergeNodeCommon {
|
|
|
337
403
|
* with a certain label before a given position
|
|
338
404
|
*/
|
|
339
405
|
leftmostTiles: Readonly<MapLike<Marker>>;
|
|
340
|
-
isLeaf(): this is
|
|
406
|
+
isLeaf(): this is ISegmentInternal;
|
|
341
407
|
/**
|
|
342
408
|
* Supports querying the total length of all descendants of this IMergeBlock from the perspective of any
|
|
343
409
|
* (clientId, seq) within the collab window.
|
|
@@ -357,25 +423,67 @@ export declare function seqLTE(seq: number, minOrRefSeq: number): boolean;
|
|
|
357
423
|
* @alpha
|
|
358
424
|
*/
|
|
359
425
|
export declare abstract class BaseSegment implements ISegment {
|
|
426
|
+
/**
|
|
427
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
428
|
+
*/
|
|
360
429
|
clientId: number;
|
|
430
|
+
/**
|
|
431
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
432
|
+
*/
|
|
361
433
|
seq: number;
|
|
434
|
+
/**
|
|
435
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
436
|
+
*/
|
|
362
437
|
removedSeq?: number;
|
|
438
|
+
/**
|
|
439
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
440
|
+
*/
|
|
363
441
|
removedClientIds?: number[];
|
|
442
|
+
/**
|
|
443
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
444
|
+
*/
|
|
364
445
|
movedSeq?: number;
|
|
446
|
+
/**
|
|
447
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
448
|
+
*/
|
|
365
449
|
movedSeqs?: number[];
|
|
450
|
+
/**
|
|
451
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
452
|
+
*/
|
|
366
453
|
movedClientIds?: number[];
|
|
454
|
+
/**
|
|
455
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
456
|
+
*/
|
|
367
457
|
wasMovedOnInsert?: boolean | undefined;
|
|
458
|
+
/**
|
|
459
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
460
|
+
*/
|
|
368
461
|
index: number;
|
|
462
|
+
/**
|
|
463
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
464
|
+
*/
|
|
369
465
|
ordinal: string;
|
|
370
466
|
cachedLength: number;
|
|
371
467
|
readonly trackingCollection: TrackingGroupCollection;
|
|
372
468
|
/***/
|
|
373
469
|
attribution?: IAttributionCollection<AttributionKey>;
|
|
374
470
|
properties?: PropertySet;
|
|
471
|
+
/**
|
|
472
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
473
|
+
*/
|
|
375
474
|
localRefs?: LocalReferenceCollection;
|
|
376
475
|
abstract readonly type: string;
|
|
476
|
+
/**
|
|
477
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
478
|
+
*/
|
|
377
479
|
localSeq?: number;
|
|
480
|
+
/**
|
|
481
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
482
|
+
*/
|
|
378
483
|
localRemovedSeq?: number;
|
|
484
|
+
/**
|
|
485
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
486
|
+
*/
|
|
379
487
|
localMovedSeq?: number;
|
|
380
488
|
constructor(properties?: PropertySet);
|
|
381
489
|
hasProperty(key: string): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeTreeNodes.d.ts","sourceRoot":"","sources":["../src/mergeTreeNodes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAE9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"mergeTreeNodes.d.ts","sourceRoot":"","sources":["../src/mergeTreeNodes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,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,EACN,iBAAiB,EAGjB,MAAM,yBAAyB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AS,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO;IAIrC,MAAM,IAAI,IAAI;CAGd;AAED;;;;;GAKG;AACH,qBAAa,mBAAmB;IAC/B,QAAQ,SAAiB;IACzB,aAAa,UAAS;IAEtB;;OAEG;IACH,MAAM,SAAK;IACX;;OAEG;IACH,UAAU,SAAK;IAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8DG;IACH,QAAQ,SAAK;IAEb,QAAQ,CAAC,CAAC,EAAE,mBAAmB,GAAG,IAAI;CAMtC;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,MAAO,MAAM,KAAK,MAAM,KAAG,MAAe,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,cAAc,MAAO,MAAM,KAAK,MAAM,KAAG,MAA4B,CAAC;AAEnF;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAmC1D"}
|
package/dist/mergeTreeNodes.js
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.debugMarkerToString = exports.compareStrings = exports.compareNumbers = exports.CollaborationWindow = exports.Marker = exports.reservedMarkerSimpleTypeKey = exports.reservedMarkerIdKey = exports.BaseSegment = exports.seqLTE = exports.MergeBlock = exports.MaxNodesInBlock = exports.toMoveInfo = exports.toRemovalInfo = void 0;
|
|
7
|
+
exports.debugMarkerToString = exports.compareStrings = exports.compareNumbers = exports.CollaborationWindow = exports.Marker = exports.reservedMarkerSimpleTypeKey = exports.reservedMarkerIdKey = exports.BaseSegment = exports.seqLTE = exports.MergeBlock = exports.MaxNodesInBlock = exports.segmentIsRemoved = exports.toMoveInfo = exports.toRemovalInfo = void 0;
|
|
8
8
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
9
9
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
10
10
|
const constants_js_1 = require("./constants.js");
|
|
11
|
+
// eslint-disable-next-line import/no-deprecated
|
|
11
12
|
const localReference_js_1 = require("./localReference.js");
|
|
12
13
|
const mergeTreeTracking_js_1 = require("./mergeTreeTracking.js");
|
|
13
14
|
const ops_js_1 = require("./ops.js");
|
|
@@ -36,6 +37,16 @@ function toMoveInfo(maybe) {
|
|
|
36
37
|
maybe?.wasMovedOnInsert === undefined, 0x86d /* movedClientIds, movedSeq, wasMovedOnInsert, and movedSeqs should all be either set or not set */);
|
|
37
38
|
}
|
|
38
39
|
exports.toMoveInfo = toMoveInfo;
|
|
40
|
+
/**
|
|
41
|
+
* Determine if a segment has been removed.
|
|
42
|
+
* @legacy
|
|
43
|
+
* @alpha
|
|
44
|
+
*/
|
|
45
|
+
function segmentIsRemoved(segment) {
|
|
46
|
+
const leaf = segment;
|
|
47
|
+
return leaf.removedSeq !== undefined;
|
|
48
|
+
}
|
|
49
|
+
exports.segmentIsRemoved = segmentIsRemoved;
|
|
39
50
|
/**
|
|
40
51
|
* Note that the actual branching factor of the MergeTree is `MaxNodesInBlock - 1`. This is because
|
|
41
52
|
* the MergeTree always inserts first, then checks for overflow and splits if the child count equals
|
|
@@ -89,9 +100,21 @@ exports.seqLTE = seqLTE;
|
|
|
89
100
|
*/
|
|
90
101
|
class BaseSegment {
|
|
91
102
|
constructor(properties) {
|
|
103
|
+
/**
|
|
104
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
105
|
+
*/
|
|
92
106
|
this.clientId = constants_js_1.LocalClientId;
|
|
107
|
+
/**
|
|
108
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
109
|
+
*/
|
|
93
110
|
this.seq = constants_js_1.UniversalSequenceNumber;
|
|
111
|
+
/**
|
|
112
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
113
|
+
*/
|
|
94
114
|
this.index = 0;
|
|
115
|
+
/**
|
|
116
|
+
* @deprecated - This property will be removed in 2.20 with no replacement.
|
|
117
|
+
*/
|
|
95
118
|
this.ordinal = "";
|
|
96
119
|
this.cachedLength = 0;
|
|
97
120
|
this.trackingCollection = new mergeTreeTracking_js_1.TrackingGroupCollection(this);
|
|
@@ -165,6 +188,7 @@ class BaseSegment {
|
|
|
165
188
|
append(other) {
|
|
166
189
|
// Note: Must call 'appendLocalRefs' before modifying this segment's length as
|
|
167
190
|
// 'this.cachedLength' is used to adjust the offsets of the local refs.
|
|
191
|
+
// eslint-disable-next-line import/no-deprecated
|
|
168
192
|
localReference_js_1.LocalReferenceCollection.append(this, other);
|
|
169
193
|
if (this.attribution) {
|
|
170
194
|
(0, internal_1.assert)(other.attribution !== undefined, 0x4bd /* attribution should be set on appendee */);
|