@fluidframework/sequence 2.0.0-rc.2.0.2 → 2.0.0-rc.3.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 (313) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +1 -1
  3. package/api-report/sequence.api.md +32 -32
  4. package/beta.d.ts +11 -0
  5. package/dist/{localValues.d.ts → IntervalCollectionValues.d.ts} +13 -12
  6. package/dist/IntervalCollectionValues.d.ts.map +1 -0
  7. package/dist/{localValues.js → IntervalCollectionValues.js} +6 -6
  8. package/dist/IntervalCollectionValues.js.map +1 -0
  9. package/dist/beta.d.ts +12 -0
  10. package/dist/index.d.ts +2 -2
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +10 -10
  13. package/dist/index.js.map +1 -1
  14. package/dist/intervalCollection.d.ts +10 -10
  15. package/dist/intervalCollection.d.ts.map +1 -1
  16. package/dist/intervalCollection.js +103 -99
  17. package/dist/intervalCollection.js.map +1 -1
  18. package/dist/{defaultMap.d.ts → intervalCollectionMap.d.ts} +11 -44
  19. package/dist/intervalCollectionMap.d.ts.map +1 -0
  20. package/dist/{defaultMap.js → intervalCollectionMap.js} +15 -70
  21. package/dist/intervalCollectionMap.js.map +1 -0
  22. package/dist/{defaultMapInterfaces.d.ts → intervalCollectionMapInterfaces.d.ts} +17 -16
  23. package/dist/intervalCollectionMapInterfaces.d.ts.map +1 -0
  24. package/dist/{defaultMapInterfaces.js → intervalCollectionMapInterfaces.js} +1 -1
  25. package/dist/intervalCollectionMapInterfaces.js.map +1 -0
  26. package/dist/intervalIndex/endpointInRangeIndex.d.ts +1 -1
  27. package/dist/intervalIndex/endpointInRangeIndex.d.ts.map +1 -1
  28. package/dist/intervalIndex/endpointInRangeIndex.js +3 -3
  29. package/dist/intervalIndex/endpointInRangeIndex.js.map +1 -1
  30. package/dist/intervalIndex/endpointIndex.d.ts +1 -1
  31. package/dist/intervalIndex/endpointIndex.d.ts.map +1 -1
  32. package/dist/intervalIndex/endpointIndex.js +3 -3
  33. package/dist/intervalIndex/endpointIndex.js.map +1 -1
  34. package/dist/intervalIndex/idIntervalIndex.d.ts.map +1 -1
  35. package/dist/intervalIndex/idIntervalIndex.js +3 -3
  36. package/dist/intervalIndex/idIntervalIndex.js.map +1 -1
  37. package/dist/intervalIndex/overlappingIntervalsIndex.d.ts +3 -3
  38. package/dist/intervalIndex/overlappingIntervalsIndex.d.ts.map +1 -1
  39. package/dist/intervalIndex/overlappingIntervalsIndex.js +2 -3
  40. package/dist/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
  41. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.d.ts.map +1 -1
  42. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.js +6 -6
  43. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.js.map +1 -1
  44. package/dist/intervalIndex/sequenceIntervalIndexes.d.ts +1 -1
  45. package/dist/intervalIndex/sequenceIntervalIndexes.d.ts.map +1 -1
  46. package/dist/intervalIndex/sequenceIntervalIndexes.js.map +1 -1
  47. package/dist/intervalIndex/startpointInRangeIndex.d.ts +1 -1
  48. package/dist/intervalIndex/startpointInRangeIndex.d.ts.map +1 -1
  49. package/dist/intervalIndex/startpointInRangeIndex.js +3 -3
  50. package/dist/intervalIndex/startpointInRangeIndex.js.map +1 -1
  51. package/dist/intervalTree.d.ts +1 -1
  52. package/dist/intervalTree.d.ts.map +1 -1
  53. package/dist/intervalTree.js +2 -2
  54. package/dist/intervalTree.js.map +1 -1
  55. package/dist/intervals/interval.d.ts +1 -1
  56. package/dist/intervals/interval.d.ts.map +1 -1
  57. package/dist/intervals/interval.js +10 -10
  58. package/dist/intervals/interval.js.map +1 -1
  59. package/dist/intervals/intervalUtils.d.ts +1 -1
  60. package/dist/intervals/intervalUtils.d.ts.map +1 -1
  61. package/dist/intervals/intervalUtils.js +5 -5
  62. package/dist/intervals/intervalUtils.js.map +1 -1
  63. package/dist/intervals/sequenceInterval.d.ts +1 -1
  64. package/dist/intervals/sequenceInterval.d.ts.map +1 -1
  65. package/dist/intervals/sequenceInterval.js +34 -34
  66. package/dist/intervals/sequenceInterval.js.map +1 -1
  67. package/dist/legacy.d.ts +61 -0
  68. package/dist/packageVersion.d.ts +1 -1
  69. package/dist/packageVersion.js +1 -1
  70. package/dist/packageVersion.js.map +1 -1
  71. package/dist/public.d.ts +12 -0
  72. package/dist/revertibles.d.ts +2 -2
  73. package/dist/revertibles.d.ts.map +1 -1
  74. package/dist/revertibles.js +34 -34
  75. package/dist/revertibles.js.map +1 -1
  76. package/dist/sequence.d.ts +7 -6
  77. package/dist/sequence.d.ts.map +1 -1
  78. package/dist/sequence.js +34 -34
  79. package/dist/sequence.js.map +1 -1
  80. package/dist/sequenceDeltaEvent.d.ts +1 -1
  81. package/dist/sequenceDeltaEvent.d.ts.map +1 -1
  82. package/dist/sequenceDeltaEvent.js +4 -4
  83. package/dist/sequenceDeltaEvent.js.map +1 -1
  84. package/dist/sequenceFactory.d.ts +1 -1
  85. package/dist/sequenceFactory.d.ts.map +1 -1
  86. package/dist/sequenceFactory.js +3 -3
  87. package/dist/sequenceFactory.js.map +1 -1
  88. package/dist/sharedIntervalCollection.d.ts +4 -3
  89. package/dist/sharedIntervalCollection.d.ts.map +1 -1
  90. package/dist/sharedIntervalCollection.js +5 -5
  91. package/dist/sharedIntervalCollection.js.map +1 -1
  92. package/dist/sharedSequence.d.ts +3 -2
  93. package/dist/sharedSequence.d.ts.map +1 -1
  94. package/dist/sharedSequence.js +4 -4
  95. package/dist/sharedSequence.js.map +1 -1
  96. package/dist/sharedString.d.ts +2 -2
  97. package/dist/sharedString.d.ts.map +1 -1
  98. package/dist/sharedString.js +9 -9
  99. package/dist/sharedString.js.map +1 -1
  100. package/internal.d.ts +11 -0
  101. package/legacy.d.ts +11 -0
  102. package/lib/{localValues.d.ts → IntervalCollectionValues.d.ts} +13 -12
  103. package/lib/IntervalCollectionValues.d.ts.map +1 -0
  104. package/lib/{localValues.js → IntervalCollectionValues.js} +3 -3
  105. package/lib/IntervalCollectionValues.js.map +1 -0
  106. package/lib/beta.d.ts +12 -0
  107. package/lib/index.d.ts +2 -2
  108. package/lib/index.d.ts.map +1 -1
  109. package/lib/index.js +1 -1
  110. package/lib/index.js.map +1 -1
  111. package/lib/intervalCollection.d.ts +10 -10
  112. package/lib/intervalCollection.d.ts.map +1 -1
  113. package/lib/intervalCollection.js +8 -4
  114. package/lib/intervalCollection.js.map +1 -1
  115. package/lib/{defaultMap.d.ts → intervalCollectionMap.d.ts} +11 -44
  116. package/lib/intervalCollectionMap.d.ts.map +1 -0
  117. package/lib/{defaultMap.js → intervalCollectionMap.js} +8 -63
  118. package/lib/intervalCollectionMap.js.map +1 -0
  119. package/lib/{defaultMapInterfaces.d.ts → intervalCollectionMapInterfaces.d.ts} +17 -16
  120. package/lib/intervalCollectionMapInterfaces.d.ts.map +1 -0
  121. package/lib/{defaultMapInterfaces.js → intervalCollectionMapInterfaces.js} +1 -1
  122. package/lib/intervalCollectionMapInterfaces.js.map +1 -0
  123. package/lib/intervalIndex/endpointInRangeIndex.d.ts +1 -1
  124. package/lib/intervalIndex/endpointInRangeIndex.d.ts.map +1 -1
  125. package/lib/intervalIndex/endpointInRangeIndex.js +1 -1
  126. package/lib/intervalIndex/endpointInRangeIndex.js.map +1 -1
  127. package/lib/intervalIndex/endpointIndex.d.ts +1 -1
  128. package/lib/intervalIndex/endpointIndex.d.ts.map +1 -1
  129. package/lib/intervalIndex/endpointIndex.js +1 -1
  130. package/lib/intervalIndex/endpointIndex.js.map +1 -1
  131. package/lib/intervalIndex/idIntervalIndex.d.ts.map +1 -1
  132. package/lib/intervalIndex/idIntervalIndex.js +1 -1
  133. package/lib/intervalIndex/idIntervalIndex.js.map +1 -1
  134. package/lib/intervalIndex/overlappingIntervalsIndex.d.ts +3 -3
  135. package/lib/intervalIndex/overlappingIntervalsIndex.d.ts.map +1 -1
  136. package/lib/intervalIndex/overlappingIntervalsIndex.js +2 -3
  137. package/lib/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
  138. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.d.ts.map +1 -1
  139. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.js +2 -2
  140. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.js.map +1 -1
  141. package/lib/intervalIndex/sequenceIntervalIndexes.d.ts +1 -1
  142. package/lib/intervalIndex/sequenceIntervalIndexes.d.ts.map +1 -1
  143. package/lib/intervalIndex/sequenceIntervalIndexes.js.map +1 -1
  144. package/lib/intervalIndex/startpointInRangeIndex.d.ts +1 -1
  145. package/lib/intervalIndex/startpointInRangeIndex.d.ts.map +1 -1
  146. package/lib/intervalIndex/startpointInRangeIndex.js +1 -1
  147. package/lib/intervalIndex/startpointInRangeIndex.js.map +1 -1
  148. package/lib/intervalTree.d.ts +1 -1
  149. package/lib/intervalTree.d.ts.map +1 -1
  150. package/lib/intervalTree.js +1 -1
  151. package/lib/intervalTree.js.map +1 -1
  152. package/lib/intervals/interval.d.ts +1 -1
  153. package/lib/intervals/interval.d.ts.map +1 -1
  154. package/lib/intervals/interval.js +3 -3
  155. package/lib/intervals/interval.js.map +1 -1
  156. package/lib/intervals/intervalUtils.d.ts +1 -1
  157. package/lib/intervals/intervalUtils.d.ts.map +1 -1
  158. package/lib/intervals/intervalUtils.js +1 -1
  159. package/lib/intervals/intervalUtils.js.map +1 -1
  160. package/lib/intervals/sequenceInterval.d.ts +1 -1
  161. package/lib/intervals/sequenceInterval.d.ts.map +1 -1
  162. package/lib/intervals/sequenceInterval.js +3 -3
  163. package/lib/intervals/sequenceInterval.js.map +1 -1
  164. package/lib/legacy.d.ts +61 -0
  165. package/lib/packageVersion.d.ts +1 -1
  166. package/lib/packageVersion.js +1 -1
  167. package/lib/packageVersion.js.map +1 -1
  168. package/lib/public.d.ts +12 -0
  169. package/lib/revertibles.d.ts +2 -2
  170. package/lib/revertibles.d.ts.map +1 -1
  171. package/lib/revertibles.js +3 -4
  172. package/lib/revertibles.js.map +1 -1
  173. package/lib/sequence.d.ts +7 -6
  174. package/lib/sequence.d.ts.map +1 -1
  175. package/lib/sequence.js +11 -12
  176. package/lib/sequence.js.map +1 -1
  177. package/lib/sequenceDeltaEvent.d.ts +1 -1
  178. package/lib/sequenceDeltaEvent.d.ts.map +1 -1
  179. package/lib/sequenceDeltaEvent.js +3 -4
  180. package/lib/sequenceDeltaEvent.js.map +1 -1
  181. package/lib/sequenceFactory.d.ts +1 -1
  182. package/lib/sequenceFactory.d.ts.map +1 -1
  183. package/lib/sequenceFactory.js +1 -1
  184. package/lib/sequenceFactory.js.map +1 -1
  185. package/lib/sharedIntervalCollection.d.ts +4 -3
  186. package/lib/sharedIntervalCollection.d.ts.map +1 -1
  187. package/lib/sharedIntervalCollection.js +4 -4
  188. package/lib/sharedIntervalCollection.js.map +1 -1
  189. package/lib/sharedSequence.d.ts +3 -2
  190. package/lib/sharedSequence.d.ts.map +1 -1
  191. package/lib/sharedSequence.js +2 -2
  192. package/lib/sharedSequence.js.map +1 -1
  193. package/lib/sharedString.d.ts +2 -2
  194. package/lib/sharedString.d.ts.map +1 -1
  195. package/lib/sharedString.js +1 -1
  196. package/lib/sharedString.js.map +1 -1
  197. package/package.json +41 -58
  198. package/src/{localValues.ts → IntervalCollectionValues.ts} +26 -18
  199. package/src/index.ts +2 -2
  200. package/src/intervalCollection.ts +46 -47
  201. package/src/{defaultMap.ts → intervalCollectionMap.ts} +42 -105
  202. package/src/{defaultMapInterfaces.ts → intervalCollectionMapInterfaces.ts} +26 -16
  203. package/src/intervalIndex/endpointInRangeIndex.ts +4 -1
  204. package/src/intervalIndex/endpointIndex.ts +4 -1
  205. package/src/intervalIndex/idIntervalIndex.ts +4 -2
  206. package/src/intervalIndex/overlappingIntervalsIndex.ts +8 -5
  207. package/src/intervalIndex/overlappingSequenceIntervalsIndex.ts +6 -3
  208. package/src/intervalIndex/sequenceIntervalIndexes.ts +3 -1
  209. package/src/intervalIndex/startpointInRangeIndex.ts +4 -1
  210. package/src/intervalTree.ts +4 -3
  211. package/src/intervals/interval.ts +6 -3
  212. package/src/intervals/intervalUtils.ts +4 -2
  213. package/src/intervals/sequenceInterval.ts +5 -3
  214. package/src/packageVersion.ts +1 -1
  215. package/src/revertibles.ts +10 -10
  216. package/src/sequence.ts +24 -31
  217. package/src/sequenceDeltaEvent.ts +3 -4
  218. package/src/sequenceFactory.ts +4 -3
  219. package/src/sharedIntervalCollection.ts +12 -18
  220. package/src/sharedSequence.ts +9 -6
  221. package/src/sharedString.ts +4 -3
  222. package/api-extractor-cjs.json +0 -8
  223. package/dist/defaultMap.d.ts.map +0 -1
  224. package/dist/defaultMap.js.map +0 -1
  225. package/dist/defaultMapInterfaces.d.ts.map +0 -1
  226. package/dist/defaultMapInterfaces.js.map +0 -1
  227. package/dist/localValues.d.ts.map +0 -1
  228. package/dist/localValues.js.map +0 -1
  229. package/dist/sequence-alpha.d.ts +0 -1432
  230. package/dist/sequence-beta.d.ts +0 -246
  231. package/dist/sequence-public.d.ts +0 -246
  232. package/dist/sequence-untrimmed.d.ts +0 -1820
  233. package/lib/defaultMap.d.ts.map +0 -1
  234. package/lib/defaultMap.js.map +0 -1
  235. package/lib/defaultMapInterfaces.d.ts.map +0 -1
  236. package/lib/defaultMapInterfaces.js.map +0 -1
  237. package/lib/localValues.d.ts.map +0 -1
  238. package/lib/localValues.js.map +0 -1
  239. package/lib/sequence-alpha.d.ts +0 -1432
  240. package/lib/sequence-beta.d.ts +0 -246
  241. package/lib/sequence-public.d.ts +0 -246
  242. package/lib/sequence-untrimmed.d.ts +0 -1820
  243. package/lib/test/collections.intervalTree.js +0 -73
  244. package/lib/test/collections.intervalTree.js.map +0 -1
  245. package/lib/test/createSnapshotFiles.js +0 -15
  246. package/lib/test/createSnapshotFiles.js.map +0 -1
  247. package/lib/test/dirname.cjs +0 -16
  248. package/lib/test/dirname.cjs.map +0 -1
  249. package/lib/test/endpointInRangeIndex.spec.js +0 -182
  250. package/lib/test/endpointInRangeIndex.spec.js.map +0 -1
  251. package/lib/test/fuzz/fuzzUtils.js +0 -250
  252. package/lib/test/fuzz/fuzzUtils.js.map +0 -1
  253. package/lib/test/fuzz/intervalCollection.fuzz.spec.js +0 -200
  254. package/lib/test/fuzz/intervalCollection.fuzz.spec.js.map +0 -1
  255. package/lib/test/fuzz/intervalRevertibles.fuzz.spec.js +0 -129
  256. package/lib/test/fuzz/intervalRevertibles.fuzz.spec.js.map +0 -1
  257. package/lib/test/fuzz/sharedString.fuzz.spec.js +0 -91
  258. package/lib/test/fuzz/sharedString.fuzz.spec.js.map +0 -1
  259. package/lib/test/generateSharedStrings.js +0 -138
  260. package/lib/test/generateSharedStrings.js.map +0 -1
  261. package/lib/test/intervalCollection.detached.spec.js +0 -126
  262. package/lib/test/intervalCollection.detached.spec.js.map +0 -1
  263. package/lib/test/intervalCollection.events.spec.js +0 -491
  264. package/lib/test/intervalCollection.events.spec.js.map +0 -1
  265. package/lib/test/intervalCollection.perf.spec.js +0 -88
  266. package/lib/test/intervalCollection.perf.spec.js.map +0 -1
  267. package/lib/test/intervalCollection.snapshot.spec.js +0 -171
  268. package/lib/test/intervalCollection.snapshot.spec.js.map +0 -1
  269. package/lib/test/intervalCollection.spec.js +0 -1660
  270. package/lib/test/intervalCollection.spec.js.map +0 -1
  271. package/lib/test/intervalIndexTestUtils.js +0 -49
  272. package/lib/test/intervalIndexTestUtils.js.map +0 -1
  273. package/lib/test/intervalRebasing.spec.js +0 -589
  274. package/lib/test/intervalRebasing.spec.js.map +0 -1
  275. package/lib/test/intervalStashedOps.spec.js +0 -142
  276. package/lib/test/intervalStashedOps.spec.js.map +0 -1
  277. package/lib/test/intervalTestUtils.js +0 -81
  278. package/lib/test/intervalTestUtils.js.map +0 -1
  279. package/lib/test/marshalling.spec.js +0 -55
  280. package/lib/test/marshalling.spec.js.map +0 -1
  281. package/lib/test/memory/sharedSequence.spec.js +0 -82
  282. package/lib/test/memory/sharedSequence.spec.js.map +0 -1
  283. package/lib/test/memory/sharedString.spec.js +0 -134
  284. package/lib/test/memory/sharedString.spec.js.map +0 -1
  285. package/lib/test/overlappingSequenceIntervalsIndex.spec.js +0 -348
  286. package/lib/test/overlappingSequenceIntervalsIndex.spec.js.map +0 -1
  287. package/lib/test/partialLoad.spec.js +0 -211
  288. package/lib/test/partialLoad.spec.js.map +0 -1
  289. package/lib/test/rebasing.spec.js +0 -81
  290. package/lib/test/rebasing.spec.js.map +0 -1
  291. package/lib/test/reentrancy.spec.js +0 -174
  292. package/lib/test/reentrancy.spec.js.map +0 -1
  293. package/lib/test/revertibles.spec.js +0 -971
  294. package/lib/test/revertibles.spec.js.map +0 -1
  295. package/lib/test/sequenceDeltaEvent.spec.js +0 -2144
  296. package/lib/test/sequenceDeltaEvent.spec.js.map +0 -1
  297. package/lib/test/sharedIntervalCollection.spec.js +0 -159
  298. package/lib/test/sharedIntervalCollection.spec.js.map +0 -1
  299. package/lib/test/sharedString.spec.js +0 -532
  300. package/lib/test/sharedString.spec.js.map +0 -1
  301. package/lib/test/snapshotEmptyProps.spec.js +0 -45
  302. package/lib/test/snapshotEmptyProps.spec.js.map +0 -1
  303. package/lib/test/snapshotVersion.spec.js +0 -149
  304. package/lib/test/snapshotVersion.spec.js.map +0 -1
  305. package/lib/test/startpointInRangeIndex.spec.js +0 -182
  306. package/lib/test/startpointInRangeIndex.spec.js.map +0 -1
  307. package/lib/test/subSequence.spec.js +0 -92
  308. package/lib/test/subSequence.spec.js.map +0 -1
  309. package/lib/test/types/validateSequencePrevious.generated.js +0 -162
  310. package/lib/test/types/validateSequencePrevious.generated.js.map +0 -1
  311. package/lib/test/v1IntervalCollectionHelpers.js +0 -93
  312. package/lib/test/v1IntervalCollectionHelpers.js.map +0 -1
  313. /package/{dist → lib}/tsdoc-metadata.json +0 -0
@@ -1,1820 +0,0 @@
1
- /**
2
- * Supports distributed data structures which are list-like.
3
- *
4
- * This library's main export is {@link SharedString}, a DDS for storing and simultaneously editing a sequence of
5
- * text.
6
- *
7
- * See the package's README for a high-level introduction to `SharedString`'s feature set.
8
- * @remarks Note that SharedString is a sequence DDS but it has additional specialized features and behaviors for
9
- * working with text.
10
- *
11
- * @packageDocumentation
12
- */
13
-
14
- import { BaseSegment } from '@fluidframework/merge-tree';
15
- import { Client } from '@fluidframework/merge-tree';
16
- import { Deferred } from '@fluidframework/core-utils';
17
- import { IChannelAttributes } from '@fluidframework/datastore-definitions';
18
- import { IChannelFactory } from '@fluidframework/datastore-definitions';
19
- import { IChannelServices } from '@fluidframework/datastore-definitions';
20
- import { IChannelStorageService } from '@fluidframework/datastore-definitions';
21
- import { IEvent } from '@fluidframework/core-interfaces';
22
- import { IEventThisPlaceHolder } from '@fluidframework/core-interfaces';
23
- import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
24
- import { IFluidSerializer } from '@fluidframework/shared-object-base';
25
- import { IJSONSegment } from '@fluidframework/merge-tree';
26
- import { IMergeTreeDeltaCallbackArgs } from '@fluidframework/merge-tree';
27
- import { IMergeTreeDeltaOpArgs } from '@fluidframework/merge-tree';
28
- import { IMergeTreeGroupMsg } from '@fluidframework/merge-tree';
29
- import { IMergeTreeMaintenanceCallbackArgs } from '@fluidframework/merge-tree';
30
- import { IRelativePosition } from '@fluidframework/merge-tree';
31
- import { ISegment } from '@fluidframework/merge-tree';
32
- import { ISegmentAction } from '@fluidframework/merge-tree';
33
- import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
34
- import { ISharedObjectEvents } from '@fluidframework/shared-object-base';
35
- import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
36
- import { ITelemetryContext } from '@fluidframework/runtime-definitions';
37
- import { LocalReferencePosition } from '@fluidframework/merge-tree';
38
- import { MapLike } from '@fluidframework/merge-tree';
39
- import { Marker } from '@fluidframework/merge-tree';
40
- import { MergeTreeDeltaOperationType } from '@fluidframework/merge-tree';
41
- import { MergeTreeDeltaOperationTypes } from '@fluidframework/merge-tree';
42
- import { MergeTreeDeltaRevertible } from '@fluidframework/merge-tree';
43
- import { MergeTreeDeltaType } from '@fluidframework/merge-tree';
44
- import { MergeTreeMaintenanceType } from '@fluidframework/merge-tree';
45
- import { MergeTreeRevertibleDriver } from '@fluidframework/merge-tree';
46
- import { PropertiesManager } from '@fluidframework/merge-tree';
47
- import { PropertySet } from '@fluidframework/merge-tree';
48
- import { ReferencePosition } from '@fluidframework/merge-tree';
49
- import { ReferenceType } from '@fluidframework/merge-tree';
50
- import { reservedMarkerIdKey } from '@fluidframework/merge-tree';
51
- import { reservedRangeLabelsKey } from '@fluidframework/merge-tree';
52
- import { reservedTileLabelsKey } from '@fluidframework/merge-tree';
53
- import { Serializable } from '@fluidframework/datastore-definitions';
54
- import { SharedObject } from '@fluidframework/shared-object-base';
55
- import { SlidingPreference } from '@fluidframework/merge-tree';
56
- import { TextSegment } from '@fluidframework/merge-tree';
57
- import { TrackingGroup } from '@fluidframework/merge-tree';
58
- import { TypedEventEmitter } from '@fluid-internal/client-utils';
59
-
60
- /**
61
- * Create revertibles for adding an interval
62
- * @alpha
63
- */
64
- export declare function appendAddIntervalToRevertibles(interval: SequenceInterval, revertibles: SharedStringRevertible[]): SharedStringRevertible[];
65
-
66
- /**
67
- * Create revertibles for moving endpoints of an interval
68
- * @alpha
69
- */
70
- export declare function appendChangeIntervalToRevertibles(string: SharedString, newInterval: SequenceInterval, previousInterval: SequenceInterval, revertibles: SharedStringRevertible[]): SharedStringRevertible[];
71
-
72
- /**
73
- * Create revertibles for deleting an interval
74
- * @alpha
75
- */
76
- export declare function appendDeleteIntervalToRevertibles(string: SharedString, interval: SequenceInterval, revertibles: SharedStringRevertible[]): SharedStringRevertible[];
77
-
78
- /**
79
- * Create revertibles for changing properties of an interval
80
- * @alpha
81
- */
82
- export declare function appendIntervalPropertyChangedToRevertibles(interval: SequenceInterval, deltas: PropertySet, revertibles: SharedStringRevertible[]): SharedStringRevertible[];
83
-
84
- /**
85
- * Create revertibles for SharedStringDeltas, handling indirectly modified intervals
86
- * (e.g. reverting remove of a range that contains an interval will move the interval back)
87
- * @alpha
88
- */
89
- export declare function appendSharedStringDeltaToRevertibles(string: SharedString, delta: SequenceDeltaEvent, revertibles: SharedStringRevertible[]): void;
90
-
91
- export { BaseSegment }
92
-
93
- /**
94
- * @internal
95
- */
96
- export declare function createEndpointIndex(sharedString: SharedString): IEndpointIndex<SequenceInterval>;
97
-
98
- /**
99
- * @internal
100
- */
101
- export declare function createEndpointInRangeIndex(sharedString: SharedString): IEndpointInRangeIndex<SequenceInterval>;
102
-
103
- /**
104
- * @internal
105
- */
106
- export declare function createIdIntervalIndex<TInterval extends ISerializableInterval>(): IIdIntervalIndex<TInterval>;
107
-
108
- /**
109
- * @alpha
110
- */
111
- export declare function createOverlappingIntervalsIndex(sharedString: SharedString): IOverlappingIntervalsIndex<SequenceInterval>;
112
-
113
- /**
114
- * @internal
115
- */
116
- export declare function createOverlappingSequenceIntervalsIndex(sharedString: SharedString): SequenceIntervalIndexes.Overlapping;
117
-
118
- /**
119
- * @internal
120
- */
121
- export declare function createStartpointInRangeIndex(sharedString: SharedString): IStartpointInRangeIndex<SequenceInterval>;
122
-
123
- /**
124
- * @alpha
125
- */
126
- export declare type DeserializeCallback = (properties: PropertySet) => void;
127
-
128
- /**
129
- * Clean up resources held by revertibles that are no longer needed.
130
- * @alpha
131
- */
132
- export declare function discardSharedStringRevertibles(sharedString: SharedString, revertibles: SharedStringRevertible[]): void;
133
-
134
- /**
135
- * Splits the text into regions ending with markers with the given `label`.
136
- * @param sharedString - String to retrieve text and markers from
137
- * @param label - label to split on
138
- * @returns Two parallel lists of text and markers, split by markers with the provided `label`.
139
- * For example:
140
- * ```typescript
141
- * // Say sharedstring has contents "hello<paragraph marker 1>world<paragraph marker 2>missing".
142
- * const { parallelText, parallelMarkers } = getTextAndMarkers(sharedString, "paragraph");
143
- * // parallelText === ["hello", "world"]
144
- * // parallelMarkers === [<paragraph marker 1 object>, <paragraph marker 2 object>]
145
- * // Note parallelText does not include "missing".
146
- * ```
147
- * @internal
148
- */
149
- export declare function getTextAndMarkers(sharedString: SharedString, label: string, start?: number, end?: number): {
150
- parallelText: string[];
151
- parallelMarkers: Marker[];
152
- };
153
-
154
- /**
155
- * @internal
156
- */
157
- export declare interface IEndpointIndex<TInterval extends ISerializableInterval> extends IntervalIndex<TInterval> {
158
- /**
159
- * @returns the previous interval based on the given position number.
160
- * If no such interval exists in this index, returns `undefined`
161
- */
162
- previousInterval(pos: number): TInterval | undefined;
163
- /**
164
- * @returns the next interval based on the given position number.
165
- * If no such interval exists in this index, returns `undefined`
166
- */
167
- nextInterval(pos: number): TInterval | undefined;
168
- }
169
-
170
- /**
171
- * Collection of intervals.
172
- *
173
- * Provide additional APIs to support efficiently querying a collection of intervals whose endpoints fall within a specified range.
174
- * @internal
175
- */
176
- export declare interface IEndpointInRangeIndex<TInterval extends ISerializableInterval> extends IntervalIndex<TInterval> {
177
- /**
178
- * @returns an array of all intervals contained in this collection whose endpoints locate in the range [start, end] (includes both ends)
179
- */
180
- findIntervalsWithEndpointInRange(start: number, end: number): TInterval[];
181
- }
182
-
183
- /**
184
- * @internal
185
- */
186
- export declare interface IIdIntervalIndex<TInterval extends ISerializableInterval> extends IntervalIndex<TInterval>, Iterable<TInterval> {
187
- getIntervalById(id: string): TInterval | undefined;
188
- [Symbol.iterator](): Iterator<TInterval>;
189
- }
190
-
191
- /**
192
- * Basic interval abstraction
193
- * @alpha
194
- */
195
- export declare interface IInterval {
196
- /**
197
- * @returns a new interval object with identical semantics.
198
- */
199
- clone(): IInterval;
200
- /**
201
- * Compares this interval to `b` with standard comparator semantics:
202
- * - returns -1 if this is less than `b`
203
- * - returns 1 if this is greater than `b`
204
- * - returns 0 if this is equivalent to `b`
205
- * @param b - Interval to compare against
206
- */
207
- compare(b: IInterval): number;
208
- /**
209
- * Compares the start endpoint of this interval to `b`'s start endpoint.
210
- * Standard comparator semantics apply.
211
- * @param b - Interval to compare against
212
- */
213
- compareStart(b: IInterval): number;
214
- /**
215
- * Compares the end endpoint of this interval to `b`'s end endpoint.
216
- * Standard comparator semantics apply.
217
- * @param b - Interval to compare against
218
- */
219
- compareEnd(b: IInterval): number;
220
- /**
221
- * Modifies one or more of the endpoints of this interval, returning a new interval representing the result.
222
- */
223
- modify(label: string, start: SequencePlace | undefined, end: SequencePlace | undefined, op?: ISequencedDocumentMessage, localSeq?: number, useNewSlidingBehavior?: boolean): IInterval | undefined;
224
- /**
225
- * @returns whether this interval overlaps with `b`.
226
- * Intervals are considered to overlap if their intersection is non-empty.
227
- */
228
- overlaps(b: IInterval): boolean;
229
- /**
230
- * Unions this interval with `b`, returning a new interval.
231
- * The union operates as a convex hull, i.e. if the two intervals are disjoint, the return value includes
232
- * intermediate values between the two intervals.
233
- */
234
- union(b: IInterval): IInterval;
235
- }
236
-
237
- /**
238
- * Collection of intervals that supports addition, modification, removal, and efficient spatial querying.
239
- * Changes to this collection will be incur updates on collaborating clients (i.e. they are not local-only).
240
- * @alpha
241
- */
242
- export declare interface IIntervalCollection<TInterval extends ISerializableInterval> extends TypedEventEmitter<IIntervalCollectionEvent<TInterval>> {
243
- readonly attached: boolean;
244
- /**
245
- * Attaches an index to this collection.
246
- * All intervals which are part of this collection will be added to the index, and the index will automatically
247
- * be updated when this collection updates due to local or remote changes.
248
- *
249
- * @remarks After attaching an index to an interval collection, applications should typically store this
250
- * index somewhere in their in-memory data model for future reference and querying.
251
- */
252
- attachIndex(index: IntervalIndex<TInterval>): void;
253
- /**
254
- * Detaches an index from this collection.
255
- * All intervals which are part of this collection will be removed from the index, and updates to this collection
256
- * due to local or remote changes will no longer incur updates to the index.
257
- *
258
- * @returns `false` if the target index cannot be found in the indexes, otherwise remove all intervals in the index and return `true`.
259
- */
260
- detachIndex(index: IntervalIndex<TInterval>): boolean;
261
- /**
262
- * @returns the interval in this collection that has the provided `id`.
263
- * If no interval in the collection has this `id`, returns `undefined`.
264
- */
265
- getIntervalById(id: string): TInterval | undefined;
266
- /**
267
- * Creates a new interval and add it to the collection.
268
- * @param start - interval start position (inclusive)
269
- * @param end - interval end position (exclusive)
270
- * @param props - properties of the interval
271
- * @returns - the created interval
272
- * @remarks See documentation on {@link SequenceInterval} for comments on
273
- * interval endpoint semantics: there are subtleties with how the current
274
- * half-open behavior is represented.
275
- *
276
- * Note that intervals may behave unexpectedly if the entire contents
277
- * of the string are deleted. In this case, it is possible for one endpoint
278
- * of the interval to become detached, while the other remains on the string.
279
- *
280
- * By adjusting the `side` and `pos` values of the `start` and `end` parameters,
281
- * it is possible to control whether the interval expands to include content
282
- * inserted at its start or end.
283
- *
284
- * See {@link SequencePlace} for more details on the model.
285
- *
286
- * @example
287
- *
288
- * Given the string "ABCD":
289
- *
290
- *```typescript
291
- * // Refers to "BC". If any content is inserted before B or after C, this
292
- * // interval will include that content
293
- * //
294
- * // Picture:
295
- * // \{start\} - A[- B - C -]D - \{end\}
296
- * // \{start\} - A - B - C - D - \{end\}
297
- * collection.add(\{ pos: 0, side: Side.After \}, \{ pos: 3, side: Side.Before \}, IntervalType.SlideOnRemove);
298
- * // Equivalent to specifying the same positions and Side.Before.
299
- * // Refers to "ABC". Content inserted after C will be included in the
300
- * // interval, but content inserted before A will not.
301
- * // \{start\} -[A - B - C -]D - \{end\}
302
- * // \{start\} - A - B - C - D - \{end\}
303
- * collection.add(0, 3, IntervalType.SlideOnRemove);
304
- *```
305
- *
306
- * In the case of the first example, if text is deleted,
307
- *
308
- * ```typescript
309
- * // Delete the character "B"
310
- * string.removeRange(1, 2);
311
- * ```
312
- *
313
- * The start point of the interval will slide to the position immediately
314
- * before "C", and the same will be true.
315
- *
316
- * ```
317
- * \{start\} - A[- C -]D - \{end\}
318
- * ```
319
- *
320
- * In this case, text inserted immediately before "C" would be included in
321
- * the interval.
322
- *
323
- * ```typescript
324
- * string.insertText(1, "EFG");
325
- * ```
326
- *
327
- * With the string now being,
328
- *
329
- * ```
330
- * \{start\} - A[- E - F - G - C -]D - \{end\}
331
- * ```
332
- *
333
- * @privateRemarks TODO: ADO:5205 the above comment regarding behavior in
334
- * the case that the entire interval has been deleted should be resolved at
335
- * the same time as this ticket
336
- */
337
- add({ start, end, props, }: {
338
- start: SequencePlace;
339
- end: SequencePlace;
340
- props?: PropertySet;
341
- }): TInterval;
342
- /**
343
- * Removes an interval from the collection.
344
- * @param id - Id of the interval to remove
345
- * @returns the removed interval
346
- */
347
- removeIntervalById(id: string): TInterval | undefined;
348
- /**
349
- * Changes the endpoints, properties, or both of an existing interval.
350
- * @param id - Id of the Interval to change
351
- * @returns the interval that was changed, if it existed in the collection.
352
- * Pass the desired new start position, end position, and/or properties in an object. Start and end positions must be changed
353
- * simultaneously - they must either both be specified or both undefined. To only change the properties, leave both endpoints
354
- * undefined. To only change the endpoints, leave the properties undefined.
355
- */
356
- change(id: string, { start, end, props }: {
357
- start?: SequencePlace;
358
- end?: SequencePlace;
359
- props?: PropertySet;
360
- }): TInterval | undefined;
361
- attachDeserializer(onDeserialize: DeserializeCallback): void;
362
- /**
363
- * @returns an iterator over all intervals in this collection.
364
- */
365
- [Symbol.iterator](): Iterator<TInterval>;
366
- /**
367
- * @returns a forward iterator over all intervals in this collection with start point equal to `startPosition`.
368
- */
369
- CreateForwardIteratorWithStartPosition(startPosition: number): Iterator<TInterval>;
370
- /**
371
- * @returns a backward iterator over all intervals in this collection with start point equal to `startPosition`.
372
- */
373
- CreateBackwardIteratorWithStartPosition(startPosition: number): Iterator<TInterval>;
374
- /**
375
- * @returns a forward iterator over all intervals in this collection with end point equal to `endPosition`.
376
- */
377
- CreateForwardIteratorWithEndPosition(endPosition: number): Iterator<TInterval>;
378
- /**
379
- * @returns a backward iterator over all intervals in this collection with end point equal to `endPosition`.
380
- */
381
- CreateBackwardIteratorWithEndPosition(endPosition: number): Iterator<TInterval>;
382
- /**
383
- * Gathers iteration results that optionally match a start/end criteria into the provided array.
384
- * @param results - Array to gather the results into. In lieu of a return value, this array will be populated with
385
- * intervals matching the query upon edit.
386
- * @param iteratesForward - whether or not iteration should be in the forward direction
387
- * @param start - If provided, only match intervals whose start point is equal to `start`.
388
- * @param end - If provided, only match intervals whose end point is equal to `end`.
389
- */
390
- gatherIterationResults(results: TInterval[], iteratesForward: boolean, start?: number, end?: number): void;
391
- /**
392
- * @deprecated - Users must manually attach the corresponding interval index to utilize this functionality, for instance:
393
- *
394
- * ```typescript
395
- * const overlappingIntervalsIndex = createOverlappingIntervalsIndex(sharedString);
396
- * collection.attachIndex(overlappingIntervalsIndex)
397
- * const result = overlappingIntervalsIndex.findOverlappingIntervals(start, end);
398
- * ```
399
- *
400
- * @returns an array of all intervals in this collection that overlap with the interval
401
- * `[startPosition, endPosition]`.
402
- */
403
- findOverlappingIntervals(startPosition: number, endPosition: number): TInterval[];
404
- /**
405
- * Applies a function to each interval in this collection.
406
- */
407
- map(fn: (interval: TInterval) => void): void;
408
- /**
409
- * @deprecated - due to the forthcoming change where the endpointIndex will no longer be
410
- * automatically added to the collection. Users are advised to independently attach the
411
- * index to the collection and utilize the API accordingly, for instance:
412
- * ```typescript
413
- * const endpointIndex = createEndpointIndex(sharedString);
414
- * collection.attachIndex(endpointIndex);
415
- * const result1 = endpointIndex.previousInterval(pos);
416
- * ```
417
- * If an index is used repeatedly, applications should generally attach it once and store it in memory.
418
- */
419
- previousInterval(pos: number): TInterval | undefined;
420
- /**
421
- * @deprecated - due to the forthcoming change where the endpointIndex will no longer be
422
- * automatically added to the collection. Users are advised to independently attach the
423
- * index to the collection and utilize the API accordingly, for instance:
424
- * ```typescript
425
- * const endpointIndex = createEndpointIndex(sharedString);
426
- * collection.attachIndex(endpointIndex);
427
- * const result2 = endpointIndex.nextInterval(pos);
428
- * ```
429
- */
430
- nextInterval(pos: number): TInterval | undefined;
431
- }
432
-
433
- /**
434
- * Change events emitted by `IntervalCollection`s
435
- * @alpha
436
- */
437
- export declare interface IIntervalCollectionEvent<TInterval extends ISerializableInterval> extends IEvent {
438
- /**
439
- * This event is invoked whenever the endpoints of an interval may have changed.
440
- * This can happen on:
441
- * - local endpoint modification
442
- * - ack of a remote endpoint modification
443
- * - position change due to segment sliding (slides due to mergeTree segment deletion will always appear local)
444
- * The `interval` argument reflects the new values.
445
- * `previousInterval` contains transient `ReferencePosition`s at the same location as the interval's original
446
- * endpoints. These references should be used for position information only.
447
- * `local` reflects whether the change originated locally.
448
- * `op` is defined if and only if the server has acked this change.
449
- * `slide` is true if the change is due to sliding on removal of position
450
- */
451
- (event: "changeInterval", listener: (interval: TInterval, previousInterval: TInterval, local: boolean, op: ISequencedDocumentMessage | undefined, slide: boolean) => void): void;
452
- /**
453
- * This event is invoked whenever an interval is added or removed from the collection.
454
- * `local` reflects whether the change originated locally.
455
- * `op` is defined if and only if the server has acked this change.
456
- */
457
- (event: "addInterval" | "deleteInterval", listener: (interval: TInterval, local: boolean, op: ISequencedDocumentMessage | undefined) => void): void;
458
- /**
459
- * This event is invoked whenever an interval's properties have changed.
460
- * `interval` reflects the state of the updated properties.
461
- * `propertyDeltas` is a map-like whose keys contain all values that were changed, and whose
462
- * values contain all previous values of the property set.
463
- * This object can be used directly in a call to `changeProperties` to revert the property change if desired.
464
- * `local` reflects whether the change originated locally.
465
- * `op` is defined if and only if the server has acked this change.
466
- */
467
- (event: "propertyChanged", listener: (interval: TInterval, propertyDeltas: PropertySet, local: boolean, op: ISequencedDocumentMessage | undefined) => void): void;
468
- /**
469
- * This event is invoked whenever an interval's endpoints or properties (or both) have changed.
470
- * `interval` reflects the state of the updated endpoints or properties.
471
- * `propertyDeltas` is a map-like whose keys contain all values that were changed, and whose
472
- * values contain all previous values of the property set.
473
- * This object can be used directly in a call to `changeProperties` to revert the property change if desired.
474
- * 'previousInterval' contains transient `ReferencePosition`s at the same location as the interval's original
475
- * endpoints. These references should be used for position information only. In the case of a property change
476
- * only, this argument should be undefined.
477
- * `local` reflects whether the change originated locally.
478
- * `slide` is true if the change is due to sliding on removal of position.
479
- */
480
- (event: "changed", listener: (interval: TInterval, propertyDeltas: PropertySet, previousInterval: TInterval | undefined, local: boolean, slide: boolean) => void): void;
481
- }
482
-
483
- /**
484
- * @sealed
485
- * @deprecated The methods within have substitutions
486
- * @internal
487
- */
488
- export declare interface IIntervalHelpers<TInterval extends ISerializableInterval> {
489
- /**
490
- *
491
- * @param label - label of the interval collection this interval is being added to. This parameter is
492
- * irrelevant for transient intervals.
493
- * @param start - numerical start position of the interval
494
- * @param end - numerical end position of the interval
495
- * @param client - client creating the interval
496
- * @param intervalType - Type of interval to create. Default is SlideOnRemove
497
- * @param op - If this create came from a remote client, op that created it. Default is undefined (i.e. local)
498
- * @param fromSnapshot - If this create came from loading a snapshot. Default is false.
499
- * @param startSide - The side on which the start position lays. See
500
- * {@link SequencePlace} for additional context
501
- * @param endSide - The side on which the end position lays. See
502
- * {@link SequencePlace} for additional context
503
- */
504
- create(label: string, start: SequencePlace | undefined, end: SequencePlace | undefined, client: Client | undefined, intervalType: IntervalType, op?: ISequencedDocumentMessage, fromSnapshot?: boolean, useNewSlidingBehavior?: boolean): TInterval;
505
- }
506
-
507
- /**
508
- * @deprecated IJSONRunSegment will be removed in a upcoming release. It has been moved to the fluid-experimental/sequence-deprecated package
509
- * @internal
510
- */
511
- export declare interface IJSONRunSegment<T> extends IJSONSegment {
512
- items: Serializable<T>[];
513
- }
514
-
515
- /**
516
- * @internal
517
- */
518
- export declare interface IMapMessageLocalMetadata {
519
- localSeq: number;
520
- }
521
-
522
- /**
523
- * A sequence place that does not refer to the special endpoint segments.
524
- *
525
- * See {@link SequencePlace} for additional context.
526
- * @alpha
527
- */
528
- export declare interface InteriorSequencePlace {
529
- pos: number;
530
- side: Side;
531
- }
532
-
533
- /**
534
- * Serializable interval whose endpoints are plain-old numbers.
535
- * @internal
536
- */
537
- export declare class Interval implements ISerializableInterval {
538
- start: number;
539
- end: number;
540
- /**
541
- * {@inheritDoc ISerializableInterval.properties}
542
- */
543
- properties: PropertySet;
544
- /***/
545
- auxProps: PropertySet[] | undefined;
546
- /**
547
- * {@inheritDoc ISerializableInterval.propertyManager}
548
- */
549
- readonly propertyManager: PropertiesManager;
550
- constructor(start: number, end: number, props?: PropertySet);
551
- /**
552
- * {@inheritDoc ISerializableInterval.getIntervalId}
553
- */
554
- getIntervalId(): string;
555
- /**
556
- * @returns an array containing any auxiliary property sets added with `addPropertySet`.
557
- */
558
- getAdditionalPropertySets(): PropertySet[];
559
- /**
560
- * Adds an auxiliary set of properties to this interval.
561
- * These properties can be recovered using `getAdditionalPropertySets`
562
- * @param props - set of properties to add
563
- * @remarks This gets called as part of the default conflict resolver for `IIntervalCollection<Interval>`
564
- * (i.e. non-sequence-based interval collections). However, the additional properties don't get serialized.
565
- * This functionality seems half-baked.
566
- */
567
- addPropertySet(props: PropertySet): void;
568
- /**
569
- * {@inheritDoc ISerializableInterval.serialize}
570
- */
571
- serialize(): ISerializedInterval;
572
- /**
573
- * {@inheritDoc IInterval.clone}
574
- */
575
- clone(): Interval;
576
- /**
577
- * {@inheritDoc IInterval.compare}
578
- */
579
- compare(b: Interval): number;
580
- /**
581
- * {@inheritDoc IInterval.compareStart}
582
- */
583
- compareStart(b: Interval): number;
584
- /**
585
- * {@inheritDoc IInterval.compareEnd}
586
- */
587
- compareEnd(b: Interval): number;
588
- /**
589
- * {@inheritDoc IInterval.overlaps}
590
- */
591
- overlaps(b: Interval): boolean;
592
- /**
593
- * {@inheritDoc IInterval.union}
594
- */
595
- union(b: Interval): Interval;
596
- getProperties(): PropertySet;
597
- /**
598
- * {@inheritDoc ISerializableInterval.addProperties}
599
- */
600
- addProperties(newProps: PropertySet, collaborating?: boolean, seq?: number): PropertySet | undefined;
601
- /**
602
- * {@inheritDoc IInterval.modify}
603
- */
604
- modify(label: string, start?: SequencePlace, end?: SequencePlace, op?: ISequencedDocumentMessage): Interval | undefined;
605
- }
606
-
607
- /**
608
- * Collection of intervals.
609
- *
610
- * Implementers of this interface will typically implement additional APIs to support efficiently querying a collection
611
- * of intervals in some manner, for example:
612
- * - "find all intervals with start endpoint between these two points"
613
- * - "find all intervals which overlap this range"
614
- * etc.
615
- * @alpha
616
- */
617
- export declare interface IntervalIndex<TInterval extends ISerializableInterval> {
618
- /**
619
- * Adds an interval to the index.
620
- * @remarks Application code should never need to invoke this method on their index for production scenarios:
621
- * Fluid handles adding and removing intervals from an index in response to sequence or interval changes.
622
- */
623
- add(interval: TInterval): void;
624
- /**
625
- * Removes an interval from the index.
626
- * @remarks Application code should never need to invoke this method on their index for production scenarios:
627
- * Fluid handles adding and removing intervals from an index in response to sequence or interval changes.
628
- */
629
- remove(interval: TInterval): void;
630
- }
631
-
632
- /**
633
- * Information that identifies an interval within a `Sequence`.
634
- * @internal
635
- */
636
- export declare interface IntervalLocator {
637
- /**
638
- * Label for the collection the interval is a part of
639
- */
640
- label: string;
641
- /**
642
- * Interval within that collection
643
- */
644
- interval: SequenceInterval;
645
- }
646
-
647
- /**
648
- * Returns an object that can be used to find the interval a given LocalReferencePosition belongs to.
649
- * @returns undefined if the reference position is not the endpoint of any interval (e.g. it was created
650
- * on the merge tree directly by app code), otherwise an {@link IntervalLocator} for the interval this
651
- * endpoint is a part of.
652
- * @internal
653
- */
654
- export declare function intervalLocatorFromEndpoint(potentialEndpoint: LocalReferencePosition): IntervalLocator | undefined;
655
-
656
- /**
657
- * Values are used in revertibles.
658
- * @alpha
659
- */
660
- export declare const IntervalOpType: {
661
- readonly PROPERTY_CHANGED: "propertyChanged";
662
- readonly POSITION_REMOVE: "positionRemove";
663
- readonly ADD: "add";
664
- readonly DELETE: "delete";
665
- readonly CHANGE: "change";
666
- };
667
-
668
- /**
669
- * @alpha
670
- */
671
- export declare type IntervalOpType = (typeof IntervalOpType)[keyof typeof IntervalOpType];
672
-
673
- /**
674
- * Data for undoing edits affecting Intervals.
675
- * @alpha
676
- */
677
- export declare type IntervalRevertible = {
678
- event: typeof IntervalOpType.CHANGE;
679
- interval: SequenceInterval;
680
- start: LocalReferencePosition;
681
- end: LocalReferencePosition;
682
- } | {
683
- event: typeof IntervalOpType.ADD;
684
- interval: SequenceInterval;
685
- } | {
686
- event: typeof IntervalOpType.DELETE;
687
- interval: SequenceInterval;
688
- start: LocalReferencePosition;
689
- end: LocalReferencePosition;
690
- } | {
691
- event: typeof IntervalOpType.PROPERTY_CHANGED;
692
- interval: SequenceInterval;
693
- propertyDeltas: PropertySet;
694
- } | {
695
- event: typeof IntervalOpType.POSITION_REMOVE;
696
- intervals: {
697
- intervalId: string;
698
- label: string;
699
- startOffset?: number;
700
- endOffset?: number;
701
- }[];
702
- revertibleRefs: {
703
- revertible: IntervalRevertible;
704
- offset: number;
705
- isStart: boolean;
706
- }[];
707
- mergeTreeRevertible: MergeTreeDeltaRevertible;
708
- };
709
-
710
- /**
711
- * Determines how an interval should expand when segments are inserted adjacent
712
- * to the range it spans
713
- *
714
- * Note that interval stickiness is currently an experimental feature and must
715
- * be explicitly enabled with the `intervalStickinessEnabled` flag
716
- *
717
- * @alpha
718
- */
719
- export declare const IntervalStickiness: {
720
- /**
721
- * Interval does not expand to include adjacent segments
722
- */
723
- readonly NONE: 0;
724
- /**
725
- * Interval expands to include segments inserted adjacent to the start
726
- */
727
- readonly START: 1;
728
- /**
729
- * Interval expands to include segments inserted adjacent to the end
730
- *
731
- * This is the default stickiness
732
- */
733
- readonly END: 2;
734
- /**
735
- * Interval expands to include all segments inserted adjacent to it
736
- */
737
- readonly FULL: 3;
738
- };
739
-
740
- /**
741
- * Determines how an interval should expand when segments are inserted adjacent
742
- * to the range it spans
743
- *
744
- * Note that interval stickiness is currently an experimental feature and must
745
- * be explicitly enabled with the `intervalStickinessEnabled` flag
746
- * @alpha
747
- */
748
- export declare type IntervalStickiness = (typeof IntervalStickiness)[keyof typeof IntervalStickiness];
749
-
750
- /**
751
- * @alpha
752
- */
753
- export declare enum IntervalType {
754
- Simple = 0,
755
- /**
756
- * SlideOnRemove indicates that the ends of the interval will slide if the segment
757
- * they reference is removed and acked.
758
- * See `packages\dds\merge-tree\docs\REFERENCEPOSITIONS.md` for details
759
- * SlideOnRemove is the default interval behavior and does not need to be specified.
760
- */
761
- SlideOnRemove = 2,
762
- /**
763
- * A temporary interval, used internally
764
- * @internal
765
- */
766
- Transient = 4
767
- }
768
-
769
- /**
770
- * @alpha
771
- */
772
- export declare interface IOverlappingIntervalsIndex<TInterval extends ISerializableInterval> extends IntervalIndex<TInterval> {
773
- /**
774
- * @returns an array of all intervals contained in this collection that overlap the range
775
- * `[start end]`.
776
- */
777
- findOverlappingIntervals(start: SequencePlace, end: SequencePlace): TInterval[];
778
- /**
779
- * Gathers the interval results based on specified parameters.
780
- */
781
- gatherIterationResults(results: TInterval[], iteratesForward: boolean, start?: SequencePlace, end?: SequencePlace): void;
782
- }
783
-
784
- export { ISegment }
785
-
786
- /**
787
- * A range that has changed corresponding to a segment modification.
788
- * @alpha
789
- */
790
- export declare interface ISequenceDeltaRange<TOperation extends MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationTypes> {
791
- /**
792
- * The type of operation that changed this range.
793
- *
794
- * @remarks Consuming code should typically compare this to the enum values defined in
795
- * `MergeTreeDeltaOperationTypes`.
796
- */
797
- operation: TOperation;
798
- /**
799
- * The index of the start of the range.
800
- */
801
- position: number;
802
- /**
803
- * The segment that corresponds to the range.
804
- */
805
- segment: ISegment;
806
- /**
807
- * Deltas object which contains all modified properties with their previous values.
808
- * Since `undefined` doesn't survive a round-trip through JSON serialization, the old value being absent
809
- * is instead encoded with `null`.
810
- *
811
- * @remarks This object is motivated by undo/redo scenarios, and provides a convenient "inverse op" to apply to
812
- * undo a property change.
813
- *
814
- * @example
815
- *
816
- * If a segment initially had properties `{ foo: "1", bar: 2 }` and it was annotated with
817
- * `{ foo: 3, baz: 5 }`, the corresponding event would have a `propertyDeltas` of `{ foo: "1", baz: null }`.
818
- */
819
- propertyDeltas: PropertySet;
820
- }
821
-
822
- /**
823
- * @alpha
824
- */
825
- export declare interface ISerializableInterval extends IInterval {
826
- /** Serializable bag of properties associated with the interval. */
827
- properties: PropertySet;
828
- /***/
829
- propertyManager: PropertiesManager;
830
- /***/
831
- serialize(): ISerializedInterval;
832
- /***/
833
- addProperties(props: PropertySet, collaborating?: boolean, seq?: number): PropertySet | undefined;
834
- /**
835
- * Gets the id associated with this interval.
836
- * When the interval is used as part of an interval collection, this id can be used to modify or remove the
837
- * interval.
838
- * @remarks This signature includes `undefined` strictly for backwards-compatibility reasons, as older versions
839
- * of Fluid didn't always write interval ids.
840
- */
841
- getIntervalId(): string | undefined;
842
- }
843
-
844
- /**
845
- * Serialized object representation of an interval.
846
- * This representation is used for ops that create or change intervals.
847
- * @alpha
848
- */
849
- export declare interface ISerializedInterval {
850
- /**
851
- * Sequence number at which `start` and `end` should be interpreted
852
- *
853
- * @remarks It's unclear that this is necessary to store here.
854
- * This should just be the refSeq on the op that modified the interval, which should be available via other means.
855
- * At the time of writing, it's not plumbed through to the reconnect/rebase code, however, which does need it.
856
- */
857
- sequenceNumber: number;
858
- /** Start position of the interval */
859
- start: number | "start" | "end";
860
- /** End position of the interval */
861
- end: number | "start" | "end";
862
- /** Interval type to create */
863
- intervalType: IntervalType;
864
- /**
865
- * The stickiness of this interval
866
- */
867
- stickiness?: IntervalStickiness;
868
- startSide?: Side;
869
- endSide?: Side;
870
- /** Any properties the interval has */
871
- properties?: PropertySet;
872
- }
873
-
874
- /**
875
- * @alpha
876
- */
877
- export declare interface ISharedIntervalCollection<TInterval extends ISerializableInterval> {
878
- getIntervalCollection(label: string): IIntervalCollection<TInterval>;
879
- }
880
-
881
- /**
882
- * Events emitted in response to changes to the sequence data.
883
- *
884
- * @remarks
885
- *
886
- * The following is the list of events emitted.
887
- *
888
- * ### "sequenceDelta"
889
- *
890
- * The sequenceDelta event is emitted when segments are inserted, annotated, or removed.
891
- *
892
- * #### Listener signature
893
- *
894
- * ```typescript
895
- * (event: SequenceDeltaEvent, target: IEventThisPlaceHolder) => void
896
- * ```
897
- * - `event` - Various information on the segments that were modified.
898
- *
899
- * - `target` - The sequence itself.
900
- *
901
- * ### "maintenance"
902
- *
903
- * The maintenance event is emitted when segments are modified during merge-tree maintenance.
904
- *
905
- * #### Listener signature
906
- *
907
- * ```typescript
908
- * (event: SequenceMaintenanceEvent, target: IEventThisPlaceHolder) => void
909
- * ```
910
- * - `event` - Various information on the segments that were modified.
911
- *
912
- * - `target` - The sequence itself.
913
- * @alpha
914
- */
915
- export declare interface ISharedSegmentSequenceEvents extends ISharedObjectEvents {
916
- (event: "createIntervalCollection", listener: (label: string, local: boolean, target: IEventThisPlaceHolder) => void): void;
917
- (event: "sequenceDelta", listener: (event: SequenceDeltaEvent, target: IEventThisPlaceHolder) => void): void;
918
- (event: "maintenance", listener: (event: SequenceMaintenanceEvent, target: IEventThisPlaceHolder) => void): void;
919
- }
920
-
921
- /**
922
- * Fluid object interface describing access methods on a SharedString
923
- * @alpha
924
- */
925
- export declare interface ISharedString extends SharedSegmentSequence<SharedStringSegment> {
926
- /**
927
- * Inserts the text at the position.
928
- * @param pos - The position to insert the text at
929
- * @param text - The text to insert
930
- * @param props - The properties of the text
931
- */
932
- insertText(pos: number, text: string, props?: PropertySet): void;
933
- /**
934
- * Inserts a marker at the position.
935
- * @param pos - The position to insert the marker at
936
- * @param refType - The reference type of the marker
937
- * @param props - The properties of the marker
938
- */
939
- insertMarker(pos: number, refType: ReferenceType, props?: PropertySet): void;
940
- /**
941
- * {@inheritDoc SharedSegmentSequence.posFromRelativePos}
942
- */
943
- posFromRelativePos(relativePos: IRelativePosition): number;
944
- }
945
-
946
- /**
947
- * Collection of intervals.
948
- *
949
- * Provide additional APIs to support efficiently querying a collection of intervals whose startpoints fall within a specified range.
950
- * @internal
951
- */
952
- export declare interface IStartpointInRangeIndex<TInterval extends ISerializableInterval> extends IntervalIndex<TInterval> {
953
- /**
954
- * @returns an array of all intervals contained in this collection whose startpoints locate in the range [start, end] (includes both ends)
955
- */
956
- findIntervalsWithStartpointInRange(start: number, end: number): TInterval[];
957
- }
958
-
959
- /**
960
- * Value types are given an IValueOpEmitter to emit their ops through the container type that holds them.
961
- * @internal
962
- * @deprecated - will be remove from public api as there is no public used of this type
963
- */
964
- export declare interface IValueOpEmitter {
965
- /**
966
- * Called by the value type to emit a value type operation through the container type holding it.
967
- * @param opName - Name of the emitted operation
968
- * @param previousValue - JSONable previous value as defined by the value type @deprecated unused
969
- * @param params - JSONable params for the operation as defined by the value type
970
- * @param localOpMetadata - JSONable local metadata which should be submitted with the op
971
- */
972
- emit(opName: IntervalOpType, previousValue: undefined, params: SerializedIntervalDelta, localOpMetadata: IMapMessageLocalMetadata): void;
973
- }
974
-
975
- export { LocalReferencePosition }
976
-
977
- export { MapLike }
978
-
979
- export { Marker }
980
-
981
- export { MergeTreeDeltaType }
982
-
983
- export { PropertySet }
984
-
985
- export { ReferencePosition }
986
-
987
- export { ReferenceType }
988
-
989
- export { reservedMarkerIdKey }
990
-
991
- export { reservedRangeLabelsKey }
992
-
993
- export { reservedTileLabelsKey }
994
-
995
- /**
996
- * Invoke revertibles to reverse prior edits
997
- * @alpha
998
- */
999
- export declare function revertSharedStringRevertibles(sharedString: SharedString, revertibles: SharedStringRevertible[]): void;
1000
-
1001
- /**
1002
- * The event object returned on sequenceDelta events.
1003
- *
1004
- * The properties of this object and its sub-objects represent the state of the sequence at the
1005
- * point in time at which the operation was applied.
1006
- * They will not take into consideration any future modifications performed to the underlying sequence and merge tree.
1007
- *
1008
- * For group ops, each op will get its own event, and the group op property will be set on the op args.
1009
- *
1010
- * Ops may get multiple events. For instance, an insert-replace will get a remove then an insert event.
1011
- * @alpha
1012
- */
1013
- export declare class SequenceDeltaEvent extends SequenceEvent<MergeTreeDeltaOperationType> {
1014
- readonly opArgs: IMergeTreeDeltaOpArgs;
1015
- /**
1016
- * Whether the event was caused by a locally-made change.
1017
- */
1018
- readonly isLocal: boolean;
1019
- constructor(opArgs: IMergeTreeDeltaOpArgs, deltaArgs: IMergeTreeDeltaCallbackArgs, mergeTreeClient: Client);
1020
- }
1021
-
1022
- /**
1023
- * Base class for SequenceDeltaEvent and SequenceMaintenanceEvent.
1024
- *
1025
- * The properties of this object and its sub-objects represent the state of the sequence at the
1026
- * point in time at which the operation was applied.
1027
- * They will not take into any future modifications performed to the underlying sequence and merge tree.
1028
- * @alpha
1029
- */
1030
- export declare abstract class SequenceEvent<TOperation extends MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationTypes> {
1031
- readonly deltaArgs: IMergeTreeDeltaCallbackArgs<TOperation>;
1032
- private readonly mergeTreeClient;
1033
- readonly deltaOperation: TOperation;
1034
- private readonly sortedRanges;
1035
- private readonly pFirst;
1036
- private readonly pLast;
1037
- constructor(deltaArgs: IMergeTreeDeltaCallbackArgs<TOperation>, mergeTreeClient: Client);
1038
- /**
1039
- * The in-order ranges affected by this delta.
1040
- * These may not be continuous.
1041
- */
1042
- get ranges(): readonly Readonly<ISequenceDeltaRange<TOperation>>[];
1043
- /**
1044
- * The client id of the client that made the change which caused the delta event
1045
- */
1046
- get clientId(): string | undefined;
1047
- /**
1048
- * The first of the modified ranges.
1049
- */
1050
- get first(): Readonly<ISequenceDeltaRange<TOperation>>;
1051
- /**
1052
- * The last of the modified ranges.
1053
- */
1054
- get last(): Readonly<ISequenceDeltaRange<TOperation>>;
1055
- }
1056
-
1057
- /**
1058
- * Interval implementation whose ends are associated with positions in a mutatable sequence.
1059
- * As such, when content is inserted into the middle of the interval, the interval expands to
1060
- * include that content.
1061
- *
1062
- * @remarks The endpoints' positions should be treated exclusively to get
1063
- * reasonable behavior. E.g., an interval referring to "hello" in "hello world"
1064
- * should have a start position of 0 and an end position of 5.
1065
- *
1066
- * To see why, consider what happens if "llo wor" is removed from the string to make "held".
1067
- * The interval's startpoint remains on the "h" (it isn't altered), but the interval's endpoint
1068
- * slides forward to the next unremoved position, which is the "l" in "held".
1069
- * Users would generally expect the interval to now refer to "he" (as it is the subset of content
1070
- * remaining after the removal), hence the "l" should be excluded.
1071
- * If the interval endpoint was treated inclusively, the interval would now refer to "hel", which
1072
- * is undesirable.
1073
- *
1074
- * Since the endpoints of an interval are treated exclusively but cannot be greater
1075
- * than or equal to the length of the associated sequence, there exist special
1076
- * endpoint segments, "start" and "end", which represent the position immediately
1077
- * before or immediately after the string respectively.
1078
- *
1079
- * If a `SequenceInterval` is created on a sequence with the
1080
- * `mergeTreeReferencesCanSlideToEndpoint` feature flag set to true, the endpoints
1081
- * of the interval that are exclusive will have the ability to slide to these
1082
- * special endpoint segments.
1083
- * @alpha
1084
- */
1085
- export declare class SequenceInterval implements ISerializableInterval {
1086
- private readonly client;
1087
- /**
1088
- * Start endpoint of this interval.
1089
- * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.
1090
- */
1091
- start: LocalReferencePosition;
1092
- /**
1093
- * End endpoint of this interval.
1094
- * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.
1095
- */
1096
- end: LocalReferencePosition;
1097
- intervalType: IntervalType;
1098
- readonly startSide: Side;
1099
- readonly endSide: Side;
1100
- /**
1101
- * {@inheritDoc ISerializableInterval.properties}
1102
- */
1103
- properties: PropertySet;
1104
- /**
1105
- * {@inheritDoc ISerializableInterval.propertyManager}
1106
- */
1107
- propertyManager: PropertiesManager;
1108
- /***/
1109
- get stickiness(): IntervalStickiness;
1110
- constructor(client: Client,
1111
- /**
1112
- * Start endpoint of this interval.
1113
- * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.
1114
- */
1115
- start: LocalReferencePosition,
1116
- /**
1117
- * End endpoint of this interval.
1118
- * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.
1119
- */
1120
- end: LocalReferencePosition, intervalType: IntervalType, props?: PropertySet, startSide?: Side, endSide?: Side);
1121
- private callbacks?;
1122
- /**
1123
- * Subscribes to position change events on this interval if there are no current listeners.
1124
- */
1125
- addPositionChangeListeners(beforePositionChange: () => void, afterPositionChange: () => void): void;
1126
- /**
1127
- * Removes the currently subscribed position change listeners.
1128
- */
1129
- removePositionChangeListeners(): void;
1130
- /**
1131
- * {@inheritDoc ISerializableInterval.serialize}
1132
- */
1133
- serialize(): ISerializedInterval;
1134
- /**
1135
- * {@inheritDoc IInterval.clone}
1136
- */
1137
- clone(): SequenceInterval;
1138
- /**
1139
- * {@inheritDoc IInterval.compare}
1140
- */
1141
- compare(b: SequenceInterval): number;
1142
- /**
1143
- * {@inheritDoc IInterval.compareStart}
1144
- */
1145
- compareStart(b: SequenceInterval): number;
1146
- /**
1147
- * {@inheritDoc IInterval.compareEnd}
1148
- */
1149
- compareEnd(b: SequenceInterval): number;
1150
- /**
1151
- * {@inheritDoc IInterval.overlaps}
1152
- */
1153
- overlaps(b: SequenceInterval): boolean;
1154
- /**
1155
- * {@inheritDoc ISerializableInterval.getIntervalId}
1156
- */
1157
- getIntervalId(): string;
1158
- /**
1159
- * {@inheritDoc IInterval.union}
1160
- */
1161
- union(b: SequenceInterval): SequenceInterval;
1162
- /**
1163
- * {@inheritDoc ISerializableInterval.addProperties}
1164
- */
1165
- addProperties(newProps: PropertySet, collab?: boolean, seq?: number): PropertySet | undefined;
1166
- /**
1167
- * @returns whether this interval overlaps two numerical positions.
1168
- */
1169
- overlapsPos(bstart: number, bend: number): boolean;
1170
- /**
1171
- * {@inheritDoc IInterval.modify}
1172
- */
1173
- modify(label: string, start: SequencePlace | undefined, end: SequencePlace | undefined, op?: ISequencedDocumentMessage, localSeq?: number, useNewSlidingBehavior?: boolean): SequenceInterval;
1174
- }
1175
-
1176
- /**
1177
- * @deprecated The methods within have substitutions
1178
- * @internal
1179
- */
1180
- export declare const sequenceIntervalHelpers: IIntervalHelpers<SequenceInterval>;
1181
-
1182
- /**
1183
- * This namespace contains specialiazations of indexes which support spatial queries
1184
- * specifically for `SequenceInterval`s.
1185
- * @internal
1186
- */
1187
- export declare namespace SequenceIntervalIndexes {
1188
- /**
1189
- * Collection of intervals.
1190
- *
1191
- * Provides additional APIs to support efficiently querying a collection of intervals based on segments and offset.
1192
- * @internal
1193
- */
1194
- export interface Overlapping extends IOverlappingIntervalsIndex<SequenceInterval> {
1195
- /**
1196
- * Finds overlapping intervals within the specified range.
1197
- *
1198
- * @returns an array of all intervals that overlap with the specified SegOff range (includes both ends)
1199
- */
1200
- findOverlappingIntervalsBySegoff(startSegoff: {
1201
- segment: ISegment | undefined;
1202
- offset: number | undefined;
1203
- }, endSegoff: {
1204
- segment: ISegment | undefined;
1205
- offset: number | undefined;
1206
- }): Iterable<SequenceInterval>;
1207
- }
1208
- }
1209
-
1210
- /**
1211
- * The event object returned on maintenance events.
1212
- *
1213
- * The properties of this object and its sub-objects represent the state of the sequence at the
1214
- * point in time at which the operation was applied.
1215
- * They will not take into consideration any future modifications performed to the underlying sequence and merge tree.
1216
- * @alpha
1217
- */
1218
- export declare class SequenceMaintenanceEvent extends SequenceEvent<MergeTreeMaintenanceType> {
1219
- readonly opArgs: IMergeTreeDeltaOpArgs | undefined;
1220
- constructor(opArgs: IMergeTreeDeltaOpArgs | undefined, deltaArgs: IMergeTreeMaintenanceCallbackArgs, mergeTreeClient: Client);
1221
- }
1222
-
1223
- /**
1224
- * Optional flags that configure options for sequence DDSs
1225
- * @internal
1226
- */
1227
- export declare interface SequenceOptions {
1228
- /**
1229
- * Enable the ability to use interval APIs that rely on positions before and
1230
- * after individual characters, referred to as "sides". See {@link SequencePlace}
1231
- * for additional context.
1232
- *
1233
- * This flag must be enabled to pass instances of {@link SequencePlace} to
1234
- * any IIntervalCollection API.
1235
- *
1236
- * Also see the feature flag `mergeTreeReferencesCanSlideToEndpoint` to allow
1237
- * endpoints to slide to the special endpoint segments.
1238
- *
1239
- * The default value is false.
1240
- */
1241
- intervalStickinessEnabled: boolean;
1242
- /**
1243
- * Enable the ability for interval endpoints to slide to the special endpoint
1244
- * segments that exist before and after the bounds of the string. This is
1245
- * primarily useful for workflows involving interval stickiness, and it is
1246
- * suggested to enable both this flag and `intervalStickinessEnabled` at the
1247
- * same time.
1248
- *
1249
- * The default value is false.
1250
- */
1251
- mergeTreeReferencesCanSlideToEndpoint: boolean;
1252
- [key: string]: boolean;
1253
- }
1254
-
1255
- /**
1256
- * Defines a position and side relative to a character in a sequence.
1257
- *
1258
- * For this purpose, sequences look like:
1259
- *
1260
- * `{start} - {character 0} - {character 1} - ... - {character N} - {end}`
1261
- *
1262
- * Each `{value}` in the diagram is a character within a sequence.
1263
- * Each `-` in the above diagram is a position where text could be inserted.
1264
- * Each position between a `{value}` and a `-` is a `SequencePlace`.
1265
- *
1266
- * The special endpoints `{start}` and `{end}` refer to positions outside the
1267
- * contents of the string.
1268
- *
1269
- * This gives us 2N + 2 possible positions to refer to within a string, where N
1270
- * is the number of characters.
1271
- *
1272
- * If the position is specified with a bare number, the side defaults to
1273
- * `Side.Before`.
1274
- *
1275
- * If a SequencePlace is the endpoint of a range (e.g. start/end of an interval or search range),
1276
- * the Side value means it is exclusive if it is nearer to the other position and inclusive if it is farther.
1277
- * E.g. the start of a range with Side.After is exclusive of the character at the position.
1278
- * @alpha
1279
- */
1280
- export declare type SequencePlace = number | "start" | "end" | InteriorSequencePlace;
1281
-
1282
- /**
1283
- * Represents a change that should be applied to an existing interval.
1284
- * Changes can modify any of start/end/properties, with `undefined` signifying no change should be made.
1285
- * @internal
1286
- */
1287
- export declare type SerializedIntervalDelta = Omit<ISerializedInterval, "start" | "end" | "properties"> & Partial<Pick<ISerializedInterval, "start" | "end" | "properties">>;
1288
-
1289
- /**
1290
- * @deprecated `SharedIntervalCollection` is not maintained and is planned to be removed.
1291
- * @internal
1292
- */
1293
- export declare class SharedIntervalCollection extends SharedObject implements ISharedIntervalCollection<Interval> {
1294
- /**
1295
- * Create a SharedIntervalCollection
1296
- *
1297
- * @param runtime - data store runtime the new shared map belongs to
1298
- * @param id - optional name of the shared map
1299
- * @returns newly create shared map (but not attached yet)
1300
- */
1301
- static create(runtime: IFluidDataStoreRuntime, id?: string): SharedIntervalCollection;
1302
- /**
1303
- * Get a factory for SharedIntervalCollection to register with the data store.
1304
- *
1305
- * @returns a factory that creates and load SharedIntervalCollection
1306
- */
1307
- static getFactory(): IChannelFactory;
1308
- readonly [Symbol.toStringTag]: string;
1309
- private readonly intervalCollections;
1310
- /**
1311
- * Constructs a new shared SharedIntervalCollection. If the object is non-local an id and service interfaces will
1312
- * be provided
1313
- */
1314
- constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
1315
- getIntervalCollection(label: string): IIntervalCollection<Interval>;
1316
- protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
1317
- protected reSubmitCore(content: any, localOpMetadata: unknown): void;
1318
- protected onDisconnect(): void;
1319
- /**
1320
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
1321
- */
1322
- protected loadCore(storage: IChannelStorageService): Promise<void>;
1323
- protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
1324
- /**
1325
- * Creates the full path of the intervalCollection label
1326
- * @param label - the incoming label
1327
- */
1328
- protected getIntervalCollectionPath(label: string): string;
1329
- protected applyStashedOp(): void;
1330
- }
1331
-
1332
- /**
1333
- * The factory that defines the SharedIntervalCollection.
1334
- * @deprecated `SharedIntervalCollection` is not maintained and is planned to be removed.
1335
- * @internal
1336
- */
1337
- export declare class SharedIntervalCollectionFactory implements IChannelFactory {
1338
- static readonly Type = "https://graph.microsoft.com/types/sharedIntervalCollection";
1339
- static readonly Attributes: IChannelAttributes;
1340
- get type(): string;
1341
- get attributes(): IChannelAttributes;
1342
- /**
1343
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
1344
- */
1345
- load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<SharedIntervalCollection>;
1346
- create(runtime: IFluidDataStoreRuntime, id: string): SharedIntervalCollection;
1347
- }
1348
-
1349
- /**
1350
- * @alpha
1351
- */
1352
- export declare abstract class SharedSegmentSequence<T extends ISegment> extends SharedObject<ISharedSegmentSequenceEvents> implements ISharedIntervalCollection<SequenceInterval>, MergeTreeRevertibleDriver {
1353
- private readonly dataStoreRuntime;
1354
- id: string;
1355
- readonly segmentFromSpec: (spec: IJSONSegment) => ISegment;
1356
- get loaded(): Promise<void>;
1357
- /**
1358
- * This is a safeguard to avoid problematic reentrancy of local ops. This type of scenario occurs if the user of SharedString subscribes
1359
- * to the `sequenceDelta` event and uses the callback for a local op to submit further local ops.
1360
- * Historically (before 2.0.0-internal.6.1.0), doing so would result in eventual consistency issues or a corrupted document.
1361
- * These issues were fixed in #16815 which makes such reentrancy no different from applying the ops in order but not from within the change events,
1362
- * but there is still little test coverage for reentrant scenarios.
1363
- * Additionally, applications submitting ops from inside change events need to take extreme care that their data models also support reentrancy.
1364
- * Since this is likely not the case, by default SharedString throws when encountering reentrant ops.
1365
- *
1366
- * An application using SharedString which explicitly wants to opt in to allowing reentrancy anyway can set `sharedStringPreventReentrancy`
1367
- * on the data store options to `false`.
1368
- */
1369
- protected guardReentrancy: <TRet>(callback: () => TRet) => TRet;
1370
- private static createOpsFromDelta;
1371
- /**
1372
- * Note: this field only provides a lower-bound on the reference sequence numbers for in-flight ops.
1373
- * The exact reason isn't understood, but some e2e tests suggest that the runtime may sometimes process
1374
- * incoming leave/join ops before putting an op that this DDS submits over the wire.
1375
- *
1376
- * E.g. SharedString submits an op while deltaManager has lastSequenceNumber = 10, but before the runtime
1377
- * puts this op over the wire, it processes a client join/leave op with sequence number 11, so the referenceSequenceNumber
1378
- * on the SharedString op is 11.
1379
- *
1380
- * The reference sequence numbers placed in this queue are also not accurate for stashed ops due to how the applyStashedOp
1381
- * flow works at the runtime level. This is a legitimate bug, and AB#6602 tracks one way to fix it (stop reaching all the way
1382
- * to deltaManager's lastSequenceNumber to obtain refSeq, instead leveraging some analogous notion on the container or datastore
1383
- * runtime).
1384
- */
1385
- private readonly inFlightRefSeqs;
1386
- private ongoingResubmitRefSeq;
1387
- /**
1388
- * Gets the reference sequence number (i.e. sequence number of the runtime's last processed op) for an op submitted
1389
- * in the current context.
1390
- *
1391
- * This value can be optionally overridden using `useResubmitRefSeq`.
1392
- * IntervalCollection's resubmit logic currently relies on preserving merge information from when the op was originally submitted,
1393
- * even if the op is resubmitted more than once. Thus during resubmit, `inFlightRefSeqs` gets populated with the
1394
- * original refSeq rather than the refSeq at the time of reconnection.
1395
- *
1396
- * @remarks - In some not fully understood cases, the runtime may process incoming ops before putting an op that this
1397
- * DDS submits over the wire. See `inFlightRefSeqs` for more details.
1398
- */
1399
- private get currentRefSeq();
1400
- protected client: Client;
1401
- /** `Deferred` that triggers once the object is loaded */
1402
- protected loadedDeferred: Deferred<void>;
1403
- private readonly loadedDeferredOutgoingOps;
1404
- private deferIncomingOps;
1405
- private readonly loadedDeferredIncomingOps;
1406
- private messagesSinceMSNChange;
1407
- private readonly intervalCollections;
1408
- constructor(dataStoreRuntime: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes, segmentFromSpec: (spec: IJSONSegment) => ISegment);
1409
- /**
1410
- * @param start - The inclusive start of the range to remove
1411
- * @param end - The exclusive end of the range to remove
1412
- */
1413
- removeRange(start: number, end: number): void;
1414
- /**
1415
- * Obliterate is similar to remove, but differs in that segments concurrently
1416
- * inserted into an obliterated range will also be removed
1417
- *
1418
- * @param start - The inclusive start of the range to obliterate
1419
- * @param end - The exclusive end of the range to obliterate
1420
- */
1421
- obliterateRange(start: number, end: number): void;
1422
- /**
1423
- * @deprecated The ability to create group ops will be removed in an upcoming
1424
- * release, as group ops are redundant with the native batching capabilities
1425
- * of the runtime
1426
- */
1427
- groupOperation(groupOp: IMergeTreeGroupMsg): void;
1428
- /**
1429
- * Finds the segment information (i.e. segment + offset) corresponding to a character position in the SharedString.
1430
- * If the position is past the end of the string, `segment` and `offset` on the returned object may be undefined.
1431
- * @param pos - Character position (index) into the current local view of the SharedString.
1432
- */
1433
- getContainingSegment(pos: number): {
1434
- segment: T | undefined;
1435
- offset: number | undefined;
1436
- };
1437
- /**
1438
- * Returns the length of the current sequence for the client
1439
- */
1440
- getLength(): number;
1441
- /**
1442
- * Returns the current position of a segment, and -1 if the segment
1443
- * does not exist in this sequence
1444
- * @param segment - The segment to get the position of
1445
- */
1446
- getPosition(segment: ISegment): number;
1447
- /**
1448
- * Annotates the range with the provided properties
1449
- *
1450
- * @param start - The inclusive start position of the range to annotate
1451
- * @param end - The exclusive end position of the range to annotate
1452
- * @param props - The properties to annotate the range with
1453
- *
1454
- */
1455
- annotateRange(start: number, end: number, props: PropertySet): void;
1456
- getPropertiesAtPosition(pos: number): PropertySet | undefined;
1457
- getRangeExtentsOfPosition(pos: number): {
1458
- posStart: number | undefined;
1459
- posAfterEnd: number | undefined;
1460
- };
1461
- /**
1462
- * Creates a `LocalReferencePosition` on this SharedString. If the refType does not include
1463
- * ReferenceType.Transient, the returned reference will be added to the localRefs on the provided segment.
1464
- * @param segment - Segment to add the local reference on
1465
- * @param offset - Offset on the segment at which to place the local reference
1466
- * @param refType - ReferenceType for the created local reference
1467
- * @param properties - PropertySet to place on the created local reference
1468
- */
1469
- createLocalReferencePosition(segment: T, offset: number, refType: ReferenceType, properties: PropertySet | undefined, slidingPreference?: SlidingPreference, canSlideToEndpoint?: boolean): LocalReferencePosition;
1470
- /**
1471
- * Resolves a `ReferencePosition` into a character position using this client's perspective.
1472
- *
1473
- * Reference positions that point to a character that has been removed will
1474
- * always return the position of the nearest non-removed character, regardless
1475
- * of `ReferenceType`. To handle this case specifically, one may wish
1476
- * to look at the segment returned by `ReferencePosition.getSegment`.
1477
- */
1478
- localReferencePositionToPosition(lref: ReferencePosition): number;
1479
- /**
1480
- * Removes a `LocalReferencePosition` from this SharedString.
1481
- */
1482
- removeLocalReferencePosition(lref: LocalReferencePosition): LocalReferencePosition | undefined;
1483
- /**
1484
- * Resolves a remote client's position against the local sequence
1485
- * and returns the remote client's position relative to the local
1486
- * sequence. The client ref seq must be above the minimum sequence number
1487
- * or the return value will be undefined.
1488
- * Generally this method is used in conjunction with signals which provide
1489
- * point in time values for the below parameters, and is useful for things
1490
- * like displaying user position. It should not be used with persisted values
1491
- * as persisted values will quickly become invalid as the remoteClientRefSeq
1492
- * moves below the minimum sequence number
1493
- * @param remoteClientPosition - The remote client's position to resolve
1494
- * @param remoteClientRefSeq - The reference sequence number of the remote client
1495
- * @param remoteClientId - The client id of the remote client
1496
- */
1497
- resolveRemoteClientPosition(remoteClientPosition: number, remoteClientRefSeq: number, remoteClientId: string): number | undefined;
1498
- private submitSequenceMessage;
1499
- /**
1500
- * Given a position specified relative to a marker id, lookup the marker
1501
- * and convert the position to a character position.
1502
- * @param relativePos - Id of marker (may be indirect) and whether position is before or after marker.
1503
- */
1504
- posFromRelativePos(relativePos: IRelativePosition): number;
1505
- /**
1506
- * Walk the underlying segments of the sequence.
1507
- * The walked segments may extend beyond the range if the segments cross the
1508
- * ranges start or end boundaries.
1509
- *
1510
- * Set split range to true to ensure only segments within the range are walked.
1511
- *
1512
- * @param handler - The function to handle each segment. Traversal ends if
1513
- * this function returns true.
1514
- * @param start - Optional. The start of range walk.
1515
- * @param end - Optional. The end of range walk
1516
- * @param accum - Optional. An object that will be passed to the handler for accumulation
1517
- * @param splitRange - Optional. Splits boundary segments on the range boundaries
1518
- */
1519
- walkSegments<TClientData>(handler: ISegmentAction<TClientData>, start?: number, end?: number, accum?: TClientData, splitRange?: boolean): void;
1520
- /**
1521
- * @returns The most recent sequence number which has been acked by the server and processed by this
1522
- * SharedSegmentSequence.
1523
- */
1524
- getCurrentSeq(): number;
1525
- /**
1526
- * Inserts a segment directly before a `ReferencePosition`.
1527
- * @param refPos - The reference position to insert the segment at
1528
- * @param segment - The segment to insert
1529
- */
1530
- insertAtReferencePosition(pos: ReferencePosition, segment: T): void;
1531
- /**
1532
- * Inserts a segment
1533
- * @param start - The position to insert the segment at
1534
- * @param spec - The segment to inserts spec
1535
- */
1536
- insertFromSpec(pos: number, spec: IJSONSegment): void;
1537
- /**
1538
- * Retrieves the interval collection keyed on `label`. If no such interval collection exists,
1539
- * creates one.
1540
- */
1541
- getIntervalCollection(label: string): IIntervalCollection<SequenceInterval>;
1542
- /**
1543
- * @returns An iterable object that enumerates the IntervalCollection labels.
1544
- *
1545
- * @example
1546
- *
1547
- * ```typescript
1548
- * const iter = this.getIntervalCollectionKeys();
1549
- * for (key of iter)
1550
- * const collection = this.getIntervalCollection(key);
1551
- * ...
1552
- * ```
1553
- */
1554
- getIntervalCollectionLabels(): IterableIterator<string>;
1555
- /**
1556
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
1557
- */
1558
- protected summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
1559
- /**
1560
- * Runs serializer over the GC data for this SharedMatrix.
1561
- * All the IFluidHandle's represent routes to other objects.
1562
- */
1563
- protected processGCDataCore(serializer: IFluidSerializer): void;
1564
- /**
1565
- * Replace the range specified from start to end with the provided segment
1566
- * This is done by inserting the segment at the end of the range, followed
1567
- * by removing the contents of the range
1568
- * For a zero or reverse range (start \>= end), insert at end do not remove anything
1569
- * @param start - The start of the range to replace
1570
- * @param end - The end of the range to replace
1571
- * @param segment - The segment that will replace the range
1572
- */
1573
- protected replaceRange(start: number, end: number, segment: ISegment): void;
1574
- /**
1575
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onConnect}
1576
- */
1577
- protected onConnect(): void;
1578
- /**
1579
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
1580
- */
1581
- protected onDisconnect(): void;
1582
- /**
1583
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}
1584
- */
1585
- protected reSubmitCore(content: any, localOpMetadata: unknown): void;
1586
- /**
1587
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
1588
- */
1589
- protected loadCore(storage: IChannelStorageService): Promise<void>;
1590
- /**
1591
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
1592
- */
1593
- protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
1594
- /**
1595
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.didAttach}
1596
- */
1597
- protected didAttach(): void;
1598
- /**
1599
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.initializeLocalCore}
1600
- */
1601
- protected initializeLocalCore(): void;
1602
- /**
1603
- * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
1604
- */
1605
- protected applyStashedOp(content: any): void;
1606
- private summarizeMergeTree;
1607
- /**
1608
- *
1609
- * @param message - Message with decoded and hydrated handles
1610
- */
1611
- private processMergeTreeMsg;
1612
- private processMinSequenceNumberChanged;
1613
- private loadFinished;
1614
- private initializeIntervalCollections;
1615
- /**
1616
- * Overrides the "currently applicable reference sequence number" for the duration of the callback.
1617
- * See remarks on `currentRefSeq` for more context.
1618
- */
1619
- private useResubmitRefSeq;
1620
- }
1621
-
1622
- /**
1623
- * @deprecated SharedSequence will be removed in a upcoming release. It has been moved to the fluid-experimental/sequence-deprecated package
1624
- * @internal
1625
- */
1626
- export declare class SharedSequence<T> extends SharedSegmentSequence<SubSequence<T>> {
1627
- id: string;
1628
- constructor(document: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes, specToSegment: (spec: IJSONSegment) => ISegment);
1629
- /**
1630
- * @param pos - The position to insert the items at.
1631
- * @param items - The items to insert.
1632
- * @param props - Optional. Properties to set on the inserted items.
1633
- */
1634
- insert(pos: number, items: Serializable<T>[], props?: PropertySet): void;
1635
- /**
1636
- * @param start - The inclusive start of the range to remove
1637
- * @param end - The exclusive end of the range to remove
1638
- */
1639
- remove(start: number, end: number): void;
1640
- /**
1641
- * Returns the total count of items in the sequence
1642
- */
1643
- getItemCount(): number;
1644
- /**
1645
- * Gets the items in the specified range
1646
- *
1647
- * @param start - The inclusive start of the range
1648
- * @param end - The exclusive end of the range
1649
- */
1650
- getItems(start: number, end?: number): Serializable<T>[];
1651
- }
1652
-
1653
- /**
1654
- * The Shared String is a specialized data structure for handling collaborative
1655
- * text. It is based on a more general Sequence data structure but has
1656
- * additional features that make working with text easier.
1657
- *
1658
- * In addition to text, a Shared String can also contain markers. Markers can be
1659
- * used to store metadata at positions within the text, like the details of an
1660
- * image or Fluid object that should be rendered with the text.
1661
- * @alpha
1662
- */
1663
- export declare class SharedString extends SharedSegmentSequence<SharedStringSegment> implements ISharedString {
1664
- id: string;
1665
- /**
1666
- * Create a new shared string.
1667
- * @param runtime - data store runtime the new shared string belongs to
1668
- * @param id - optional name of the shared string
1669
- * @returns newly create shared string (but not attached yet)
1670
- */
1671
- static create(runtime: IFluidDataStoreRuntime, id?: string): SharedString;
1672
- /**
1673
- * Get a factory for SharedString to register with the data store.
1674
- * @returns a factory that creates and load SharedString
1675
- */
1676
- static getFactory(): SharedStringFactory;
1677
- get ISharedString(): ISharedString;
1678
- private readonly mergeTreeTextHelper;
1679
- constructor(document: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes);
1680
- /**
1681
- * Inserts a marker at a relative position.
1682
- * @param relativePos1 - The relative position to insert the marker at
1683
- * @param refType - The reference type of the marker
1684
- * @param props - The properties of the marker
1685
- */
1686
- insertMarkerRelative(relativePos1: IRelativePosition, refType: ReferenceType, props?: PropertySet): void;
1687
- /**
1688
- * {@inheritDoc ISharedString.insertMarker}
1689
- */
1690
- insertMarker(pos: number, refType: ReferenceType, props?: PropertySet): void;
1691
- /**
1692
- * Inserts the text at the position.
1693
- * @param relativePos1 - The relative position to insert the text at
1694
- * @param text - The text to insert
1695
- * @param props - The properties of text
1696
- */
1697
- insertTextRelative(relativePos1: IRelativePosition, text: string, props?: PropertySet): void;
1698
- /**
1699
- * {@inheritDoc ISharedString.insertText}
1700
- */
1701
- insertText(pos: number, text: string, props?: PropertySet): void;
1702
- /**
1703
- * Replaces a range with the provided text.
1704
- * @param start - The inclusive start of the range to replace
1705
- * @param end - The exclusive end of the range to replace
1706
- * @param text - The text to replace the range with
1707
- * @param props - Optional. The properties of the replacement text
1708
- */
1709
- replaceText(start: number, end: number, text: string, props?: PropertySet): void;
1710
- /**
1711
- * Removes the text in the given range.
1712
- * @param start - The inclusive start of the range to remove
1713
- * @param end - The exclusive end of the range to replace
1714
- * @returns the message sent.
1715
- */
1716
- removeText(start: number, end: number): void;
1717
- /**
1718
- * Annotates the marker with the provided properties.
1719
- * @param marker - The marker to annotate
1720
- * @param props - The properties to annotate the marker with
1721
- */
1722
- annotateMarker(marker: Marker, props: PropertySet): void;
1723
- /**
1724
- * Searches a string for the nearest marker in either direction to a given start position.
1725
- * The search will include the start position, so markers at the start position are valid
1726
- * results of the search.
1727
- * @param startPos - Position at which to start the search
1728
- * @param markerLabel - Label of the marker to search for
1729
- * @param forwards - Whether the desired marker comes before (false) or after (true) `startPos`
1730
- */
1731
- searchForMarker(startPos: number, markerLabel: string, forwards?: boolean): Marker | undefined;
1732
- /**
1733
- * Retrieve text from the SharedString in string format.
1734
- * @param start - The starting index of the text to retrieve, or 0 if omitted.
1735
- * @param end - The ending index of the text to retrieve, or the end of the string if omitted
1736
- * @returns The requested text content as a string.
1737
- */
1738
- getText(start?: number, end?: number): string;
1739
- /**
1740
- * Adds spaces for markers and handles, so that position calculations account for them.
1741
- */
1742
- getTextWithPlaceholders(start?: number, end?: number): string;
1743
- getTextRangeWithMarkers(start: number, end: number): string;
1744
- /**
1745
- * Looks up and returns a `Marker` using its id. Returns `undefined` if there is no marker with the provided
1746
- * id in this `SharedString`.
1747
- */
1748
- getMarkerFromId(id: string): ISegment | undefined;
1749
- /**
1750
- * Revert an op
1751
- */
1752
- protected rollback(content: any, localOpMetadata: unknown): void;
1753
- }
1754
-
1755
- /**
1756
- * @alpha
1757
- */
1758
- export declare class SharedStringFactory implements IChannelFactory {
1759
- static Type: string;
1760
- static readonly Attributes: IChannelAttributes;
1761
- static segmentFromSpec(spec: any): SharedStringSegment;
1762
- get type(): string;
1763
- get attributes(): IChannelAttributes;
1764
- /**
1765
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
1766
- */
1767
- load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<SharedString>;
1768
- /**
1769
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
1770
- */
1771
- create(document: IFluidDataStoreRuntime, id: string): SharedString;
1772
- }
1773
-
1774
- /**
1775
- * Data for undoing edits on SharedStrings and Intervals.
1776
- * @alpha
1777
- */
1778
- export declare type SharedStringRevertible = MergeTreeDeltaRevertible | IntervalRevertible;
1779
-
1780
- /**
1781
- * @alpha
1782
- */
1783
- export declare type SharedStringSegment = TextSegment | Marker;
1784
-
1785
- /**
1786
- * Defines a side relative to a character in a sequence.
1787
- *
1788
- * @remarks See {@link SequencePlace} for additional context on usage.
1789
- * @alpha
1790
- */
1791
- export declare enum Side {
1792
- Before = 0,
1793
- After = 1
1794
- }
1795
-
1796
- /**
1797
- * @deprecated SubSequence will be removed in a upcoming release. It has been moved to the fluid-experimental/sequence-deprecated package
1798
- * @internal
1799
- */
1800
- export declare class SubSequence<T> extends BaseSegment {
1801
- items: Serializable<T>[];
1802
- static readonly typeString: string;
1803
- static is(segment: ISegment): segment is SubSequence<any>;
1804
- static fromJSONObject<U>(spec: any): SubSequence<U> | undefined;
1805
- readonly type: string;
1806
- constructor(items: Serializable<T>[]);
1807
- toJSONObject(): IJSONRunSegment<T>;
1808
- clone(start?: number, end?: number): SubSequence<T>;
1809
- canAppend(segment: ISegment): boolean;
1810
- toString(): string;
1811
- append(segment: ISegment): void;
1812
- removeRange(start: number, end: number): boolean;
1813
- protected createSplitSegmentAt(pos: number): SubSequence<T> | undefined;
1814
- }
1815
-
1816
- export { TextSegment }
1817
-
1818
- export { TrackingGroup }
1819
-
1820
- export { }