@fluidframework/sequence 1.4.0-115997 → 2.0.0-dev-rc.1.0.0.224419

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 (349) hide show
  1. package/.eslintrc.js +9 -11
  2. package/.mocharc.js +12 -0
  3. package/CHANGELOG.md +449 -0
  4. package/README.md +364 -183
  5. package/api-extractor-lint.json +4 -0
  6. package/api-extractor.json +2 -2
  7. package/api-report/sequence.api.md +741 -0
  8. package/dist/{defaultMap.js → defaultMap.cjs} +29 -22
  9. package/dist/defaultMap.cjs.map +1 -0
  10. package/dist/defaultMap.d.ts +7 -6
  11. package/dist/defaultMap.d.ts.map +1 -1
  12. package/dist/defaultMapInterfaces.cjs +7 -0
  13. package/dist/defaultMapInterfaces.cjs.map +1 -0
  14. package/dist/defaultMapInterfaces.d.ts +44 -12
  15. package/dist/defaultMapInterfaces.d.ts.map +1 -1
  16. package/dist/index.cjs +60 -0
  17. package/dist/index.cjs.map +1 -0
  18. package/dist/index.d.ts +14 -12
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/intervalCollection.cjs +1159 -0
  21. package/dist/intervalCollection.cjs.map +1 -0
  22. package/dist/intervalCollection.d.ts +461 -162
  23. package/dist/intervalCollection.d.ts.map +1 -1
  24. package/dist/intervalIndex/endpointInRangeIndex.cjs +66 -0
  25. package/dist/intervalIndex/endpointInRangeIndex.cjs.map +1 -0
  26. package/dist/intervalIndex/endpointInRangeIndex.d.ts +34 -0
  27. package/dist/intervalIndex/endpointInRangeIndex.d.ts.map +1 -0
  28. package/dist/intervalIndex/endpointIndex.cjs +47 -0
  29. package/dist/intervalIndex/endpointIndex.cjs.map +1 -0
  30. package/dist/intervalIndex/endpointIndex.d.ts +38 -0
  31. package/dist/intervalIndex/endpointIndex.d.ts.map +1 -0
  32. package/dist/intervalIndex/idIntervalIndex.cjs +44 -0
  33. package/dist/intervalIndex/idIntervalIndex.cjs.map +1 -0
  34. package/dist/intervalIndex/idIntervalIndex.d.ts +18 -0
  35. package/dist/intervalIndex/idIntervalIndex.d.ts.map +1 -0
  36. package/dist/intervalIndex/index.cjs +24 -0
  37. package/dist/intervalIndex/index.cjs.map +1 -0
  38. package/dist/intervalIndex/index.d.ts +13 -0
  39. package/dist/intervalIndex/index.d.ts.map +1 -0
  40. package/dist/{defaultMapInterfaces.js → intervalIndex/intervalIndex.cjs} +1 -1
  41. package/dist/intervalIndex/intervalIndex.cjs.map +1 -0
  42. package/dist/intervalIndex/intervalIndex.d.ts +30 -0
  43. package/dist/intervalIndex/intervalIndex.d.ts.map +1 -0
  44. package/dist/intervalIndex/intervalIndexUtils.cjs +22 -0
  45. package/dist/intervalIndex/intervalIndexUtils.cjs.map +1 -0
  46. package/dist/intervalIndex/intervalIndexUtils.d.ts +17 -0
  47. package/dist/intervalIndex/intervalIndexUtils.d.ts.map +1 -0
  48. package/dist/intervalIndex/overlappingIntervalsIndex.cjs +116 -0
  49. package/dist/intervalIndex/overlappingIntervalsIndex.cjs.map +1 -0
  50. package/dist/intervalIndex/overlappingIntervalsIndex.d.ts +44 -0
  51. package/dist/intervalIndex/overlappingIntervalsIndex.d.ts.map +1 -0
  52. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.cjs +41 -0
  53. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.cjs.map +1 -0
  54. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.d.ts +11 -0
  55. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.d.ts.map +1 -0
  56. package/dist/intervalIndex/sequenceIntervalIndexes.cjs +7 -0
  57. package/dist/intervalIndex/sequenceIntervalIndexes.cjs.map +1 -0
  58. package/dist/intervalIndex/sequenceIntervalIndexes.d.ts +35 -0
  59. package/dist/intervalIndex/sequenceIntervalIndexes.d.ts.map +1 -0
  60. package/dist/intervalIndex/startpointInRangeIndex.cjs +66 -0
  61. package/dist/intervalIndex/startpointInRangeIndex.cjs.map +1 -0
  62. package/dist/intervalIndex/startpointInRangeIndex.d.ts +34 -0
  63. package/dist/intervalIndex/startpointInRangeIndex.d.ts.map +1 -0
  64. package/dist/intervalTree.cjs +80 -0
  65. package/dist/intervalTree.cjs.map +1 -0
  66. package/dist/intervalTree.d.ts +24 -0
  67. package/dist/intervalTree.d.ts.map +1 -0
  68. package/dist/intervals/index.cjs +23 -0
  69. package/dist/intervals/index.cjs.map +1 -0
  70. package/dist/intervals/index.d.ts +8 -0
  71. package/dist/intervals/index.d.ts.map +1 -0
  72. package/dist/intervals/interval.cjs +181 -0
  73. package/dist/intervals/interval.cjs.map +1 -0
  74. package/dist/intervals/interval.d.ts +84 -0
  75. package/dist/intervals/interval.d.ts.map +1 -0
  76. package/dist/intervals/intervalUtils.cjs +83 -0
  77. package/dist/intervals/intervalUtils.cjs.map +1 -0
  78. package/dist/intervals/intervalUtils.d.ts +230 -0
  79. package/dist/intervals/intervalUtils.d.ts.map +1 -0
  80. package/dist/intervals/sequenceInterval.cjs +378 -0
  81. package/dist/intervals/sequenceInterval.cjs.map +1 -0
  82. package/dist/intervals/sequenceInterval.d.ts +137 -0
  83. package/dist/intervals/sequenceInterval.d.ts.map +1 -0
  84. package/dist/{localValues.js → localValues.cjs} +1 -1
  85. package/dist/localValues.cjs.map +1 -0
  86. package/dist/localValues.d.ts +2 -1
  87. package/dist/localValues.d.ts.map +1 -1
  88. package/dist/{packageVersion.js → packageVersion.cjs} +2 -2
  89. package/dist/packageVersion.cjs.map +1 -0
  90. package/dist/packageVersion.d.ts +1 -1
  91. package/dist/packageVersion.d.ts.map +1 -1
  92. package/dist/revertibles.cjs +425 -0
  93. package/dist/revertibles.cjs.map +1 -0
  94. package/dist/revertibles.d.ts +86 -0
  95. package/dist/revertibles.d.ts.map +1 -0
  96. package/dist/sequence-alpha.d.ts +1315 -0
  97. package/dist/sequence-beta.d.ts +244 -0
  98. package/dist/sequence-public.d.ts +244 -0
  99. package/dist/sequence-untrimmed.d.ts +1803 -0
  100. package/dist/{sequence.js → sequence.cjs} +226 -156
  101. package/dist/sequence.cjs.map +1 -0
  102. package/dist/sequence.d.ts +125 -48
  103. package/dist/sequence.d.ts.map +1 -1
  104. package/dist/{sequenceDeltaEvent.js → sequenceDeltaEvent.cjs} +18 -8
  105. package/dist/sequenceDeltaEvent.cjs.map +1 -0
  106. package/dist/sequenceDeltaEvent.d.ts +24 -7
  107. package/dist/sequenceDeltaEvent.d.ts.map +1 -1
  108. package/dist/sequenceFactory.cjs +55 -0
  109. package/dist/sequenceFactory.cjs.map +1 -0
  110. package/dist/sequenceFactory.d.ts +3 -89
  111. package/dist/sequenceFactory.d.ts.map +1 -1
  112. package/dist/{sharedIntervalCollection.js → sharedIntervalCollection.cjs} +17 -22
  113. package/dist/sharedIntervalCollection.cjs.map +1 -0
  114. package/dist/sharedIntervalCollection.d.ts +12 -12
  115. package/dist/sharedIntervalCollection.d.ts.map +1 -1
  116. package/dist/{sharedSequence.js → sharedSequence.cjs} +29 -22
  117. package/dist/sharedSequence.cjs.map +1 -0
  118. package/dist/sharedSequence.d.ts +14 -2
  119. package/dist/sharedSequence.d.ts.map +1 -1
  120. package/dist/sharedString.cjs +286 -0
  121. package/dist/sharedString.cjs.map +1 -0
  122. package/dist/sharedString.d.ts +58 -22
  123. package/dist/sharedString.d.ts.map +1 -1
  124. package/dist/tsdoc-metadata.json +11 -0
  125. package/lib/{defaultMap.d.ts → defaultMap.d.mts} +7 -6
  126. package/lib/defaultMap.d.mts.map +1 -0
  127. package/lib/{defaultMap.js → defaultMap.mjs} +28 -21
  128. package/lib/defaultMap.mjs.map +1 -0
  129. package/lib/{defaultMapInterfaces.d.ts → defaultMapInterfaces.d.mts} +44 -12
  130. package/lib/defaultMapInterfaces.d.mts.map +1 -0
  131. package/lib/defaultMapInterfaces.mjs +6 -0
  132. package/lib/defaultMapInterfaces.mjs.map +1 -0
  133. package/lib/index.d.mts +17 -0
  134. package/lib/index.d.mts.map +1 -0
  135. package/lib/index.mjs +16 -0
  136. package/lib/index.mjs.map +1 -0
  137. package/lib/intervalCollection.d.mts +569 -0
  138. package/lib/intervalCollection.d.mts.map +1 -0
  139. package/lib/intervalCollection.mjs +1144 -0
  140. package/lib/intervalCollection.mjs.map +1 -0
  141. package/lib/intervalIndex/endpointInRangeIndex.d.mts +34 -0
  142. package/lib/intervalIndex/endpointInRangeIndex.d.mts.map +1 -0
  143. package/lib/intervalIndex/endpointInRangeIndex.mjs +61 -0
  144. package/lib/intervalIndex/endpointInRangeIndex.mjs.map +1 -0
  145. package/lib/intervalIndex/endpointIndex.d.mts +38 -0
  146. package/lib/intervalIndex/endpointIndex.d.mts.map +1 -0
  147. package/lib/intervalIndex/endpointIndex.mjs +42 -0
  148. package/lib/intervalIndex/endpointIndex.mjs.map +1 -0
  149. package/lib/intervalIndex/idIntervalIndex.d.mts +18 -0
  150. package/lib/intervalIndex/idIntervalIndex.d.mts.map +1 -0
  151. package/lib/intervalIndex/idIntervalIndex.mjs +40 -0
  152. package/lib/intervalIndex/idIntervalIndex.mjs.map +1 -0
  153. package/lib/intervalIndex/index.d.mts +13 -0
  154. package/lib/intervalIndex/index.d.mts.map +1 -0
  155. package/lib/intervalIndex/index.mjs +11 -0
  156. package/lib/intervalIndex/index.mjs.map +1 -0
  157. package/lib/intervalIndex/intervalIndex.d.mts +30 -0
  158. package/lib/intervalIndex/intervalIndex.d.mts.map +1 -0
  159. package/lib/{defaultMapInterfaces.js → intervalIndex/intervalIndex.mjs} +1 -1
  160. package/lib/intervalIndex/intervalIndex.mjs.map +1 -0
  161. package/lib/intervalIndex/intervalIndexUtils.d.mts +17 -0
  162. package/lib/intervalIndex/intervalIndexUtils.d.mts.map +1 -0
  163. package/lib/intervalIndex/intervalIndexUtils.mjs +18 -0
  164. package/lib/intervalIndex/intervalIndexUtils.mjs.map +1 -0
  165. package/lib/intervalIndex/overlappingIntervalsIndex.d.mts +44 -0
  166. package/lib/intervalIndex/overlappingIntervalsIndex.d.mts.map +1 -0
  167. package/lib/intervalIndex/overlappingIntervalsIndex.mjs +111 -0
  168. package/lib/intervalIndex/overlappingIntervalsIndex.mjs.map +1 -0
  169. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.d.mts +11 -0
  170. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.d.mts.map +1 -0
  171. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.mjs +37 -0
  172. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.mjs.map +1 -0
  173. package/lib/intervalIndex/sequenceIntervalIndexes.d.mts +35 -0
  174. package/lib/intervalIndex/sequenceIntervalIndexes.d.mts.map +1 -0
  175. package/lib/intervalIndex/sequenceIntervalIndexes.mjs +6 -0
  176. package/lib/intervalIndex/sequenceIntervalIndexes.mjs.map +1 -0
  177. package/lib/intervalIndex/startpointInRangeIndex.d.mts +34 -0
  178. package/lib/intervalIndex/startpointInRangeIndex.d.mts.map +1 -0
  179. package/lib/intervalIndex/startpointInRangeIndex.mjs +61 -0
  180. package/lib/intervalIndex/startpointInRangeIndex.mjs.map +1 -0
  181. package/lib/intervalTree.d.mts +24 -0
  182. package/lib/intervalTree.d.mts.map +1 -0
  183. package/lib/intervalTree.mjs +76 -0
  184. package/lib/intervalTree.mjs.map +1 -0
  185. package/lib/intervals/index.d.mts +8 -0
  186. package/lib/intervals/index.d.mts.map +1 -0
  187. package/lib/intervals/index.mjs +8 -0
  188. package/lib/intervals/index.mjs.map +1 -0
  189. package/lib/intervals/interval.d.mts +84 -0
  190. package/lib/intervals/interval.d.mts.map +1 -0
  191. package/lib/intervals/interval.mjs +176 -0
  192. package/lib/intervals/interval.mjs.map +1 -0
  193. package/lib/intervals/intervalUtils.d.mts +230 -0
  194. package/lib/intervals/intervalUtils.d.mts.map +1 -0
  195. package/lib/intervals/intervalUtils.mjs +77 -0
  196. package/lib/intervals/intervalUtils.mjs.map +1 -0
  197. package/lib/intervals/sequenceInterval.d.mts +137 -0
  198. package/lib/intervals/sequenceInterval.d.mts.map +1 -0
  199. package/lib/intervals/sequenceInterval.mjs +370 -0
  200. package/lib/intervals/sequenceInterval.mjs.map +1 -0
  201. package/lib/{localValues.d.ts → localValues.d.mts} +3 -2
  202. package/lib/localValues.d.mts.map +1 -0
  203. package/lib/{localValues.js → localValues.mjs} +2 -2
  204. package/lib/localValues.mjs.map +1 -0
  205. package/lib/{packageVersion.d.ts → packageVersion.d.mts} +1 -1
  206. package/lib/{packageVersion.d.ts.map → packageVersion.d.mts.map} +1 -1
  207. package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
  208. package/lib/packageVersion.mjs.map +1 -0
  209. package/lib/revertibles.d.mts +86 -0
  210. package/lib/revertibles.d.mts.map +1 -0
  211. package/lib/revertibles.mjs +416 -0
  212. package/lib/revertibles.mjs.map +1 -0
  213. package/lib/sequence-alpha.d.mts +1315 -0
  214. package/lib/sequence-beta.d.mts +244 -0
  215. package/lib/sequence-public.d.mts +244 -0
  216. package/lib/sequence-untrimmed.d.mts +1803 -0
  217. package/lib/{sequence.d.ts → sequence.d.mts} +127 -50
  218. package/lib/sequence.d.mts.map +1 -0
  219. package/lib/{sequence.js → sequence.mjs} +225 -152
  220. package/lib/sequence.mjs.map +1 -0
  221. package/lib/{sequenceDeltaEvent.d.ts → sequenceDeltaEvent.d.mts} +24 -7
  222. package/lib/sequenceDeltaEvent.d.mts.map +1 -0
  223. package/lib/{sequenceDeltaEvent.js → sequenceDeltaEvent.mjs} +20 -8
  224. package/lib/sequenceDeltaEvent.mjs.map +1 -0
  225. package/lib/sequenceFactory.d.mts +22 -0
  226. package/lib/sequenceFactory.d.mts.map +1 -0
  227. package/lib/sequenceFactory.mjs +51 -0
  228. package/lib/sequenceFactory.mjs.map +1 -0
  229. package/lib/{sharedIntervalCollection.d.ts → sharedIntervalCollection.d.mts} +12 -12
  230. package/lib/sharedIntervalCollection.d.mts.map +1 -0
  231. package/lib/{sharedIntervalCollection.js → sharedIntervalCollection.mjs} +16 -21
  232. package/lib/sharedIntervalCollection.mjs.map +1 -0
  233. package/lib/{sharedSequence.d.ts → sharedSequence.d.mts} +15 -3
  234. package/lib/sharedSequence.d.mts.map +1 -0
  235. package/lib/{sharedSequence.js → sharedSequence.mjs} +30 -23
  236. package/lib/sharedSequence.mjs.map +1 -0
  237. package/lib/{sharedString.d.ts → sharedString.d.mts} +60 -24
  238. package/lib/sharedString.d.mts.map +1 -0
  239. package/lib/sharedString.mjs +281 -0
  240. package/lib/sharedString.mjs.map +1 -0
  241. package/package.json +146 -75
  242. package/prettier.config.cjs +8 -0
  243. package/sequence.test-files.tar +0 -0
  244. package/src/defaultMap.ts +417 -403
  245. package/src/defaultMapInterfaces.ts +157 -117
  246. package/src/index.ts +86 -26
  247. package/src/intervalCollection.ts +2043 -1563
  248. package/src/intervalIndex/endpointInRangeIndex.ts +116 -0
  249. package/src/intervalIndex/endpointIndex.ts +91 -0
  250. package/src/intervalIndex/idIntervalIndex.ts +64 -0
  251. package/src/intervalIndex/index.ts +25 -0
  252. package/src/intervalIndex/intervalIndex.ts +32 -0
  253. package/src/intervalIndex/intervalIndexUtils.ts +27 -0
  254. package/src/intervalIndex/overlappingIntervalsIndex.ts +187 -0
  255. package/src/intervalIndex/overlappingSequenceIntervalsIndex.ts +80 -0
  256. package/src/intervalIndex/sequenceIntervalIndexes.ts +34 -0
  257. package/src/intervalIndex/startpointInRangeIndex.ts +114 -0
  258. package/src/intervalTree.ts +98 -0
  259. package/src/intervals/index.ts +25 -0
  260. package/src/intervals/interval.ts +238 -0
  261. package/src/intervals/intervalUtils.ts +288 -0
  262. package/src/intervals/sequenceInterval.ts +616 -0
  263. package/src/localValues.ts +68 -73
  264. package/src/packageVersion.ts +1 -1
  265. package/src/revertibles.ts +693 -0
  266. package/src/sequence.ts +845 -690
  267. package/src/sequenceDeltaEvent.ts +164 -131
  268. package/src/sequenceFactory.ts +58 -214
  269. package/src/sharedIntervalCollection.ts +161 -152
  270. package/src/sharedSequence.ts +181 -167
  271. package/src/sharedString.ts +390 -234
  272. package/tsc-multi.test.json +10 -0
  273. package/tsconfig.json +11 -13
  274. package/.editorconfig +0 -7
  275. package/.vscode/launch.json +0 -15
  276. package/dist/defaultMap.js.map +0 -1
  277. package/dist/defaultMapInterfaces.js.map +0 -1
  278. package/dist/index.js +0 -44
  279. package/dist/index.js.map +0 -1
  280. package/dist/intervalCollection.js +0 -1250
  281. package/dist/intervalCollection.js.map +0 -1
  282. package/dist/localValues.js.map +0 -1
  283. package/dist/packageVersion.js.map +0 -1
  284. package/dist/sequence.js.map +0 -1
  285. package/dist/sequenceDeltaEvent.js.map +0 -1
  286. package/dist/sequenceFactory.js +0 -192
  287. package/dist/sequenceFactory.js.map +0 -1
  288. package/dist/sharedIntervalCollection.js.map +0 -1
  289. package/dist/sharedNumberSequence.d.ts +0 -50
  290. package/dist/sharedNumberSequence.d.ts.map +0 -1
  291. package/dist/sharedNumberSequence.js +0 -61
  292. package/dist/sharedNumberSequence.js.map +0 -1
  293. package/dist/sharedObjectSequence.d.ts +0 -50
  294. package/dist/sharedObjectSequence.d.ts.map +0 -1
  295. package/dist/sharedObjectSequence.js +0 -61
  296. package/dist/sharedObjectSequence.js.map +0 -1
  297. package/dist/sharedSequence.js.map +0 -1
  298. package/dist/sharedString.js +0 -187
  299. package/dist/sharedString.js.map +0 -1
  300. package/dist/sparsematrix.d.ts +0 -139
  301. package/dist/sparsematrix.d.ts.map +0 -1
  302. package/dist/sparsematrix.js +0 -332
  303. package/dist/sparsematrix.js.map +0 -1
  304. package/lib/defaultMap.d.ts.map +0 -1
  305. package/lib/defaultMap.js.map +0 -1
  306. package/lib/defaultMapInterfaces.d.ts.map +0 -1
  307. package/lib/defaultMapInterfaces.js.map +0 -1
  308. package/lib/index.d.ts +0 -27
  309. package/lib/index.d.ts.map +0 -1
  310. package/lib/index.js +0 -26
  311. package/lib/index.js.map +0 -1
  312. package/lib/intervalCollection.d.ts +0 -270
  313. package/lib/intervalCollection.d.ts.map +0 -1
  314. package/lib/intervalCollection.js +0 -1238
  315. package/lib/intervalCollection.js.map +0 -1
  316. package/lib/localValues.d.ts.map +0 -1
  317. package/lib/localValues.js.map +0 -1
  318. package/lib/packageVersion.js.map +0 -1
  319. package/lib/sequence.d.ts.map +0 -1
  320. package/lib/sequence.js.map +0 -1
  321. package/lib/sequenceDeltaEvent.d.ts.map +0 -1
  322. package/lib/sequenceDeltaEvent.js.map +0 -1
  323. package/lib/sequenceFactory.d.ts +0 -108
  324. package/lib/sequenceFactory.d.ts.map +0 -1
  325. package/lib/sequenceFactory.js +0 -186
  326. package/lib/sequenceFactory.js.map +0 -1
  327. package/lib/sharedIntervalCollection.d.ts.map +0 -1
  328. package/lib/sharedIntervalCollection.js.map +0 -1
  329. package/lib/sharedNumberSequence.d.ts +0 -50
  330. package/lib/sharedNumberSequence.d.ts.map +0 -1
  331. package/lib/sharedNumberSequence.js +0 -57
  332. package/lib/sharedNumberSequence.js.map +0 -1
  333. package/lib/sharedObjectSequence.d.ts +0 -50
  334. package/lib/sharedObjectSequence.d.ts.map +0 -1
  335. package/lib/sharedObjectSequence.js +0 -57
  336. package/lib/sharedObjectSequence.js.map +0 -1
  337. package/lib/sharedSequence.d.ts.map +0 -1
  338. package/lib/sharedSequence.js.map +0 -1
  339. package/lib/sharedString.d.ts.map +0 -1
  340. package/lib/sharedString.js +0 -183
  341. package/lib/sharedString.js.map +0 -1
  342. package/lib/sparsematrix.d.ts +0 -139
  343. package/lib/sparsematrix.d.ts.map +0 -1
  344. package/lib/sparsematrix.js +0 -323
  345. package/lib/sparsematrix.js.map +0 -1
  346. package/src/sharedNumberSequence.ts +0 -62
  347. package/src/sharedObjectSequence.ts +0 -62
  348. package/src/sparsematrix.ts +0 -421
  349. package/tsconfig.esnext.json +0 -7
@@ -6,8 +6,9 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.DefaultMap = void 0;
8
8
  const shared_object_base_1 = require("@fluidframework/shared-object-base");
9
- const common_utils_1 = require("@fluidframework/common-utils");
10
- const localValues_1 = require("./localValues");
9
+ const client_utils_1 = require("@fluid-internal/client-utils");
10
+ const core_utils_1 = require("@fluidframework/core-utils");
11
+ const localValues_1 = require("./localValues.cjs");
11
12
  /**
12
13
  * A DefaultMap is a map-like distributed data structure, supporting operations on values stored by
13
14
  * string key locations.
@@ -16,6 +17,12 @@ const localValues_1 = require("./localValues");
16
17
  * a collection that wasn't previously known)
17
18
  */
18
19
  class DefaultMap {
20
+ /**
21
+ * The number of key/value pairs stored in the map.
22
+ */
23
+ get size() {
24
+ return this.data.size;
25
+ }
19
26
  /**
20
27
  * Create a new default map.
21
28
  * @param serializer - The serializer to serialize / parse handles
@@ -24,11 +31,12 @@ class DefaultMap {
24
31
  * @param type - The value type to create at values of this map
25
32
  * @param eventEmitter - The object that will emit map events
26
33
  */
27
- constructor(serializer, handle, submitMessage, type, eventEmitter = new common_utils_1.TypedEventEmitter()) {
34
+ constructor(serializer, handle, submitMessage, type, options, eventEmitter = new client_utils_1.TypedEventEmitter()) {
28
35
  this.serializer = serializer;
29
36
  this.handle = handle;
30
37
  this.submitMessage = submitMessage;
31
38
  this.type = type;
39
+ this.options = options;
32
40
  this.eventEmitter = eventEmitter;
33
41
  /**
34
42
  * Mapping of op types to message handlers.
@@ -40,12 +48,6 @@ class DefaultMap {
40
48
  this.data = new Map();
41
49
  this.messageHandlers = this.getMessageHandlers();
42
50
  }
43
- /**
44
- * The number of key/value pairs stored in the map.
45
- */
46
- get size() {
47
- return this.data.size;
48
- }
49
51
  /**
50
52
  * Get an iterator over the keys in this map.
51
53
  * @returns The iterator
@@ -111,8 +113,7 @@ class DefaultMap {
111
113
  * {@inheritDoc ISharedMap.get}
112
114
  */
113
115
  get(key) {
114
- var _a;
115
- const localValue = (_a = this.data.get(key)) !== null && _a !== void 0 ? _a : this.createCore(key, true);
116
+ const localValue = this.data.get(key) ?? this.createCore(key, true);
116
117
  return localValue.value;
117
118
  }
118
119
  /**
@@ -153,8 +154,8 @@ class DefaultMap {
153
154
  for (const [key, serializable] of Object.entries(json)) {
154
155
  // Back-compat: legacy documents may have handles to an intervalCollection map kernel.
155
156
  // These collections should be empty, and ValueTypes are no longer supported.
156
- if (serializable.type === shared_object_base_1.ValueType[shared_object_base_1.ValueType.Plain]
157
- || serializable.type === shared_object_base_1.ValueType[shared_object_base_1.ValueType.Shared]) {
157
+ if (serializable.type === shared_object_base_1.ValueType[shared_object_base_1.ValueType.Plain] ||
158
+ serializable.type === shared_object_base_1.ValueType[shared_object_base_1.ValueType.Shared]) {
158
159
  continue;
159
160
  }
160
161
  // Back-compat: Sequence previously arbitrarily prefixed all interval collection keys with
@@ -220,7 +221,7 @@ class DefaultMap {
220
221
  * @param local - Whether the message originated from the local client
221
222
  */
222
223
  createCore(key, local) {
223
- const localValue = new localValues_1.ValueTypeLocalValue(this.type.factory.load(this.makeMapValueOpEmitter(key), undefined), this.type);
224
+ const localValue = new localValues_1.ValueTypeLocalValue(this.type.factory.load(this.makeMapValueOpEmitter(key), undefined, this.options), this.type);
224
225
  const previousValue = this.data.get(key);
225
226
  this.data.set(key, localValue);
226
227
  const event = { key, previousValue };
@@ -238,9 +239,10 @@ class DefaultMap {
238
239
  * @returns The local value that was produced
239
240
  */
240
241
  makeLocal(key, serializable) {
241
- (0, common_utils_1.assert)(serializable.type !== shared_object_base_1.ValueType[shared_object_base_1.ValueType.Plain] && serializable.type !== shared_object_base_1.ValueType[shared_object_base_1.ValueType.Shared], 0x2e1 /* "Support for plain value types removed." */);
242
+ (0, core_utils_1.assert)(serializable.type !== shared_object_base_1.ValueType[shared_object_base_1.ValueType.Plain] &&
243
+ serializable.type !== shared_object_base_1.ValueType[shared_object_base_1.ValueType.Shared], 0x2e1 /* "Support for plain value types removed." */);
242
244
  serializable.value = (0, shared_object_base_1.parseHandles)(serializable.value, this.serializer);
243
- const localValue = this.type.factory.load(this.makeMapValueOpEmitter(key), serializable.value);
245
+ const localValue = this.type.factory.load(this.makeMapValueOpEmitter(key), serializable.value, this.options);
244
246
  return new localValues_1.ValueTypeLocalValue(localValue, this.type);
245
247
  }
246
248
  /**
@@ -255,8 +257,7 @@ class DefaultMap {
255
257
  // watching for manipulations of that item.
256
258
  messageHandlers.set("act", {
257
259
  process: (op, local, message, localOpMetadata) => {
258
- var _a;
259
- const localValue = (_a = this.data.get(op.key)) !== null && _a !== void 0 ? _a : this.createCore(op.key, local);
260
+ const localValue = this.data.get(op.key) ?? this.createCore(op.key, local);
260
261
  const handler = localValue.getOpHandler(op.value.opName);
261
262
  const previousValue = localValue.value;
262
263
  const translatedValue = (0, shared_object_base_1.parseHandles)(op.value.value, this.serializer);
@@ -269,12 +270,16 @@ class DefaultMap {
269
270
  },
270
271
  resubmit: (op, localOpMetadata) => {
271
272
  const localValue = this.data.get(op.key);
273
+ (0, core_utils_1.assert)(localValue !== undefined, 0x3f8 /* Local value expected on resubmission */);
272
274
  const handler = localValue.getOpHandler(op.value.opName);
273
- const { rebasedOp, rebasedLocalOpMetadata, } = handler.rebase(localValue.value, op.value, localOpMetadata);
274
- this.submitMessage(Object.assign(Object.assign({}, op), { value: rebasedOp }), rebasedLocalOpMetadata);
275
+ const rebased = handler.rebase(localValue.value, op.value, localOpMetadata);
276
+ if (rebased !== undefined) {
277
+ const { rebasedOp, rebasedLocalOpMetadata } = rebased;
278
+ this.submitMessage({ ...op, value: rebasedOp }, rebasedLocalOpMetadata);
279
+ }
275
280
  },
276
281
  getStashedOpLocalMetadata: (op) => {
277
- (0, common_utils_1.assert)(false, 0x016 /* "apply stashed op not implemented for custom value type ops" */);
282
+ (0, core_utils_1.assert)(false, 0x016 /* "apply stashed op not implemented for custom value type ops" */);
278
283
  },
279
284
  });
280
285
  return messageHandlers;
@@ -285,7 +290,9 @@ class DefaultMap {
285
290
  * @param key - The key of the map that the value type will be stored on
286
291
  * @returns A value op emitter for the given key
287
292
  */
293
+ // eslint-disable-next-line import/no-deprecated
288
294
  makeMapValueOpEmitter(key) {
295
+ // eslint-disable-next-line import/no-deprecated
289
296
  const emit = (opName, previousValue, params, localOpMetadata) => {
290
297
  const translatedParams = (0, shared_object_base_1.makeHandlesSerializable)(params, this.serializer, this.handle);
291
298
  const op = {
@@ -304,4 +311,4 @@ class DefaultMap {
304
311
  }
305
312
  }
306
313
  exports.DefaultMap = DefaultMap;
307
- //# sourceMappingURL=defaultMap.js.map
314
+ //# sourceMappingURL=defaultMap.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultMap.cjs","sourceRoot":"","sources":["../src/defaultMap.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,2EAK4C;AAC5C,+DAAiE;AACjE,2DAAoD;AACpD,mDAAsE;AAmFtE;;;;;;GAMG;AACH,MAAa,UAAU;IACtB;;OAEG;IACH,IAAW,IAAI;QACd,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IACvB,CAAC;IAYD;;;;;;;OAOG;IACH,YACkB,UAA4B,EAC5B,MAAoB,EACpB,aAGR,EACQ,IAAmB,EACnB,OAAkC,EACnC,eAAe,IAAI,gCAAiB,EAA2B;QAR9D,eAAU,GAAV,UAAU,CAAkB;QAC5B,WAAM,GAAN,MAAM,CAAc;QACpB,kBAAa,GAAb,aAAa,CAGrB;QACQ,SAAI,GAAJ,IAAI,CAAe;QACnB,YAAO,GAAP,OAAO,CAA2B;QACnC,iBAAY,GAAZ,YAAY,CAAmD;QA3BhF;;WAEG;QACc,oBAAe,GAA4C,IAAI,GAAG,EAAE,CAAC;QAEtF;;WAEG;QACc,SAAI,GAAG,IAAI,GAAG,EAAkC,CAAC;QAqBjE,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAClD,CAAC;IAED;;;OAGG;IACI,IAAI;QACV,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,OAAO;QACb,MAAM,oBAAoB,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACjD,MAAM,QAAQ,GAAG;YAChB,IAAI;gBACH,MAAM,OAAO,GAAG,oBAAoB,CAAC,IAAI,EAAE,CAA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,CAAC,EAA0B,EAAE,EAAE;gBACzD,IAAA,mBAAM,EACL,KAAK,EACL,KAAK,CAAC,kEAAkE,CACxE,CAAC;YACH,CAAC;SACD,CAAC,CAAC;QAEH,OAAO,eAAe,CAAC;IACxB,CAAC;IAED;;;;;OAKG;IACH,gDAAgD;IACxC,qBAAqB,CAAC,GAAW;QACxC,gDAAgD;QAChD,MAAM,IAAI,GAA4B,CACrC,MAAsB,EACtB,aAAsB,EACtB,MAA+B,EAC/B,eAAyC,EAClC,EAAE;YACT,MAAM,gBAAgB,GAAG,IAAA,4CAAuB,EAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAEvF,MAAM,EAAE,GAA2B;gBAClC,GAAG;gBACH,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE;oBACN,MAAM;oBACN,KAAK,EAAE,gBAAgB;iBACvB;aACD,CAAC;YAEF,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC;YAExC,MAAM,KAAK,GAAkB,EAAE,GAAG,EAAE,aAAa,EAAE,CAAC;YACpD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC9E,CAAC,CAAC;QAEF,OAAO,EAAE,IAAI,EAAE,CAAC;IACjB,CAAC;CACD;AAvWD,gCAuWC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIFluidSerializer,\n\tmakeHandlesSerializable,\n\tparseHandles,\n\tValueType,\n} from \"@fluidframework/shared-object-base\";\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { makeSerializable, ValueTypeLocalValue } from \"./localValues\";\nimport {\n\tISerializableValue,\n\tISerializedValue,\n\tIValueChanged,\n\t// eslint-disable-next-line import/no-deprecated\n\tIValueOpEmitter,\n\tIValueType,\n\tIValueTypeOperationValue,\n\tISharedDefaultMapEvents,\n\tIMapMessageLocalMetadata,\n\tSequenceOptions,\n} from \"./defaultMapInterfaces\";\nimport { IntervalOpType, SerializedIntervalDelta } from \"./intervals\";\n\n/**\n * Defines the means to process and submit a given op on a map.\n */\ninterface IMapMessageHandler {\n\t/**\n\t * Apply the given operation.\n\t * @param op - The map operation to apply\n\t * @param local - Whether the message originated from the local client\n\t * @param message - The full message. Not provided for stashed ops.\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t */\n\tprocess(\n\t\top: IMapOperation,\n\t\tlocal: boolean,\n\t\tmessage: ISequencedDocumentMessage | undefined,\n\t\tlocalOpMetadata: IMapMessageLocalMetadata,\n\t): void;\n\n\t/**\n\t * Communicate the operation to remote clients.\n\t * @param op - The map operation to submit\n\t */\n\tsubmit(op: IMapOperation, localOpMetadata: IMapMessageLocalMetadata): void;\n\n\tresubmit(op: IMapOperation, localOpMetadata: IMapMessageLocalMetadata): void;\n\n\tgetStashedOpLocalMetadata(op: IMapOperation): unknown;\n}\n\n/**\n * Describes an operation specific to a value type.\n */\nexport interface IMapValueTypeOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"act\";\n\n\t/**\n\t * Map key being modified.\n\t */\n\tkey: string;\n\n\t/**\n\t * Value of the operation, specific to the value type.\n\t * @alpha\n\t */\n\tvalue: IValueTypeOperationValue;\n}\n\n/**\n * Description of a map delta operation\n */\nexport type IMapOperation = IMapValueTypeOperation;\n\n/**\n * Defines the in-memory object structure to be used for the conversion to/from serialized.\n * Directly used in JSON.stringify, direct result from JSON.parse\n */\nexport interface IMapDataObjectSerializable {\n\t[key: string]: ISerializableValue;\n}\n\nexport interface IMapDataObjectSerialized {\n\t[key: string]: ISerializedValue;\n}\n\n/**\n * A DefaultMap is a map-like distributed data structure, supporting operations on values stored by\n * string key locations.\n *\n * Creation of values is implicit on access (either via `get` or a remote op application referring to\n * a collection that wasn't previously known)\n */\nexport class DefaultMap<T> {\n\t/**\n\t * The number of key/value pairs stored in the map.\n\t */\n\tpublic get size(): number {\n\t\treturn this.data.size;\n\t}\n\n\t/**\n\t * Mapping of op types to message handlers.\n\t */\n\tprivate readonly messageHandlers: ReadonlyMap<string, IMapMessageHandler> = new Map();\n\n\t/**\n\t * The in-memory data the map is storing.\n\t */\n\tprivate readonly data = new Map<string, ValueTypeLocalValue<T>>();\n\n\t/**\n\t * Create a new default map.\n\t * @param serializer - The serializer to serialize / parse handles\n\t * @param handle - The handle of the shared object using the kernel\n\t * @param submitMessage - A callback to submit a message through the shared object\n\t * @param type - The value type to create at values of this map\n\t * @param eventEmitter - The object that will emit map events\n\t */\n\tconstructor(\n\t\tprivate readonly serializer: IFluidSerializer,\n\t\tprivate readonly handle: IFluidHandle,\n\t\tprivate readonly submitMessage: (\n\t\t\top: IMapValueTypeOperation,\n\t\t\tlocalOpMetadata: IMapMessageLocalMetadata,\n\t\t) => void,\n\t\tprivate readonly type: IValueType<T>,\n\t\tprivate readonly options?: Partial<SequenceOptions>,\n\t\tpublic readonly eventEmitter = new TypedEventEmitter<ISharedDefaultMapEvents>(),\n\t) {\n\t\tthis.messageHandlers = this.getMessageHandlers();\n\t}\n\n\t/**\n\t * Get an iterator over the keys in this map.\n\t * @returns The iterator\n\t */\n\tpublic keys(): IterableIterator<string> {\n\t\treturn this.data.keys();\n\t}\n\n\t/**\n\t * Get an iterator over the entries in this map.\n\t * @returns The iterator\n\t */\n\tpublic entries(): IterableIterator<[string, any]> {\n\t\tconst localEntriesIterator = this.data.entries();\n\t\tconst iterator = {\n\t\t\tnext(): IteratorResult<[string, any]> {\n\t\t\t\tconst nextVal = localEntriesIterator.next();\n\t\t\t\treturn nextVal.done\n\t\t\t\t\t? { value: undefined, done: true }\n\t\t\t\t\t: { value: [nextVal.value[0], nextVal.value[1].value], done: false }; // Unpack the stored value\n\t\t\t},\n\t\t\t[Symbol.iterator]() {\n\t\t\t\treturn this;\n\t\t\t},\n\t\t};\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * Get an iterator over the values in this map.\n\t * @returns The iterator\n\t */\n\tpublic values(): IterableIterator<any> {\n\t\tconst localValuesIterator = this.data.values();\n\t\tconst iterator = {\n\t\t\tnext(): IteratorResult<any> {\n\t\t\t\tconst nextVal = localValuesIterator.next();\n\t\t\t\treturn nextVal.done\n\t\t\t\t\t? { value: undefined, done: true }\n\t\t\t\t\t: { value: nextVal.value.value, done: false }; // Unpack the stored value\n\t\t\t},\n\t\t\t[Symbol.iterator]() {\n\t\t\t\treturn this;\n\t\t\t},\n\t\t};\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * Get an iterator over the entries in this map.\n\t * @returns The iterator\n\t */\n\tpublic [Symbol.iterator](): IterableIterator<[string, any]> {\n\t\treturn this.entries();\n\t}\n\n\t/**\n\t * Executes the given callback on each entry in the map.\n\t * @param callbackFn - Callback function\n\t */\n\tpublic forEach(callbackFn: (value: any, key: string, map: Map<string, any>) => void): void {\n\t\tthis.data.forEach((localValue, key, m) => {\n\t\t\tcallbackFn(localValue.value, key, m);\n\t\t});\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedMap.get}\n\t */\n\tpublic get(key: string): T {\n\t\tconst localValue = this.data.get(key) ?? this.createCore(key, true);\n\n\t\treturn localValue.value;\n\t}\n\n\t/**\n\t * Check if a key exists in the map.\n\t * @param key - The key to check\n\t * @returns True if the key exists, false otherwise\n\t */\n\tpublic has(key: string): boolean {\n\t\treturn this.data.has(key);\n\t}\n\n\t/**\n\t * Serializes the data stored in the shared map to a JSON string\n\t * @param serializer - The serializer to use to serialize handles in its values.\n\t * @returns A JSON string containing serialized map data\n\t */\n\tpublic getSerializedStorage(serializer: IFluidSerializer): IMapDataObjectSerialized {\n\t\tconst serializableMapData: IMapDataObjectSerialized = {};\n\t\tthis.data.forEach((localValue, key) => {\n\t\t\tserializableMapData[key] = localValue.makeSerialized(serializer, this.handle);\n\t\t});\n\t\treturn serializableMapData;\n\t}\n\n\tpublic getSerializableStorage(serializer: IFluidSerializer): IMapDataObjectSerializable {\n\t\tconst serializableMapData: IMapDataObjectSerializable = {};\n\t\tthis.data.forEach((localValue, key) => {\n\t\t\tserializableMapData[key] = makeSerializable(localValue, serializer, this.handle);\n\t\t});\n\t\treturn serializableMapData;\n\t}\n\n\tpublic serialize(serializer: IFluidSerializer): string {\n\t\treturn JSON.stringify(this.getSerializableStorage(serializer));\n\t}\n\n\t/**\n\t * Populate the kernel with the given map data.\n\t * @param data - A JSON string containing serialized map data\n\t */\n\tpublic populateFromSerializable(json: IMapDataObjectSerializable): void {\n\t\tfor (const [key, serializable] of Object.entries(json)) {\n\t\t\t// Back-compat: legacy documents may have handles to an intervalCollection map kernel.\n\t\t\t// These collections should be empty, and ValueTypes are no longer supported.\n\t\t\tif (\n\t\t\t\tserializable.type === ValueType[ValueType.Plain] ||\n\t\t\t\tserializable.type === ValueType[ValueType.Shared]\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Back-compat: Sequence previously arbitrarily prefixed all interval collection keys with\n\t\t\t// \"intervalCollections/\". This would burden users trying to iterate the collection and\n\t\t\t// access its value, as well as those trying to match a create message to its underlying\n\t\t\t// collection. See https://github.com/microsoft/FluidFramework/issues/10557 for more context.\n\t\t\tconst normalizedKey = key.startsWith(\"intervalCollections/\") ? key.substring(20) : key;\n\n\t\t\tconst localValue = {\n\t\t\t\tkey: normalizedKey,\n\t\t\t\tvalue: this.makeLocal(key, serializable),\n\t\t\t};\n\n\t\t\tthis.data.set(localValue.key, localValue.value);\n\t\t}\n\t}\n\n\tpublic populate(json: string): void {\n\t\tthis.populateFromSerializable(JSON.parse(json) as IMapDataObjectSerializable);\n\t}\n\n\t/**\n\t * Submit the given op if a handler is registered.\n\t * @param op - The operation to attempt to submit\n\t * @param localOpMetadata - The local metadata associated with the op. This is kept locally by the runtime\n\t * and not sent to the server. This will be sent back when this message is received back from the server. This is\n\t * also sent if we are asked to resubmit the message.\n\t * @returns True if the operation was submitted, false otherwise.\n\t */\n\tpublic tryResubmitMessage(\n\t\top: IMapOperation,\n\t\tlocalOpMetadata: IMapMessageLocalMetadata,\n\t): boolean {\n\t\tconst type: string = op.type;\n\t\tconst handler = this.messageHandlers.get(type);\n\t\tif (handler !== undefined) {\n\t\t\thandler.resubmit(op, localOpMetadata);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic tryGetStashedOpLocalMetadata(op: IMapOperation): unknown {\n\t\tconst type: string = op.type;\n\t\tif (this.messageHandlers.has(type)) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\treturn this.messageHandlers.get(type)!.getStashedOpLocalMetadata(op);\n\t\t}\n\t\tthrow new Error(\"no apply stashed op handler\");\n\t}\n\n\t/**\n\t * Process the given op if a handler is registered.\n\t * @param message - The message to process\n\t * @param local - Whether the message originated from the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t * @returns True if the operation was processed, false otherwise.\n\t */\n\tpublic tryProcessMessage(\n\t\top: IMapOperation,\n\t\tlocal: boolean,\n\t\tmessage: ISequencedDocumentMessage | undefined,\n\t\tlocalOpMetadata: unknown,\n\t): boolean {\n\t\tconst handler = this.messageHandlers.get(op.type);\n\t\tif (handler !== undefined) {\n\t\t\thandler.process(op, local, message, localOpMetadata as IMapMessageLocalMetadata);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Initializes a default ValueType at the provided key.\n\t * Should be used when a map operation incurs creation.\n\t * @param key - The key being initialized\n\t * @param local - Whether the message originated from the local client\n\t */\n\tprivate createCore(key: string, local: boolean): ValueTypeLocalValue<T> {\n\t\tconst localValue = new ValueTypeLocalValue(\n\t\t\tthis.type.factory.load(this.makeMapValueOpEmitter(key), undefined, this.options),\n\t\t\tthis.type,\n\t\t);\n\t\tconst previousValue = this.data.get(key);\n\t\tthis.data.set(key, localValue);\n\t\tconst event: IValueChanged = { key, previousValue };\n\t\tthis.eventEmitter.emit(\"create\", event, local, this.eventEmitter);\n\t\treturn localValue;\n\t}\n\n\t/**\n\t * The remote ISerializableValue we're receiving (either as a result of a load or an incoming set op) will\n\t * have the information we need to create a real object, but will not be the real object yet. For example,\n\t * we might know it's a map and the map's ID but not have the actual map or its data yet. makeLocal's\n\t * job is to convert that information into a real object for local usage.\n\t * @param key - The key that the caller intends to store the local value into (used for ops later). But\n\t * doesn't actually store the local value into that key. So better not lie!\n\t * @param serializable - The remote information that we can convert into a real object\n\t * @returns The local value that was produced\n\t */\n\tprivate makeLocal(key: string, serializable: ISerializableValue): ValueTypeLocalValue<T> {\n\t\tassert(\n\t\t\tserializable.type !== ValueType[ValueType.Plain] &&\n\t\t\t\tserializable.type !== ValueType[ValueType.Shared],\n\t\t\t0x2e1 /* \"Support for plain value types removed.\" */,\n\t\t);\n\n\t\tserializable.value = parseHandles(serializable.value, this.serializer);\n\t\tconst localValue = this.type.factory.load(\n\t\t\tthis.makeMapValueOpEmitter(key),\n\t\t\tserializable.value,\n\t\t\tthis.options,\n\t\t);\n\t\treturn new ValueTypeLocalValue(localValue, this.type);\n\t}\n\n\t/**\n\t * Get the message handlers for the map.\n\t * @returns A map of string op names to IMapMessageHandlers for those ops\n\t */\n\tprivate getMessageHandlers() {\n\t\tconst messageHandlers = new Map<string, IMapMessageHandler>();\n\t\t// Ops with type \"act\" describe actions taken by custom value type handlers of whatever item is\n\t\t// being addressed. These custom handlers can be retrieved from the ValueTypeLocalValue which has\n\t\t// stashed its valueType (and therefore its handlers). We also emit a valueChanged for anyone\n\t\t// watching for manipulations of that item.\n\t\tmessageHandlers.set(\"act\", {\n\t\t\tprocess: (op: IMapValueTypeOperation, local, message, localOpMetadata) => {\n\t\t\t\tconst localValue = this.data.get(op.key) ?? this.createCore(op.key, local);\n\t\t\t\tconst handler = localValue.getOpHandler(op.value.opName);\n\t\t\t\tconst previousValue = localValue.value;\n\t\t\t\tconst translatedValue = parseHandles(op.value.value, this.serializer);\n\t\t\t\thandler.process(previousValue, translatedValue, local, message, localOpMetadata);\n\t\t\t\tconst event: IValueChanged = { key: op.key, previousValue };\n\t\t\t\tthis.eventEmitter.emit(\"valueChanged\", event, local, message, this.eventEmitter);\n\t\t\t},\n\t\t\tsubmit: (op: IMapValueTypeOperation, localOpMetadata: IMapMessageLocalMetadata) => {\n\t\t\t\tthis.submitMessage(op, localOpMetadata);\n\t\t\t},\n\t\t\tresubmit: (op: IMapValueTypeOperation, localOpMetadata: IMapMessageLocalMetadata) => {\n\t\t\t\tconst localValue = this.data.get(op.key);\n\n\t\t\t\tassert(localValue !== undefined, 0x3f8 /* Local value expected on resubmission */);\n\n\t\t\t\tconst handler = localValue.getOpHandler(op.value.opName);\n\t\t\t\tconst rebased = handler.rebase(localValue.value, op.value, localOpMetadata);\n\t\t\t\tif (rebased !== undefined) {\n\t\t\t\t\tconst { rebasedOp, rebasedLocalOpMetadata } = rebased;\n\t\t\t\t\tthis.submitMessage({ ...op, value: rebasedOp }, rebasedLocalOpMetadata);\n\t\t\t\t}\n\t\t\t},\n\t\t\tgetStashedOpLocalMetadata: (op: IMapValueTypeOperation) => {\n\t\t\t\tassert(\n\t\t\t\t\tfalse,\n\t\t\t\t\t0x016 /* \"apply stashed op not implemented for custom value type ops\" */,\n\t\t\t\t);\n\t\t\t},\n\t\t});\n\n\t\treturn messageHandlers;\n\t}\n\n\t/**\n\t * Create an emitter for a value type to emit ops from the given key.\n\t * @alpha\n\t * @param key - The key of the map that the value type will be stored on\n\t * @returns A value op emitter for the given key\n\t */\n\t// eslint-disable-next-line import/no-deprecated\n\tprivate makeMapValueOpEmitter(key: string): IValueOpEmitter {\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tconst emit: IValueOpEmitter[\"emit\"] = (\n\t\t\topName: IntervalOpType,\n\t\t\tpreviousValue: unknown,\n\t\t\tparams: SerializedIntervalDelta,\n\t\t\tlocalOpMetadata: IMapMessageLocalMetadata,\n\t\t): void => {\n\t\t\tconst translatedParams = makeHandlesSerializable(params, this.serializer, this.handle);\n\n\t\t\tconst op: IMapValueTypeOperation = {\n\t\t\t\tkey,\n\t\t\t\ttype: \"act\",\n\t\t\t\tvalue: {\n\t\t\t\t\topName,\n\t\t\t\t\tvalue: translatedParams,\n\t\t\t\t},\n\t\t\t};\n\n\t\t\tthis.submitMessage(op, localOpMetadata);\n\n\t\t\tconst event: IValueChanged = { key, previousValue };\n\t\t\tthis.eventEmitter.emit(\"valueChanged\", event, true, null, this.eventEmitter);\n\t\t};\n\n\t\treturn { emit };\n\t}\n}\n"]}
@@ -5,8 +5,8 @@
5
5
  import { IFluidHandle } from "@fluidframework/core-interfaces";
6
6
  import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
7
7
  import { IFluidSerializer } from "@fluidframework/shared-object-base";
8
- import { TypedEventEmitter } from "@fluidframework/common-utils";
9
- import { ISerializableValue, ISerializedValue, IValueType, IValueTypeOperationValue, ISharedDefaultMapEvents, IMapMessageLocalMetadata } from "./defaultMapInterfaces";
8
+ import { TypedEventEmitter } from "@fluid-internal/client-utils";
9
+ import { ISerializableValue, ISerializedValue, IValueType, IValueTypeOperationValue, ISharedDefaultMapEvents, IMapMessageLocalMetadata, SequenceOptions } from "./defaultMapInterfaces";
10
10
  /**
11
11
  * Describes an operation specific to a value type.
12
12
  */
@@ -28,7 +28,7 @@ export interface IMapValueTypeOperation {
28
28
  /**
29
29
  * Description of a map delta operation
30
30
  */
31
- export declare type IMapOperation = IMapValueTypeOperation;
31
+ export type IMapOperation = IMapValueTypeOperation;
32
32
  /**
33
33
  * Defines the in-memory object structure to be used for the conversion to/from serialized.
34
34
  * Directly used in JSON.stringify, direct result from JSON.parse
@@ -51,6 +51,7 @@ export declare class DefaultMap<T> {
51
51
  private readonly handle;
52
52
  private readonly submitMessage;
53
53
  private readonly type;
54
+ private readonly options?;
54
55
  readonly eventEmitter: TypedEventEmitter<ISharedDefaultMapEvents>;
55
56
  /**
56
57
  * The number of key/value pairs stored in the map.
@@ -72,7 +73,7 @@ export declare class DefaultMap<T> {
72
73
  * @param type - The value type to create at values of this map
73
74
  * @param eventEmitter - The object that will emit map events
74
75
  */
75
- constructor(serializer: IFluidSerializer, handle: IFluidHandle, submitMessage: (op: any, localOpMetadata: IMapMessageLocalMetadata) => void, type: IValueType<T>, eventEmitter?: TypedEventEmitter<ISharedDefaultMapEvents>);
76
+ constructor(serializer: IFluidSerializer, handle: IFluidHandle, submitMessage: (op: IMapValueTypeOperation, localOpMetadata: IMapMessageLocalMetadata) => void, type: IValueType<T>, options?: Partial<SequenceOptions> | undefined, eventEmitter?: TypedEventEmitter<ISharedDefaultMapEvents>);
76
77
  /**
77
78
  * Get an iterator over the keys in this map.
78
79
  * @returns The iterator
@@ -130,8 +131,8 @@ export declare class DefaultMap<T> {
130
131
  * also sent if we are asked to resubmit the message.
131
132
  * @returns True if the operation was submitted, false otherwise.
132
133
  */
133
- tryResubmitMessage(op: any, localOpMetadata: IMapMessageLocalMetadata): boolean;
134
- tryGetStashedOpLocalMetadata(op: any): unknown;
134
+ tryResubmitMessage(op: IMapOperation, localOpMetadata: IMapMessageLocalMetadata): boolean;
135
+ tryGetStashedOpLocalMetadata(op: IMapOperation): unknown;
135
136
  /**
136
137
  * Process the given op if a handler is registered.
137
138
  * @param message - The message to process
@@ -1 +1 @@
1
- {"version":3,"file":"defaultMap.d.ts","sourceRoot":"","sources":["../src/defaultMap.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EACH,gBAAgB,EAInB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAU,iBA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AAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAInC;;;;;;;OAOG;IACI,kBAAkB,CACxB,EAAE,EAAE,aAAa,EACjB,eAAe,EAAE,wBAAwB,GACvC,OAAO;IAUH,4BAA4B,CAAC,EAAE,EAAE,aAAa,GAAG,OAAO;IAS/D;;;;;;;OAOG;IACI,iBAAiB,CACvB,EAAE,EAAE,aAAa,EACjB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,yBAAyB,GAAG,SAAS,EAC9C,eAAe,EAAE,OAAO,GACtB,OAAO;IASV;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAYlB;;;;;;;;;OASG;IACH,OAAO,CAAC,SAAS;IAgBjB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IA0C1B;;;;;OAKG;IAEH,OAAO,CAAC,qBAAqB;CA2B7B"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=defaultMapInterfaces.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultMapInterfaces.cjs","sourceRoot":"","sources":["../src/defaultMapInterfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport { ISharedObjectEvents } from \"@fluidframework/shared-object-base\";\nimport { IEventThisPlaceHolder } from \"@fluidframework/core-interfaces\";\nimport { ISerializedInterval, IntervalOpType, SerializedIntervalDelta } from \"./intervals\";\n\n/**\n * Type of \"valueChanged\" event parameter.\n */\nexport interface IValueChanged {\n\t/**\n\t * The key storing the value that changed.\n\t */\n\tkey: string;\n\n\t/**\n\t * The value that was stored at the key prior to the change.\n\t */\n\tpreviousValue: any;\n}\n\n/**\n * Value types are given an IValueOpEmitter to emit their ops through the container type that holds them.\n * @internal\n * @deprecated - will be remove from public api as there is no public used of this type\n */\nexport interface IValueOpEmitter {\n\t/**\n\t * Called by the value type to emit a value type operation through the container type holding it.\n\t * @param opName - Name of the emitted operation\n\t * @param previousValue - JSONable previous value as defined by the value type @deprecated unused\n\t * @param params - JSONable params for the operation as defined by the value type\n\t * @param localOpMetadata - JSONable local metadata which should be submitted with the op\n\t */\n\temit(\n\t\topName: IntervalOpType,\n\t\tpreviousValue: undefined,\n\t\tparams: SerializedIntervalDelta,\n\t\tlocalOpMetadata: IMapMessageLocalMetadata,\n\t): void;\n}\n\n/**\n * @internal\n */\nexport interface IMapMessageLocalMetadata {\n\tlocalSeq: number;\n}\n\n/**\n * Optional flags that configure options for sequence DDSs\n * @internal\n */\nexport interface SequenceOptions {\n\t/**\n\t * Enable the ability to use interval APIs that rely on positions before and\n\t * after individual characters, referred to as \"sides\". See {@link SequencePlace}\n\t * for additional context.\n\t *\n\t * This flag must be enabled to pass instances of {@link SequencePlace} to\n\t * any IIntervalCollection API.\n\t *\n\t * Also see the feature flag `mergeTreeReferencesCanSlideToEndpoint` to allow\n\t * endpoints to slide to the special endpoint segments.\n\t *\n\t * The default value is false.\n\t */\n\tintervalStickinessEnabled: boolean;\n\t/**\n\t * Enable the ability for interval endpoints to slide to the special endpoint\n\t * segments that exist before and after the bounds of the string. This is\n\t * primarily useful for workflows involving interval stickiness, and it is\n\t * suggested to enable both this flag and `intervalStickinessEnabled` at the\n\t * same time.\n\t *\n\t * The default value is false.\n\t */\n\tmergeTreeReferencesCanSlideToEndpoint: boolean;\n\t[key: string]: boolean;\n}\n\n/**\n * A value factory is used to serialize/deserialize value types to a map\n * @alpha\n */\nexport interface IValueFactory<T> {\n\t/**\n\t * Create a new value type. Used both in creation of new value types, as well as in loading existing ones\n\t * from remote.\n\t * @param emitter - Emitter object that the created value type will use to emit operations\n\t * @param raw - Initialization parameters as defined by the value type\n\t * @returns The new value type\n\t * @alpha\n\t */\n\tload(emitter: IValueOpEmitter, raw: any, options?: Partial<SequenceOptions>): T;\n\n\t/**\n\t * Given a value type, provides a JSONable form of its data to be used for snapshotting. This data must be\n\t * loadable using the load method of its factory.\n\t * @param value - The value type to serialize\n\t * @returns The JSONable form of the value type\n\t * @alpha\n\t */\n\tstore(value: T): any;\n}\n\n/**\n * Defines an operation that a value type is able to handle.\n * @alpha\n */\nexport interface IValueOperation<T> {\n\t/**\n\t * Performs the actual processing on the incoming operation.\n\t * @param value - The current value stored at the given key, which should be the value type\n\t * @param params - The params on the incoming operation\n\t * @param local - Whether the operation originated from this client\n\t * @param message - The operation itself\n\t * @param localOpMetadata - any local metadata submitted by `IValueOpEmitter.emit`.\n\t * @alpha\n\t */\n\tprocess(\n\t\tvalue: T,\n\t\tparams: ISerializedInterval,\n\t\tlocal: boolean,\n\t\tmessage: ISequencedDocumentMessage | undefined,\n\t\tlocalOpMetadata: IMapMessageLocalMetadata | undefined,\n\t): void;\n\n\t/**\n\t * Rebases an `op` on `value` from its original perspective (ref/local seq) to the current\n\t * perspective. Should be invoked on reconnection.\n\t * @param value - The current value stored at the given key, which should be the value type.\n\t * @param op - The op to be rebased.\n\t * @param localOpMetadata - Any local metadata that was originally submitted with the op.\n\t * @returns A rebased version of the op and any local metadata that should be submitted with it.\n\t */\n\trebase(\n\t\tvalue: T,\n\t\top: IValueTypeOperationValue,\n\t\tlocalOpMetadata: IMapMessageLocalMetadata,\n\t):\n\t\t| { rebasedOp: IValueTypeOperationValue; rebasedLocalOpMetadata: IMapMessageLocalMetadata }\n\t\t| undefined;\n}\n\n/**\n * Defines a value type that can be registered on a container type.\n */\nexport interface IValueType<T> {\n\t/**\n\t * Name of the value type.\n\t * @alpha\n\t */\n\tname: string;\n\n\t/**\n\t * Factory method used to convert to/from a JSON form of the type.\n\t * @alpha\n\t */\n\tfactory: IValueFactory<T>;\n\n\t/**\n\t * Operations that can be applied to the value type.\n\t * @alpha\n\t */\n\tops: Map<IntervalOpType, IValueOperation<T>>;\n}\n\nexport interface ISharedDefaultMapEvents extends ISharedObjectEvents {\n\t(\n\t\tevent: \"valueChanged\" | \"create\",\n\t\tlistener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void,\n\t): void;\n}\n\n/**\n * The _ready-for-serialization_ format of values contained in DDS contents. This allows us to use\n * ISerializableValue.type to understand whether they're storing a Plain JS object, a SharedObject, or a value type.\n * Note that the in-memory equivalent of ISerializableValue is ILocalValue (similarly holding a type, but with\n * the _in-memory representation_ of the value instead). An ISerializableValue is what gets passed to\n * JSON.stringify and comes out of JSON.parse. This format is used both for snapshots (loadCore/populate)\n * and ops (set).\n *\n * The DefaultMap implementation for sequence has been specialized to only support a single ValueType, which serializes\n * and deserializes via .store() and .load().\n */\nexport interface ISerializableValue {\n\t/**\n\t * A type annotation to help indicate how the value serializes.\n\t */\n\ttype: string;\n\n\t/**\n\t * The JSONable representation of the value.\n\t */\n\tvalue: any;\n}\n\nexport interface ISerializedValue {\n\t/**\n\t * A type annotation to help indicate how the value serializes.\n\t */\n\ttype: string;\n\n\t/**\n\t * String representation of the value.\n\t */\n\tvalue: string | undefined;\n}\n\n/**\n * ValueTypes handle ops slightly differently from SharedObjects or plain JS objects. Since the Map/Directory doesn't\n * know how to handle the ValueType's ops, those ops are instead passed along to the ValueType for processing.\n * IValueTypeOperationValue is that passed-along op. The opName on it is the ValueType-specific operation and the\n * value is whatever params the ValueType needs to complete that operation. Similar to ISerializableValue, it is\n * serializable via JSON.stringify/parse but differs in that it has no equivalency with an in-memory value - rather\n * it just describes an operation to be applied to an already-in-memory value.\n * @alpha\n */\nexport interface IValueTypeOperationValue {\n\t/**\n\t * The name of the operation.\n\t */\n\topName: IntervalOpType;\n\n\t/**\n\t * The payload that is submitted along with the operation.\n\t */\n\tvalue: SerializedIntervalDelta;\n}\n"]}
@@ -4,7 +4,8 @@
4
4
  */
5
5
  import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
6
6
  import { ISharedObjectEvents } from "@fluidframework/shared-object-base";
7
- import { IEventThisPlaceHolder } from "@fluidframework/common-definitions";
7
+ import { IEventThisPlaceHolder } from "@fluidframework/core-interfaces";
8
+ import { ISerializedInterval, IntervalOpType, SerializedIntervalDelta } from "./intervals";
8
9
  /**
9
10
  * Type of "valueChanged" event parameter.
10
11
  */
@@ -21,17 +22,17 @@ export interface IValueChanged {
21
22
  /**
22
23
  * Value types are given an IValueOpEmitter to emit their ops through the container type that holds them.
23
24
  * @internal
25
+ * @deprecated - will be remove from public api as there is no public used of this type
24
26
  */
25
27
  export interface IValueOpEmitter {
26
28
  /**
27
29
  * Called by the value type to emit a value type operation through the container type holding it.
28
30
  * @param opName - Name of the emitted operation
29
- * @param previousValue - JSONable previous value as defined by the value type
31
+ * @param previousValue - JSONable previous value as defined by the value type @deprecated unused
30
32
  * @param params - JSONable params for the operation as defined by the value type
31
33
  * @param localOpMetadata - JSONable local metadata which should be submitted with the op
32
- * @internal
33
34
  */
34
- emit(opName: string, previousValue: any, params: any, localOpMetadata: IMapMessageLocalMetadata): void;
35
+ emit(opName: IntervalOpType, previousValue: undefined, params: SerializedIntervalDelta, localOpMetadata: IMapMessageLocalMetadata): void;
35
36
  }
36
37
  /**
37
38
  * @internal
@@ -39,6 +40,37 @@ export interface IValueOpEmitter {
39
40
  export interface IMapMessageLocalMetadata {
40
41
  localSeq: number;
41
42
  }
43
+ /**
44
+ * Optional flags that configure options for sequence DDSs
45
+ * @internal
46
+ */
47
+ export interface SequenceOptions {
48
+ /**
49
+ * Enable the ability to use interval APIs that rely on positions before and
50
+ * after individual characters, referred to as "sides". See {@link SequencePlace}
51
+ * for additional context.
52
+ *
53
+ * This flag must be enabled to pass instances of {@link SequencePlace} to
54
+ * any IIntervalCollection API.
55
+ *
56
+ * Also see the feature flag `mergeTreeReferencesCanSlideToEndpoint` to allow
57
+ * endpoints to slide to the special endpoint segments.
58
+ *
59
+ * The default value is false.
60
+ */
61
+ intervalStickinessEnabled: boolean;
62
+ /**
63
+ * Enable the ability for interval endpoints to slide to the special endpoint
64
+ * segments that exist before and after the bounds of the string. This is
65
+ * primarily useful for workflows involving interval stickiness, and it is
66
+ * suggested to enable both this flag and `intervalStickinessEnabled` at the
67
+ * same time.
68
+ *
69
+ * The default value is false.
70
+ */
71
+ mergeTreeReferencesCanSlideToEndpoint: boolean;
72
+ [key: string]: boolean;
73
+ }
42
74
  /**
43
75
  * A value factory is used to serialize/deserialize value types to a map
44
76
  * @alpha
@@ -52,7 +84,7 @@ export interface IValueFactory<T> {
52
84
  * @returns The new value type
53
85
  * @alpha
54
86
  */
55
- load(emitter: IValueOpEmitter, raw: any): T;
87
+ load(emitter: IValueOpEmitter, raw: any, options?: Partial<SequenceOptions>): T;
56
88
  /**
57
89
  * Given a value type, provides a JSONable form of its data to be used for snapshotting. This data must be
58
90
  * loadable using the load method of its factory.
@@ -76,7 +108,7 @@ export interface IValueOperation<T> {
76
108
  * @param localOpMetadata - any local metadata submitted by `IValueOpEmitter.emit`.
77
109
  * @alpha
78
110
  */
79
- process(value: T, params: any, local: boolean, message: ISequencedDocumentMessage | undefined, localOpMetadata: IMapMessageLocalMetadata | undefined): any;
111
+ process(value: T, params: ISerializedInterval, local: boolean, message: ISequencedDocumentMessage | undefined, localOpMetadata: IMapMessageLocalMetadata | undefined): void;
80
112
  /**
81
113
  * Rebases an `op` on `value` from its original perspective (ref/local seq) to the current
82
114
  * perspective. Should be invoked on reconnection.
@@ -88,7 +120,7 @@ export interface IValueOperation<T> {
88
120
  rebase(value: T, op: IValueTypeOperationValue, localOpMetadata: IMapMessageLocalMetadata): {
89
121
  rebasedOp: IValueTypeOperationValue;
90
122
  rebasedLocalOpMetadata: IMapMessageLocalMetadata;
91
- };
123
+ } | undefined;
92
124
  }
93
125
  /**
94
126
  * Defines a value type that can be registered on a container type.
@@ -108,10 +140,10 @@ export interface IValueType<T> {
108
140
  * Operations that can be applied to the value type.
109
141
  * @alpha
110
142
  */
111
- ops: Map<string, IValueOperation<T>>;
143
+ ops: Map<IntervalOpType, IValueOperation<T>>;
112
144
  }
113
145
  export interface ISharedDefaultMapEvents extends ISharedObjectEvents {
114
- (event: "valueChanged" | "create", listener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): any;
146
+ (event: "valueChanged" | "create", listener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): void;
115
147
  }
116
148
  /**
117
149
  * The _ready-for-serialization_ format of values contained in DDS contents. This allows us to use
@@ -121,7 +153,7 @@ export interface ISharedDefaultMapEvents extends ISharedObjectEvents {
121
153
  * JSON.stringify and comes out of JSON.parse. This format is used both for snapshots (loadCore/populate)
122
154
  * and ops (set).
123
155
  *
124
- * The DefaultMap impelmentation for sequence has been specialized to only support a single ValueType, which serializes
156
+ * The DefaultMap implementation for sequence has been specialized to only support a single ValueType, which serializes
125
157
  * and deserializes via .store() and .load().
126
158
  */
127
159
  export interface ISerializableValue {
@@ -157,10 +189,10 @@ export interface IValueTypeOperationValue {
157
189
  /**
158
190
  * The name of the operation.
159
191
  */
160
- opName: string;
192
+ opName: IntervalOpType;
161
193
  /**
162
194
  * The payload that is submitted along with the operation.
163
195
  */
164
- value: any;
196
+ value: SerializedIntervalDelta;
165
197
  }
166
198
  //# sourceMappingURL=defaultMapInterfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaultMapInterfaces.d.ts","sourceRoot":"","sources":["../src/defaultMapInterfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,aAAa,EAAE,GAAG,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe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IACnE,CACC,KAAK,EAAE,cAAc,GAAG,QAAQ,EAChC,QAAQ,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,qBAAqB,KAAK,IAAI,GACvF,IAAI,CAAC;CACR;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,kBAAkB;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,GAAG,CAAC;CACX;AAED,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,wBAAwB;IACxC;;OAEG;IACH,MAAM,EAAE,cAAc,CAAC;IAEvB;;OAEG;IACH,KAAK,EAAE,uBAAuB,CAAC;CAC/B"}
package/dist/index.cjs ADDED
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.TrackingGroup = exports.reservedRangeLabelsKey = exports.reservedTileLabelsKey = exports.reservedMarkerIdKey = exports.MergeTreeDeltaType = exports.TextSegment = exports.ReferenceType = exports.BaseSegment = exports.Marker = exports.SubSequence = exports.SharedSequence = exports.SharedIntervalCollectionFactory = exports.SharedIntervalCollection = exports.SharedString = exports.getTextAndMarkers = exports.SharedStringFactory = exports.SequenceMaintenanceEvent = exports.SequenceEvent = exports.SequenceDeltaEvent = exports.SharedSegmentSequence = exports.revertSharedStringRevertibles = exports.discardSharedStringRevertibles = exports.appendSharedStringDeltaToRevertibles = exports.appendIntervalPropertyChangedToRevertibles = exports.appendDeleteIntervalToRevertibles = exports.appendChangeIntervalToRevertibles = exports.appendAddIntervalToRevertibles = exports.createEndpointIndex = exports.createIdIntervalIndex = exports.createStartpointInRangeIndex = exports.createEndpointInRangeIndex = exports.createOverlappingSequenceIntervalsIndex = exports.createOverlappingIntervalsIndex = exports.Side = exports.intervalLocatorFromEndpoint = exports.sequenceIntervalHelpers = exports.IntervalStickiness = exports.SequenceInterval = exports.IntervalType = exports.IntervalOpType = exports.Interval = void 0;
8
+ var intervals_1 = require("./intervals/index.cjs");
9
+ Object.defineProperty(exports, "Interval", { enumerable: true, get: function () { return intervals_1.Interval; } });
10
+ Object.defineProperty(exports, "IntervalOpType", { enumerable: true, get: function () { return intervals_1.IntervalOpType; } });
11
+ Object.defineProperty(exports, "IntervalType", { enumerable: true, get: function () { return intervals_1.IntervalType; } });
12
+ Object.defineProperty(exports, "SequenceInterval", { enumerable: true, get: function () { return intervals_1.SequenceInterval; } });
13
+ Object.defineProperty(exports, "IntervalStickiness", { enumerable: true, get: function () { return intervals_1.IntervalStickiness; } });
14
+ Object.defineProperty(exports, "sequenceIntervalHelpers", { enumerable: true, get: function () { return intervals_1.sequenceIntervalHelpers; } });
15
+ var intervalCollection_1 = require("./intervalCollection.cjs");
16
+ Object.defineProperty(exports, "intervalLocatorFromEndpoint", { enumerable: true, get: function () { return intervalCollection_1.intervalLocatorFromEndpoint; } });
17
+ Object.defineProperty(exports, "Side", { enumerable: true, get: function () { return intervalCollection_1.Side; } });
18
+ var intervalIndex_1 = require("./intervalIndex/index.cjs");
19
+ Object.defineProperty(exports, "createOverlappingIntervalsIndex", { enumerable: true, get: function () { return intervalIndex_1.createOverlappingIntervalsIndex; } });
20
+ Object.defineProperty(exports, "createOverlappingSequenceIntervalsIndex", { enumerable: true, get: function () { return intervalIndex_1.createOverlappingSequenceIntervalsIndex; } });
21
+ Object.defineProperty(exports, "createEndpointInRangeIndex", { enumerable: true, get: function () { return intervalIndex_1.createEndpointInRangeIndex; } });
22
+ Object.defineProperty(exports, "createStartpointInRangeIndex", { enumerable: true, get: function () { return intervalIndex_1.createStartpointInRangeIndex; } });
23
+ Object.defineProperty(exports, "createIdIntervalIndex", { enumerable: true, get: function () { return intervalIndex_1.createIdIntervalIndex; } });
24
+ Object.defineProperty(exports, "createEndpointIndex", { enumerable: true, get: function () { return intervalIndex_1.createEndpointIndex; } });
25
+ var revertibles_1 = require("./revertibles.cjs");
26
+ Object.defineProperty(exports, "appendAddIntervalToRevertibles", { enumerable: true, get: function () { return revertibles_1.appendAddIntervalToRevertibles; } });
27
+ Object.defineProperty(exports, "appendChangeIntervalToRevertibles", { enumerable: true, get: function () { return revertibles_1.appendChangeIntervalToRevertibles; } });
28
+ Object.defineProperty(exports, "appendDeleteIntervalToRevertibles", { enumerable: true, get: function () { return revertibles_1.appendDeleteIntervalToRevertibles; } });
29
+ Object.defineProperty(exports, "appendIntervalPropertyChangedToRevertibles", { enumerable: true, get: function () { return revertibles_1.appendIntervalPropertyChangedToRevertibles; } });
30
+ Object.defineProperty(exports, "appendSharedStringDeltaToRevertibles", { enumerable: true, get: function () { return revertibles_1.appendSharedStringDeltaToRevertibles; } });
31
+ Object.defineProperty(exports, "discardSharedStringRevertibles", { enumerable: true, get: function () { return revertibles_1.discardSharedStringRevertibles; } });
32
+ Object.defineProperty(exports, "revertSharedStringRevertibles", { enumerable: true, get: function () { return revertibles_1.revertSharedStringRevertibles; } });
33
+ var sequence_1 = require("./sequence.cjs");
34
+ Object.defineProperty(exports, "SharedSegmentSequence", { enumerable: true, get: function () { return sequence_1.SharedSegmentSequence; } });
35
+ var sequenceDeltaEvent_1 = require("./sequenceDeltaEvent.cjs");
36
+ Object.defineProperty(exports, "SequenceDeltaEvent", { enumerable: true, get: function () { return sequenceDeltaEvent_1.SequenceDeltaEvent; } });
37
+ Object.defineProperty(exports, "SequenceEvent", { enumerable: true, get: function () { return sequenceDeltaEvent_1.SequenceEvent; } });
38
+ Object.defineProperty(exports, "SequenceMaintenanceEvent", { enumerable: true, get: function () { return sequenceDeltaEvent_1.SequenceMaintenanceEvent; } });
39
+ var sequenceFactory_1 = require("./sequenceFactory.cjs");
40
+ Object.defineProperty(exports, "SharedStringFactory", { enumerable: true, get: function () { return sequenceFactory_1.SharedStringFactory; } });
41
+ var sharedString_1 = require("./sharedString.cjs");
42
+ Object.defineProperty(exports, "getTextAndMarkers", { enumerable: true, get: function () { return sharedString_1.getTextAndMarkers; } });
43
+ Object.defineProperty(exports, "SharedString", { enumerable: true, get: function () { return sharedString_1.SharedString; } });
44
+ var sharedIntervalCollection_1 = require("./sharedIntervalCollection.cjs");
45
+ Object.defineProperty(exports, "SharedIntervalCollection", { enumerable: true, get: function () { return sharedIntervalCollection_1.SharedIntervalCollection; } });
46
+ Object.defineProperty(exports, "SharedIntervalCollectionFactory", { enumerable: true, get: function () { return sharedIntervalCollection_1.SharedIntervalCollectionFactory; } });
47
+ var sharedSequence_1 = require("./sharedSequence.cjs");
48
+ Object.defineProperty(exports, "SharedSequence", { enumerable: true, get: function () { return sharedSequence_1.SharedSequence; } });
49
+ Object.defineProperty(exports, "SubSequence", { enumerable: true, get: function () { return sharedSequence_1.SubSequence; } });
50
+ var merge_tree_1 = require("@fluidframework/merge-tree");
51
+ Object.defineProperty(exports, "Marker", { enumerable: true, get: function () { return merge_tree_1.Marker; } });
52
+ Object.defineProperty(exports, "BaseSegment", { enumerable: true, get: function () { return merge_tree_1.BaseSegment; } });
53
+ Object.defineProperty(exports, "ReferenceType", { enumerable: true, get: function () { return merge_tree_1.ReferenceType; } });
54
+ Object.defineProperty(exports, "TextSegment", { enumerable: true, get: function () { return merge_tree_1.TextSegment; } });
55
+ Object.defineProperty(exports, "MergeTreeDeltaType", { enumerable: true, get: function () { return merge_tree_1.MergeTreeDeltaType; } });
56
+ Object.defineProperty(exports, "reservedMarkerIdKey", { enumerable: true, get: function () { return merge_tree_1.reservedMarkerIdKey; } });
57
+ Object.defineProperty(exports, "reservedTileLabelsKey", { enumerable: true, get: function () { return merge_tree_1.reservedTileLabelsKey; } });
58
+ Object.defineProperty(exports, "reservedRangeLabelsKey", { enumerable: true, get: function () { return merge_tree_1.reservedRangeLabelsKey; } });
59
+ Object.defineProperty(exports, "TrackingGroup", { enumerable: true, get: function () { return merge_tree_1.TrackingGroup; } });
60
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAeH,mDAYqB;AAVpB,qGAAA,QAAQ,OAAA;AACR,2GAAA,cAAc,OAAA;AACd,yGAAA,YAAY,OAAA;AAGZ,6GAAA,gBAAgB,OAAA;AAEhB,+GAAA,kBAAkB,OAAA;AAElB,oHAAA,uBAAuB,OAAA;AAExB,+DAS8B;AAJ7B,iIAAA,2BAA2B,OAAA;AAC3B,0GAAA,IAAI,OAAA;AAIL,2DAcyB;AAVxB,gIAAA,+BAA+B,OAAA;AAC/B,wIAAA,uCAAuC,OAAA;AAGvC,2HAAA,0BAA0B,OAAA;AAC1B,6HAAA,4BAA4B,OAAA;AAE5B,sHAAA,qBAAqB,OAAA;AAErB,oHAAA,mBAAmB,OAAA;AAEpB,iDAUuB;AATtB,6HAAA,8BAA8B,OAAA;AAC9B,gIAAA,iCAAiC,OAAA;AACjC,gIAAA,iCAAiC,OAAA;AACjC,yIAAA,0CAA0C,OAAA;AAC1C,mIAAA,oCAAoC,OAAA;AACpC,6HAAA,8BAA8B,OAAA;AAE9B,4HAAA,6BAA6B,OAAA;AAG9B,2CAAiF;AAA1C,iHAAA,qBAAqB,OAAA;AAC5D,+DAK8B;AAH7B,wHAAA,kBAAkB,OAAA;AAClB,mHAAA,aAAa,OAAA;AACb,8HAAA,wBAAwB,OAAA;AAEzB,yDAAwD;AAA/C,sHAAA,mBAAmB,OAAA;AAC5B,mDAKwB;AAJvB,iHAAA,iBAAiB,OAAA;AAEjB,4GAAA,YAAY,OAAA;AAGb,2EAIoC;AAFnC,oIAAA,wBAAwB,OAAA;AACxB,2IAAA,+BAA+B,OAAA;AAEhC,uDAAgF;AAAtD,gHAAA,cAAc,OAAA;AAAE,6GAAA,WAAW,OAAA;AAErD,yDAeoC;AAbnC,oGAAA,MAAM,OAAA;AACN,yGAAA,WAAW,OAAA;AAEX,2GAAA,aAAa,OAAA;AAGb,yGAAA,WAAW,OAAA;AACX,gHAAA,kBAAkB,OAAA;AAClB,iHAAA,mBAAmB,OAAA;AACnB,mHAAA,qBAAqB,OAAA;AACrB,oHAAA,sBAAsB,OAAA;AACtB,2GAAA,aAAa,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Supports distributed data structures which are list-like.\n *\n * This library's main export is {@link SharedString}, a DDS for storing and simultaneously editing a sequence of\n * text.\n *\n * See the package's README for a high-level introduction to `SharedString`'s feature set.\n * @remarks Note that SharedString is a sequence DDS but it has additional specialized features and behaviors for\n * working with text.\n *\n * @packageDocumentation\n */\nexport { IMapMessageLocalMetadata, IValueOpEmitter, SequenceOptions } from \"./defaultMapInterfaces\";\nexport {\n\tIInterval,\n\tInterval,\n\tIntervalOpType,\n\tIntervalType,\n\tISerializableInterval,\n\tISerializedInterval,\n\tSequenceInterval,\n\tSerializedIntervalDelta,\n\tIntervalStickiness,\n\tIIntervalHelpers,\n\tsequenceIntervalHelpers,\n} from \"./intervals\";\nexport {\n\tDeserializeCallback,\n\tIIntervalCollectionEvent,\n\tIIntervalCollection,\n\tIntervalLocator,\n\tintervalLocatorFromEndpoint,\n\tSide,\n\tInteriorSequencePlace,\n\tSequencePlace,\n} from \"./intervalCollection\";\nexport {\n\tIntervalIndex,\n\tSequenceIntervalIndexes,\n\tIOverlappingIntervalsIndex,\n\tcreateOverlappingIntervalsIndex,\n\tcreateOverlappingSequenceIntervalsIndex,\n\tIEndpointInRangeIndex,\n\tIStartpointInRangeIndex,\n\tcreateEndpointInRangeIndex,\n\tcreateStartpointInRangeIndex,\n\tIIdIntervalIndex,\n\tcreateIdIntervalIndex,\n\tIEndpointIndex,\n\tcreateEndpointIndex,\n} from \"./intervalIndex\";\nexport {\n\tappendAddIntervalToRevertibles,\n\tappendChangeIntervalToRevertibles,\n\tappendDeleteIntervalToRevertibles,\n\tappendIntervalPropertyChangedToRevertibles,\n\tappendSharedStringDeltaToRevertibles,\n\tdiscardSharedStringRevertibles,\n\tIntervalRevertible,\n\trevertSharedStringRevertibles,\n\tSharedStringRevertible,\n} from \"./revertibles\";\nexport { ISharedSegmentSequenceEvents, SharedSegmentSequence } from \"./sequence\";\nexport {\n\tISequenceDeltaRange,\n\tSequenceDeltaEvent,\n\tSequenceEvent,\n\tSequenceMaintenanceEvent,\n} from \"./sequenceDeltaEvent\";\nexport { SharedStringFactory } from \"./sequenceFactory\";\nexport {\n\tgetTextAndMarkers,\n\tISharedString,\n\tSharedString,\n\tSharedStringSegment,\n} from \"./sharedString\";\nexport {\n\tISharedIntervalCollection,\n\tSharedIntervalCollection,\n\tSharedIntervalCollectionFactory,\n} from \"./sharedIntervalCollection\";\nexport { IJSONRunSegment, SharedSequence, SubSequence } from \"./sharedSequence\";\n\nexport {\n\tISegment,\n\tMarker,\n\tBaseSegment,\n\tReferencePosition,\n\tReferenceType,\n\tPropertySet,\n\tMapLike,\n\tTextSegment,\n\tMergeTreeDeltaType,\n\treservedMarkerIdKey,\n\treservedTileLabelsKey,\n\treservedRangeLabelsKey,\n\tTrackingGroup,\n\tLocalReferencePosition,\n} from \"@fluidframework/merge-tree\";\n"]}
package/dist/index.d.ts CHANGED
@@ -5,23 +5,25 @@
5
5
  /**
6
6
  * Supports distributed data structures which are list-like.
7
7
  *
8
- * This package's main export is {@link SharedSequence}, a DDS for storing and simultaneously editing a sequence of
8
+ * This library's main export is {@link SharedString}, a DDS for storing and simultaneously editing a sequence of
9
9
  * text.
10
10
  *
11
+ * See the package's README for a high-level introduction to `SharedString`'s feature set.
11
12
  * @remarks Note that SharedString is a sequence DDS but it has additional specialized features and behaviors for
12
13
  * working with text.
13
14
  *
14
15
  * @packageDocumentation
15
16
  */
16
- export { DeserializeCallback, IIntervalCollectionEvent, IIntervalHelpers, Interval, IntervalCollection, IntervalCollectionIterator, IntervalType, ISerializableInterval, ISerializedInterval, SequenceInterval, ISerializedIntervalCollectionV2, CompressedSerializedInterval, } from "./intervalCollection";
17
- export { IMapMessageLocalMetadata, IValueOpEmitter, } from "./defaultMapInterfaces";
18
- export * from "./sharedString";
19
- export * from "./sequence";
20
- export * from "./sequenceFactory";
21
- export * from "./sequenceDeltaEvent";
22
- export * from "./sharedSequence";
23
- export * from "./sharedObjectSequence";
24
- export * from "./sharedNumberSequence";
25
- export * from "./sparsematrix";
26
- export * from "./sharedIntervalCollection";
17
+ export { IMapMessageLocalMetadata, IValueOpEmitter, SequenceOptions } from "./defaultMapInterfaces";
18
+ export { IInterval, Interval, IntervalOpType, IntervalType, ISerializableInterval, ISerializedInterval, SequenceInterval, SerializedIntervalDelta, IntervalStickiness, IIntervalHelpers, sequenceIntervalHelpers, } from "./intervals";
19
+ export { DeserializeCallback, IIntervalCollectionEvent, IIntervalCollection, IntervalLocator, intervalLocatorFromEndpoint, Side, InteriorSequencePlace, SequencePlace, } from "./intervalCollection";
20
+ export { IntervalIndex, SequenceIntervalIndexes, IOverlappingIntervalsIndex, createOverlappingIntervalsIndex, createOverlappingSequenceIntervalsIndex, IEndpointInRangeIndex, IStartpointInRangeIndex, createEndpointInRangeIndex, createStartpointInRangeIndex, IIdIntervalIndex, createIdIntervalIndex, IEndpointIndex, createEndpointIndex, } from "./intervalIndex";
21
+ export { appendAddIntervalToRevertibles, appendChangeIntervalToRevertibles, appendDeleteIntervalToRevertibles, appendIntervalPropertyChangedToRevertibles, appendSharedStringDeltaToRevertibles, discardSharedStringRevertibles, IntervalRevertible, revertSharedStringRevertibles, SharedStringRevertible, } from "./revertibles";
22
+ export { ISharedSegmentSequenceEvents, SharedSegmentSequence } from "./sequence";
23
+ export { ISequenceDeltaRange, SequenceDeltaEvent, SequenceEvent, SequenceMaintenanceEvent, } from "./sequenceDeltaEvent";
24
+ export { SharedStringFactory } from "./sequenceFactory";
25
+ export { getTextAndMarkers, ISharedString, SharedString, SharedStringSegment, } from "./sharedString";
26
+ export { ISharedIntervalCollection, SharedIntervalCollection, SharedIntervalCollectionFactory, } from "./sharedIntervalCollection";
27
+ export { IJSONRunSegment, SharedSequence, SubSequence } from "./sharedSequence";
28
+ export { ISegment, Marker, BaseSegment, ReferencePosition, ReferenceType, PropertySet, MapLike, TextSegment, MergeTreeDeltaType, reservedMarkerIdKey, reservedTileLabelsKey, reservedRangeLabelsKey, TrackingGroup, LocalReferencePosition, } from "@fluidframework/merge-tree";
27
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH,OAAO,EACH,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,QAAQ,EACR,kBAAkB,EAClB,0BAA0B,EAC1B,YAAY,EACZ,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,+BAA+B,EAC/B,4BAA4B,GAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,wBAAwB,EACxB,eAAe,GAClB,MAAM,wBAAwB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACpG,OAAO,EACN,SAAS,EACT,QAAQ,EACR,cAAc,EACd,YAAY,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