@fluidframework/merge-tree 2.12.0 → 2.20.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.
Files changed (307) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/api-report/merge-tree.legacy.alpha.api.md +0 -108
  3. package/dist/MergeTreeTextHelper.d.ts.map +1 -1
  4. package/dist/MergeTreeTextHelper.js +0 -2
  5. package/dist/MergeTreeTextHelper.js.map +1 -1
  6. package/dist/attributionPolicy.d.ts.map +1 -1
  7. package/dist/attributionPolicy.js +6 -16
  8. package/dist/attributionPolicy.js.map +1 -1
  9. package/dist/client.d.ts +3 -4
  10. package/dist/client.d.ts.map +1 -1
  11. package/dist/client.js +39 -28
  12. package/dist/client.js.map +1 -1
  13. package/dist/endOfTreeSegment.d.ts +2 -1
  14. package/dist/endOfTreeSegment.d.ts.map +1 -1
  15. package/dist/endOfTreeSegment.js.map +1 -1
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +2 -4
  19. package/dist/index.js.map +1 -1
  20. package/dist/legacy.d.ts +0 -4
  21. package/dist/localReference.d.ts +5 -7
  22. package/dist/localReference.d.ts.map +1 -1
  23. package/dist/localReference.js +1 -3
  24. package/dist/localReference.js.map +1 -1
  25. package/dist/mergeTree.d.ts +8 -7
  26. package/dist/mergeTree.d.ts.map +1 -1
  27. package/dist/mergeTree.js +187 -228
  28. package/dist/mergeTree.js.map +1 -1
  29. package/dist/mergeTreeNodeWalk.d.ts.map +1 -1
  30. package/dist/mergeTreeNodeWalk.js +3 -2
  31. package/dist/mergeTreeNodeWalk.js.map +1 -1
  32. package/dist/mergeTreeNodes.d.ts +65 -325
  33. package/dist/mergeTreeNodes.d.ts.map +1 -1
  34. package/dist/mergeTreeNodes.js +96 -130
  35. package/dist/mergeTreeNodes.js.map +1 -1
  36. package/dist/mergeTreeTracking.d.ts.map +1 -1
  37. package/dist/mergeTreeTracking.js +0 -2
  38. package/dist/mergeTreeTracking.js.map +1 -1
  39. package/dist/opBuilder.d.ts +0 -5
  40. package/dist/opBuilder.d.ts.map +1 -1
  41. package/dist/opBuilder.js +0 -5
  42. package/dist/opBuilder.js.map +1 -1
  43. package/dist/package.json +2 -1
  44. package/dist/partialLengths.d.ts +2 -2
  45. package/dist/partialLengths.d.ts.map +1 -1
  46. package/dist/partialLengths.js +29 -31
  47. package/dist/partialLengths.js.map +1 -1
  48. package/dist/perspective.d.ts +3 -2
  49. package/dist/perspective.d.ts.map +1 -1
  50. package/dist/perspective.js +5 -2
  51. package/dist/perspective.js.map +1 -1
  52. package/dist/referencePositions.d.ts.map +1 -1
  53. package/dist/referencePositions.js +4 -1
  54. package/dist/referencePositions.js.map +1 -1
  55. package/dist/revertibles.d.ts.map +1 -1
  56. package/dist/revertibles.js +10 -14
  57. package/dist/revertibles.js.map +1 -1
  58. package/dist/segmentGroupCollection.d.ts +4 -4
  59. package/dist/segmentGroupCollection.d.ts.map +1 -1
  60. package/dist/segmentGroupCollection.js +0 -6
  61. package/dist/segmentGroupCollection.js.map +1 -1
  62. package/dist/segmentInfos.d.ts +251 -0
  63. package/dist/segmentInfos.d.ts.map +1 -0
  64. package/dist/segmentInfos.js +166 -0
  65. package/dist/segmentInfos.js.map +1 -0
  66. package/dist/snapshotLoader.d.ts.map +1 -1
  67. package/dist/snapshotLoader.js +36 -44
  68. package/dist/snapshotLoader.js.map +1 -1
  69. package/dist/snapshotV1.d.ts.map +1 -1
  70. package/dist/snapshotV1.js +9 -12
  71. package/dist/snapshotV1.js.map +1 -1
  72. package/dist/snapshotlegacy.d.ts +2 -2
  73. package/dist/snapshotlegacy.d.ts.map +1 -1
  74. package/dist/snapshotlegacy.js +5 -3
  75. package/dist/snapshotlegacy.js.map +1 -1
  76. package/dist/sortedSegmentSet.d.ts.map +1 -1
  77. package/dist/sortedSegmentSet.js +5 -8
  78. package/dist/sortedSegmentSet.js.map +1 -1
  79. package/dist/test/beastTest.spec.d.ts +0 -2
  80. package/dist/test/beastTest.spec.d.ts.map +1 -1
  81. package/dist/test/beastTest.spec.js +1 -5
  82. package/dist/test/beastTest.spec.js.map +1 -1
  83. package/dist/test/client.annotateMarker.spec.js.map +1 -1
  84. package/dist/test/client.applyMsg.spec.js +15 -12
  85. package/dist/test/client.applyMsg.spec.js.map +1 -1
  86. package/dist/test/client.attributionFarm.spec.js.map +1 -1
  87. package/dist/test/client.getPosition.spec.js +3 -2
  88. package/dist/test/client.getPosition.spec.js.map +1 -1
  89. package/dist/test/client.localReference.spec.js +6 -6
  90. package/dist/test/client.localReference.spec.js.map +1 -1
  91. package/dist/test/client.localReferenceFarm.spec.js.map +1 -1
  92. package/dist/test/client.rollback.spec.js.map +1 -1
  93. package/dist/test/dirname.cjs +0 -1
  94. package/dist/test/dirname.cjs.map +1 -1
  95. package/dist/test/index.d.ts +1 -1
  96. package/dist/test/index.d.ts.map +1 -1
  97. package/dist/test/index.js +2 -4
  98. package/dist/test/index.js.map +1 -1
  99. package/dist/test/mergeTree.annotate.spec.js +3 -0
  100. package/dist/test/mergeTree.annotate.spec.js.map +1 -1
  101. package/dist/test/mergeTree.insertingWalk.spec.js +1 -1
  102. package/dist/test/mergeTree.insertingWalk.spec.js.map +1 -1
  103. package/dist/test/mergeTree.markRangeRemoved.spec.js +2 -0
  104. package/dist/test/mergeTree.markRangeRemoved.spec.js.map +1 -1
  105. package/dist/test/mergeTree.walk.spec.js.map +1 -1
  106. package/dist/test/mergeTreeOperationRunner.d.ts.map +1 -1
  107. package/dist/test/mergeTreeOperationRunner.js +2 -3
  108. package/dist/test/mergeTreeOperationRunner.js.map +1 -1
  109. package/dist/test/obliterate.spec.js.map +1 -1
  110. package/dist/test/propertyManager.spec.js.map +1 -1
  111. package/dist/test/reconnectHelper.d.ts +2 -1
  112. package/dist/test/reconnectHelper.d.ts.map +1 -1
  113. package/dist/test/reconnectHelper.js.map +1 -1
  114. package/dist/test/resetPendingSegmentsToOp.spec.js.map +1 -1
  115. package/dist/test/revertibleFarm.spec.js.map +1 -1
  116. package/dist/test/segmentGroupCollection.spec.js +15 -3
  117. package/dist/test/segmentGroupCollection.spec.js.map +1 -1
  118. package/dist/test/snapshot.utils.d.ts +2 -2
  119. package/dist/test/snapshot.utils.d.ts.map +1 -1
  120. package/dist/test/snapshot.utils.js.map +1 -1
  121. package/dist/test/sortedSegmentSet.spec.js +4 -3
  122. package/dist/test/sortedSegmentSet.spec.js.map +1 -1
  123. package/dist/test/testClient.d.ts +8 -6
  124. package/dist/test/testClient.d.ts.map +1 -1
  125. package/dist/test/testClient.js +28 -27
  126. package/dist/test/testClient.js.map +1 -1
  127. package/dist/test/testClientLogger.d.ts.map +1 -1
  128. package/dist/test/testClientLogger.js +6 -4
  129. package/dist/test/testClientLogger.js.map +1 -1
  130. package/dist/test/testUtils.d.ts +2 -2
  131. package/dist/test/testUtils.d.ts.map +1 -1
  132. package/dist/test/testUtils.js +32 -8
  133. package/dist/test/testUtils.js.map +1 -1
  134. package/dist/test/text.d.ts +2 -2
  135. package/dist/test/text.d.ts.map +1 -1
  136. package/dist/test/text.js +12 -6
  137. package/dist/test/text.js.map +1 -1
  138. package/dist/test/tracking.spec.js.map +1 -1
  139. package/dist/test/wordUnitTests.spec.js +1 -1
  140. package/dist/test/wordUnitTests.spec.js.map +1 -1
  141. package/dist/zamboni.d.ts.map +1 -1
  142. package/dist/zamboni.js +8 -7
  143. package/dist/zamboni.js.map +1 -1
  144. package/lib/MergeTreeTextHelper.d.ts.map +1 -1
  145. package/lib/MergeTreeTextHelper.js +0 -2
  146. package/lib/MergeTreeTextHelper.js.map +1 -1
  147. package/lib/attributionPolicy.d.ts.map +1 -1
  148. package/lib/attributionPolicy.js +6 -16
  149. package/lib/attributionPolicy.js.map +1 -1
  150. package/lib/client.d.ts +3 -4
  151. package/lib/client.d.ts.map +1 -1
  152. package/lib/client.js +40 -29
  153. package/lib/client.js.map +1 -1
  154. package/lib/endOfTreeSegment.d.ts +2 -1
  155. package/lib/endOfTreeSegment.d.ts.map +1 -1
  156. package/lib/endOfTreeSegment.js.map +1 -1
  157. package/lib/index.d.ts +1 -1
  158. package/lib/index.d.ts.map +1 -1
  159. package/lib/index.js +1 -1
  160. package/lib/index.js.map +1 -1
  161. package/lib/legacy.d.ts +0 -4
  162. package/lib/localReference.d.ts +5 -7
  163. package/lib/localReference.d.ts.map +1 -1
  164. package/lib/localReference.js +1 -3
  165. package/lib/localReference.js.map +1 -1
  166. package/lib/mergeTree.d.ts +8 -7
  167. package/lib/mergeTree.d.ts.map +1 -1
  168. package/lib/mergeTree.js +175 -220
  169. package/lib/mergeTree.js.map +1 -1
  170. package/lib/mergeTreeNodeWalk.d.ts.map +1 -1
  171. package/lib/mergeTreeNodeWalk.js +3 -2
  172. package/lib/mergeTreeNodeWalk.js.map +1 -1
  173. package/lib/mergeTreeNodes.d.ts +65 -325
  174. package/lib/mergeTreeNodes.d.ts.map +1 -1
  175. package/lib/mergeTreeNodes.js +92 -127
  176. package/lib/mergeTreeNodes.js.map +1 -1
  177. package/lib/mergeTreeTracking.d.ts.map +1 -1
  178. package/lib/mergeTreeTracking.js +0 -2
  179. package/lib/mergeTreeTracking.js.map +1 -1
  180. package/lib/opBuilder.d.ts +0 -5
  181. package/lib/opBuilder.d.ts.map +1 -1
  182. package/lib/opBuilder.js +0 -5
  183. package/lib/opBuilder.js.map +1 -1
  184. package/lib/partialLengths.d.ts +2 -2
  185. package/lib/partialLengths.d.ts.map +1 -1
  186. package/lib/partialLengths.js +26 -28
  187. package/lib/partialLengths.js.map +1 -1
  188. package/lib/perspective.d.ts +3 -2
  189. package/lib/perspective.d.ts.map +1 -1
  190. package/lib/perspective.js +5 -2
  191. package/lib/perspective.js.map +1 -1
  192. package/lib/referencePositions.d.ts.map +1 -1
  193. package/lib/referencePositions.js +4 -1
  194. package/lib/referencePositions.js.map +1 -1
  195. package/lib/revertibles.d.ts.map +1 -1
  196. package/lib/revertibles.js +8 -12
  197. package/lib/revertibles.js.map +1 -1
  198. package/lib/segmentGroupCollection.d.ts +4 -4
  199. package/lib/segmentGroupCollection.d.ts.map +1 -1
  200. package/lib/segmentGroupCollection.js +0 -6
  201. package/lib/segmentGroupCollection.js.map +1 -1
  202. package/lib/segmentInfos.d.ts +251 -0
  203. package/lib/segmentInfos.d.ts.map +1 -0
  204. package/lib/segmentInfos.js +145 -0
  205. package/lib/segmentInfos.js.map +1 -0
  206. package/lib/snapshotLoader.d.ts.map +1 -1
  207. package/lib/snapshotLoader.js +36 -44
  208. package/lib/snapshotLoader.js.map +1 -1
  209. package/lib/snapshotV1.d.ts.map +1 -1
  210. package/lib/snapshotV1.js +9 -12
  211. package/lib/snapshotV1.js.map +1 -1
  212. package/lib/snapshotlegacy.d.ts +2 -2
  213. package/lib/snapshotlegacy.d.ts.map +1 -1
  214. package/lib/snapshotlegacy.js +5 -3
  215. package/lib/snapshotlegacy.js.map +1 -1
  216. package/lib/sortedSegmentSet.d.ts.map +1 -1
  217. package/lib/sortedSegmentSet.js +5 -8
  218. package/lib/sortedSegmentSet.js.map +1 -1
  219. package/lib/test/beastTest.spec.d.ts +0 -2
  220. package/lib/test/beastTest.spec.d.ts.map +1 -1
  221. package/lib/test/beastTest.spec.js +0 -3
  222. package/lib/test/beastTest.spec.js.map +1 -1
  223. package/lib/test/client.annotateMarker.spec.js.map +1 -1
  224. package/lib/test/client.applyMsg.spec.js +15 -12
  225. package/lib/test/client.applyMsg.spec.js.map +1 -1
  226. package/lib/test/client.attributionFarm.spec.js.map +1 -1
  227. package/lib/test/client.getPosition.spec.js +3 -2
  228. package/lib/test/client.getPosition.spec.js.map +1 -1
  229. package/lib/test/client.localReference.spec.js +1 -1
  230. package/lib/test/client.localReference.spec.js.map +1 -1
  231. package/lib/test/client.localReferenceFarm.spec.js.map +1 -1
  232. package/lib/test/client.rollback.spec.js +1 -1
  233. package/lib/test/client.rollback.spec.js.map +1 -1
  234. package/lib/test/dirname.cjs +0 -1
  235. package/lib/test/dirname.cjs.map +1 -1
  236. package/lib/test/index.d.ts +1 -1
  237. package/lib/test/index.d.ts.map +1 -1
  238. package/lib/test/index.js +1 -1
  239. package/lib/test/index.js.map +1 -1
  240. package/lib/test/mergeTree.annotate.spec.js +3 -0
  241. package/lib/test/mergeTree.annotate.spec.js.map +1 -1
  242. package/lib/test/mergeTree.insertingWalk.spec.js +2 -2
  243. package/lib/test/mergeTree.insertingWalk.spec.js.map +1 -1
  244. package/lib/test/mergeTree.markRangeRemoved.spec.js +2 -0
  245. package/lib/test/mergeTree.markRangeRemoved.spec.js.map +1 -1
  246. package/lib/test/mergeTree.walk.spec.js.map +1 -1
  247. package/lib/test/mergeTreeOperationRunner.d.ts.map +1 -1
  248. package/lib/test/mergeTreeOperationRunner.js +1 -2
  249. package/lib/test/mergeTreeOperationRunner.js.map +1 -1
  250. package/lib/test/obliterate.spec.js.map +1 -1
  251. package/lib/test/propertyManager.spec.js.map +1 -1
  252. package/lib/test/reconnectHelper.d.ts +2 -1
  253. package/lib/test/reconnectHelper.d.ts.map +1 -1
  254. package/lib/test/reconnectHelper.js.map +1 -1
  255. package/lib/test/resetPendingSegmentsToOp.spec.js.map +1 -1
  256. package/lib/test/revertibleFarm.spec.js.map +1 -1
  257. package/lib/test/segmentGroupCollection.spec.js +15 -3
  258. package/lib/test/segmentGroupCollection.spec.js.map +1 -1
  259. package/lib/test/snapshot.utils.d.ts +2 -2
  260. package/lib/test/snapshot.utils.d.ts.map +1 -1
  261. package/lib/test/snapshot.utils.js.map +1 -1
  262. package/lib/test/sortedSegmentSet.spec.js +4 -3
  263. package/lib/test/sortedSegmentSet.spec.js.map +1 -1
  264. package/lib/test/testClient.d.ts +8 -6
  265. package/lib/test/testClient.d.ts.map +1 -1
  266. package/lib/test/testClient.js +29 -28
  267. package/lib/test/testClient.js.map +1 -1
  268. package/lib/test/testClientLogger.d.ts.map +1 -1
  269. package/lib/test/testClientLogger.js +5 -3
  270. package/lib/test/testClientLogger.js.map +1 -1
  271. package/lib/test/testUtils.d.ts +2 -2
  272. package/lib/test/testUtils.d.ts.map +1 -1
  273. package/lib/test/testUtils.js +9 -8
  274. package/lib/test/testUtils.js.map +1 -1
  275. package/lib/test/text.d.ts +2 -2
  276. package/lib/test/text.d.ts.map +1 -1
  277. package/lib/test/text.js +12 -6
  278. package/lib/test/text.js.map +1 -1
  279. package/lib/test/tracking.spec.js.map +1 -1
  280. package/lib/test/wordUnitTests.spec.js +1 -1
  281. package/lib/test/wordUnitTests.spec.js.map +1 -1
  282. package/lib/zamboni.d.ts.map +1 -1
  283. package/lib/zamboni.js +7 -6
  284. package/lib/zamboni.js.map +1 -1
  285. package/package.json +77 -19
  286. package/src/MergeTreeTextHelper.ts +2 -4
  287. package/src/attributionPolicy.ts +5 -13
  288. package/src/client.ts +55 -44
  289. package/src/endOfTreeSegment.ts +3 -5
  290. package/src/index.ts +0 -7
  291. package/src/localReference.ts +6 -8
  292. package/src/mergeTree.ts +233 -290
  293. package/src/mergeTreeNodeWalk.ts +3 -2
  294. package/src/mergeTreeNodes.ts +160 -490
  295. package/src/mergeTreeTracking.ts +0 -3
  296. package/src/opBuilder.ts +0 -5
  297. package/src/partialLengths.ts +40 -29
  298. package/src/perspective.ts +23 -4
  299. package/src/referencePositions.ts +4 -1
  300. package/src/revertibles.ts +19 -16
  301. package/src/segmentGroupCollection.ts +7 -18
  302. package/src/segmentInfos.ts +371 -0
  303. package/src/snapshotLoader.ts +56 -57
  304. package/src/snapshotV1.ts +14 -16
  305. package/src/snapshotlegacy.ts +12 -17
  306. package/src/sortedSegmentSet.ts +6 -8
  307. 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;AAErF,eAAO,MAAM,UAAU;;CAEb,CAAC;AAEX,MAAM,MAAM,U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AC;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,UAAU,GAAG,SAAS,EAClC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,UAAU,EAC7C,kBAAkB,CAAC,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,UAAU,EACtD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,EACtC,OAAO,GAAE,OAAc,GACrB,OAAO,CAyET;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC/B,SAAS,EAAE,UAAU,EACrB,UAAU,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,OAAO,GAAG,SAAS,GACpD,OAAO,CAcT;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAChC,SAAS,EAAE,UAAU,EACrB,UAAU,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,OAAO,GAAG,SAAS,GACpD,OAAO,CAeT;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CACnC,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,GAAG,SAAS,GAAG,IAAI,GAC/D,OAAO,CAqBT"}
@@ -5,6 +5,7 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.walkAllChildSegments = exports.backwardExcursion = exports.forwardExcursion = exports.depthFirstNodeWalk = exports.NodeAction = exports.LeafAction = void 0;
8
+ const segmentInfos_js_1 = require("./segmentInfos.js");
8
9
  exports.LeafAction = {
9
10
  Exit: false,
10
11
  };
@@ -100,7 +101,7 @@ exports.depthFirstNodeWalk = depthFirstNodeWalk;
100
101
  * All segments past `node` are visited, regardless of their visibility.
101
102
  */
102
103
  function forwardExcursion(startNode, leafAction) {
103
- if (startNode.parent === undefined) {
104
+ if (!(0, segmentInfos_js_1.isMergeNodeInfo)(startNode)) {
104
105
  return true;
105
106
  }
106
107
  return depthFirstNodeWalk(startNode.parent,
@@ -115,7 +116,7 @@ exports.forwardExcursion = forwardExcursion;
115
116
  * All segments past `node` are visited, regardless of their visibility.
116
117
  */
117
118
  function backwardExcursion(startNode, leafAction) {
118
- if (startNode.parent === undefined) {
119
+ if (!(0, segmentInfos_js_1.isMergeNodeInfo)(startNode)) {
119
120
  return true;
120
121
  }
121
122
  return depthFirstNodeWalk(startNode.parent,
@@ -1 +1 @@
1
- {"version":3,"file":"mergeTreeNodeWalk.js","sourceRoot":"","sources":["../src/mergeTreeNodeWalk.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIU,QAAA,UAAU,GAAG;IACzB,IAAI,EAAE,KAAK;CACF,CAAC;AAIE,QAAA,UAAU,GAAG;IACzB,QAAQ,EAAE,SAAS;IACnB,iDAAiD;IACjD,IAAI,EAAE,kBAAU,CAAC,IAAI;IACrB,IAAI,EAAE,CAAC;CACE,CAAC;AAOX;;;;;;;;;;GAUG;AACH,SAAgB,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,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CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACpC,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,kBAAkB,CACxB,SAAS,CAAC,MAAM;IAChB,gDAAgD;IAChD,8CAA8C;IAC9C,qBAAqB;IACrB,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,EAC9C,SAAS,CAAC,gBAAgB,EAC1B,UAAU,EACV,SAAS,CAAC,cAAc,EACxB,KAAK,CAAC,aAAa,CACnB,CAAC;AACH,CAAC;AAlBD,8CAkBC;AAED;;;;;GAKG;AACH,SAAgB,oBAAoB,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,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"]}
1
+ {"version":3,"file":"mergeTreeNodeWalk.js","sourceRoot":"","sources":["../src/mergeTreeNodeWalk.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,uDAAoD;AAEv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G,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\";\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"]}
@@ -11,48 +11,46 @@ 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 SegmentWithInfo } from "./segmentInfos.js";
14
15
  import { PropertiesManager } from "./segmentPropertiesManager.js";
15
- /**
16
- * Common properties for a node in a merge tree.
17
- * @legacy
18
- * @alpha
19
- * @deprecated - This interface will be removed in 2.20 with no replacement.
20
- */
21
- export interface IMergeNodeCommon {
22
- /**
23
- * The index of this node in its parent's list of children.
24
- */
25
- index: number;
26
- /**
27
- * A string that can be used for comparing the location of this node to other `MergeNode`s in the same tree.
28
- * `a.ordinal < b.ordinal` if and only if `a` comes before `b` in a pre-order traversal of the tree.
29
- */
30
- ordinal: string;
31
- isLeaf(): this is ISegment;
32
- }
33
16
  /**
34
17
  * This interface exposes internal things to dds that leverage merge tree,
35
18
  * like sequence and matrix.
36
19
  *
37
20
  * We use tiered interface to control visibility of segment properties.
38
- * This sits between ISegment and ISegmentLeaf. It should only expose
21
+ * This sits between ISegment and ISegmentPrivate. It should only expose
39
22
  * things tagged internal.
40
23
  *
24
+ * Everything added here beyond ISegment should be optional to keep the ability
25
+ * to implicitly convert between the tiered interfaces.
26
+ *
41
27
  * @internal
42
28
  */
43
- export type ISegmentInternal = Omit<ISegment, keyof IRemovalInfo | keyof IMoveInfo> & Partial<IMergeNodeCommon> & Partial<IRemovalInfo> & Partial<IMoveInfo> & {
29
+ export interface ISegmentInternal extends ISegment {
44
30
  localRefs?: LocalReferenceCollection;
45
- };
31
+ /**
32
+ * Whether or not this segment is a special segment denoting the start or
33
+ * end of the tree
34
+ *
35
+ * Endpoint segments are imaginary segments positioned immediately before or
36
+ * after the tree. These segments cannot be referenced by regular operations
37
+ * and exist primarily as a bucket for local references to slide onto during
38
+ * deletion of regular segments.
39
+ */
40
+ readonly endpointType?: "start" | "end";
41
+ }
46
42
  /**
47
43
  * We use tiered interface to control visibility of segment properties.
48
44
  * This is the lowest interface and is not exported, it site below ISegment and ISegmentInternal.
49
45
  * It should only expose unexported things.
50
46
  *
47
+ * Everything added here beyond ISegmentInternal should be optional to keep the ability
48
+ * to implicitly convert between the tiered interfaces.
49
+ *
51
50
  * someday we may split tree leaves from segments, but for now they are the same
52
51
  * this is just a convenience type that makes it clear that we need something that is both a segment and a leaf node
53
52
  */
54
- export type ISegmentLeaf = ISegmentInternal & {
55
- parent?: MergeBlock;
53
+ export interface ISegmentPrivate extends ISegmentInternal {
56
54
  segmentGroups?: SegmentGroupCollection;
57
55
  propertyManager?: PropertiesManager;
58
56
  /**
@@ -61,100 +59,49 @@ export type ISegmentLeaf = ISegmentInternal & {
61
59
  * then the segment is not obliterated because it is aware of the latest obliteration.
62
60
  */
63
61
  prevObliterateByInserter?: ObliterateInfo;
64
- };
65
- export type IMergeNode = MergeBlock | ISegmentLeaf;
62
+ }
66
63
  /**
67
- * Contains removal information associated to an {@link ISegment}.
68
- * @legacy
69
- * @alpha
70
- * @deprecated - This interface will be removed in 2.20 with no replacement.
64
+ * Segment leafs are segments that have both IMergeNodeInfo and IInsertionInfo. This means they
65
+ * are inserted at a position, and bound via their parent MergeBlock to the merge tree. MergeBlocks'
66
+ * children are either a segment leaf, or another merge block for interior nodes of the tree. When working
67
+ * within the tree it is generally unnecessary to use type coercions methods common to the infos, and segment
68
+ * leafs, as the children of MergeBlocks are already well typed. However, when segments come from outside the
69
+ * merge tree, like via client's public methods, it becomes necessary to use the type coercions methods
70
+ * to ensure the passed in segment objects are correctly bound to the merge tree.
71
71
  */
72
- export interface IRemovalInfo {
73
- /**
74
- * Local seq at which this segment was removed, if the removal is yet-to-be acked.
75
- */
76
- localRemovedSeq?: number;
77
- /**
78
- * Seq at which this segment was removed.
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
- }
72
+ export type ISegmentLeaf = SegmentWithInfo<IMergeNodeInfo & IInsertionInfo>;
73
+ /**
74
+ * A type-guard which determines if the segment has segment leaf, and
75
+ * returns true if it does, along with applying strong typing.
76
+ * @param nodeLike - The segment-like object to check.
77
+ * @returns True if the segment is a segment leaf, otherwise false.
78
+ */
79
+ export declare const isSegmentLeaf: (segmentLike: unknown) => segmentLike is ISegmentLeaf;
89
80
  /**
90
- * Returns the removal information for a segment.
81
+ * Converts a segment-like object to a segment leaf object if possible.
91
82
  *
92
- * @internal
83
+ * @param segmentLike - The segment-like object to convert.
84
+ * @returns The segment leaf if the conversion is possible, otherwise undefined.
93
85
  */
94
- export declare function toRemovalInfo(maybe: Partial<IRemovalInfo> | undefined): IRemovalInfo | undefined;
86
+ export declare const toSegmentLeaf: (segmentLike: unknown) => ISegmentLeaf | undefined;
95
87
  /**
96
- * Tracks information about when and where this segment was moved to.
88
+ * Asserts that the segment is a segment leaf. Usage of this function should not produce a user facing error.
97
89
  *
98
- * Note that merge-tree does not currently support moving and only supports
99
- * obliterate. The fields below include "move" in their names to avoid renaming
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.
90
+ * @param segmentLike - The segment-like object to check.
91
+ * @throws Will throw an error if the segment is not a segment leaf.
104
92
  */
105
- export interface IMoveInfo {
106
- /**
107
- * Local seq at which this segment was moved if the move is yet-to-be
108
- * acked.
109
- */
110
- localMovedSeq?: number;
111
- /**
112
- * The first seq at which this segment was moved.
113
- */
114
- movedSeq: number;
115
- /**
116
- * All seqs at which this segment was moved. In the case of overlapping,
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;
93
+ export declare const assertSegmentLeaf: (segmentLike: unknown) => asserts segmentLike is ISegmentLeaf;
94
+ /**
95
+ * This type is used for building MergeBlocks from segments and other MergeBlocks. We need this
96
+ * type as segments may not yet be bound to the tree, so lack merge node info which is required for
97
+ * segment leafs.
98
+ */
99
+ export type IMergeNodeBuilder = MergeBlock | SegmentWithInfo<IInsertionInfo>;
100
+ /**
101
+ * This type is used by MergeBlocks to define their children, which are either segments or other
102
+ * MergeBlocks.
103
+ */
104
+ export type IMergeNode = MergeBlock | ISegmentLeaf;
158
105
  /**
159
106
  * A segment representing a portion of the merge tree.
160
107
  * Segments are leaf nodes of the merge tree and contain data.
@@ -164,17 +111,6 @@ export declare function toMoveInfo(maybe: Partial<IMoveInfo> | undefined): IMove
164
111
  export interface ISegment {
165
112
  readonly type: string;
166
113
  readonly trackingCollection: TrackingGroupCollection;
167
- /**
168
- * Whether or not this segment is a special segment denoting the start or
169
- * end of the tree
170
- *
171
- * Endpoint segments are imaginary segments positioned immediately before or
172
- * after the tree. These segments cannot be referenced by regular operations
173
- * and exist primarily as a bucket for local references to slide onto during
174
- * deletion of regular segments.
175
- * @deprecated - This property will be removed in 2.20 with no replacement.
176
- */
177
- readonly endpointType?: "start" | "end";
178
114
  /**
179
115
  * The length of the contents of the node.
180
116
  */
@@ -195,44 +131,6 @@ export interface ISegment {
195
131
  * or only attribute certain property modifications, etc.)
196
132
  */
197
133
  attribution?: IAttributionCollection<AttributionKey>;
198
- /**
199
- * Local seq at which this segment was inserted.
200
- * This is defined if and only if the insertion of the segment is pending ack, i.e. `seq` is UnassignedSequenceNumber.
201
- * Once the segment is acked, this field is cleared.
202
- *
203
- * @privateRemarks
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.
206
- */
207
- 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
- /**
221
- * Seq at which this segment was inserted.
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.
224
- */
225
- seq?: number;
226
- /**
227
- * Short clientId for the client that inserted this segment.
228
- * @deprecated - This property will be removed in 2.20 with no replacement.
229
- */
230
- clientId: number;
231
- /**
232
- * Local references added to this segment.
233
- * @deprecated - This property will be removed in 2.20 with no replacement.
234
- */
235
- localRefs?: LocalReferenceCollection;
236
134
  /**
237
135
  * Properties that have been added to this segment via annotation.
238
136
  */
@@ -243,56 +141,6 @@ export interface ISegment {
243
141
  splitAt(pos: number): ISegment | undefined;
244
142
  toJSONObject(): any;
245
143
  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;
296
144
  }
297
145
  /**
298
146
  * Determine if a segment has been removed.
@@ -300,12 +148,6 @@ export interface ISegment {
300
148
  * @alpha
301
149
  */
302
150
  export declare function segmentIsRemoved(segment: ISegment): boolean;
303
- /**
304
- * @internal
305
- */
306
- export interface IMarkerModifiedAction {
307
- (marker: Marker): void;
308
- }
309
151
  /**
310
152
  * @legacy
311
153
  * @alpha
@@ -313,46 +155,15 @@ export interface IMarkerModifiedAction {
313
155
  export interface ISegmentAction<TClientData> {
314
156
  (segment: ISegment, pos: number, refSeq: number, clientId: number, start: number, end: number, accum: TClientData): boolean;
315
157
  }
316
- /**
317
- * @internal
318
- */
319
158
  export interface ISegmentChanges {
320
- next?: ISegmentInternal;
321
- replaceCurrent?: ISegmentInternal;
159
+ next?: SegmentWithInfo<IInsertionInfo>;
160
+ replaceCurrent?: SegmentWithInfo<IInsertionInfo>;
322
161
  }
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
162
  export interface InsertContext {
339
- candidateSegment?: ISegmentInternal;
340
- leaf: (segment: ISegmentInternal | undefined, pos: number, ic: InsertContext) => ISegmentChanges;
163
+ candidateSegment?: SegmentWithInfo<IInsertionInfo>;
164
+ leaf: (segment: ISegmentLeaf | undefined, pos: number, ic: InsertContext) => ISegmentChanges;
341
165
  continuePredicate?: (continueFromBlock: MergeBlock) => boolean;
342
166
  }
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
167
  export interface ObliterateInfo {
357
168
  start: LocalReferencePosition;
358
169
  end: LocalReferencePosition;
@@ -362,11 +173,8 @@ export interface ObliterateInfo {
362
173
  localSeq: number | undefined;
363
174
  segmentGroup: SegmentGroup | undefined;
364
175
  }
365
- /**
366
- * @internal
367
- */
368
- export interface SegmentGroup<S extends ISegmentInternal = ISegmentInternal> {
369
- segments: S[];
176
+ export interface SegmentGroup {
177
+ segments: ISegmentLeaf[];
370
178
  previousProps?: PropertySet[];
371
179
  localSeq?: number;
372
180
  refSeq: number;
@@ -377,13 +185,9 @@ export interface SegmentGroup<S extends ISegmentInternal = ISegmentInternal> {
377
185
  * the MergeTree always inserts first, then checks for overflow and splits if the child count equals
378
186
  * `MaxNodesInBlock`. (i.e., `MaxNodesInBlock` contains 1 extra slot for temporary storage to
379
187
  * facilitate splits.)
380
- * @internal
381
188
  */
382
189
  export declare const MaxNodesInBlock = 8;
383
- /**
384
- * @internal
385
- */
386
- export declare class MergeBlock implements IMergeNodeCommon {
190
+ export declare class MergeBlock implements Partial<IMergeNodeInfo> {
387
191
  childCount: number;
388
192
  children: IMergeNode[];
389
193
  needsScour?: boolean;
@@ -415,76 +219,20 @@ export declare class MergeBlock implements IMergeNodeCommon {
415
219
  partialLengths?: PartialSequenceLengths;
416
220
  constructor(childCount: number);
417
221
  setOrdinal(child: IMergeNode, index: number): void;
418
- assignChild(child: IMergeNode, index: number, updateOrdinal?: boolean): void;
419
222
  }
223
+ export declare function assignChild<C extends IMergeNodeBuilder>(parent: MergeBlock, child: C, index: number, updateOrdinal?: boolean): asserts child is C & IMergeNodeInfo;
420
224
  export declare function seqLTE(seq: number, minOrRefSeq: number): boolean;
421
225
  /**
422
226
  * @legacy
423
227
  * @alpha
424
228
  */
425
229
  export declare abstract class BaseSegment implements ISegment {
426
- /**
427
- * @deprecated - This property will be removed in 2.20 with no replacement.
428
- */
429
- clientId: number;
430
- /**
431
- * @deprecated - This property will be removed in 2.20 with no replacement.
432
- */
433
- seq: number;
434
- /**
435
- * @deprecated - This property will be removed in 2.20 with no replacement.
436
- */
437
- removedSeq?: number;
438
- /**
439
- * @deprecated - This property will be removed in 2.20 with no replacement.
440
- */
441
- removedClientIds?: number[];
442
- /**
443
- * @deprecated - This property will be removed in 2.20 with no replacement.
444
- */
445
- movedSeq?: number;
446
- /**
447
- * @deprecated - This property will be removed in 2.20 with no replacement.
448
- */
449
- movedSeqs?: number[];
450
- /**
451
- * @deprecated - This property will be removed in 2.20 with no replacement.
452
- */
453
- movedClientIds?: number[];
454
- /**
455
- * @deprecated - This property will be removed in 2.20 with no replacement.
456
- */
457
- wasMovedOnInsert?: boolean | undefined;
458
- /**
459
- * @deprecated - This property will be removed in 2.20 with no replacement.
460
- */
461
- index: number;
462
- /**
463
- * @deprecated - This property will be removed in 2.20 with no replacement.
464
- */
465
- ordinal: string;
466
230
  cachedLength: number;
467
231
  readonly trackingCollection: TrackingGroupCollection;
468
232
  /***/
469
233
  attribution?: IAttributionCollection<AttributionKey>;
470
234
  properties?: PropertySet;
471
- /**
472
- * @deprecated - This property will be removed in 2.20 with no replacement.
473
- */
474
- localRefs?: LocalReferenceCollection;
475
235
  abstract readonly type: string;
476
- /**
477
- * @deprecated - This property will be removed in 2.20 with no replacement.
478
- */
479
- localSeq?: number;
480
- /**
481
- * @deprecated - This property will be removed in 2.20 with no replacement.
482
- */
483
- localRemovedSeq?: number;
484
- /**
485
- * @deprecated - This property will be removed in 2.20 with no replacement.
486
- */
487
- localMovedSeq?: number;
488
236
  constructor(properties?: PropertySet);
489
237
  hasProperty(key: string): boolean;
490
238
  isLeaf(): this is ISegment;
@@ -587,7 +335,7 @@ export declare class CollaborationWindow {
587
335
  * { localSeq: 1, seq: UnassignedSequenceNumber, text: "C" },
588
336
  * ]
589
337
  * ```
590
- * (note that {@link ISegment.localSeq} tracks the localSeq at which a segment was inserted)
338
+ * (note that localSeq tracks the localSeq at which a segment was inserted)
591
339
  *
592
340
  * Suppose the client then disconnects and reconnects before any of its insertions are acked. The reconnect flow will necessitate
593
341
  * that the client regenerates and resubmits ops based on its current segment state as well as the original op that was sent.
@@ -639,12 +387,4 @@ export declare const compareNumbers: (a: number, b: number) => number;
639
387
  * Compares two strings.
640
388
  */
641
389
  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
390
  //# sourceMappingURL=mergeTreeNodes.d.ts.map
@@ -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;AAOpE,OAAO,EAAE,wBAAwB,EAAE,KAAK,sBAAsB,EA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