@fluidframework/sequence 2.0.0-internal.7.3.0 → 2.0.0-internal.7.4.1

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 (323) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/api-extractor-lint.json +13 -0
  3. package/api-extractor.json +8 -3
  4. package/api-report/sequence.api.md +87 -84
  5. package/dist/{defaultMap.js → defaultMap.cjs} +9 -4
  6. package/dist/defaultMap.cjs.map +1 -0
  7. package/dist/defaultMap.d.ts +3 -3
  8. package/dist/defaultMap.d.ts.map +1 -1
  9. package/dist/{defaultMapInterfaces.js → defaultMapInterfaces.cjs} +1 -1
  10. package/dist/defaultMapInterfaces.cjs.map +1 -0
  11. package/dist/defaultMapInterfaces.d.ts +11 -10
  12. package/dist/defaultMapInterfaces.d.ts.map +1 -1
  13. package/dist/{index.js → index.cjs} +11 -11
  14. package/dist/index.cjs.map +1 -0
  15. package/dist/{intervalCollection.js → intervalCollection.cjs} +53 -48
  16. package/dist/intervalCollection.cjs.map +1 -0
  17. package/dist/intervalCollection.d.ts +66 -12
  18. package/dist/intervalCollection.d.ts.map +1 -1
  19. package/dist/intervalIndex/{endpointInRangeIndex.js → endpointInRangeIndex.cjs} +4 -4
  20. package/dist/intervalIndex/endpointInRangeIndex.cjs.map +1 -0
  21. package/dist/intervalIndex/endpointInRangeIndex.d.ts +2 -2
  22. package/dist/intervalIndex/{endpointIndex.js → endpointIndex.cjs} +3 -3
  23. package/dist/intervalIndex/endpointIndex.cjs.map +1 -0
  24. package/dist/intervalIndex/endpointIndex.d.ts +2 -2
  25. package/dist/intervalIndex/{idIntervalIndex.js → idIntervalIndex.cjs} +2 -2
  26. package/dist/intervalIndex/idIntervalIndex.cjs.map +1 -0
  27. package/dist/intervalIndex/idIntervalIndex.d.ts +2 -2
  28. package/dist/intervalIndex/{index.js → index.cjs} +7 -7
  29. package/dist/intervalIndex/index.cjs.map +1 -0
  30. package/dist/intervalIndex/{intervalIndex.js → intervalIndex.cjs} +1 -1
  31. package/dist/intervalIndex/intervalIndex.cjs.map +1 -0
  32. package/dist/intervalIndex/intervalIndex.d.ts +1 -1
  33. package/dist/intervalIndex/{intervalIndexUtils.js → intervalIndexUtils.cjs} +1 -1
  34. package/dist/intervalIndex/intervalIndexUtils.cjs.map +1 -0
  35. package/dist/intervalIndex/{overlappingIntervalsIndex.js → overlappingIntervalsIndex.cjs} +5 -5
  36. package/dist/intervalIndex/overlappingIntervalsIndex.cjs.map +1 -0
  37. package/dist/intervalIndex/overlappingIntervalsIndex.d.ts +2 -2
  38. package/dist/intervalIndex/{overlappingSequenceIntervalsIndex.js → overlappingSequenceIntervalsIndex.cjs} +4 -4
  39. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.cjs.map +1 -0
  40. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.d.ts +1 -1
  41. package/dist/intervalIndex/{sequenceIntervalIndexes.js → sequenceIntervalIndexes.cjs} +1 -1
  42. package/dist/intervalIndex/sequenceIntervalIndexes.cjs.map +1 -0
  43. package/dist/intervalIndex/sequenceIntervalIndexes.d.ts +2 -1
  44. package/dist/intervalIndex/sequenceIntervalIndexes.d.ts.map +1 -1
  45. package/dist/intervalIndex/{startpointInRangeIndex.js → startpointInRangeIndex.cjs} +4 -4
  46. package/dist/intervalIndex/startpointInRangeIndex.cjs.map +1 -0
  47. package/dist/intervalIndex/startpointInRangeIndex.d.ts +2 -2
  48. package/dist/{intervalTree.js → intervalTree.cjs} +1 -1
  49. package/dist/intervalTree.cjs.map +1 -0
  50. package/dist/intervals/{index.js → index.cjs} +4 -4
  51. package/dist/intervals/index.cjs.map +1 -0
  52. package/dist/intervals/{interval.js → interval.cjs} +2 -6
  53. package/dist/intervals/interval.cjs.map +1 -0
  54. package/dist/intervals/interval.d.ts +2 -7
  55. package/dist/intervals/interval.d.ts.map +1 -1
  56. package/dist/intervals/{intervalUtils.js → intervalUtils.cjs} +4 -4
  57. package/dist/intervals/intervalUtils.cjs.map +1 -0
  58. package/dist/intervals/intervalUtils.d.ts +15 -14
  59. package/dist/intervals/intervalUtils.d.ts.map +1 -1
  60. package/dist/intervals/{sequenceInterval.js → sequenceInterval.cjs} +6 -14
  61. package/dist/intervals/sequenceInterval.cjs.map +1 -0
  62. package/dist/intervals/sequenceInterval.d.ts +3 -12
  63. package/dist/intervals/sequenceInterval.d.ts.map +1 -1
  64. package/dist/{localValues.js → localValues.cjs} +1 -1
  65. package/dist/localValues.cjs.map +1 -0
  66. package/dist/localValues.d.ts +2 -1
  67. package/dist/localValues.d.ts.map +1 -1
  68. package/dist/{packageVersion.js → packageVersion.cjs} +2 -2
  69. package/dist/packageVersion.cjs.map +1 -0
  70. package/dist/packageVersion.d.ts +1 -1
  71. package/dist/{revertibles.js → revertibles.cjs} +10 -12
  72. package/dist/revertibles.cjs.map +1 -0
  73. package/dist/revertibles.d.ts +9 -15
  74. package/dist/revertibles.d.ts.map +1 -1
  75. package/dist/sequence-alpha.d.ts +226 -507
  76. package/dist/sequence-beta.d.ts +131 -1368
  77. package/dist/sequence-public.d.ts +131 -1368
  78. package/dist/sequence-untrimmed.d.ts +121 -90
  79. package/dist/{sequence.js → sequence.cjs} +5 -5
  80. package/dist/sequence.cjs.map +1 -0
  81. package/dist/sequence.d.ts +2 -3
  82. package/dist/sequence.d.ts.map +1 -1
  83. package/dist/{sequenceDeltaEvent.js → sequenceDeltaEvent.cjs} +4 -4
  84. package/dist/sequenceDeltaEvent.cjs.map +1 -0
  85. package/dist/sequenceDeltaEvent.d.ts +4 -4
  86. package/dist/{sequenceFactory.js → sequenceFactory.cjs} +4 -4
  87. package/dist/sequenceFactory.cjs.map +1 -0
  88. package/dist/sequenceFactory.d.ts +1 -1
  89. package/dist/{sharedIntervalCollection.js → sharedIntervalCollection.cjs} +6 -6
  90. package/dist/sharedIntervalCollection.cjs.map +1 -0
  91. package/dist/sharedIntervalCollection.d.ts +3 -3
  92. package/dist/{sharedSequence.js → sharedSequence.cjs} +4 -4
  93. package/dist/sharedSequence.cjs.map +1 -0
  94. package/dist/sharedSequence.d.ts +3 -3
  95. package/dist/{sharedString.js → sharedString.cjs} +9 -6
  96. package/dist/sharedString.cjs.map +1 -0
  97. package/dist/sharedString.d.ts +8 -5
  98. package/dist/sharedString.d.ts.map +1 -1
  99. package/lib/{defaultMap.d.ts → defaultMap.d.mts} +4 -4
  100. package/lib/defaultMap.d.mts.map +1 -0
  101. package/lib/{defaultMap.js → defaultMap.mjs} +9 -4
  102. package/lib/defaultMap.mjs.map +1 -0
  103. package/lib/{defaultMapInterfaces.d.ts → defaultMapInterfaces.d.mts} +11 -10
  104. package/lib/defaultMapInterfaces.d.mts.map +1 -0
  105. package/lib/{defaultMapInterfaces.js → defaultMapInterfaces.mjs} +1 -1
  106. package/lib/defaultMapInterfaces.mjs.map +1 -0
  107. package/lib/{index.d.ts → index.d.mts} +11 -23
  108. package/lib/index.d.mts.map +1 -0
  109. package/lib/{index.js → index.mjs} +11 -11
  110. package/lib/index.mjs.map +1 -0
  111. package/lib/{intervalCollection.d.ts → intervalCollection.d.mts} +68 -14
  112. package/lib/intervalCollection.d.mts.map +1 -0
  113. package/lib/{intervalCollection.js → intervalCollection.mjs} +53 -50
  114. package/lib/intervalCollection.mjs.map +1 -0
  115. package/lib/intervalIndex/{endpointInRangeIndex.d.ts → endpointInRangeIndex.d.mts} +5 -5
  116. package/lib/intervalIndex/endpointInRangeIndex.d.mts.map +1 -0
  117. package/lib/intervalIndex/{endpointInRangeIndex.js → endpointInRangeIndex.mjs} +4 -4
  118. package/lib/intervalIndex/endpointInRangeIndex.mjs.map +1 -0
  119. package/lib/intervalIndex/{endpointIndex.d.ts → endpointIndex.d.mts} +5 -5
  120. package/lib/intervalIndex/endpointIndex.d.mts.map +1 -0
  121. package/lib/intervalIndex/{endpointIndex.js → endpointIndex.mjs} +3 -3
  122. package/lib/intervalIndex/endpointIndex.mjs.map +1 -0
  123. package/lib/intervalIndex/{idIntervalIndex.d.ts → idIntervalIndex.d.mts} +4 -4
  124. package/lib/intervalIndex/idIntervalIndex.d.mts.map +1 -0
  125. package/lib/intervalIndex/{idIntervalIndex.js → idIntervalIndex.mjs} +2 -2
  126. package/lib/intervalIndex/idIntervalIndex.mjs.map +1 -0
  127. package/lib/intervalIndex/{index.d.ts → index.d.mts} +8 -8
  128. package/lib/intervalIndex/index.d.mts.map +1 -0
  129. package/lib/intervalIndex/{index.js → index.mjs} +7 -7
  130. package/{dist/intervalIndex/index.js.map → lib/intervalIndex/index.mjs.map} +1 -1
  131. package/lib/intervalIndex/{intervalIndex.d.ts → intervalIndex.d.mts} +2 -2
  132. package/lib/intervalIndex/intervalIndex.d.mts.map +1 -0
  133. package/lib/intervalIndex/{intervalIndex.js → intervalIndex.mjs} +1 -1
  134. package/lib/intervalIndex/intervalIndex.mjs.map +1 -0
  135. package/lib/intervalIndex/{intervalIndexUtils.js → intervalIndexUtils.mjs} +1 -1
  136. package/lib/intervalIndex/intervalIndexUtils.mjs.map +1 -0
  137. package/lib/intervalIndex/{overlappingIntervalsIndex.d.ts → overlappingIntervalsIndex.d.mts} +7 -7
  138. package/lib/intervalIndex/overlappingIntervalsIndex.d.mts.map +1 -0
  139. package/lib/intervalIndex/{overlappingIntervalsIndex.js → overlappingIntervalsIndex.mjs} +5 -5
  140. package/lib/intervalIndex/overlappingIntervalsIndex.mjs.map +1 -0
  141. package/lib/intervalIndex/{overlappingSequenceIntervalsIndex.d.ts → overlappingSequenceIntervalsIndex.d.mts} +3 -3
  142. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.d.mts.map +1 -0
  143. package/lib/intervalIndex/{overlappingSequenceIntervalsIndex.js → overlappingSequenceIntervalsIndex.mjs} +4 -4
  144. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.mjs.map +1 -0
  145. package/lib/intervalIndex/{sequenceIntervalIndexes.d.ts → sequenceIntervalIndexes.d.mts} +4 -3
  146. package/lib/intervalIndex/sequenceIntervalIndexes.d.mts.map +1 -0
  147. package/lib/intervalIndex/{sequenceIntervalIndexes.js → sequenceIntervalIndexes.mjs} +1 -1
  148. package/lib/intervalIndex/sequenceIntervalIndexes.mjs.map +1 -0
  149. package/lib/intervalIndex/{startpointInRangeIndex.d.ts → startpointInRangeIndex.d.mts} +5 -5
  150. package/lib/intervalIndex/startpointInRangeIndex.d.mts.map +1 -0
  151. package/lib/intervalIndex/{startpointInRangeIndex.js → startpointInRangeIndex.mjs} +4 -4
  152. package/lib/intervalIndex/startpointInRangeIndex.mjs.map +1 -0
  153. package/lib/{intervalTree.d.ts → intervalTree.d.mts} +1 -1
  154. package/lib/intervalTree.d.mts.map +1 -0
  155. package/lib/{intervalTree.js → intervalTree.mjs} +1 -1
  156. package/lib/intervalTree.mjs.map +1 -0
  157. package/lib/intervals/{index.d.ts → index.d.mts} +3 -3
  158. package/lib/intervals/index.d.mts.map +1 -0
  159. package/lib/intervals/{index.js → index.mjs} +4 -4
  160. package/lib/intervals/{index.js.map → index.mjs.map} +1 -1
  161. package/lib/intervals/{interval.d.ts → interval.d.mts} +4 -9
  162. package/lib/intervals/interval.d.mts.map +1 -0
  163. package/lib/intervals/{interval.js → interval.mjs} +2 -6
  164. package/lib/intervals/interval.mjs.map +1 -0
  165. package/lib/intervals/{intervalUtils.d.ts → intervalUtils.d.mts} +16 -15
  166. package/lib/intervals/intervalUtils.d.mts.map +1 -0
  167. package/lib/intervals/{intervalUtils.js → intervalUtils.mjs} +4 -6
  168. package/lib/intervals/intervalUtils.mjs.map +1 -0
  169. package/lib/intervals/{sequenceInterval.d.ts → sequenceInterval.d.mts} +5 -14
  170. package/lib/intervals/sequenceInterval.d.mts.map +1 -0
  171. package/lib/intervals/{sequenceInterval.js → sequenceInterval.mjs} +6 -16
  172. package/lib/intervals/sequenceInterval.mjs.map +1 -0
  173. package/lib/{localValues.d.ts → localValues.d.mts} +3 -2
  174. package/lib/localValues.d.mts.map +1 -0
  175. package/lib/{localValues.js → localValues.mjs} +1 -1
  176. package/lib/localValues.mjs.map +1 -0
  177. package/lib/{packageVersion.d.ts → packageVersion.d.mts} +1 -1
  178. package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
  179. package/lib/packageVersion.mjs.map +1 -0
  180. package/lib/{revertibles.d.ts → revertibles.d.mts} +12 -18
  181. package/lib/revertibles.d.mts.map +1 -0
  182. package/lib/{revertibles.js → revertibles.mjs} +10 -14
  183. package/lib/revertibles.mjs.map +1 -0
  184. package/lib/{sequence-public.d.ts → sequence-alpha.d.mts} +221 -422
  185. package/lib/sequence-beta.d.mts +270 -0
  186. package/lib/sequence-public.d.mts +270 -0
  187. package/lib/{sequence-untrimmed.d.ts → sequence-untrimmed.d.mts} +121 -90
  188. package/lib/{sequence.d.ts → sequence.d.mts} +6 -7
  189. package/lib/sequence.d.mts.map +1 -0
  190. package/lib/{sequence.js → sequence.mjs} +5 -6
  191. package/lib/sequence.mjs.map +1 -0
  192. package/lib/{sequenceDeltaEvent.d.ts → sequenceDeltaEvent.d.mts} +4 -4
  193. package/lib/sequenceDeltaEvent.d.mts.map +1 -0
  194. package/lib/{sequenceDeltaEvent.js → sequenceDeltaEvent.mjs} +4 -5
  195. package/lib/sequenceDeltaEvent.mjs.map +1 -0
  196. package/lib/{sequenceFactory.d.ts → sequenceFactory.d.mts} +2 -2
  197. package/lib/sequenceFactory.d.mts.map +1 -0
  198. package/lib/{sequenceFactory.js → sequenceFactory.mjs} +4 -4
  199. package/lib/sequenceFactory.mjs.map +1 -0
  200. package/lib/{sharedIntervalCollection.d.ts → sharedIntervalCollection.d.mts} +5 -5
  201. package/lib/sharedIntervalCollection.d.mts.map +1 -0
  202. package/lib/{sharedIntervalCollection.js → sharedIntervalCollection.mjs} +6 -6
  203. package/lib/sharedIntervalCollection.mjs.map +1 -0
  204. package/lib/{sharedSequence.d.ts → sharedSequence.d.mts} +4 -4
  205. package/lib/sharedSequence.d.mts.map +1 -0
  206. package/lib/{sharedSequence.js → sharedSequence.mjs} +4 -4
  207. package/lib/sharedSequence.mjs.map +1 -0
  208. package/lib/{sharedString.d.ts → sharedString.d.mts} +10 -7
  209. package/lib/sharedString.d.mts.map +1 -0
  210. package/lib/{sharedString.js → sharedString.mjs} +9 -6
  211. package/lib/sharedString.mjs.map +1 -0
  212. package/package.json +46 -29
  213. package/sequence.test-files.tar +0 -0
  214. package/src/defaultMap.ts +22 -16
  215. package/src/defaultMapInterfaces.ts +15 -12
  216. package/src/intervalCollection.ts +131 -67
  217. package/src/intervalIndex/endpointInRangeIndex.ts +2 -2
  218. package/src/intervalIndex/endpointIndex.ts +2 -2
  219. package/src/intervalIndex/idIntervalIndex.ts +2 -2
  220. package/src/intervalIndex/intervalIndex.ts +1 -1
  221. package/src/intervalIndex/overlappingIntervalsIndex.ts +2 -2
  222. package/src/intervalIndex/overlappingSequenceIntervalsIndex.ts +1 -1
  223. package/src/intervalIndex/sequenceIntervalIndexes.ts +2 -1
  224. package/src/intervalIndex/startpointInRangeIndex.ts +2 -2
  225. package/src/intervals/interval.ts +2 -7
  226. package/src/intervals/intervalUtils.ts +15 -15
  227. package/src/intervals/sequenceInterval.ts +3 -12
  228. package/src/localValues.ts +2 -1
  229. package/src/packageVersion.ts +1 -1
  230. package/src/revertibles.ts +9 -15
  231. package/src/sequence.ts +2 -3
  232. package/src/sequenceDeltaEvent.ts +4 -4
  233. package/src/sequenceFactory.ts +1 -1
  234. package/src/sharedIntervalCollection.ts +3 -3
  235. package/src/sharedSequence.ts +3 -3
  236. package/src/sharedString.ts +8 -5
  237. package/tsc-multi.test.json +10 -0
  238. package/dist/defaultMap.js.map +0 -1
  239. package/dist/defaultMapInterfaces.js.map +0 -1
  240. package/dist/index.js.map +0 -1
  241. package/dist/intervalCollection.js.map +0 -1
  242. package/dist/intervalIndex/endpointInRangeIndex.js.map +0 -1
  243. package/dist/intervalIndex/endpointIndex.js.map +0 -1
  244. package/dist/intervalIndex/idIntervalIndex.js.map +0 -1
  245. package/dist/intervalIndex/intervalIndex.js.map +0 -1
  246. package/dist/intervalIndex/intervalIndexUtils.js.map +0 -1
  247. package/dist/intervalIndex/overlappingIntervalsIndex.js.map +0 -1
  248. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.js.map +0 -1
  249. package/dist/intervalIndex/sequenceIntervalIndexes.js.map +0 -1
  250. package/dist/intervalIndex/startpointInRangeIndex.js.map +0 -1
  251. package/dist/intervalTree.js.map +0 -1
  252. package/dist/intervals/index.js.map +0 -1
  253. package/dist/intervals/interval.js.map +0 -1
  254. package/dist/intervals/intervalUtils.js.map +0 -1
  255. package/dist/intervals/sequenceInterval.js.map +0 -1
  256. package/dist/localValues.js.map +0 -1
  257. package/dist/packageVersion.js.map +0 -1
  258. package/dist/revertibles.js.map +0 -1
  259. package/dist/sequence.js.map +0 -1
  260. package/dist/sequenceDeltaEvent.js.map +0 -1
  261. package/dist/sequenceFactory.js.map +0 -1
  262. package/dist/sharedIntervalCollection.js.map +0 -1
  263. package/dist/sharedSequence.js.map +0 -1
  264. package/dist/sharedString.js.map +0 -1
  265. package/lib/defaultMap.d.ts.map +0 -1
  266. package/lib/defaultMap.js.map +0 -1
  267. package/lib/defaultMapInterfaces.d.ts.map +0 -1
  268. package/lib/defaultMapInterfaces.js.map +0 -1
  269. package/lib/index.d.ts.map +0 -1
  270. package/lib/index.js.map +0 -1
  271. package/lib/intervalCollection.d.ts.map +0 -1
  272. package/lib/intervalCollection.js.map +0 -1
  273. package/lib/intervalIndex/endpointInRangeIndex.d.ts.map +0 -1
  274. package/lib/intervalIndex/endpointInRangeIndex.js.map +0 -1
  275. package/lib/intervalIndex/endpointIndex.d.ts.map +0 -1
  276. package/lib/intervalIndex/endpointIndex.js.map +0 -1
  277. package/lib/intervalIndex/idIntervalIndex.d.ts.map +0 -1
  278. package/lib/intervalIndex/idIntervalIndex.js.map +0 -1
  279. package/lib/intervalIndex/index.d.ts.map +0 -1
  280. package/lib/intervalIndex/index.js.map +0 -1
  281. package/lib/intervalIndex/intervalIndex.d.ts.map +0 -1
  282. package/lib/intervalIndex/intervalIndex.js.map +0 -1
  283. package/lib/intervalIndex/intervalIndexUtils.js.map +0 -1
  284. package/lib/intervalIndex/overlappingIntervalsIndex.d.ts.map +0 -1
  285. package/lib/intervalIndex/overlappingIntervalsIndex.js.map +0 -1
  286. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.d.ts.map +0 -1
  287. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.js.map +0 -1
  288. package/lib/intervalIndex/sequenceIntervalIndexes.d.ts.map +0 -1
  289. package/lib/intervalIndex/sequenceIntervalIndexes.js.map +0 -1
  290. package/lib/intervalIndex/startpointInRangeIndex.d.ts.map +0 -1
  291. package/lib/intervalIndex/startpointInRangeIndex.js.map +0 -1
  292. package/lib/intervalTree.d.ts.map +0 -1
  293. package/lib/intervalTree.js.map +0 -1
  294. package/lib/intervals/index.d.ts.map +0 -1
  295. package/lib/intervals/interval.d.ts.map +0 -1
  296. package/lib/intervals/interval.js.map +0 -1
  297. package/lib/intervals/intervalUtils.d.ts.map +0 -1
  298. package/lib/intervals/intervalUtils.js.map +0 -1
  299. package/lib/intervals/sequenceInterval.d.ts.map +0 -1
  300. package/lib/intervals/sequenceInterval.js.map +0 -1
  301. package/lib/localValues.d.ts.map +0 -1
  302. package/lib/localValues.js.map +0 -1
  303. package/lib/packageVersion.js.map +0 -1
  304. package/lib/revertibles.d.ts.map +0 -1
  305. package/lib/revertibles.js.map +0 -1
  306. package/lib/sequence-alpha.d.ts +0 -1587
  307. package/lib/sequence-beta.d.ts +0 -1507
  308. package/lib/sequence.d.ts.map +0 -1
  309. package/lib/sequence.js.map +0 -1
  310. package/lib/sequenceDeltaEvent.d.ts.map +0 -1
  311. package/lib/sequenceDeltaEvent.js.map +0 -1
  312. package/lib/sequenceFactory.d.ts.map +0 -1
  313. package/lib/sequenceFactory.js.map +0 -1
  314. package/lib/sharedIntervalCollection.d.ts.map +0 -1
  315. package/lib/sharedIntervalCollection.js.map +0 -1
  316. package/lib/sharedSequence.d.ts.map +0 -1
  317. package/lib/sharedSequence.js.map +0 -1
  318. package/lib/sharedString.d.ts.map +0 -1
  319. package/lib/sharedString.js.map +0 -1
  320. package/tsconfig.esnext.json +0 -6
  321. /package/lib/intervalIndex/{intervalIndexUtils.d.ts → intervalIndexUtils.d.mts} +0 -0
  322. /package/lib/intervalIndex/{intervalIndexUtils.d.ts.map → intervalIndexUtils.d.mts.map} +0 -0
  323. /package/lib/{packageVersion.d.ts.map → packageVersion.d.mts.map} +0 -0
@@ -3,8 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { Marker, refHasTileLabel, TextSegment, } from "@fluidframework/merge-tree";
6
- import { SharedSegmentSequence } from "./sequence";
7
- import { SharedStringFactory } from "./sequenceFactory";
6
+ import { SharedSegmentSequence } from "./sequence.mjs";
7
+ import { SharedStringFactory } from "./sequenceFactory.mjs";
8
8
  /**
9
9
  * The Shared String is a specialized data structure for handling collaborative
10
10
  * text. It is based on a more general Sequence data structure but has
@@ -13,8 +13,7 @@ import { SharedStringFactory } from "./sequenceFactory";
13
13
  * In addition to text, a Shared String can also contain markers. Markers can be
14
14
  * used to store metadata at positions within the text, like the details of an
15
15
  * image or Fluid object that should be rendered with the text.
16
- *
17
- * @public
16
+ * @alpha
18
17
  */
19
18
  export class SharedString extends SharedSegmentSequence {
20
19
  /**
@@ -113,6 +112,10 @@ export class SharedString extends SharedSegmentSequence {
113
112
  * @param marker - The marker to annotate
114
113
  * @param props - The properties to annotate the marker with
115
114
  * @param consensusCallback - The callback called when consensus is reached
115
+ *
116
+ * @deprecated We no longer intend to support this functionality and it will
117
+ * be removed in a future release. There is no replacement for this
118
+ * functionality.
116
119
  */
117
120
  annotateMarkerNotifyConsensus(marker, props, callback) {
118
121
  this.guardReentrancy(() => this.client.annotateMarkerNotifyConsensus(marker, props, callback));
@@ -202,7 +205,7 @@ export class SharedString extends SharedSegmentSequence {
202
205
  * // parallelMarkers === [<paragraph marker 1 object>, <paragraph marker 2 object>]
203
206
  * // Note parallelText does not include "missing".
204
207
  * ```
205
- * @public
208
+ * @internal
206
209
  */
207
210
  export function getTextAndMarkers(sharedString, label, start, end) {
208
211
  const accum = {
@@ -290,4 +293,4 @@ const gatherTextAndMarkers = (segment, pos, refSeq, clientId, start, end, accumT
290
293
  }
291
294
  return true;
292
295
  };
293
- //# sourceMappingURL=sharedString.js.map
296
+ //# sourceMappingURL=sharedString.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedString.mjs","sourceRoot":"","sources":["../src/sharedString.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAQN,MAAM,EAIN,eAAe,EACf,WAAW,GACX,MAAM,4BAA4B;OAE5B,EAAE,qBAAqB,EAAE;OACzB,EAAE,mBAAmB,EAAE;AAsC9B;;;;;;;;;GASG;AACH,MAAM,OAAO,YACZ,SAAQ,qBAA0C;IAGlD;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAAC,OAA+B,EAAE,EAAW;QAChE,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,mBAAmB,CAAC,IAAI,CAAiB,CAAC;IAC5E,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,UAAU;QACvB,OAAO,IAAI,mBAAmB,EAAE,CAAC;IAClC,CAAC;IAED,IAAW,aAAa;QACvB,OAAO,IAAI,CAAC;IACb,CAAC;IAID,YACC,QAAgC,EACzB,EAAU,EACjB,UAA8B;QAE9B,KAAK,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,mBAAmB,CAAC,eAAsB,CAAC,CAAC;QAHrE,OAAE,GAAF,EAAE,CAAQ;QAIjB,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAC3D,CAAC;IAED;;;;;OAKG;IACI,oBAAoB,CAC1B,YAA+B,EAC/B,OAAsB,EACtB,KAAmB;QAEnB,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,KAAK,EAAE;YACV,OAAO,CAA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C,KAAK,CAAC;YACrC,MAAM,IAAI,GAAG,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC;YAC7C,WAAW,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;SACzD;KACD;SAAM;QACN,IAAI,WAAW,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;YAC1C,MAAM,eAAe,GACpB,WAAW,KAAK,GAAG;gBAClB,CAAC,CAAC,gEAAgE;oBAChE,KAAK,OAAO,CAAC,QAAQ,EAAE,EAAE;gBAC3B,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAC7C,WAAW,CAAC,IAAI,IAAI,eAAe,CAAC;SACpC;aAAM;YACN,MAAM,MAAM,GAAG,OAAiB,CAAC;YACjC,IAAI,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,mBAAmB,CAAC,EAAE;gBAC3D,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACvC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBAC9C,WAAW,CAAC,IAAI,GAAG,EAAE,CAAC;aACtB;SACD;KACD;IAED,OAAO,IAAI,CAAC;AACb,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tICombiningOp,\n\tIMergeTreeInsertMsg,\n\tIMergeTreeRemoveMsg,\n\tIMergeTreeTextHelper,\n\tIRelativePosition,\n\tISegment,\n\tISegmentAction,\n\tMarker,\n\tPropertySet,\n\tReferencePosition,\n\tReferenceType,\n\trefHasTileLabel,\n\tTextSegment,\n} from \"@fluidframework/merge-tree\";\nimport { IFluidDataStoreRuntime, IChannelAttributes } from \"@fluidframework/datastore-definitions\";\nimport { SharedSegmentSequence } from \"./sequence\";\nimport { SharedStringFactory } from \"./sequenceFactory\";\n\n/**\n * Fluid object interface describing access methods on a SharedString\n * @alpha\n */\nexport interface ISharedString extends SharedSegmentSequence<SharedStringSegment> {\n\t/**\n\t * Inserts the text at the position.\n\t * @param pos - The position to insert the text at\n\t * @param text - The text to insert\n\t * @param props - The properties of the text\n\t */\n\tinsertText(pos: number, text: string, props?: PropertySet): void;\n\n\t/**\n\t * Inserts a marker at the position.\n\t * @param pos - The position to insert the marker at\n\t * @param refType - The reference type of the marker\n\t * @param props - The properties of the marker\n\t */\n\tinsertMarker(\n\t\tpos: number,\n\t\trefType: ReferenceType,\n\t\tprops?: PropertySet,\n\t): IMergeTreeInsertMsg | undefined;\n\n\t/**\n\t * {@inheritDoc SharedSegmentSequence.posFromRelativePos}\n\t */\n\tposFromRelativePos(relativePos: IRelativePosition): number;\n}\n\n/**\n * @alpha\n */\nexport type SharedStringSegment = TextSegment | Marker;\n\n/**\n * The Shared String is a specialized data structure for handling collaborative\n * text. It is based on a more general Sequence data structure but has\n * additional features that make working with text easier.\n *\n * In addition to text, a Shared String can also contain markers. Markers can be\n * used to store metadata at positions within the text, like the details of an\n * image or Fluid object that should be rendered with the text.\n * @alpha\n */\nexport class SharedString\n\textends SharedSegmentSequence<SharedStringSegment>\n\timplements ISharedString\n{\n\t/**\n\t * Create a new shared string.\n\t * @param runtime - data store runtime the new shared string belongs to\n\t * @param id - optional name of the shared string\n\t * @returns newly create shared string (but not attached yet)\n\t */\n\tpublic static create(runtime: IFluidDataStoreRuntime, id?: string) {\n\t\treturn runtime.createChannel(id, SharedStringFactory.Type) as SharedString;\n\t}\n\n\t/**\n\t * Get a factory for SharedString to register with the data store.\n\t * @returns a factory that creates and load SharedString\n\t */\n\tpublic static getFactory() {\n\t\treturn new SharedStringFactory();\n\t}\n\n\tpublic get ISharedString(): ISharedString {\n\t\treturn this;\n\t}\n\n\tprivate readonly mergeTreeTextHelper: IMergeTreeTextHelper;\n\n\tconstructor(\n\t\tdocument: IFluidDataStoreRuntime,\n\t\tpublic id: string,\n\t\tattributes: IChannelAttributes,\n\t) {\n\t\tsuper(document, id, attributes, SharedStringFactory.segmentFromSpec as any);\n\t\tthis.mergeTreeTextHelper = this.client.createTextHelper();\n\t}\n\n\t/**\n\t * Inserts a marker at a relative position.\n\t * @param relativePos1 - The relative position to insert the marker at\n\t * @param refType - The reference type of the marker\n\t * @param props - The properties of the marker\n\t */\n\tpublic insertMarkerRelative(\n\t\trelativePos1: IRelativePosition,\n\t\trefType: ReferenceType,\n\t\tprops?: PropertySet,\n\t) {\n\t\tconst segment = new Marker(refType);\n\t\tif (props) {\n\t\t\tsegment.addProperties(props);\n\t\t}\n\n\t\tconst pos = this.posFromRelativePos(relativePos1);\n\t\tthis.guardReentrancy(() => this.client.insertSegmentLocal(pos, segment));\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.insertMarker}\n\t */\n\tpublic insertMarker(\n\t\tpos: number,\n\t\trefType: ReferenceType,\n\t\tprops?: PropertySet,\n\t): IMergeTreeInsertMsg | undefined {\n\t\tconst segment = new Marker(refType);\n\t\tif (props) {\n\t\t\tsegment.addProperties(props);\n\t\t}\n\n\t\treturn this.guardReentrancy(() => this.client.insertSegmentLocal(pos, segment));\n\t}\n\n\t/**\n\t * Inserts the text at the position.\n\t * @param relativePos1 - The relative position to insert the text at\n\t * @param text - The text to insert\n\t * @param props - The properties of text\n\t */\n\tpublic insertTextRelative(relativePos1: IRelativePosition, text: string, props?: PropertySet) {\n\t\tconst segment = new TextSegment(text);\n\t\tif (props) {\n\t\t\tsegment.addProperties(props);\n\t\t}\n\n\t\tconst pos = this.posFromRelativePos(relativePos1);\n\t\tthis.guardReentrancy(() => this.client.insertSegmentLocal(pos, segment));\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedString.insertText}\n\t */\n\tpublic insertText(pos: number, text: string, props?: PropertySet) {\n\t\tconst segment = new TextSegment(text);\n\t\tif (props) {\n\t\t\tsegment.addProperties(props);\n\t\t}\n\n\t\tthis.guardReentrancy(() => this.client.insertSegmentLocal(pos, segment));\n\t}\n\n\t/**\n\t * Replaces a range with the provided text.\n\t * @param start - The inclusive start of the range to replace\n\t * @param end - The exclusive end of the range to replace\n\t * @param text - The text to replace the range with\n\t * @param props - Optional. The properties of the replacement text\n\t */\n\tpublic replaceText(start: number, end: number, text: string, props?: PropertySet) {\n\t\tthis.replaceRange(start, end, TextSegment.make(text, props));\n\t}\n\n\t/**\n\t * Removes the text in the given range.\n\t * @param start - The inclusive start of the range to remove\n\t * @param end - The exclusive end of the range to replace\n\t * @returns the message sent.\n\t */\n\tpublic removeText(start: number, end: number): IMergeTreeRemoveMsg {\n\t\treturn this.removeRange(start, end);\n\t}\n\n\t/**\n\t * Annotates the marker with the provided properties and calls the callback on consensus.\n\t * @param marker - The marker to annotate\n\t * @param props - The properties to annotate the marker with\n\t * @param consensusCallback - The callback called when consensus is reached\n\t *\n\t * @deprecated We no longer intend to support this functionality and it will\n\t * be removed in a future release. There is no replacement for this\n\t * functionality.\n\t */\n\tpublic annotateMarkerNotifyConsensus(\n\t\tmarker: Marker,\n\t\tprops: PropertySet,\n\t\tcallback: (m: Marker) => void,\n\t) {\n\t\tthis.guardReentrancy(() =>\n\t\t\tthis.client.annotateMarkerNotifyConsensus(marker, props, callback),\n\t\t);\n\t}\n\n\t/**\n\t * Annotates the marker with the provided properties.\n\t * @param marker - The marker to annotate\n\t * @param props - The properties to annotate the marker with\n\t * @param combiningOp - Optional. Specifies how to combine values for the property, such as \"incr\" for increment.\n\t */\n\tpublic annotateMarker(marker: Marker, props: PropertySet, combiningOp?: ICombiningOp) {\n\t\tthis.guardReentrancy(() => this.client.annotateMarker(marker, props, combiningOp));\n\t}\n\n\t/**\n\t * Finds the nearest reference with ReferenceType.Tile to `startPos` in the direction dictated by `tilePrecedesPos`.\n\t * Note that Markers receive `ReferenceType.Tile` by default.\n\t * @deprecated Use `searchForMarker` instead.\n\t * @param startPos - Position at which to start the search\n\t * @param clientId - clientId dictating the perspective to search from\n\t * @param tileLabel - Label of the tile to search for\n\t * @param preceding - Whether the desired tile comes before (true) or after (false) `startPos`\n\t */\n\tpublic findTile(\n\t\tstartPos: number | undefined,\n\t\ttileLabel: string,\n\t\tpreceding = true,\n\t):\n\t\t| {\n\t\t\t\ttile: ReferencePosition;\n\t\t\t\tpos: number;\n\t\t }\n\t\t| undefined {\n\t\treturn this.client.findTile(startPos ?? 0, tileLabel, preceding);\n\t}\n\n\t/**\n\t * Searches a string for the nearest marker in either direction to a given start position.\n\t * The search will include the start position, so markers at the start position are valid\n\t * results of the search.\n\t * @param startPos - Position at which to start the search\n\t * @param markerLabel - Label of the marker to search for\n\t * @param forwards - Whether the desired marker comes before (false) or after (true) `startPos`\n\t */\n\tpublic searchForMarker(\n\t\tstartPos: number,\n\t\tmarkerLabel: string,\n\t\tforwards = true,\n\t): Marker | undefined {\n\t\treturn this.client.searchForMarker(startPos, markerLabel, forwards);\n\t}\n\n\t/**\n\t * Retrieve text from the SharedString in string format.\n\t * @param start - The starting index of the text to retrieve, or 0 if omitted.\n\t * @param end - The ending index of the text to retrieve, or the end of the string if omitted\n\t * @returns The requested text content as a string.\n\t */\n\tpublic getText(start?: number, end?: number) {\n\t\tconst segmentWindow = this.client.getCollabWindow();\n\t\treturn this.mergeTreeTextHelper.getText(\n\t\t\tsegmentWindow.currentSeq,\n\t\t\tsegmentWindow.clientId,\n\t\t\t\"\",\n\t\t\tstart,\n\t\t\tend,\n\t\t);\n\t}\n\n\t/**\n\t * Adds spaces for markers and handles, so that position calculations account for them.\n\t */\n\tpublic getTextWithPlaceholders(start?: number, end?: number) {\n\t\tconst segmentWindow = this.client.getCollabWindow();\n\t\treturn this.mergeTreeTextHelper.getText(\n\t\t\tsegmentWindow.currentSeq,\n\t\t\tsegmentWindow.clientId,\n\t\t\t\" \",\n\t\t\tstart,\n\t\t\tend,\n\t\t);\n\t}\n\n\tpublic getTextRangeWithMarkers(start: number, end: number) {\n\t\tconst segmentWindow = this.client.getCollabWindow();\n\t\treturn this.mergeTreeTextHelper.getText(\n\t\t\tsegmentWindow.currentSeq,\n\t\t\tsegmentWindow.clientId,\n\t\t\t\"*\",\n\t\t\tstart,\n\t\t\tend,\n\t\t);\n\t}\n\n\t/**\n\t * Looks up and returns a `Marker` using its id. Returns `undefined` if there is no marker with the provided\n\t * id in this `SharedString`.\n\t */\n\tpublic getMarkerFromId(id: string): ISegment | undefined {\n\t\treturn this.client.getMarkerFromId(id);\n\t}\n\n\t/**\n\t * Revert an op\n\t */\n\tprotected rollback(content: any, localOpMetadata: unknown): void {\n\t\tif (this.client.rollback !== undefined) {\n\t\t\tthis.client.rollback(content, localOpMetadata);\n\t\t} else {\n\t\t\tsuper.rollback(content, localOpMetadata);\n\t\t}\n\t}\n}\n\ninterface ITextAndMarkerAccumulator {\n\tparallelText: string[];\n\tparallelMarkers: Marker[];\n\tparallelMarkerLabel: string;\n\tplaceholder?: string;\n\ttagsInProgress: string[];\n\ttextSegment: TextSegment;\n}\n\n/**\n * Splits the text into regions ending with markers with the given `label`.\n * @param sharedString - String to retrieve text and markers from\n * @param label - label to split on\n * @returns Two parallel lists of text and markers, split by markers with the provided `label`.\n * For example:\n * ```typescript\n * // Say sharedstring has contents \"hello<paragraph marker 1>world<paragraph marker 2>missing\".\n * const { parallelText, parallelMarkers } = getTextAndMarkers(sharedString, \"paragraph\");\n * // parallelText === [\"hello\", \"world\"]\n * // parallelMarkers === [<paragraph marker 1 object>, <paragraph marker 2 object>]\n * // Note parallelText does not include \"missing\".\n * ```\n * @internal\n */\nexport function getTextAndMarkers(\n\tsharedString: SharedString,\n\tlabel: string,\n\tstart?: number,\n\tend?: number,\n): {\n\tparallelText: string[];\n\tparallelMarkers: Marker[];\n} {\n\tconst accum: ITextAndMarkerAccumulator = {\n\t\tparallelMarkerLabel: label,\n\t\tparallelMarkers: [],\n\t\tparallelText: [],\n\t\ttagsInProgress: [],\n\t\ttextSegment: new TextSegment(\"\"),\n\t};\n\n\tsharedString.walkSegments(gatherTextAndMarkers, start, end, accum);\n\treturn { parallelText: accum.parallelText, parallelMarkers: accum.parallelMarkers };\n}\n\nconst gatherTextAndMarkers: ISegmentAction<ITextAndMarkerAccumulator> = (\n\tsegment: ISegment,\n\tpos: number,\n\trefSeq: number,\n\tclientId: number,\n\tstart: number,\n\tend: number,\n\taccumText: ITextAndMarkerAccumulator,\n) => {\n\tconst { placeholder, tagsInProgress, textSegment } = accumText;\n\tif (TextSegment.is(segment)) {\n\t\tlet beginTags = \"\";\n\t\tlet endTags = \"\";\n\t\t// TODO: let clients pass in function to get tag\n\t\tconst tags = [] as string[];\n\t\tconst initTags = [] as string[];\n\n\t\tif (segment.properties?.[\"font-weight\"]) {\n\t\t\ttags.push(\"b\");\n\t\t}\n\t\tif (segment.properties?.[\"text-decoration\"]) {\n\t\t\ttags.push(\"u\");\n\t\t}\n\t\tconst remTags = [] as string[];\n\t\tif (tags.length > 0) {\n\t\t\tfor (const tag of tags) {\n\t\t\t\tif (!tagsInProgress.includes(tag)) {\n\t\t\t\t\tbeginTags += `<${tag}>`;\n\t\t\t\t\tinitTags.push(tag);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const accumTag of tagsInProgress) {\n\t\t\t\tif (!tags.includes(accumTag)) {\n\t\t\t\t\tendTags += `</${accumTag}>`;\n\t\t\t\t\tremTags.push(accumTag);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const initTag of initTags.reverse()) {\n\t\t\t\ttagsInProgress.push(initTag);\n\t\t\t}\n\t\t} else {\n\t\t\tfor (const accumTag of tagsInProgress) {\n\t\t\t\tendTags += `</${accumTag}>`;\n\t\t\t\tremTags.push(accumTag);\n\t\t\t}\n\t\t}\n\t\tfor (const remTag of remTags) {\n\t\t\tconst remdex = tagsInProgress.indexOf(remTag);\n\t\t\tif (remdex >= 0) {\n\t\t\t\ttagsInProgress.splice(remdex, 1);\n\t\t\t}\n\t\t}\n\t\ttextSegment.text += endTags;\n\t\ttextSegment.text += beginTags;\n\t\tif (start <= 0 && end >= segment.text.length) {\n\t\t\ttextSegment.text += segment.text;\n\t\t} else {\n\t\t\tconst seglen = segment.text.length;\n\t\t\tconst _start = start < 0 ? 0 : start;\n\t\t\tconst _end = end >= seglen ? undefined : end;\n\t\t\ttextSegment.text += segment.text.substring(_start, _end);\n\t\t}\n\t} else {\n\t\tif (placeholder && placeholder.length > 0) {\n\t\t\tconst placeholderText =\n\t\t\t\tplaceholder === \"*\"\n\t\t\t\t\t? // eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\t\t\t\t `\\n${segment.toString()}`\n\t\t\t\t\t: placeholder.repeat(segment.cachedLength);\n\t\t\ttextSegment.text += placeholderText;\n\t\t} else {\n\t\t\tconst marker = segment as Marker;\n\t\t\tif (refHasTileLabel(marker, accumText.parallelMarkerLabel)) {\n\t\t\t\taccumText.parallelMarkers.push(marker);\n\t\t\t\taccumText.parallelText.push(textSegment.text);\n\t\t\t\ttextSegment.text = \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/sequence",
3
- "version": "2.0.0-internal.7.3.0",
3
+ "version": "2.0.0-internal.7.4.1",
4
4
  "description": "Distributed sequence",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -11,20 +11,32 @@
11
11
  "license": "MIT",
12
12
  "author": "Microsoft and contributors",
13
13
  "sideEffects": false,
14
- "main": "dist/index.js",
15
- "module": "lib/index.js",
14
+ "exports": {
15
+ ".": {
16
+ "import": {
17
+ "types": "./lib/index.d.mts",
18
+ "default": "./lib/index.mjs"
19
+ },
20
+ "require": {
21
+ "types": "./dist/index.d.ts",
22
+ "default": "./dist/index.cjs"
23
+ }
24
+ }
25
+ },
26
+ "main": "dist/index.cjs",
27
+ "module": "lib/index.mjs",
16
28
  "types": "dist/index.d.ts",
17
29
  "c8": {
18
30
  "all": true,
19
31
  "cache-dir": "nyc/.cache",
20
32
  "exclude": [
21
33
  "src/test/**/*.ts",
22
- "dist/test/**/*.js"
34
+ "dist/test/**/*.?js"
23
35
  ],
24
36
  "exclude-after-remap": false,
25
37
  "include": [
26
38
  "src/**/*.ts",
27
- "dist/**/*.js"
39
+ "dist/**/*.?js"
28
40
  ],
29
41
  "report-dir": "nyc/report",
30
42
  "reporter": [
@@ -35,34 +47,34 @@
35
47
  "temp-directory": "nyc/.nyc_output"
36
48
  },
37
49
  "dependencies": {
38
- "@fluid-internal/client-utils": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0",
39
- "@fluidframework/core-interfaces": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0",
40
- "@fluidframework/core-utils": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0",
41
- "@fluidframework/datastore-definitions": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0",
42
- "@fluidframework/merge-tree": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0",
50
+ "@fluid-internal/client-utils": ">=2.0.0-internal.7.4.1 <2.0.0-internal.7.5.0",
51
+ "@fluidframework/core-interfaces": ">=2.0.0-internal.7.4.1 <2.0.0-internal.7.5.0",
52
+ "@fluidframework/core-utils": ">=2.0.0-internal.7.4.1 <2.0.0-internal.7.5.0",
53
+ "@fluidframework/datastore-definitions": ">=2.0.0-internal.7.4.1 <2.0.0-internal.7.5.0",
54
+ "@fluidframework/merge-tree": ">=2.0.0-internal.7.4.1 <2.0.0-internal.7.5.0",
43
55
  "@fluidframework/protocol-definitions": "^3.0.0",
44
- "@fluidframework/runtime-definitions": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0",
45
- "@fluidframework/runtime-utils": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0",
46
- "@fluidframework/shared-object-base": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0",
47
- "@fluidframework/telemetry-utils": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0",
56
+ "@fluidframework/runtime-definitions": ">=2.0.0-internal.7.4.1 <2.0.0-internal.7.5.0",
57
+ "@fluidframework/runtime-utils": ">=2.0.0-internal.7.4.1 <2.0.0-internal.7.5.0",
58
+ "@fluidframework/shared-object-base": ">=2.0.0-internal.7.4.1 <2.0.0-internal.7.5.0",
59
+ "@fluidframework/telemetry-utils": ">=2.0.0-internal.7.4.1 <2.0.0-internal.7.5.0",
48
60
  "uuid": "^9.0.0"
49
61
  },
50
62
  "devDependencies": {
51
- "@fluid-private/stochastic-test-utils": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0",
52
- "@fluid-private/test-dds-utils": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0",
63
+ "@arethetypeswrong/cli": "^0.13.3",
64
+ "@fluid-private/stochastic-test-utils": ">=2.0.0-internal.7.4.1 <2.0.0-internal.7.5.0",
65
+ "@fluid-private/test-dds-utils": ">=2.0.0-internal.7.4.1 <2.0.0-internal.7.5.0",
53
66
  "@fluid-tools/benchmark": "^0.48.0",
54
67
  "@fluid-tools/build-cli": "^0.28.0",
55
68
  "@fluidframework/build-common": "^2.0.3",
56
69
  "@fluidframework/build-tools": "^0.28.0",
57
70
  "@fluidframework/eslint-config-fluid": "^3.1.0",
58
- "@fluidframework/mocha-test-setup": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0",
71
+ "@fluidframework/mocha-test-setup": ">=2.0.0-internal.7.4.1 <2.0.0-internal.7.5.0",
59
72
  "@fluidframework/sequence-previous": "npm:@fluidframework/sequence@2.0.0-internal.7.2.0",
60
- "@fluidframework/test-runtime-utils": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0",
73
+ "@fluidframework/test-runtime-utils": ">=2.0.0-internal.7.4.1 <2.0.0-internal.7.5.0",
61
74
  "@microsoft/api-extractor": "^7.38.3",
62
75
  "@types/diff": "^3.5.1",
63
76
  "@types/mocha": "^9.1.1",
64
- "@types/node": "^16.18.38",
65
- "@types/random-js": "^1.0.31",
77
+ "@types/node": "^18.19.0",
66
78
  "c8": "^7.7.1",
67
79
  "copyfiles": "^2.4.1",
68
80
  "cross-env": "^7.0.3",
@@ -73,8 +85,11 @@
73
85
  "mocha-multi-reporters": "^1.5.1",
74
86
  "moment": "^2.21.0",
75
87
  "prettier": "~3.0.3",
76
- "random-js": "^1.0.8",
88
+ "random-js": "^2.1.0",
89
+ "renamer": "^4.0.0",
90
+ "replace-in-file": "^6.3.5",
77
91
  "rimraf": "^4.4.0",
92
+ "tsc-multi": "^1.1.0",
78
93
  "typescript": "~5.1.6"
79
94
  },
80
95
  "fluidBuild": {
@@ -104,31 +119,33 @@
104
119
  "build:commonjs": "fluid-build . --task commonjs",
105
120
  "build:compile": "fluid-build . --task compile",
106
121
  "build:docs": "fluid-build . --task api",
107
- "build:esnext": "tsc --project ./tsconfig.esnext.json",
122
+ "build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
108
123
  "build:genver": "gen-version",
109
- "build:test": "tsc --project ./src/test/tsconfig.json",
124
+ "build:rename-types": "renamer \"lib/**\" -f .d.ts -r .d.mts --force",
125
+ "build:test": "tsc-multi --config ./tsc-multi.test.json",
126
+ "check:are-the-types-wrong": "attw --pack",
127
+ "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
110
128
  "ci:build:docs": "api-extractor run",
111
129
  "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
112
130
  "eslint": "eslint --format stylish src",
113
131
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
114
132
  "format": "npm run prettier:fix",
115
- "lint": "npm run prettier && npm run eslint",
133
+ "lint": "npm run prettier && npm run check:release-tags && npm run eslint",
116
134
  "lint:fix": "npm run prettier:fix && npm run eslint:fix",
117
135
  "perf": "cross-env FLUID_TEST_VERBOSE=1 mocha \"dist/**/*.spec.js\" --node-option unhandled-rejections=strict,expose-gc --exit -r node_modules/@fluidframework/mocha-test-setup --perfMode --fgrep @Benchmark --reporter @fluid-tools/benchmark/dist/MochaReporter.js --timeout 30000",
118
136
  "perf:measure": "npm run perf -- --fgrep @Measurement",
119
- "prettier": "prettier --check . --ignore-path ../../../.prettierignore",
120
- "prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
137
+ "prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
138
+ "prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
121
139
  "test": "npm run test:mocha",
122
140
  "test:benchmark:report": "mocha \"dist/test/*.perf.spec.js\" --node-option unhandled-rejections=strict,expose-gc --exit --perfMode --fgrep @Benchmark -r @fluidframework/mocha-test-setup --reporter @fluid-tools/benchmark/dist/MochaReporter.js --timeout 60000",
123
141
  "test:coverage": "c8 npm test",
124
142
  "test:memory": "mocha --config src/test/memory/.mocharc.js",
125
143
  "test:memory-profiling:report": "mocha --config src/test/memory/.mocharc.js",
126
- "test:mocha": "mocha --ignore \"dist/test/memory/**/*\" --recursive \"dist/test/**/*.spec.js\" -r node_modules/@fluidframework/mocha-test-setup",
144
+ "test:mocha": "mocha --ignore \"dist/test/memory/**/*\" --recursive \"dist/test/**/*.spec.?js\" -r node_modules/@fluidframework/mocha-test-setup",
127
145
  "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
128
146
  "test:newsnapfiles": "node dist/test/createSnapshotFiles.js",
129
147
  "test:stress": "cross-env FUZZ_TEST_COUNT=100 FUZZ_STRESS_RUN=true mocha --ignore \"dist/test/memory/**/*\" --recursive \"dist/test/**/*.fuzz.spec.js\" -r @fluidframework/mocha-test-setup",
130
- "testfarm": "node dist/test/testFarm.js",
131
- "tsc": "tsc",
148
+ "tsc": "tsc-multi --config ../../../common/build/build-common/tsc-multi.cjs.json",
132
149
  "typetests:gen": "fluid-type-test-generator",
133
150
  "typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
134
151
  }
Binary file
package/src/defaultMap.ts CHANGED
@@ -18,6 +18,7 @@ import {
18
18
  ISerializableValue,
19
19
  ISerializedValue,
20
20
  IValueChanged,
21
+ // eslint-disable-next-line import/no-deprecated
21
22
  IValueOpEmitter,
22
23
  IValueType,
23
24
  IValueTypeOperationValue,
@@ -25,6 +26,7 @@ import {
25
26
  IMapMessageLocalMetadata,
26
27
  SequenceOptions,
27
28
  } from "./defaultMapInterfaces";
29
+ import { IntervalOpType, SerializedIntervalDelta } from "./intervals";
28
30
 
29
31
  /**
30
32
  * Defines the means to process and submit a given op on a map.
@@ -131,7 +133,7 @@ export class DefaultMap<T> {
131
133
  private readonly serializer: IFluidSerializer,
132
134
  private readonly handle: IFluidHandle,
133
135
  private readonly submitMessage: (
134
- op: any,
136
+ op: IMapValueTypeOperation,
135
137
  localOpMetadata: IMapMessageLocalMetadata,
136
138
  ) => void,
137
139
  private readonly type: IValueType<T>,
@@ -292,21 +294,24 @@ export class DefaultMap<T> {
292
294
  * also sent if we are asked to resubmit the message.
293
295
  * @returns True if the operation was submitted, false otherwise.
294
296
  */
295
- public tryResubmitMessage(op: any, localOpMetadata: IMapMessageLocalMetadata): boolean {
297
+ public tryResubmitMessage(
298
+ op: IMapOperation,
299
+ localOpMetadata: IMapMessageLocalMetadata,
300
+ ): boolean {
296
301
  const type: string = op.type;
297
302
  const handler = this.messageHandlers.get(type);
298
303
  if (handler !== undefined) {
299
- handler.resubmit(op as IMapOperation, localOpMetadata);
304
+ handler.resubmit(op, localOpMetadata);
300
305
  return true;
301
306
  }
302
307
  return false;
303
308
  }
304
309
 
305
- public tryGetStashedOpLocalMetadata(op: any): unknown {
310
+ public tryGetStashedOpLocalMetadata(op: IMapOperation): unknown {
306
311
  const type: string = op.type;
307
312
  if (this.messageHandlers.has(type)) {
308
313
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
309
- return this.messageHandlers.get(type)!.getStashedOpLocalMetadata(op as IMapOperation);
314
+ return this.messageHandlers.get(type)!.getStashedOpLocalMetadata(op);
310
315
  }
311
316
  throw new Error("no apply stashed op handler");
312
317
  }
@@ -406,12 +411,11 @@ export class DefaultMap<T> {
406
411
  assert(localValue !== undefined, 0x3f8 /* Local value expected on resubmission */);
407
412
 
408
413
  const handler = localValue.getOpHandler(op.value.opName);
409
- const { rebasedOp, rebasedLocalOpMetadata } = handler.rebase(
410
- localValue.value,
411
- op.value,
412
- localOpMetadata,
413
- );
414
- this.submitMessage({ ...op, value: rebasedOp }, rebasedLocalOpMetadata);
414
+ const rebased = handler.rebase(localValue.value, op.value, localOpMetadata);
415
+ if (rebased !== undefined) {
416
+ const { rebasedOp, rebasedLocalOpMetadata } = rebased;
417
+ this.submitMessage({ ...op, value: rebasedOp }, rebasedLocalOpMetadata);
418
+ }
415
419
  },
416
420
  getStashedOpLocalMetadata: (op: IMapValueTypeOperation) => {
417
421
  assert(
@@ -430,13 +434,15 @@ export class DefaultMap<T> {
430
434
  * @param key - The key of the map that the value type will be stored on
431
435
  * @returns A value op emitter for the given key
432
436
  */
437
+ // eslint-disable-next-line import/no-deprecated
433
438
  private makeMapValueOpEmitter(key: string): IValueOpEmitter {
434
- const emit = (
435
- opName: string,
436
- previousValue: any,
437
- params: any,
439
+ // eslint-disable-next-line import/no-deprecated
440
+ const emit: IValueOpEmitter["emit"] = (
441
+ opName: IntervalOpType,
442
+ previousValue: unknown,
443
+ params: SerializedIntervalDelta,
438
444
  localOpMetadata: IMapMessageLocalMetadata,
439
- ) => {
445
+ ): void => {
440
446
  const translatedParams = makeHandlesSerializable(params, this.serializer, this.handle);
441
447
 
442
448
  const op: IMapValueTypeOperation = {
@@ -6,6 +6,7 @@
6
6
  import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
7
7
  import { ISharedObjectEvents } from "@fluidframework/shared-object-base";
8
8
  import { IEventThisPlaceHolder } from "@fluidframework/core-interfaces";
9
+ import { ISerializedInterval, IntervalOpType, SerializedIntervalDelta } from "./intervals";
9
10
 
10
11
  /**
11
12
  * Type of "valueChanged" event parameter.
@@ -25,20 +26,20 @@ export interface IValueChanged {
25
26
  /**
26
27
  * Value types are given an IValueOpEmitter to emit their ops through the container type that holds them.
27
28
  * @internal
29
+ * @deprecated - will be remove from public api as there is no public used of this type
28
30
  */
29
31
  export interface IValueOpEmitter {
30
32
  /**
31
33
  * Called by the value type to emit a value type operation through the container type holding it.
32
34
  * @param opName - Name of the emitted operation
33
- * @param previousValue - JSONable previous value as defined by the value type
35
+ * @param previousValue - JSONable previous value as defined by the value type @deprecated unused
34
36
  * @param params - JSONable params for the operation as defined by the value type
35
37
  * @param localOpMetadata - JSONable local metadata which should be submitted with the op
36
- * @internal
37
38
  */
38
39
  emit(
39
- opName: string,
40
- previousValue: any,
41
- params: any,
40
+ opName: IntervalOpType,
41
+ previousValue: undefined,
42
+ params: SerializedIntervalDelta,
42
43
  localOpMetadata: IMapMessageLocalMetadata,
43
44
  ): void;
44
45
  }
@@ -52,7 +53,7 @@ export interface IMapMessageLocalMetadata {
52
53
 
53
54
  /**
54
55
  * Optional flags that configure options for sequence DDSs
55
- * @public
56
+ * @internal
56
57
  */
57
58
  export interface SequenceOptions {
58
59
  /**
@@ -123,7 +124,7 @@ export interface IValueOperation<T> {
123
124
  */
124
125
  process(
125
126
  value: T,
126
- params: any,
127
+ params: ISerializedInterval,
127
128
  local: boolean,
128
129
  message: ISequencedDocumentMessage | undefined,
129
130
  localOpMetadata: IMapMessageLocalMetadata | undefined,
@@ -141,7 +142,9 @@ export interface IValueOperation<T> {
141
142
  value: T,
142
143
  op: IValueTypeOperationValue,
143
144
  localOpMetadata: IMapMessageLocalMetadata,
144
- ): { rebasedOp: IValueTypeOperationValue; rebasedLocalOpMetadata: IMapMessageLocalMetadata };
145
+ ):
146
+ | { rebasedOp: IValueTypeOperationValue; rebasedLocalOpMetadata: IMapMessageLocalMetadata }
147
+ | undefined;
145
148
  }
146
149
 
147
150
  /**
@@ -164,7 +167,7 @@ export interface IValueType<T> {
164
167
  * Operations that can be applied to the value type.
165
168
  * @alpha
166
169
  */
167
- ops: Map<string, IValueOperation<T>>;
170
+ ops: Map<IntervalOpType, IValueOperation<T>>;
168
171
  }
169
172
 
170
173
  export interface ISharedDefaultMapEvents extends ISharedObjectEvents {
@@ -182,7 +185,7 @@ export interface ISharedDefaultMapEvents extends ISharedObjectEvents {
182
185
  * JSON.stringify and comes out of JSON.parse. This format is used both for snapshots (loadCore/populate)
183
186
  * and ops (set).
184
187
  *
185
- * The DefaultMap impelmentation for sequence has been specialized to only support a single ValueType, which serializes
188
+ * The DefaultMap implementation for sequence has been specialized to only support a single ValueType, which serializes
186
189
  * and deserializes via .store() and .load().
187
190
  */
188
191
  export interface ISerializableValue {
@@ -222,10 +225,10 @@ export interface IValueTypeOperationValue {
222
225
  /**
223
226
  * The name of the operation.
224
227
  */
225
- opName: string;
228
+ opName: IntervalOpType;
226
229
 
227
230
  /**
228
231
  * The payload that is submitted along with the operation.
229
232
  */
230
- value: any;
233
+ value: SerializedIntervalDelta;
231
234
  }