@fluidframework/sequence 2.0.0-internal.8.0.1 → 2.0.0-rc.1.0.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 (232) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +0 -6
  3. package/api-extractor-esm.json +4 -0
  4. package/api-extractor-lint.json +1 -10
  5. package/api-extractor.json +1 -9
  6. package/api-report/sequence.api.md +3 -15
  7. package/dist/defaultMap.d.ts +2 -2
  8. package/dist/defaultMap.d.ts.map +1 -1
  9. package/dist/defaultMap.js +10 -5
  10. package/dist/defaultMap.js.map +1 -1
  11. package/dist/defaultMapInterfaces.d.ts +3 -2
  12. package/dist/defaultMapInterfaces.d.ts.map +1 -1
  13. package/dist/defaultMapInterfaces.js.map +1 -1
  14. package/dist/intervalCollection.d.ts +3 -43
  15. package/dist/intervalCollection.d.ts.map +1 -1
  16. package/dist/intervalCollection.js +62 -50
  17. package/dist/intervalCollection.js.map +1 -1
  18. package/dist/intervals/index.d.ts +1 -1
  19. package/dist/intervals/index.d.ts.map +1 -1
  20. package/dist/intervals/index.js +2 -1
  21. package/dist/intervals/index.js.map +1 -1
  22. package/dist/intervals/intervalUtils.d.ts +12 -2
  23. package/dist/intervals/intervalUtils.d.ts.map +1 -1
  24. package/dist/intervals/intervalUtils.js +10 -3
  25. package/dist/intervals/intervalUtils.js.map +1 -1
  26. package/dist/packageVersion.d.ts +1 -1
  27. package/dist/packageVersion.d.ts.map +1 -1
  28. package/dist/packageVersion.js +1 -1
  29. package/dist/packageVersion.js.map +1 -1
  30. package/dist/revertibles.d.ts.map +1 -1
  31. package/dist/revertibles.js +9 -3
  32. package/dist/revertibles.js.map +1 -1
  33. package/dist/sequence-alpha.d.ts +2 -47
  34. package/dist/sequence-beta.d.ts +0 -29
  35. package/dist/sequence-public.d.ts +0 -29
  36. package/dist/sequence-untrimmed.d.ts +5 -48
  37. package/dist/sequence.d.ts +2 -2
  38. package/dist/sequence.d.ts.map +1 -1
  39. package/dist/sequence.js +5 -1
  40. package/dist/sequence.js.map +1 -1
  41. package/dist/sharedString.d.ts +1 -14
  42. package/dist/sharedString.d.ts.map +1 -1
  43. package/dist/sharedString.js +0 -12
  44. package/dist/sharedString.js.map +1 -1
  45. package/lib/{defaultMap.d.ts → defaultMap.d.mts} +3 -3
  46. package/lib/defaultMap.d.mts.map +1 -0
  47. package/lib/{defaultMap.js → defaultMap.mjs} +28 -27
  48. package/lib/defaultMap.mjs.map +1 -0
  49. package/lib/{defaultMapInterfaces.d.ts → defaultMapInterfaces.d.mts} +4 -3
  50. package/lib/defaultMapInterfaces.d.mts.map +1 -0
  51. package/lib/{intervalIndex/intervalIndex.js → defaultMapInterfaces.mjs} +2 -3
  52. package/lib/defaultMapInterfaces.mjs.map +1 -0
  53. package/lib/{index.d.ts → index.d.mts} +12 -24
  54. package/lib/index.d.mts.map +1 -0
  55. package/lib/index.mjs +16 -0
  56. package/lib/index.mjs.map +1 -0
  57. package/lib/{intervalCollection.d.ts → intervalCollection.d.mts} +6 -46
  58. package/lib/intervalCollection.d.mts.map +1 -0
  59. package/lib/{intervalCollection.js → intervalCollection.mjs} +176 -179
  60. package/lib/intervalCollection.mjs.map +1 -0
  61. package/lib/intervalIndex/{endpointInRangeIndex.d.ts → endpointInRangeIndex.d.mts} +4 -4
  62. package/lib/intervalIndex/endpointInRangeIndex.d.mts.map +1 -0
  63. package/lib/intervalIndex/{endpointInRangeIndex.js → endpointInRangeIndex.mjs} +13 -18
  64. package/lib/intervalIndex/endpointInRangeIndex.mjs.map +1 -0
  65. package/lib/intervalIndex/{endpointIndex.d.ts → endpointIndex.d.mts} +4 -4
  66. package/lib/intervalIndex/endpointIndex.d.mts.map +1 -0
  67. package/lib/intervalIndex/{endpointIndex.js → endpointIndex.mjs} +9 -14
  68. package/lib/intervalIndex/endpointIndex.mjs.map +1 -0
  69. package/lib/intervalIndex/{idIntervalIndex.d.ts → idIntervalIndex.d.mts} +3 -3
  70. package/lib/intervalIndex/idIntervalIndex.d.mts.map +1 -0
  71. package/lib/intervalIndex/{idIntervalIndex.js → idIntervalIndex.mjs} +5 -9
  72. package/lib/intervalIndex/idIntervalIndex.mjs.map +1 -0
  73. package/lib/intervalIndex/{index.d.ts → index.d.mts} +9 -9
  74. package/lib/intervalIndex/index.d.mts.map +1 -0
  75. package/lib/intervalIndex/index.mjs +11 -0
  76. package/lib/intervalIndex/{index.js.map → index.mjs.map} +1 -1
  77. package/lib/intervalIndex/{intervalIndex.d.ts → intervalIndex.d.mts} +2 -2
  78. package/lib/intervalIndex/intervalIndex.d.mts.map +1 -0
  79. package/lib/intervalIndex/intervalIndex.mjs +6 -0
  80. package/lib/intervalIndex/{intervalIndex.js.map → intervalIndex.mjs.map} +1 -1
  81. package/lib/intervalIndex/{intervalIndexUtils.d.ts → intervalIndexUtils.d.mts} +1 -1
  82. package/lib/intervalIndex/intervalIndexUtils.d.mts.map +1 -0
  83. package/lib/intervalIndex/{intervalIndexUtils.js → intervalIndexUtils.mjs} +5 -9
  84. package/lib/intervalIndex/intervalIndexUtils.mjs.map +1 -0
  85. package/lib/intervalIndex/{overlappingIntervalsIndex.d.ts → overlappingIntervalsIndex.d.mts} +6 -6
  86. package/lib/intervalIndex/overlappingIntervalsIndex.d.mts.map +1 -0
  87. package/lib/intervalIndex/{overlappingIntervalsIndex.js → overlappingIntervalsIndex.mjs} +11 -16
  88. package/lib/intervalIndex/overlappingIntervalsIndex.mjs.map +1 -0
  89. package/lib/intervalIndex/{overlappingSequenceIntervalsIndex.d.ts → overlappingSequenceIntervalsIndex.d.mts} +3 -3
  90. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.d.mts.map +1 -0
  91. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.mjs +37 -0
  92. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.mjs.map +1 -0
  93. package/lib/intervalIndex/{sequenceIntervalIndexes.d.ts → sequenceIntervalIndexes.d.mts} +3 -3
  94. package/lib/intervalIndex/sequenceIntervalIndexes.d.mts.map +1 -0
  95. package/lib/intervalIndex/sequenceIntervalIndexes.mjs +6 -0
  96. package/lib/intervalIndex/{sequenceIntervalIndexes.js.map → sequenceIntervalIndexes.mjs.map} +1 -1
  97. package/lib/intervalIndex/{startpointInRangeIndex.d.ts → startpointInRangeIndex.d.mts} +4 -4
  98. package/lib/intervalIndex/startpointInRangeIndex.d.mts.map +1 -0
  99. package/lib/intervalIndex/{startpointInRangeIndex.js → startpointInRangeIndex.mjs} +13 -18
  100. package/lib/intervalIndex/startpointInRangeIndex.mjs.map +1 -0
  101. package/lib/{intervalTree.d.ts → intervalTree.d.mts} +2 -2
  102. package/lib/intervalTree.d.mts.map +1 -0
  103. package/lib/{intervalTree.js → intervalTree.mjs} +4 -8
  104. package/lib/intervalTree.mjs.map +1 -0
  105. package/lib/intervals/{index.d.ts → index.d.mts} +4 -4
  106. package/lib/intervals/index.d.mts.map +1 -0
  107. package/lib/intervals/index.mjs +8 -0
  108. package/lib/intervals/index.mjs.map +1 -0
  109. package/lib/intervals/{interval.d.ts → interval.d.mts} +3 -3
  110. package/lib/intervals/interval.d.mts.map +1 -0
  111. package/lib/intervals/{interval.js → interval.mjs} +13 -18
  112. package/lib/intervals/interval.mjs.map +1 -0
  113. package/lib/intervals/{intervalUtils.d.ts → intervalUtils.d.mts} +14 -4
  114. package/lib/intervals/intervalUtils.d.mts.map +1 -0
  115. package/lib/intervals/{intervalUtils.js → intervalUtils.mjs} +22 -21
  116. package/lib/intervals/intervalUtils.mjs.map +1 -0
  117. package/lib/intervals/{sequenceInterval.d.ts → sequenceInterval.d.mts} +3 -3
  118. package/lib/intervals/sequenceInterval.d.mts.map +1 -0
  119. package/lib/intervals/{sequenceInterval.js → sequenceInterval.mjs} +56 -64
  120. package/lib/intervals/sequenceInterval.mjs.map +1 -0
  121. package/lib/{localValues.d.ts → localValues.d.mts} +3 -3
  122. package/lib/localValues.d.mts.map +1 -0
  123. package/lib/{localValues.js → localValues.mjs} +5 -10
  124. package/lib/localValues.mjs.map +1 -0
  125. package/lib/{packageVersion.d.ts → packageVersion.d.mts} +2 -2
  126. package/lib/packageVersion.d.mts.map +1 -0
  127. package/lib/packageVersion.mjs +9 -0
  128. package/lib/packageVersion.mjs.map +1 -0
  129. package/lib/{revertibles.d.ts → revertibles.d.mts} +4 -4
  130. package/lib/revertibles.d.mts.map +1 -0
  131. package/lib/{revertibles.js → revertibles.mjs} +71 -74
  132. package/lib/revertibles.mjs.map +1 -0
  133. package/lib/{sequence-alpha.d.ts → sequence-alpha.d.mts} +2 -60
  134. package/lib/{sequence-public.d.ts → sequence-beta.d.mts} +0 -42
  135. package/lib/{sequence-beta.d.ts → sequence-public.d.mts} +0 -42
  136. package/lib/{sequence-untrimmed.d.ts → sequence-untrimmed.d.mts} +5 -61
  137. package/lib/{sequence.d.ts → sequence.d.mts} +7 -7
  138. package/lib/sequence.d.mts.map +1 -0
  139. package/lib/{sequence.js → sequence.mjs} +51 -48
  140. package/lib/sequence.mjs.map +1 -0
  141. package/lib/{sequenceDeltaEvent.d.ts → sequenceDeltaEvent.d.mts} +1 -1
  142. package/lib/sequenceDeltaEvent.d.mts.map +1 -0
  143. package/lib/{sequenceDeltaEvent.js → sequenceDeltaEvent.mjs} +10 -14
  144. package/lib/sequenceDeltaEvent.mjs.map +1 -0
  145. package/lib/{sequenceFactory.d.ts → sequenceFactory.d.mts} +2 -2
  146. package/lib/sequenceFactory.d.mts.map +1 -0
  147. package/lib/{sequenceFactory.js → sequenceFactory.mjs} +10 -14
  148. package/lib/sequenceFactory.mjs.map +1 -0
  149. package/lib/{sharedIntervalCollection.d.ts → sharedIntervalCollection.d.mts} +3 -3
  150. package/lib/sharedIntervalCollection.d.mts.map +1 -0
  151. package/lib/{sharedIntervalCollection.js → sharedIntervalCollection.mjs} +14 -19
  152. package/lib/sharedIntervalCollection.mjs.map +1 -0
  153. package/lib/{sharedSequence.d.ts → sharedSequence.d.mts} +2 -2
  154. package/lib/sharedSequence.d.mts.map +1 -0
  155. package/lib/{sharedSequence.js → sharedSequence.mjs} +7 -12
  156. package/lib/sharedSequence.mjs.map +1 -0
  157. package/lib/{sharedString.d.ts → sharedString.d.mts} +4 -17
  158. package/lib/sharedString.d.mts.map +1 -0
  159. package/lib/{sharedString.js → sharedString.mjs} +17 -34
  160. package/lib/sharedString.mjs.map +1 -0
  161. package/package.json +97 -46
  162. package/src/defaultMap.ts +17 -12
  163. package/src/defaultMapInterfaces.ts +9 -2
  164. package/src/intervalCollection.ts +67 -123
  165. package/src/intervals/index.ts +1 -0
  166. package/src/intervals/intervalUtils.ts +14 -4
  167. package/src/packageVersion.ts +1 -1
  168. package/src/revertibles.ts +9 -11
  169. package/src/sequence.ts +7 -3
  170. package/src/sharedString.ts +0 -23
  171. package/lib/defaultMap.d.ts.map +0 -1
  172. package/lib/defaultMap.js.map +0 -1
  173. package/lib/defaultMapInterfaces.d.ts.map +0 -1
  174. package/lib/defaultMapInterfaces.js +0 -7
  175. package/lib/defaultMapInterfaces.js.map +0 -1
  176. package/lib/index.d.ts.map +0 -1
  177. package/lib/index.js +0 -60
  178. package/lib/index.js.map +0 -1
  179. package/lib/intervalCollection.d.ts.map +0 -1
  180. package/lib/intervalCollection.js.map +0 -1
  181. package/lib/intervalIndex/endpointInRangeIndex.d.ts.map +0 -1
  182. package/lib/intervalIndex/endpointInRangeIndex.js.map +0 -1
  183. package/lib/intervalIndex/endpointIndex.d.ts.map +0 -1
  184. package/lib/intervalIndex/endpointIndex.js.map +0 -1
  185. package/lib/intervalIndex/idIntervalIndex.d.ts.map +0 -1
  186. package/lib/intervalIndex/idIntervalIndex.js.map +0 -1
  187. package/lib/intervalIndex/index.d.ts.map +0 -1
  188. package/lib/intervalIndex/index.js +0 -24
  189. package/lib/intervalIndex/intervalIndex.d.ts.map +0 -1
  190. package/lib/intervalIndex/intervalIndexUtils.d.ts.map +0 -1
  191. package/lib/intervalIndex/intervalIndexUtils.js.map +0 -1
  192. package/lib/intervalIndex/overlappingIntervalsIndex.d.ts.map +0 -1
  193. package/lib/intervalIndex/overlappingIntervalsIndex.js.map +0 -1
  194. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.d.ts.map +0 -1
  195. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.js +0 -41
  196. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.js.map +0 -1
  197. package/lib/intervalIndex/sequenceIntervalIndexes.d.ts.map +0 -1
  198. package/lib/intervalIndex/sequenceIntervalIndexes.js +0 -7
  199. package/lib/intervalIndex/startpointInRangeIndex.d.ts.map +0 -1
  200. package/lib/intervalIndex/startpointInRangeIndex.js.map +0 -1
  201. package/lib/intervalTree.d.ts.map +0 -1
  202. package/lib/intervalTree.js.map +0 -1
  203. package/lib/intervals/index.d.ts.map +0 -1
  204. package/lib/intervals/index.js +0 -23
  205. package/lib/intervals/index.js.map +0 -1
  206. package/lib/intervals/interval.d.ts.map +0 -1
  207. package/lib/intervals/interval.js.map +0 -1
  208. package/lib/intervals/intervalUtils.d.ts.map +0 -1
  209. package/lib/intervals/intervalUtils.js.map +0 -1
  210. package/lib/intervals/sequenceInterval.d.ts.map +0 -1
  211. package/lib/intervals/sequenceInterval.js.map +0 -1
  212. package/lib/localValues.d.ts.map +0 -1
  213. package/lib/localValues.js.map +0 -1
  214. package/lib/packageVersion.d.ts.map +0 -1
  215. package/lib/packageVersion.js +0 -12
  216. package/lib/packageVersion.js.map +0 -1
  217. package/lib/revertibles.d.ts.map +0 -1
  218. package/lib/revertibles.js.map +0 -1
  219. package/lib/sequence.d.ts.map +0 -1
  220. package/lib/sequence.js.map +0 -1
  221. package/lib/sequenceDeltaEvent.d.ts.map +0 -1
  222. package/lib/sequenceDeltaEvent.js.map +0 -1
  223. package/lib/sequenceFactory.d.ts.map +0 -1
  224. package/lib/sequenceFactory.js.map +0 -1
  225. package/lib/sharedIntervalCollection.d.ts.map +0 -1
  226. package/lib/sharedIntervalCollection.js.map +0 -1
  227. package/lib/sharedSequence.d.ts.map +0 -1
  228. package/lib/sharedSequence.js.map +0 -1
  229. package/lib/sharedString.d.ts.map +0 -1
  230. package/lib/sharedString.js.map +0 -1
  231. package/sequence.test-files.tar +0 -0
  232. package/tsconfig.esnext.json +0 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/sequence",
3
- "version": "2.0.0-internal.8.0.1",
3
+ "version": "2.0.0-rc.1.0.0",
4
4
  "description": "Distributed sequence",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -11,20 +11,82 @@
11
11
  "license": "MIT",
12
12
  "author": "Microsoft and contributors",
13
13
  "sideEffects": false,
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.js"
23
+ }
24
+ },
25
+ "./test/intervalCollection": {
26
+ "import": {
27
+ "types": "./lib/intervalCollection.d.mts",
28
+ "default": "./lib/intervalCollection.mjs"
29
+ },
30
+ "require": {
31
+ "types": "./dist/intervalCollection.d.ts",
32
+ "default": "./dist/intervalCollection.js"
33
+ }
34
+ },
35
+ "./alpha": {
36
+ "import": {
37
+ "types": "./lib/sequence-alpha.d.mts",
38
+ "default": "./lib/index.mjs"
39
+ },
40
+ "require": {
41
+ "types": "./dist/sequence-alpha.d.ts",
42
+ "default": "./dist/index.js"
43
+ }
44
+ },
45
+ "./beta": {
46
+ "import": {
47
+ "types": "./lib/sequence-beta.d.mts",
48
+ "default": "./lib/index.mjs"
49
+ },
50
+ "require": {
51
+ "types": "./dist/sequence-beta.d.ts",
52
+ "default": "./dist/index.js"
53
+ }
54
+ },
55
+ "./internal": {
56
+ "import": {
57
+ "types": "./lib/index.d.mts",
58
+ "default": "./lib/index.mjs"
59
+ },
60
+ "require": {
61
+ "types": "./dist/index.d.ts",
62
+ "default": "./dist/index.js"
63
+ }
64
+ },
65
+ "./public": {
66
+ "import": {
67
+ "types": "./lib/sequence-public.d.mts",
68
+ "default": "./lib/index.mjs"
69
+ },
70
+ "require": {
71
+ "types": "./dist/sequence-public.d.ts",
72
+ "default": "./dist/index.js"
73
+ }
74
+ }
75
+ },
14
76
  "main": "dist/index.js",
15
- "module": "lib/index.js",
77
+ "module": "lib/index.mjs",
16
78
  "types": "dist/index.d.ts",
17
79
  "c8": {
18
80
  "all": true,
19
81
  "cache-dir": "nyc/.cache",
20
82
  "exclude": [
21
- "src/test/**/*.ts",
22
- "dist/test/**/*.js"
83
+ "src/test/**/*.*ts",
84
+ "dist/test/**/*.*js"
23
85
  ],
24
86
  "exclude-after-remap": false,
25
87
  "include": [
26
- "src/**/*.ts",
27
- "dist/**/*.js"
88
+ "src/**/*.*ts",
89
+ "dist/**/*.*js"
28
90
  ],
29
91
  "report-dir": "nyc/report",
30
92
  "reporter": [
@@ -35,36 +97,36 @@
35
97
  "temp-directory": "nyc/.nyc_output"
36
98
  },
37
99
  "dependencies": {
38
- "@fluid-internal/client-utils": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
39
- "@fluidframework/core-interfaces": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
40
- "@fluidframework/core-utils": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
41
- "@fluidframework/datastore-definitions": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
42
- "@fluidframework/merge-tree": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
43
- "@fluidframework/protocol-definitions": "^3.0.0",
44
- "@fluidframework/runtime-definitions": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
45
- "@fluidframework/runtime-utils": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
46
- "@fluidframework/shared-object-base": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
47
- "@fluidframework/telemetry-utils": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
100
+ "@fluid-internal/client-utils": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
101
+ "@fluidframework/core-interfaces": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
102
+ "@fluidframework/core-utils": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
103
+ "@fluidframework/datastore-definitions": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
104
+ "@fluidframework/merge-tree": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
105
+ "@fluidframework/protocol-definitions": "^3.1.0",
106
+ "@fluidframework/runtime-definitions": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
107
+ "@fluidframework/runtime-utils": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
108
+ "@fluidframework/shared-object-base": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
109
+ "@fluidframework/telemetry-utils": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
48
110
  "uuid": "^9.0.0"
49
111
  },
50
112
  "devDependencies": {
51
113
  "@arethetypeswrong/cli": "^0.13.3",
52
- "@fluid-private/stochastic-test-utils": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
53
- "@fluid-private/test-dds-utils": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
114
+ "@fluid-private/stochastic-test-utils": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
115
+ "@fluid-private/test-dds-utils": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
54
116
  "@fluid-tools/benchmark": "^0.48.0",
55
- "@fluid-tools/build-cli": "^0.28.0",
117
+ "@fluid-tools/build-cli": "^0.29.0",
56
118
  "@fluidframework/build-common": "^2.0.3",
57
- "@fluidframework/build-tools": "^0.28.0",
58
- "@fluidframework/eslint-config-fluid": "^3.1.0",
59
- "@fluidframework/mocha-test-setup": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
60
- "@fluidframework/sequence-previous": "npm:@fluidframework/sequence@2.0.0-internal.7.2.0",
61
- "@fluidframework/test-runtime-utils": ">=2.0.0-internal.8.0.1 <2.0.0-internal.8.1.0",
119
+ "@fluidframework/build-tools": "^0.29.0",
120
+ "@fluidframework/eslint-config-fluid": "^3.2.0",
121
+ "@fluidframework/mocha-test-setup": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
122
+ "@fluidframework/sequence-previous": "npm:@fluidframework/sequence@2.0.0-internal.8.0.0",
123
+ "@fluidframework/test-runtime-utils": ">=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0",
62
124
  "@microsoft/api-extractor": "^7.38.3",
63
125
  "@types/diff": "^3.5.1",
64
126
  "@types/mocha": "^9.1.1",
65
127
  "@types/node": "^18.19.0",
66
128
  "@types/uuid": "^9.0.2",
67
- "c8": "^7.7.1",
129
+ "c8": "^8.0.1",
68
130
  "copyfiles": "^2.4.1",
69
131
  "cross-env": "^7.0.3",
70
132
  "diff": "^3.5.0",
@@ -75,7 +137,9 @@
75
137
  "moment": "^2.21.0",
76
138
  "prettier": "~3.0.3",
77
139
  "random-js": "^2.1.0",
140
+ "replace-in-file": "^6.3.5",
78
141
  "rimraf": "^4.4.0",
142
+ "tsc-multi": "^1.1.0",
79
143
  "typescript": "~5.1.6"
80
144
  },
81
145
  "fluidBuild": {
@@ -96,23 +160,10 @@
96
160
  },
97
161
  "typeValidation": {
98
162
  "broken": {
99
- "InterfaceDeclaration_ISharedString": {
100
- "forwardCompat": false,
101
- "backCompat": false
102
- },
103
- "ClassDeclaration_SharedSegmentSequence": {
104
- "forwardCompat": false,
105
- "backCompat": false
106
- },
107
- "ClassDeclaration_SharedSequence": {
108
- "forwardCompat": false,
163
+ "InterfaceDeclaration_IIntervalCollection": {
109
164
  "backCompat": false
110
165
  },
111
166
  "ClassDeclaration_SharedString": {
112
- "forwardCompat": false,
113
- "backCompat": false
114
- },
115
- "TypeAliasDeclaration_SharedStringSegment": {
116
167
  "backCompat": false
117
168
  }
118
169
  }
@@ -120,15 +171,15 @@
120
171
  "scripts": {
121
172
  "api": "fluid-build . --task api",
122
173
  "api-extractor:commonjs": "api-extractor run --local",
123
- "api-extractor:esnext": "copyfiles -u 1 \"dist/**/*-@(alpha|beta|public|untrimmed).d.ts\" lib",
174
+ "api-extractor:esnext": "api-extractor run --config ./api-extractor-esm.json",
124
175
  "build": "fluid-build . --task build",
125
176
  "build:commonjs": "fluid-build . --task commonjs",
126
177
  "build:compile": "fluid-build . --task compile",
127
178
  "build:docs": "fluid-build . --task api",
128
- "build:esnext": "tsc --project ./tsconfig.esnext.json",
179
+ "build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
129
180
  "build:genver": "gen-version",
130
181
  "build:test": "tsc --project ./src/test/tsconfig.json",
131
- "check:are-the-types-wrong": "attw --pack",
182
+ "check:are-the-types-wrong": "attw --pack . --entrypoints .",
132
183
  "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
133
184
  "ci:build:docs": "api-extractor run",
134
185
  "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
@@ -137,19 +188,19 @@
137
188
  "format": "npm run prettier:fix",
138
189
  "lint": "npm run prettier && npm run check:release-tags && npm run eslint",
139
190
  "lint:fix": "npm run prettier:fix && npm run eslint:fix",
140
- "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",
191
+ "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",
141
192
  "perf:measure": "npm run perf -- --fgrep @Measurement",
142
193
  "prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
143
194
  "prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
144
195
  "test": "npm run test:mocha",
145
- "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",
196
+ "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",
146
197
  "test:coverage": "c8 npm test",
147
198
  "test:memory": "mocha --config src/test/memory/.mocharc.js",
148
199
  "test:memory-profiling:report": "mocha --config src/test/memory/.mocharc.js",
149
- "test:mocha": "mocha --ignore \"dist/test/memory/**/*\" --recursive \"dist/test/**/*.spec.js\" -r node_modules/@fluidframework/mocha-test-setup",
200
+ "test:mocha": "mocha --ignore \"dist/test/memory/**/*\" --recursive \"dist/test/**/*.spec.*js\" -r node_modules/@fluidframework/mocha-test-setup",
150
201
  "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
151
202
  "test:newsnapfiles": "node dist/test/createSnapshotFiles.js",
152
- "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",
203
+ "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",
153
204
  "tsc": "tsc",
154
205
  "typetests:gen": "fluid-type-test-generator",
155
206
  "typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
package/src/defaultMap.ts CHANGED
@@ -21,13 +21,16 @@ import {
21
21
  // eslint-disable-next-line import/no-deprecated
22
22
  IValueOpEmitter,
23
23
  IValueType,
24
- IValueTypeOperationValue,
25
24
  ISharedDefaultMapEvents,
26
25
  IMapMessageLocalMetadata,
27
26
  SequenceOptions,
27
+ IValueTypeOperationValue,
28
28
  } from "./defaultMapInterfaces";
29
- import { IntervalOpType, SerializedIntervalDelta } from "./intervals";
29
+ import { SerializedIntervalDelta, IntervalDeltaOpType } from "./intervals";
30
30
 
31
+ function isMapOperation(op: unknown): op is IMapOperation {
32
+ return typeof op === "object" && op !== null && "type" in op && op.type === "act";
33
+ }
31
34
  /**
32
35
  * Defines the means to process and submit a given op on a map.
33
36
  */
@@ -55,7 +58,7 @@ interface IMapMessageHandler {
55
58
 
56
59
  resubmit(op: IMapOperation, localOpMetadata: IMapMessageLocalMetadata): void;
57
60
 
58
- getStashedOpLocalMetadata(op: IMapOperation): unknown;
61
+ getStashedOpLocalMetadata(op: IMapOperation): IMapMessageLocalMetadata;
59
62
  }
60
63
 
61
64
  /**
@@ -307,13 +310,12 @@ export class DefaultMap<T> {
307
310
  return false;
308
311
  }
309
312
 
310
- public tryGetStashedOpLocalMetadata(op: IMapOperation): unknown {
311
- const type: string = op.type;
312
- if (this.messageHandlers.has(type)) {
313
+ public tryGetStashedOpLocalMetadata(op: unknown): IMapMessageLocalMetadata | undefined {
314
+ if (isMapOperation(op) && this.messageHandlers.has(op.type)) {
313
315
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
314
- return this.messageHandlers.get(type)!.getStashedOpLocalMetadata(op);
316
+ return this.messageHandlers.get(op.type)!.getStashedOpLocalMetadata(op);
315
317
  }
316
- throw new Error("no apply stashed op handler");
318
+ return undefined;
317
319
  }
318
320
 
319
321
  /**
@@ -417,11 +419,14 @@ export class DefaultMap<T> {
417
419
  this.submitMessage({ ...op, value: rebasedOp }, rebasedLocalOpMetadata);
418
420
  }
419
421
  },
420
- getStashedOpLocalMetadata: (op: IMapValueTypeOperation) => {
422
+ getStashedOpLocalMetadata: (op: IMapValueTypeOperation): IMapMessageLocalMetadata => {
423
+ const localValue = this.data.get(op.key) ?? this.createCore(op.key, true);
421
424
  assert(
422
- false,
423
- 0x016 /* "apply stashed op not implemented for custom value type ops" */,
425
+ localValue !== undefined,
426
+ 0x879 /* Local value expected on applying stashed op */,
424
427
  );
428
+ const handler = localValue.getOpHandler(op.value.opName);
429
+ return handler.applyStashedOp(localValue.value, op.value);
425
430
  },
426
431
  });
427
432
 
@@ -438,7 +443,7 @@ export class DefaultMap<T> {
438
443
  private makeMapValueOpEmitter(key: string): IValueOpEmitter {
439
444
  // eslint-disable-next-line import/no-deprecated
440
445
  const emit: IValueOpEmitter["emit"] = (
441
- opName: IntervalOpType,
446
+ opName: IntervalDeltaOpType,
442
447
  previousValue: unknown,
443
448
  params: SerializedIntervalDelta,
444
449
  localOpMetadata: IMapMessageLocalMetadata,
@@ -6,7 +6,12 @@
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
+ import {
10
+ ISerializedInterval,
11
+ IntervalOpType,
12
+ SerializedIntervalDelta,
13
+ IntervalDeltaOpType,
14
+ } from "./intervals";
10
15
 
11
16
  /**
12
17
  * Type of "valueChanged" event parameter.
@@ -145,6 +150,8 @@ export interface IValueOperation<T> {
145
150
  ):
146
151
  | { rebasedOp: IValueTypeOperationValue; rebasedLocalOpMetadata: IMapMessageLocalMetadata }
147
152
  | undefined;
153
+
154
+ applyStashedOp(value: T, op: IValueTypeOperationValue): IMapMessageLocalMetadata;
148
155
  }
149
156
 
150
157
  /**
@@ -225,7 +232,7 @@ export interface IValueTypeOperationValue {
225
232
  /**
226
233
  * The name of the operation.
227
234
  */
228
- opName: IntervalOpType;
235
+ opName: IntervalDeltaOpType;
229
236
 
230
237
  /**
231
238
  * The payload that is submitted along with the operation.
@@ -7,7 +7,7 @@
7
7
  /* eslint-disable import/no-deprecated */
8
8
 
9
9
  import { TypedEventEmitter } from "@fluid-internal/client-utils";
10
- import { assert } from "@fluidframework/core-utils";
10
+ import { assert, unreachableCase } from "@fluidframework/core-utils";
11
11
  import { IEvent } from "@fluidframework/core-interfaces";
12
12
  import {
13
13
  addProperties,
@@ -35,6 +35,7 @@ import {
35
35
  IValueOpEmitter,
36
36
  IValueOperation,
37
37
  IValueType,
38
+ IValueTypeOperationValue,
38
39
  SequenceOptions,
39
40
  } from "./defaultMapInterfaces";
40
41
  import {
@@ -53,6 +54,7 @@ import {
53
54
  startReferenceSlidingPreference,
54
55
  sequenceIntervalHelpers,
55
56
  createInterval,
57
+ IntervalDeltaOpType,
56
58
  } from "./intervals";
57
59
  import {
58
60
  EndpointIndex,
@@ -578,6 +580,13 @@ export function makeOpsMap<T extends ISerializableInterval>(): Map<
578
580
  return { rebasedOp, rebasedLocalOpMetadata: localOpMetadata };
579
581
  };
580
582
 
583
+ const applyStashedOp: IValueOperation<IntervalCollection<T>>["applyStashedOp"] = (
584
+ collection,
585
+ op,
586
+ ) => {
587
+ return collection.applyStashedOp(op);
588
+ };
589
+
581
590
  return new Map<IntervalOpType, IValueOperation<IntervalCollection<T>>>([
582
591
  [
583
592
  IntervalOpType.ADD,
@@ -592,6 +601,7 @@ export function makeOpsMap<T extends ISerializableInterval>(): Map<
592
601
  collection.ackAdd(params, local, op, localOpMetadata);
593
602
  },
594
603
  rebase,
604
+ applyStashedOp,
595
605
  },
596
606
  ],
597
607
  [
@@ -605,6 +615,7 @@ export function makeOpsMap<T extends ISerializableInterval>(): Map<
605
615
  // Deletion of intervals is based on id, so requires no rebasing.
606
616
  return { rebasedOp: op, rebasedLocalOpMetadata: localOpMetadata };
607
617
  },
618
+ applyStashedOp,
608
619
  },
609
620
  ],
610
621
  [
@@ -620,6 +631,7 @@ export function makeOpsMap<T extends ISerializableInterval>(): Map<
620
631
  collection.ackChange(params, local, op, localOpMetadata);
621
632
  },
622
633
  rebase,
634
+ applyStashedOp,
623
635
  },
624
636
  ],
625
637
  ]);
@@ -724,12 +736,6 @@ export interface IIntervalCollectionEvent<TInterval extends ISerializableInterva
724
736
  ): void;
725
737
  }
726
738
 
727
- // solely for type checking in the implementation of add - will be removed once
728
- // deprecated signatures are removed
729
- const isSequencePlace = (place: any): place is SequencePlace => {
730
- return typeof place === "number" || typeof place === "string" || place.pos !== undefined;
731
- };
732
-
733
739
  /**
734
740
  * Collection of intervals that supports addition, modification, removal, and efficient spatial querying.
735
741
  * Changes to this collection will be incur updates on collaborating clients (i.e. they are not local-only).
@@ -762,12 +768,10 @@ export interface IIntervalCollection<TInterval extends ISerializableInterval>
762
768
  getIntervalById(id: string): TInterval | undefined;
763
769
  /**
764
770
  * Creates a new interval and add it to the collection.
765
- * @deprecated call IntervalCollection.add without specifying an intervalType
766
771
  * @param start - interval start position (inclusive)
767
772
  * @param end - interval end position (exclusive)
768
- * @param intervalType - type of the interval. All intervals are SlideOnRemove. Intervals may not be Transient.
769
773
  * @param props - properties of the interval
770
- * @returns The created interval
774
+ * @returns - the created interval
771
775
  * @remarks See documentation on {@link SequenceInterval} for comments on
772
776
  * interval endpoint semantics: there are subtleties with how the current
773
777
  * half-open behavior is represented.
@@ -833,21 +837,6 @@ export interface IIntervalCollection<TInterval extends ISerializableInterval>
833
837
  * the case that the entire interval has been deleted should be resolved at
834
838
  * the same time as this ticket
835
839
  */
836
- add(
837
- start: SequencePlace,
838
- end: SequencePlace,
839
- intervalType: IntervalType,
840
- props?: PropertySet,
841
- ): TInterval;
842
- /**
843
- * Creates a new interval and add it to the collection.
844
- * @param start - interval start position (inclusive)
845
- * @param end - interval end position (exclusive)
846
- * @param props - properties of the interval
847
- * @returns - the created interval
848
- * @remarks - See documentation on {@link SequenceInterval} for comments on interval endpoint semantics: there are subtleties
849
- * with how the current half-open behavior is represented.
850
- */
851
840
  add({
852
841
  start,
853
842
  end,
@@ -863,23 +852,6 @@ export interface IIntervalCollection<TInterval extends ISerializableInterval>
863
852
  * @returns the removed interval
864
853
  */
865
854
  removeIntervalById(id: string): TInterval | undefined;
866
- /**
867
- * Changes the properties on an existing interval.
868
- * @deprecated - call change with the id and and object containing the new properties
869
- * @param id - Id of the interval whose properties should be changed
870
- * @param props - Property set to apply to the interval. Shallow merging is used between any existing properties
871
- * and `prop`, i.e. the interval will end up with a property object equivalent to `{ ...oldProps, ...props }`.
872
- */
873
- changeProperties(id: string, props: PropertySet): void;
874
- /**
875
- * Changes the endpoints of an existing interval.
876
- * @deprecated - call change with the start and end parameters encapsulated in an object
877
- * @param id - Id of the interval to change
878
- * @param start - New start value. To leave the endpoint unchanged, pass the current value.
879
- * @param end - New end value. To leave the endpoint unchanged, pass the current value.
880
- * @returns the interval that was changed, if it existed in the collection.
881
- */
882
- change(id: string, start: SequencePlace, end: SequencePlace): TInterval | undefined;
883
855
  /**
884
856
  * Changes the endpoints, properties, or both of an existing interval.
885
857
  * @param id - Id of the Interval to change
@@ -1257,15 +1229,7 @@ export class IntervalCollection<TInterval extends ISerializableInterval>
1257
1229
 
1258
1230
  /**
1259
1231
  * {@inheritdoc IIntervalCollection.add}
1260
- * @deprecated call IntervalCollection.add without specifying an intervalType
1261
1232
  */
1262
- public add(
1263
- start: SequencePlace,
1264
- end: SequencePlace,
1265
- intervalType: IntervalType,
1266
- props?: PropertySet,
1267
- ): TInterval;
1268
-
1269
1233
  public add({
1270
1234
  start,
1271
1235
  end,
@@ -1274,47 +1238,12 @@ export class IntervalCollection<TInterval extends ISerializableInterval>
1274
1238
  start: SequencePlace;
1275
1239
  end: SequencePlace;
1276
1240
  props?: PropertySet;
1277
- }): TInterval;
1278
-
1279
- public add(
1280
- start:
1281
- | SequencePlace
1282
- | {
1283
- start: SequencePlace;
1284
- end: SequencePlace;
1285
- props?: PropertySet;
1286
- },
1287
- end?: SequencePlace,
1288
- intervalType?: IntervalType,
1289
- props?: PropertySet,
1290
- ): TInterval {
1291
- let intStart: SequencePlace;
1292
- let intEnd: SequencePlace;
1293
- let type: IntervalType;
1294
- let properties: PropertySet | undefined;
1295
-
1296
- if (isSequencePlace(start)) {
1297
- intStart = start;
1298
- assert(end !== undefined, 0x7c0 /* end must be defined */);
1299
- intEnd = end;
1300
- assert(intervalType !== undefined, 0x7c1 /* intervalType must be defined */);
1301
- type = intervalType;
1302
- properties = props;
1303
- } else {
1304
- intStart = start.start;
1305
- intEnd = start.end;
1306
- type = IntervalType.SlideOnRemove;
1307
- properties = start.props;
1308
- }
1309
-
1241
+ }): TInterval {
1310
1242
  if (!this.localCollection) {
1311
1243
  throw new LoggingError("attach must be called prior to adding intervals");
1312
1244
  }
1313
- if (type & IntervalType.Transient) {
1314
- throw new LoggingError("Can not add transient intervals");
1315
- }
1316
1245
 
1317
- const { startSide, endSide, startPos, endPos } = endpointPosAndSide(intStart, intEnd);
1246
+ const { startSide, endSide, startPos, endPos } = endpointPosAndSide(start, end);
1318
1247
 
1319
1248
  assert(
1320
1249
  startPos !== undefined &&
@@ -1326,13 +1255,13 @@ export class IntervalCollection<TInterval extends ISerializableInterval>
1326
1255
 
1327
1256
  const stickiness = computeStickinessFromSide(startPos, startSide, endPos, endSide);
1328
1257
 
1329
- this.assertStickinessEnabled(intStart, intEnd);
1258
+ this.assertStickinessEnabled(start, end);
1330
1259
 
1331
1260
  const interval: TInterval = this.localCollection.addInterval(
1332
1261
  toSequencePlace(startPos, startSide),
1333
1262
  toSequencePlace(endPos, endSide),
1334
- type,
1335
- properties,
1263
+ IntervalType.SlideOnRemove,
1264
+ props,
1336
1265
  );
1337
1266
 
1338
1267
  if (interval) {
@@ -1343,7 +1272,7 @@ export class IntervalCollection<TInterval extends ISerializableInterval>
1343
1272
  const serializedInterval: ISerializedInterval = {
1344
1273
  start: startPos,
1345
1274
  end: endPos,
1346
- intervalType: type,
1275
+ intervalType: IntervalType.SlideOnRemove,
1347
1276
  properties: interval.properties,
1348
1277
  sequenceNumber: this.client?.getCurrentSeq() ?? 0,
1349
1278
  stickiness,
@@ -1401,45 +1330,13 @@ export class IntervalCollection<TInterval extends ISerializableInterval>
1401
1330
  }
1402
1331
  return interval;
1403
1332
  }
1404
-
1405
- /**
1406
- * {@inheritdoc IIntervalCollection.changeProperties}
1407
- * @deprecated - call change with the id and an object containing the new props values
1408
- */
1409
- public changeProperties(id: string, props: PropertySet) {
1410
- this.change(id, { props });
1411
- }
1412
-
1413
- /**
1414
- * {@inheritdoc IIntervalCollection.change}
1415
- * @deprecated - call change with the id and an object containing the new start, end, and/or props values
1416
- */
1417
- public change(id: string, start: SequencePlace, end: SequencePlace): TInterval | undefined;
1418
1333
  /**
1419
1334
  * {@inheritdoc IIntervalCollection.change}
1420
1335
  */
1421
1336
  public change(
1422
1337
  id: string,
1423
1338
  { start, end, props }: { start?: SequencePlace; end?: SequencePlace; props?: PropertySet },
1424
- ): TInterval | undefined;
1425
- public change(
1426
- arg1: string,
1427
- arg2: SequencePlace | { start?: SequencePlace; end?: SequencePlace; props?: PropertySet },
1428
- arg3?: SequencePlace,
1429
1339
  ): TInterval | undefined {
1430
- const id: string = arg1;
1431
- let start: SequencePlace | undefined;
1432
- let end: SequencePlace | undefined;
1433
- let props: PropertySet | undefined;
1434
- if (isSequencePlace(arg2)) {
1435
- start = arg2;
1436
- end = arg3;
1437
- } else {
1438
- start = arg2.start;
1439
- end = arg2.end;
1440
- props = arg2.props;
1441
- }
1442
-
1443
1340
  if (!this.localCollection) {
1444
1341
  throw new LoggingError("Attach must be called before accessing intervals");
1445
1342
  }
@@ -1759,6 +1656,53 @@ export class IntervalCollection<TInterval extends ISerializableInterval>
1759
1656
  return rebased;
1760
1657
  }
1761
1658
 
1659
+ public applyStashedOp(op: IValueTypeOperationValue): IMapMessageLocalMetadata {
1660
+ let interval: TInterval | undefined;
1661
+ let props: PropertySet | undefined;
1662
+ let intervalId: string;
1663
+ switch (op.opName) {
1664
+ case IntervalDeltaOpType.ADD: {
1665
+ assert(op.value.start !== undefined, 0x87a /* start is undefined */);
1666
+ assert(op.value.end !== undefined, 0x87b /* end is undefined */);
1667
+ interval = this.add({
1668
+ start: op.value.start,
1669
+ end: op.value.end,
1670
+ props: op.value.properties,
1671
+ });
1672
+ const metadata = {
1673
+ localSeq: this.getNextLocalSeq(),
1674
+ };
1675
+ if (interval !== undefined) {
1676
+ this.localSeqToSerializedInterval.set(metadata.localSeq, interval.serialize());
1677
+ }
1678
+ return metadata;
1679
+ }
1680
+ case IntervalDeltaOpType.DELETE:
1681
+ this.removeIntervalById(op.value.properties?.intervalId);
1682
+ return {
1683
+ localSeq: this.getNextLocalSeq(),
1684
+ };
1685
+ case IntervalDeltaOpType.CHANGE: {
1686
+ assert(op.value.properties !== undefined, 0x87c /* properties is undefined */);
1687
+ ({ intervalId, ...props } = op.value.properties);
1688
+ interval = this.change(intervalId, {
1689
+ start: op.value.start,
1690
+ end: op.value.end,
1691
+ props,
1692
+ });
1693
+ const metadata = {
1694
+ localSeq: this.getNextLocalSeq(),
1695
+ };
1696
+ if (interval !== undefined) {
1697
+ this.localSeqToSerializedInterval.set(metadata.localSeq, interval.serialize());
1698
+ }
1699
+ return metadata;
1700
+ }
1701
+ default:
1702
+ unreachableCase(op.opName, `Unknown interval op type: ${op.opName}`);
1703
+ }
1704
+ }
1705
+
1762
1706
  private getSlideToSegment(
1763
1707
  lref: LocalReferencePosition,
1764
1708
  ): { segment: ISegment | undefined; offset: number | undefined } | undefined {
@@ -9,6 +9,7 @@ export {
9
9
  ISerializableInterval,
10
10
  IntervalOpType,
11
11
  IntervalType,
12
+ IntervalDeltaOpType,
12
13
  IIntervalHelpers,
13
14
  IntervalStickiness,
14
15
  SerializedIntervalDelta,