@fluidframework/sequence 2.0.0-internal.7.3.0 → 2.0.0-internal.7.4.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 (203) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/api-extractor-lint.json +13 -0
  3. package/api-extractor.json +8 -3
  4. package/api-report/sequence.api.md +87 -84
  5. package/dist/defaultMap.d.ts +3 -3
  6. package/dist/defaultMap.d.ts.map +1 -1
  7. package/dist/defaultMap.js +7 -2
  8. package/dist/defaultMap.js.map +1 -1
  9. package/dist/defaultMapInterfaces.d.ts +11 -10
  10. package/dist/defaultMapInterfaces.d.ts.map +1 -1
  11. package/dist/defaultMapInterfaces.js.map +1 -1
  12. package/dist/intervalCollection.d.ts +66 -12
  13. package/dist/intervalCollection.d.ts.map +1 -1
  14. package/dist/intervalCollection.js +50 -45
  15. package/dist/intervalCollection.js.map +1 -1
  16. package/dist/intervalIndex/endpointInRangeIndex.d.ts +2 -2
  17. package/dist/intervalIndex/endpointInRangeIndex.js +1 -1
  18. package/dist/intervalIndex/endpointInRangeIndex.js.map +1 -1
  19. package/dist/intervalIndex/endpointIndex.d.ts +2 -2
  20. package/dist/intervalIndex/endpointIndex.js +1 -1
  21. package/dist/intervalIndex/endpointIndex.js.map +1 -1
  22. package/dist/intervalIndex/idIntervalIndex.d.ts +2 -2
  23. package/dist/intervalIndex/idIntervalIndex.js +1 -1
  24. package/dist/intervalIndex/idIntervalIndex.js.map +1 -1
  25. package/dist/intervalIndex/intervalIndex.d.ts +1 -1
  26. package/dist/intervalIndex/intervalIndex.js.map +1 -1
  27. package/dist/intervalIndex/overlappingIntervalsIndex.d.ts +2 -2
  28. package/dist/intervalIndex/overlappingIntervalsIndex.js +1 -1
  29. package/dist/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
  30. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.d.ts +1 -1
  31. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.js +1 -1
  32. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.js.map +1 -1
  33. package/dist/intervalIndex/sequenceIntervalIndexes.d.ts +2 -1
  34. package/dist/intervalIndex/sequenceIntervalIndexes.d.ts.map +1 -1
  35. package/dist/intervalIndex/sequenceIntervalIndexes.js.map +1 -1
  36. package/dist/intervalIndex/startpointInRangeIndex.d.ts +2 -2
  37. package/dist/intervalIndex/startpointInRangeIndex.js +1 -1
  38. package/dist/intervalIndex/startpointInRangeIndex.js.map +1 -1
  39. package/dist/intervals/interval.d.ts +2 -7
  40. package/dist/intervals/interval.d.ts.map +1 -1
  41. package/dist/intervals/interval.js +1 -5
  42. package/dist/intervals/interval.js.map +1 -1
  43. package/dist/intervals/intervalUtils.d.ts +15 -14
  44. package/dist/intervals/intervalUtils.d.ts.map +1 -1
  45. package/dist/intervals/intervalUtils.js +3 -3
  46. package/dist/intervals/intervalUtils.js.map +1 -1
  47. package/dist/intervals/sequenceInterval.d.ts +3 -12
  48. package/dist/intervals/sequenceInterval.d.ts.map +1 -1
  49. package/dist/intervals/sequenceInterval.js +3 -11
  50. package/dist/intervals/sequenceInterval.js.map +1 -1
  51. package/dist/localValues.d.ts +2 -1
  52. package/dist/localValues.d.ts.map +1 -1
  53. package/dist/localValues.js.map +1 -1
  54. package/dist/packageVersion.d.ts +1 -1
  55. package/dist/packageVersion.js +1 -1
  56. package/dist/packageVersion.js.map +1 -1
  57. package/dist/revertibles.d.ts +9 -15
  58. package/dist/revertibles.d.ts.map +1 -1
  59. package/dist/revertibles.js +7 -9
  60. package/dist/revertibles.js.map +1 -1
  61. package/dist/sequence-alpha.d.ts +226 -507
  62. package/dist/sequence-beta.d.ts +131 -1368
  63. package/dist/sequence-public.d.ts +131 -1368
  64. package/dist/sequence-untrimmed.d.ts +121 -90
  65. package/dist/sequence.d.ts +2 -3
  66. package/dist/sequence.d.ts.map +1 -1
  67. package/dist/sequence.js +1 -1
  68. package/dist/sequence.js.map +1 -1
  69. package/dist/sequenceDeltaEvent.d.ts +4 -4
  70. package/dist/sequenceDeltaEvent.js +3 -3
  71. package/dist/sequenceDeltaEvent.js.map +1 -1
  72. package/dist/sequenceFactory.d.ts +1 -1
  73. package/dist/sequenceFactory.js +1 -1
  74. package/dist/sequenceFactory.js.map +1 -1
  75. package/dist/sharedIntervalCollection.d.ts +3 -3
  76. package/dist/sharedIntervalCollection.js +2 -2
  77. package/dist/sharedIntervalCollection.js.map +1 -1
  78. package/dist/sharedSequence.d.ts +3 -3
  79. package/dist/sharedSequence.js +2 -2
  80. package/dist/sharedSequence.js.map +1 -1
  81. package/dist/sharedString.d.ts +8 -5
  82. package/dist/sharedString.d.ts.map +1 -1
  83. package/dist/sharedString.js +6 -3
  84. package/dist/sharedString.js.map +1 -1
  85. package/lib/defaultMap.d.ts +3 -3
  86. package/lib/defaultMap.d.ts.map +1 -1
  87. package/lib/defaultMap.js +29 -20
  88. package/lib/defaultMap.js.map +1 -1
  89. package/lib/defaultMapInterfaces.d.ts +11 -10
  90. package/lib/defaultMapInterfaces.d.ts.map +1 -1
  91. package/lib/defaultMapInterfaces.js +2 -1
  92. package/lib/defaultMapInterfaces.js.map +1 -1
  93. package/lib/index.js +45 -10
  94. package/lib/index.js.map +1 -1
  95. package/lib/intervalCollection.d.ts +66 -12
  96. package/lib/intervalCollection.d.ts.map +1 -1
  97. package/lib/intervalCollection.js +174 -156
  98. package/lib/intervalCollection.js.map +1 -1
  99. package/lib/intervalIndex/endpointInRangeIndex.d.ts +2 -2
  100. package/lib/intervalIndex/endpointInRangeIndex.js +18 -13
  101. package/lib/intervalIndex/endpointInRangeIndex.js.map +1 -1
  102. package/lib/intervalIndex/endpointIndex.d.ts +2 -2
  103. package/lib/intervalIndex/endpointIndex.js +14 -9
  104. package/lib/intervalIndex/endpointIndex.js.map +1 -1
  105. package/lib/intervalIndex/idIntervalIndex.d.ts +2 -2
  106. package/lib/intervalIndex/idIntervalIndex.js +9 -5
  107. package/lib/intervalIndex/idIntervalIndex.js.map +1 -1
  108. package/lib/intervalIndex/index.js +19 -6
  109. package/lib/intervalIndex/index.js.map +1 -1
  110. package/lib/intervalIndex/intervalIndex.d.ts +1 -1
  111. package/lib/intervalIndex/intervalIndex.js +2 -1
  112. package/lib/intervalIndex/intervalIndex.js.map +1 -1
  113. package/lib/intervalIndex/intervalIndexUtils.js +8 -4
  114. package/lib/intervalIndex/intervalIndexUtils.js.map +1 -1
  115. package/lib/intervalIndex/overlappingIntervalsIndex.d.ts +2 -2
  116. package/lib/intervalIndex/overlappingIntervalsIndex.js +16 -11
  117. package/lib/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
  118. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.d.ts +1 -1
  119. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.js +15 -11
  120. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.js.map +1 -1
  121. package/lib/intervalIndex/sequenceIntervalIndexes.d.ts +2 -1
  122. package/lib/intervalIndex/sequenceIntervalIndexes.d.ts.map +1 -1
  123. package/lib/intervalIndex/sequenceIntervalIndexes.js +2 -1
  124. package/lib/intervalIndex/sequenceIntervalIndexes.js.map +1 -1
  125. package/lib/intervalIndex/startpointInRangeIndex.d.ts +2 -2
  126. package/lib/intervalIndex/startpointInRangeIndex.js +18 -13
  127. package/lib/intervalIndex/startpointInRangeIndex.js.map +1 -1
  128. package/lib/intervalTree.js +9 -4
  129. package/lib/intervalTree.js.map +1 -1
  130. package/lib/intervals/index.js +18 -3
  131. package/lib/intervals/index.js.map +1 -1
  132. package/lib/intervals/interval.d.ts +2 -7
  133. package/lib/intervals/interval.d.ts.map +1 -1
  134. package/lib/intervals/interval.js +19 -18
  135. package/lib/intervals/interval.js.map +1 -1
  136. package/lib/intervals/intervalUtils.d.ts +15 -14
  137. package/lib/intervals/intervalUtils.d.ts.map +1 -1
  138. package/lib/intervals/intervalUtils.js +21 -16
  139. package/lib/intervals/intervalUtils.js.map +1 -1
  140. package/lib/intervals/sequenceInterval.d.ts +3 -12
  141. package/lib/intervals/sequenceInterval.d.ts.map +1 -1
  142. package/lib/intervals/sequenceInterval.js +68 -70
  143. package/lib/intervals/sequenceInterval.js.map +1 -1
  144. package/lib/localValues.d.ts +2 -1
  145. package/lib/localValues.d.ts.map +1 -1
  146. package/lib/localValues.js +9 -4
  147. package/lib/localValues.js.map +1 -1
  148. package/lib/packageVersion.d.ts +1 -1
  149. package/lib/packageVersion.js +5 -2
  150. package/lib/packageVersion.js.map +1 -1
  151. package/lib/revertibles.d.ts +9 -15
  152. package/lib/revertibles.d.ts.map +1 -1
  153. package/lib/revertibles.js +76 -68
  154. package/lib/revertibles.js.map +1 -1
  155. package/lib/sequence-alpha.d.ts +226 -507
  156. package/lib/sequence-beta.d.ts +131 -1368
  157. package/lib/sequence-public.d.ts +131 -1368
  158. package/lib/sequence-untrimmed.d.ts +121 -90
  159. package/lib/sequence.d.ts +2 -3
  160. package/lib/sequence.d.ts.map +1 -1
  161. package/lib/sequence.js +45 -40
  162. package/lib/sequence.js.map +1 -1
  163. package/lib/sequenceDeltaEvent.d.ts +4 -4
  164. package/lib/sequenceDeltaEvent.js +16 -10
  165. package/lib/sequenceDeltaEvent.js.map +1 -1
  166. package/lib/sequenceFactory.d.ts +1 -1
  167. package/lib/sequenceFactory.js +14 -10
  168. package/lib/sequenceFactory.js.map +1 -1
  169. package/lib/sharedIntervalCollection.d.ts +3 -3
  170. package/lib/sharedIntervalCollection.js +20 -15
  171. package/lib/sharedIntervalCollection.js.map +1 -1
  172. package/lib/sharedSequence.d.ts +3 -3
  173. package/lib/sharedSequence.js +13 -8
  174. package/lib/sharedSequence.js.map +1 -1
  175. package/lib/sharedString.d.ts +8 -5
  176. package/lib/sharedString.d.ts.map +1 -1
  177. package/lib/sharedString.js +27 -19
  178. package/lib/sharedString.js.map +1 -1
  179. package/package.json +22 -20
  180. package/sequence.test-files.tar +0 -0
  181. package/src/defaultMap.ts +22 -16
  182. package/src/defaultMapInterfaces.ts +15 -12
  183. package/src/intervalCollection.ts +131 -67
  184. package/src/intervalIndex/endpointInRangeIndex.ts +2 -2
  185. package/src/intervalIndex/endpointIndex.ts +2 -2
  186. package/src/intervalIndex/idIntervalIndex.ts +2 -2
  187. package/src/intervalIndex/intervalIndex.ts +1 -1
  188. package/src/intervalIndex/overlappingIntervalsIndex.ts +2 -2
  189. package/src/intervalIndex/overlappingSequenceIntervalsIndex.ts +1 -1
  190. package/src/intervalIndex/sequenceIntervalIndexes.ts +2 -1
  191. package/src/intervalIndex/startpointInRangeIndex.ts +2 -2
  192. package/src/intervals/interval.ts +2 -7
  193. package/src/intervals/intervalUtils.ts +15 -15
  194. package/src/intervals/sequenceInterval.ts +3 -12
  195. package/src/localValues.ts +2 -1
  196. package/src/packageVersion.ts +1 -1
  197. package/src/revertibles.ts +9 -15
  198. package/src/sequence.ts +2 -3
  199. package/src/sequenceDeltaEvent.ts +4 -4
  200. package/src/sequenceFactory.ts +1 -1
  201. package/src/sharedIntervalCollection.ts +3 -3
  202. package/src/sharedSequence.ts +3 -3
  203. package/src/sharedString.ts +8 -5
@@ -55,140 +55,48 @@ import { SharedObject } from '@fluidframework/shared-object-base';
55
55
  import { SlidingPreference } from '@fluidframework/merge-tree';
56
56
  import { SummarySerializer } from '@fluidframework/shared-object-base';
57
57
  import { TextSegment } from '@fluidframework/merge-tree';
58
+ import { TypedEventEmitter } from '@fluid-internal/client-utils';
58
59
 
59
- /**
60
- * Create revertibles for adding an interval
61
- * @alpha
62
- */
63
- export declare function appendAddIntervalToRevertibles(interval: SequenceInterval, revertibles: SharedStringRevertible[]): SharedStringRevertible[];
60
+ /* Excluded from this release type: appendAddIntervalToRevertibles */
64
61
 
65
- /**
66
- * Create revertibles for moving endpoints of an interval
67
- * @alpha
68
- */
69
- export declare function appendChangeIntervalToRevertibles(string: SharedString, newInterval: SequenceInterval, previousInterval: SequenceInterval, revertibles: SharedStringRevertible[]): SharedStringRevertible[];
62
+ /* Excluded from this release type: appendChangeIntervalToRevertibles */
70
63
 
71
- /**
72
- * Create revertibles for deleting an interval
73
- * @alpha
74
- */
75
- export declare function appendDeleteIntervalToRevertibles(string: SharedString, interval: SequenceInterval, revertibles: SharedStringRevertible[]): SharedStringRevertible[];
64
+ /* Excluded from this release type: appendDeleteIntervalToRevertibles */
76
65
 
77
- /**
78
- * Create revertibles for changing properties of an interval
79
- * @alpha
80
- */
81
- export declare function appendIntervalPropertyChangedToRevertibles(interval: SequenceInterval, deltas: PropertySet, revertibles: SharedStringRevertible[]): SharedStringRevertible[];
66
+ /* Excluded from this release type: appendIntervalPropertyChangedToRevertibles */
82
67
 
83
- /**
84
- * Create revertibles for SharedStringDeltas, handling indirectly modified intervals
85
- * (e.g. reverting remove of a range that contains an interval will move the interval back)
86
- *
87
- * @alpha
88
- */
89
- export declare function appendSharedStringDeltaToRevertibles(string: SharedString, delta: SequenceDeltaEvent, revertibles: SharedStringRevertible[]): void;
68
+ /* Excluded from this release type: appendSharedStringDeltaToRevertibles */
90
69
 
91
- /**
92
- * @public
93
- */
94
- export declare function createEndpointIndex(sharedString: SharedString): IEndpointIndex<SequenceInterval>;
70
+ /* Excluded from this release type: createEndpointIndex */
95
71
 
96
- /**
97
- * @public
98
- */
99
- export declare function createEndpointInRangeIndex(sharedString: SharedString): IEndpointInRangeIndex<SequenceInterval>;
72
+ /* Excluded from this release type: createEndpointInRangeIndex */
100
73
 
101
- /**
102
- * @public
103
- */
104
- export declare function createIdIntervalIndex<TInterval extends ISerializableInterval>(): IIdIntervalIndex<TInterval>;
74
+ /* Excluded from this release type: createIdIntervalIndex */
105
75
 
106
- /**
107
- * @public
108
- */
109
- export declare function createOverlappingIntervalsIndex(sharedString: SharedString): IOverlappingIntervalsIndex<SequenceInterval>;
76
+ /* Excluded from this release type: createOverlappingIntervalsIndex */
110
77
 
111
- /**
112
- * @public
113
- */
114
- export declare function createOverlappingSequenceIntervalsIndex(sharedString: SharedString): SequenceIntervalIndexes.Overlapping;
78
+ /* Excluded from this release type: createOverlappingSequenceIntervalsIndex */
115
79
 
116
- /**
117
- * @public
118
- */
119
- export declare function createStartpointInRangeIndex(sharedString: SharedString): IStartpointInRangeIndex<SequenceInterval>;
80
+ /* Excluded from this release type: createStartpointInRangeIndex */
120
81
 
121
82
  /**
122
- * @public
83
+ * @alpha
123
84
  */
124
85
  export declare type DeserializeCallback = (properties: PropertySet) => void;
125
86
 
126
- /**
127
- * Clean up resources held by revertibles that are no longer needed.
128
- * @alpha
129
- */
130
- export declare function discardSharedStringRevertibles(sharedString: SharedString, revertibles: SharedStringRevertible[]): void;
87
+ /* Excluded from this release type: discardSharedStringRevertibles */
131
88
 
132
- /**
133
- * Splits the text into regions ending with markers with the given `label`.
134
- * @param sharedString - String to retrieve text and markers from
135
- * @param label - label to split on
136
- * @returns Two parallel lists of text and markers, split by markers with the provided `label`.
137
- * For example:
138
- * ```typescript
139
- * // Say sharedstring has contents "hello<paragraph marker 1>world<paragraph marker 2>missing".
140
- * const { parallelText, parallelMarkers } = getTextAndMarkers(sharedString, "paragraph");
141
- * // parallelText === ["hello", "world"]
142
- * // parallelMarkers === [<paragraph marker 1 object>, <paragraph marker 2 object>]
143
- * // Note parallelText does not include "missing".
144
- * ```
145
- * @public
146
- */
147
- export declare function getTextAndMarkers(sharedString: SharedString, label: string, start?: number, end?: number): {
148
- parallelText: string[];
149
- parallelMarkers: Marker[];
150
- };
89
+ /* Excluded from this release type: getTextAndMarkers */
151
90
 
152
- /**
153
- * @public
154
- */
155
- export declare interface IEndpointIndex<TInterval extends ISerializableInterval> extends IntervalIndex<TInterval> {
156
- /**
157
- * @returns the previous interval based on the given position number.
158
- * If no such interval exists in this index, returns `undefined`
159
- */
160
- previousInterval(pos: number): TInterval | undefined;
161
- /**
162
- * @returns the next interval based on the given position number.
163
- * If no such interval exists in this index, returns `undefined`
164
- */
165
- nextInterval(pos: number): TInterval | undefined;
166
- }
91
+ /* Excluded from this release type: IEndpointIndex */
167
92
 
168
- /**
169
- * Collection of intervals.
170
- *
171
- * Provide additional APIs to support efficiently querying a collection of intervals whose endpoints fall within a specified range.
172
- * @public
173
- */
174
- export declare interface IEndpointInRangeIndex<TInterval extends ISerializableInterval> extends IntervalIndex<TInterval> {
175
- /**
176
- * @returns an array of all intervals contained in this collection whose endpoints locate in the range [start, end] (includes both ends)
177
- */
178
- findIntervalsWithEndpointInRange(start: number, end: number): TInterval[];
179
- }
93
+ /* Excluded from this release type: IEndpointInRangeIndex */
180
94
 
181
- /**
182
- * @public
183
- */
184
- export declare interface IIdIntervalIndex<TInterval extends ISerializableInterval> extends IntervalIndex<TInterval>, Iterable<TInterval> {
185
- getIntervalById(id: string): TInterval | undefined;
186
- [Symbol.iterator](): Iterator<TInterval>;
187
- }
95
+ /* Excluded from this release type: IIdIntervalIndex */
188
96
 
189
97
  /**
190
98
  * Basic interval abstraction
191
- * @public
99
+ * @alpha
192
100
  */
193
101
  export declare interface IInterval {
194
102
  /**
@@ -215,19 +123,27 @@ export declare interface IInterval {
215
123
  * @param b - Interval to compare against
216
124
  */
217
125
  compareEnd(b: IInterval): number;
218
- /* Excluded from this release type: modify */
126
+ /**
127
+ * Modifies one or more of the endpoints of this interval, returning a new interval representing the result.
128
+ */
129
+ modify(label: string, start: SequencePlace | undefined, end: SequencePlace | undefined, op?: ISequencedDocumentMessage, localSeq?: number, useNewSlidingBehavior?: boolean): IInterval | undefined;
219
130
  /**
220
131
  * @returns whether this interval overlaps with `b`.
221
132
  * Intervals are considered to overlap if their intersection is non-empty.
222
133
  */
223
134
  overlaps(b: IInterval): boolean;
224
- /* Excluded from this release type: union */
135
+ /**
136
+ * Unions this interval with `b`, returning a new interval.
137
+ * The union operates as a convex hull, i.e. if the two intervals are disjoint, the return value includes
138
+ * intermediate values between the two intervals.
139
+ */
140
+ union(b: IInterval): IInterval;
225
141
  }
226
142
 
227
143
  /**
228
144
  * Collection of intervals that supports addition, modification, removal, and efficient spatial querying.
229
145
  * Changes to this collection will be incur updates on collaborating clients (i.e. they are not local-only).
230
- * @public
146
+ * @alpha
231
147
  */
232
148
  export declare interface IIntervalCollection<TInterval extends ISerializableInterval> extends TypedEventEmitter<IIntervalCollectionEvent<TInterval>> {
233
149
  readonly attached: boolean;
@@ -349,6 +265,7 @@ export declare interface IIntervalCollection<TInterval extends ISerializableInte
349
265
  removeIntervalById(id: string): TInterval | undefined;
350
266
  /**
351
267
  * Changes the properties on an existing interval.
268
+ * @deprecated - call change with the id and and object containing the new properties
352
269
  * @param id - Id of the interval whose properties should be changed
353
270
  * @param props - Property set to apply to the interval. Shallow merging is used between any existing properties
354
271
  * and `prop`, i.e. the interval will end up with a property object equivalent to `{ ...oldProps, ...props }`.
@@ -356,12 +273,26 @@ export declare interface IIntervalCollection<TInterval extends ISerializableInte
356
273
  changeProperties(id: string, props: PropertySet): any;
357
274
  /**
358
275
  * Changes the endpoints of an existing interval.
276
+ * @deprecated - call change with the start and end parameters encapsulated in an object
359
277
  * @param id - Id of the interval to change
360
278
  * @param start - New start value. To leave the endpoint unchanged, pass the current value.
361
279
  * @param end - New end value. To leave the endpoint unchanged, pass the current value.
362
280
  * @returns the interval that was changed, if it existed in the collection.
363
281
  */
364
282
  change(id: string, start: SequencePlace, end: SequencePlace): TInterval | undefined;
283
+ /**
284
+ * Changes the endpoints, properties, or both of an existing interval.
285
+ * @param id - Id of the Interval to change
286
+ * @returns the interval that was changed, if it existed in the collection.
287
+ * Pass the desired new start position, end position, and/or properties in an object. Start and end positions must be changed
288
+ * simultaneously - they must either both be specified or both undefined. To only change the properties, leave both endpoints
289
+ * undefined. To only change the endpoints, leave the properties undefined.
290
+ */
291
+ change(id: string, { start, end, props }: {
292
+ start?: SequencePlace;
293
+ end?: SequencePlace;
294
+ props?: PropertySet;
295
+ }): TInterval | undefined;
365
296
  attachDeserializer(onDeserialize: DeserializeCallback): void;
366
297
  /**
367
298
  * @returns an iterator over all intervals in this collection.
@@ -393,6 +324,14 @@ export declare interface IIntervalCollection<TInterval extends ISerializableInte
393
324
  */
394
325
  gatherIterationResults(results: TInterval[], iteratesForward: boolean, start?: number, end?: number): void;
395
326
  /**
327
+ * @deprecated - Users must manually attach the corresponding interval index to utilize this functionality, for instance:
328
+ *
329
+ * ```typescript
330
+ * const overlappingIntervalsIndex = createOverlappingIntervalsIndex(sharedString);
331
+ * collection.attachIndex(overlappingIntervalsIndex)
332
+ * const result = overlappingIntervalsIndex.findOverlappingIntervals(start, end);
333
+ * ```
334
+ *
396
335
  * @returns an array of all intervals in this collection that overlap with the interval
397
336
  * `[startPosition, endPosition]`.
398
337
  */
@@ -401,13 +340,34 @@ export declare interface IIntervalCollection<TInterval extends ISerializableInte
401
340
  * Applies a function to each interval in this collection.
402
341
  */
403
342
  map(fn: (interval: TInterval) => void): void;
343
+ /**
344
+ * @deprecated - due to the forthcoming change where the endpointIndex will no longer be
345
+ * automatically added to the collection. Users are advised to independently attach the
346
+ * index to the collection and utilize the API accordingly, for instance:
347
+ * ```typescript
348
+ * const endpointIndex = createEndpointIndex(sharedString);
349
+ * collection.attachIndex(endpointIndex);
350
+ * const result1 = endpointIndex.previousInterval(pos);
351
+ * ```
352
+ * If an index is used repeatedly, applications should generally attach it once and store it in memory.
353
+ */
404
354
  previousInterval(pos: number): TInterval | undefined;
355
+ /**
356
+ * @deprecated - due to the forthcoming change where the endpointIndex will no longer be
357
+ * automatically added to the collection. Users are advised to independently attach the
358
+ * index to the collection and utilize the API accordingly, for instance:
359
+ * ```typescript
360
+ * const endpointIndex = createEndpointIndex(sharedString);
361
+ * collection.attachIndex(endpointIndex);
362
+ * const result2 = endpointIndex.nextInterval(pos);
363
+ * ```
364
+ */
405
365
  nextInterval(pos: number): TInterval | undefined;
406
366
  }
407
367
 
408
368
  /**
409
369
  * Change events emitted by `IntervalCollection`s
410
- * @public
370
+ * @alpha
411
371
  */
412
372
  export declare interface IIntervalCollectionEvent<TInterval extends ISerializableInterval> extends IEvent {
413
373
  /**
@@ -442,37 +402,9 @@ export declare interface IIntervalCollectionEvent<TInterval extends ISerializabl
442
402
  (event: "propertyChanged", listener: (interval: TInterval, propertyDeltas: PropertySet, local: boolean, op: ISequencedDocumentMessage | undefined) => void): any;
443
403
  }
444
404
 
445
- /**
446
- * @sealed
447
- * @deprecated The methods within have substitutions
448
- * @public
449
- */
450
- export declare interface IIntervalHelpers<TInterval extends ISerializableInterval> {
451
- /**
452
- *
453
- * @param label - label of the interval collection this interval is being added to. This parameter is
454
- * irrelevant for transient intervals.
455
- * @param start - numerical start position of the interval
456
- * @param end - numerical end position of the interval
457
- * @param client - client creating the interval
458
- * @param intervalType - Type of interval to create. Default is SlideOnRemove
459
- * @param op - If this create came from a remote client, op that created it. Default is undefined (i.e. local)
460
- * @param fromSnapshot - If this create came from loading a snapshot. Default is false.
461
- * @param startSide - The side on which the start position lays. See
462
- * {@link SequencePlace} for additional context
463
- * @param endSide - The side on which the end position lays. See
464
- * {@link SequencePlace} for additional context
465
- */
466
- create(label: string, start: SequencePlace | undefined, end: SequencePlace | undefined, client: Client | undefined, intervalType: IntervalType, op?: ISequencedDocumentMessage, fromSnapshot?: boolean, useNewSlidingBehavior?: boolean): TInterval;
467
- }
405
+ /* Excluded from this release type: IIntervalHelpers */
468
406
 
469
- /**
470
- * @deprecated IJSONRunSegment will be removed in a upcoming release. It has been moved to the fluid-experimental/sequence-deprecated package
471
- * @public
472
- */
473
- export declare interface IJSONRunSegment<T> extends IJSONSegment {
474
- items: Serializable<T>[];
475
- }
407
+ /* Excluded from this release type: IJSONRunSegment */
476
408
 
477
409
  /* Excluded from this release type: IMapMessageLocalMetadata */
478
410
 
@@ -480,71 +412,14 @@ export declare interface IJSONRunSegment<T> extends IJSONSegment {
480
412
  * A sequence place that does not refer to the special endpoint segments.
481
413
  *
482
414
  * See {@link SequencePlace} for additional context.
483
- * @public
415
+ * @alpha
484
416
  */
485
417
  export declare interface InteriorSequencePlace {
486
418
  pos: number;
487
419
  side: Side;
488
420
  }
489
421
 
490
- /**
491
- * Serializable interval whose endpoints are plain-old numbers.
492
- * @public
493
- */
494
- export declare class Interval implements ISerializableInterval {
495
- start: number;
496
- end: number;
497
- /**
498
- * {@inheritDoc ISerializableInterval.properties}
499
- */
500
- properties: PropertySet;
501
- /* Excluded from this release type: auxProps */
502
- /* Excluded from this release type: propertyManager */
503
- constructor(start: number, end: number, props?: PropertySet);
504
- /**
505
- * {@inheritDoc ISerializableInterval.getIntervalId}
506
- */
507
- getIntervalId(): string;
508
- /**
509
- * @returns an array containing any auxiliary property sets added with `addPropertySet`.
510
- */
511
- getAdditionalPropertySets(): PropertySet[];
512
- /**
513
- * Adds an auxiliary set of properties to this interval.
514
- * These properties can be recovered using `getAdditionalPropertySets`
515
- * @param props - set of properties to add
516
- * @remarks This gets called as part of the default conflict resolver for `IIntervalCollection<Interval>`
517
- * (i.e. non-sequence-based interval collections). However, the additional properties don't get serialized.
518
- * This functionality seems half-baked.
519
- */
520
- addPropertySet(props: PropertySet): void;
521
- /* Excluded from this release type: serialize */
522
- /**
523
- * {@inheritDoc IInterval.clone}
524
- */
525
- clone(): Interval;
526
- /**
527
- * {@inheritDoc IInterval.compare}
528
- */
529
- compare(b: Interval): number;
530
- /**
531
- * {@inheritDoc IInterval.compareStart}
532
- */
533
- compareStart(b: Interval): number;
534
- /**
535
- * {@inheritDoc IInterval.compareEnd}
536
- */
537
- compareEnd(b: Interval): number;
538
- /**
539
- * {@inheritDoc IInterval.overlaps}
540
- */
541
- overlaps(b: Interval): boolean;
542
- /* Excluded from this release type: union */
543
- getProperties(): PropertySet;
544
- /* Excluded from this release type: addProperties */
545
- /* Excluded from this release type: modify */
546
- private initializeProperties;
547
- }
422
+ /* Excluded from this release type: Interval */
548
423
 
549
424
  /**
550
425
  * Collection of intervals.
@@ -554,7 +429,7 @@ export declare class Interval implements ISerializableInterval {
554
429
  * - "find all intervals with start endpoint between these two points"
555
430
  * - "find all intervals which overlap this range"
556
431
  * etc.
557
- * @public
432
+ * @alpha
558
433
  */
559
434
  export declare interface IntervalIndex<TInterval extends ISerializableInterval> {
560
435
  /**
@@ -571,84 +446,56 @@ export declare interface IntervalIndex<TInterval extends ISerializableInterval>
571
446
  remove(interval: TInterval): void;
572
447
  }
573
448
 
449
+ /* Excluded from this release type: IntervalLocator */
450
+
451
+ /* Excluded from this release type: intervalLocatorFromEndpoint */
452
+
453
+ /* Excluded from this release type: IntervalOpType */
454
+
455
+ /* Excluded from this release type: IntervalRevertible */
456
+
574
457
  /**
575
- * Information that identifies an interval within a `Sequence`.
576
- * @public
458
+ * Determines how an interval should expand when segments are inserted adjacent
459
+ * to the range it spans
460
+ *
461
+ * Note that interval stickiness is currently an experimental feature and must
462
+ * be explicitly enabled with the `intervalStickinessEnabled` flag
463
+ *
464
+ * @alpha
577
465
  */
578
- export declare interface IntervalLocator {
466
+ export declare const IntervalStickiness: {
579
467
  /**
580
- * Label for the collection the interval is a part of
468
+ * Interval does not expand to include adjacent segments
581
469
  */
582
- label: string;
470
+ readonly NONE: 0;
583
471
  /**
584
- * Interval within that collection
472
+ * Interval expands to include segments inserted adjacent to the start
585
473
  */
586
- interval: SequenceInterval;
587
- }
588
-
589
- /**
590
- * Returns an object that can be used to find the interval a given LocalReferencePosition belongs to.
591
- * @returns undefined if the reference position is not the endpoint of any interval (e.g. it was created
592
- * on the merge tree directly by app code), otherwise an {@link IntervalLocator} for the interval this
593
- * endpoint is a part of.
594
- * @public
595
- */
596
- export declare function intervalLocatorFromEndpoint(potentialEndpoint: LocalReferencePosition): IntervalLocator | undefined;
597
-
598
- /**
599
- * Values are used in persisted formats (ops) and revertibles.
600
- * @alpha
601
- */
602
- export declare const IntervalOpType: {
603
- readonly ADD: "add";
604
- readonly DELETE: "delete";
605
- readonly CHANGE: "change";
606
- readonly PROPERTY_CHANGED: "propertyChanged";
607
- readonly POSITION_REMOVE: "positionRemove";
474
+ readonly START: 1;
475
+ /**
476
+ * Interval expands to include segments inserted adjacent to the end
477
+ *
478
+ * This is the default stickiness
479
+ */
480
+ readonly END: 2;
481
+ /**
482
+ * Interval expands to include all segments inserted adjacent to it
483
+ */
484
+ readonly FULL: 3;
608
485
  };
609
486
 
610
487
  /**
611
- * Data for undoing edits affecting Intervals.
488
+ * Determines how an interval should expand when segments are inserted adjacent
489
+ * to the range it spans
612
490
  *
491
+ * Note that interval stickiness is currently an experimental feature and must
492
+ * be explicitly enabled with the `intervalStickinessEnabled` flag
613
493
  * @alpha
614
494
  */
615
- export declare type IntervalRevertible = {
616
- event: typeof IntervalOpType.CHANGE;
617
- interval: SequenceInterval;
618
- start: LocalReferencePosition;
619
- end: LocalReferencePosition;
620
- } | {
621
- event: typeof IntervalOpType.ADD;
622
- interval: SequenceInterval;
623
- } | {
624
- event: typeof IntervalOpType.DELETE;
625
- interval: SequenceInterval;
626
- start: LocalReferencePosition;
627
- end: LocalReferencePosition;
628
- } | {
629
- event: typeof IntervalOpType.PROPERTY_CHANGED;
630
- interval: SequenceInterval;
631
- propertyDeltas: PropertySet;
632
- } | {
633
- event: typeof IntervalOpType.POSITION_REMOVE;
634
- intervals: {
635
- intervalId: string;
636
- label: string;
637
- startOffset?: number;
638
- endOffset?: number;
639
- }[];
640
- revertibleRefs: {
641
- revertible: IntervalRevertible;
642
- offset: number;
643
- isStart: boolean;
644
- }[];
645
- mergeTreeRevertible: MergeTreeDeltaRevertible;
646
- };
647
-
648
- /* Excluded from this release type: IntervalStickiness */
495
+ export declare type IntervalStickiness = (typeof IntervalStickiness)[keyof typeof IntervalStickiness];
649
496
 
650
497
  /**
651
- * @public
498
+ * @alpha
652
499
  */
653
500
  export declare enum IntervalType {
654
501
  Simple = 0,
@@ -666,24 +513,11 @@ export declare enum IntervalType {
666
513
  /* Excluded from this release type: Transient */
667
514
  }
668
515
 
669
- /**
670
- * @public
671
- */
672
- export declare interface IOverlappingIntervalsIndex<TInterval extends ISerializableInterval> extends IntervalIndex<TInterval> {
673
- /**
674
- * @returns an array of all intervals contained in this collection that overlap the range
675
- * `[start end]`.
676
- */
677
- findOverlappingIntervals(start: SequencePlace, end: SequencePlace): TInterval[];
678
- /**
679
- * Gathers the interval results based on specified parameters.
680
- */
681
- gatherIterationResults(results: TInterval[], iteratesForward: boolean, start?: SequencePlace, end?: SequencePlace): void;
682
- }
516
+ /* Excluded from this release type: IOverlappingIntervalsIndex */
683
517
 
684
518
  /**
685
519
  * A range that has changed corresponding to a segment modification.
686
- * @public
520
+ * @alpha
687
521
  */
688
522
  export declare interface ISequenceDeltaRange<TOperation extends MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationTypes> {
689
523
  /**
@@ -718,14 +552,17 @@ export declare interface ISequenceDeltaRange<TOperation extends MergeTreeDeltaOp
718
552
  }
719
553
 
720
554
  /**
721
- * @public
555
+ * @alpha
722
556
  */
723
557
  export declare interface ISerializableInterval extends IInterval {
724
558
  /** Serializable bag of properties associated with the interval. */
725
559
  properties: PropertySet;
726
- /* Excluded from this release type: propertyManager */
727
- /* Excluded from this release type: serialize */
728
- /* Excluded from this release type: addProperties */
560
+ /***/
561
+ propertyManager: PropertiesManager;
562
+ /***/
563
+ serialize(): ISerializedInterval;
564
+ /***/
565
+ addProperties(props: PropertySet, collaborating?: boolean, seq?: number): PropertySet | undefined;
729
566
  /**
730
567
  * Gets the id associated with this interval.
731
568
  * When the interval is used as part of an interval collection, this id can be used to modify or remove the
@@ -736,10 +573,38 @@ export declare interface ISerializableInterval extends IInterval {
736
573
  getIntervalId(): string | undefined;
737
574
  }
738
575
 
739
- /* Excluded from this release type: ISerializedInterval */
576
+ /**
577
+ * Serialized object representation of an interval.
578
+ * This representation is used for ops that create or change intervals.
579
+ * @alpha
580
+ */
581
+ export declare interface ISerializedInterval {
582
+ /**
583
+ * Sequence number at which `start` and `end` should be interpreted
584
+ *
585
+ * @remarks It's unclear that this is necessary to store here.
586
+ * This should just be the refSeq on the op that modified the interval, which should be available via other means.
587
+ * At the time of writing, it's not plumbed through to the reconnect/rebase code, however, which does need it.
588
+ */
589
+ sequenceNumber: number;
590
+ /** Start position of the interval */
591
+ start: number | "start" | "end";
592
+ /** End position of the interval */
593
+ end: number | "start" | "end";
594
+ /** Interval type to create */
595
+ intervalType: IntervalType;
596
+ /**
597
+ * The stickiness of this interval
598
+ */
599
+ stickiness?: IntervalStickiness;
600
+ startSide?: Side;
601
+ endSide?: Side;
602
+ /** Any properties the interval has */
603
+ properties?: PropertySet;
604
+ }
740
605
 
741
606
  /**
742
- * @public
607
+ * @alpha
743
608
  */
744
609
  export declare interface ISharedIntervalCollection<TInterval extends ISerializableInterval> {
745
610
  getIntervalCollection(label: string): IIntervalCollection<TInterval>;
@@ -777,7 +642,7 @@ export declare interface ISharedIntervalCollection<TInterval extends ISerializab
777
642
  * - `event` - Various information on the segments that were modified.
778
643
  *
779
644
  * - `target` - The sequence itself.
780
- * @public
645
+ * @alpha
781
646
  */
782
647
  export declare interface ISharedSegmentSequenceEvents extends ISharedObjectEvents {
783
648
  (event: "createIntervalCollection", listener: (label: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
@@ -787,7 +652,7 @@ export declare interface ISharedSegmentSequenceEvents extends ISharedObjectEvent
787
652
 
788
653
  /**
789
654
  * Fluid object interface describing access methods on a SharedString
790
- * @public
655
+ * @alpha
791
656
  */
792
657
  export declare interface ISharedString extends SharedSegmentSequence<SharedStringSegment> {
793
658
  /**
@@ -810,27 +675,13 @@ export declare interface ISharedString extends SharedSegmentSequence<SharedStrin
810
675
  posFromRelativePos(relativePos: IRelativePosition): number;
811
676
  }
812
677
 
813
- /**
814
- * Collection of intervals.
815
- *
816
- * Provide additional APIs to support efficiently querying a collection of intervals whose startpoints fall within a specified range.
817
- * @public
818
- */
819
- export declare interface IStartpointInRangeIndex<TInterval extends ISerializableInterval> extends IntervalIndex<TInterval> {
820
- /**
821
- * @returns an array of all intervals contained in this collection whose startpoints locate in the range [start, end] (includes both ends)
822
- */
823
- findIntervalsWithStartpointInRange(start: number, end: number): TInterval[];
824
- }
678
+ /* Excluded from this release type: IStartpointInRangeIndex */
825
679
 
826
680
  /* Excluded from this release type: IValueOpEmitter */
827
681
 
828
- /**
829
- * Invoke revertibles to reverse prior edits
830
- *
831
- * @alpha
832
- */
833
- export declare function revertSharedStringRevertibles(sharedString: SharedString, revertibles: SharedStringRevertible[]): void;
682
+ /* Excluded from this release type: MergeTreeDeltaRevertible */
683
+
684
+ /* Excluded from this release type: revertSharedStringRevertibles */
834
685
 
835
686
  /**
836
687
  * The event object returned on sequenceDelta events.
@@ -842,7 +693,7 @@ export declare function revertSharedStringRevertibles(sharedString: SharedString
842
693
  * For group ops, each op will get its own event, and the group op property will be set on the op args.
843
694
  *
844
695
  * Ops may get multiple events. For instance, an insert-replace will get a remove then an insert event.
845
- * @public
696
+ * @alpha
846
697
  */
847
698
  export declare class SequenceDeltaEvent extends SequenceEvent<MergeTreeDeltaOperationType> {
848
699
  readonly opArgs: IMergeTreeDeltaOpArgs;
@@ -859,7 +710,7 @@ export declare class SequenceDeltaEvent extends SequenceEvent<MergeTreeDeltaOper
859
710
  * The properties of this object and its sub-objects represent the state of the sequence at the
860
711
  * point in time at which the operation was applied.
861
712
  * They will not take into any future modifications performed to the underlying sequence and merge tree.
862
- * @public
713
+ * @alpha
863
714
  */
864
715
  export declare abstract class SequenceEvent<TOperation extends MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationTypes> {
865
716
  readonly deltaArgs: IMergeTreeDeltaCallbackArgs<TOperation>;
@@ -914,7 +765,7 @@ export declare abstract class SequenceEvent<TOperation extends MergeTreeDeltaOpe
914
765
  * `mergeTreeReferencesCanSlideToEndpoint` feature flag set to true, the endpoints
915
766
  * of the interval that are exclusive will have the ability to slide to these
916
767
  * special endpoint segments.
917
- * @public
768
+ * @alpha
918
769
  */
919
770
  export declare class SequenceInterval implements ISerializableInterval {
920
771
  private readonly client;
@@ -935,8 +786,12 @@ export declare class SequenceInterval implements ISerializableInterval {
935
786
  * {@inheritDoc ISerializableInterval.properties}
936
787
  */
937
788
  properties: PropertySet;
938
- /* Excluded from this release type: propertyManager */
939
- /* Excluded from this release type: stickiness */
789
+ /**
790
+ * {@inheritDoc ISerializableInterval.propertyManager}
791
+ */
792
+ propertyManager: PropertiesManager;
793
+ /***/
794
+ get stickiness(): IntervalStickiness;
940
795
  constructor(client: Client,
941
796
  /**
942
797
  * Start endpoint of this interval.
@@ -949,9 +804,18 @@ export declare class SequenceInterval implements ISerializableInterval {
949
804
  */
950
805
  end: LocalReferencePosition, intervalType: IntervalType, props?: PropertySet, startSide?: Side, endSide?: Side);
951
806
  private callbacks?;
952
- /* Excluded from this release type: addPositionChangeListeners */
953
- /* Excluded from this release type: removePositionChangeListeners */
954
- /* Excluded from this release type: serialize */
807
+ /**
808
+ * Subscribes to position change events on this interval if there are no current listeners.
809
+ */
810
+ addPositionChangeListeners(beforePositionChange: () => void, afterPositionChange: () => void): void;
811
+ /**
812
+ * Removes the currently subscribed position change listeners.
813
+ */
814
+ removePositionChangeListeners(): void;
815
+ /**
816
+ * {@inheritDoc ISerializableInterval.serialize}
817
+ */
818
+ serialize(): ISerializedInterval;
955
819
  /**
956
820
  * {@inheritDoc IInterval.clone}
957
821
  */
@@ -976,48 +840,28 @@ export declare class SequenceInterval implements ISerializableInterval {
976
840
  * {@inheritDoc ISerializableInterval.getIntervalId}
977
841
  */
978
842
  getIntervalId(): string;
979
- /* Excluded from this release type: union */
980
- /* Excluded from this release type: addProperties */
843
+ /**
844
+ * {@inheritDoc IInterval.union}
845
+ */
846
+ union(b: SequenceInterval): SequenceInterval;
847
+ /**
848
+ * {@inheritDoc ISerializableInterval.addProperties}
849
+ */
850
+ addProperties(newProps: PropertySet, collab?: boolean, seq?: number, op?: ICombiningOp): PropertySet | undefined;
981
851
  /**
982
852
  * @returns whether this interval overlaps two numerical positions.
983
853
  */
984
854
  overlapsPos(bstart: number, bend: number): boolean;
985
- /* Excluded from this release type: modify */
855
+ /**
856
+ * {@inheritDoc IInterval.modify}
857
+ */
858
+ modify(label: string, start: SequencePlace | undefined, end: SequencePlace | undefined, op?: ISequencedDocumentMessage, localSeq?: number, useNewSlidingBehavior?: boolean): SequenceInterval;
986
859
  private initializeProperties;
987
860
  }
988
861
 
989
- /**
990
- * @deprecated The methods within have substitutions
991
- * @public
992
- */
993
- export declare const sequenceIntervalHelpers: IIntervalHelpers<SequenceInterval>;
862
+ /* Excluded from this release type: sequenceIntervalHelpers */
994
863
 
995
- /**
996
- * This namespace contains specialiazations of indexes which support spatial queries
997
- * specifically for `SequenceInterval`s.
998
- * @public
999
- */
1000
- export declare namespace SequenceIntervalIndexes {
1001
- /**
1002
- * Collection of intervals.
1003
- *
1004
- * Provides additional APIs to support efficiently querying a collection of intervals based on segments and offset.
1005
- */
1006
- export interface Overlapping extends IOverlappingIntervalsIndex<SequenceInterval> {
1007
- /**
1008
- * Finds overlapping intervals within the specified range.
1009
- *
1010
- * @returns an array of all intervals that overlap with the specified SegOff range (includes both ends)
1011
- */
1012
- findOverlappingIntervalsBySegoff(startSegoff: {
1013
- segment: ISegment | undefined;
1014
- offset: number | undefined;
1015
- }, endSegoff: {
1016
- segment: ISegment | undefined;
1017
- offset: number | undefined;
1018
- }): Iterable<SequenceInterval>;
1019
- }
1020
- }
864
+ /* Excluded from this release type: SequenceIntervalIndexes */
1021
865
 
1022
866
  /**
1023
867
  * The event object returned on maintenance events.
@@ -1025,44 +869,14 @@ export declare namespace SequenceIntervalIndexes {
1025
869
  * The properties of this object and its sub-objects represent the state of the sequence at the
1026
870
  * point in time at which the operation was applied.
1027
871
  * They will not take into consideration any future modifications performed to the underlying sequence and merge tree.
1028
- * @public
872
+ * @alpha
1029
873
  */
1030
874
  export declare class SequenceMaintenanceEvent extends SequenceEvent<MergeTreeMaintenanceType> {
1031
875
  readonly opArgs: IMergeTreeDeltaOpArgs | undefined;
1032
876
  constructor(opArgs: IMergeTreeDeltaOpArgs | undefined, deltaArgs: IMergeTreeMaintenanceCallbackArgs, mergeTreeClient: Client);
1033
877
  }
1034
878
 
1035
- /**
1036
- * Optional flags that configure options for sequence DDSs
1037
- * @public
1038
- */
1039
- export declare interface SequenceOptions {
1040
- /**
1041
- * Enable the ability to use interval APIs that rely on positions before and
1042
- * after individual characters, referred to as "sides". See {@link SequencePlace}
1043
- * for additional context.
1044
- *
1045
- * This flag must be enabled to pass instances of {@link SequencePlace} to
1046
- * any IIntervalCollection API.
1047
- *
1048
- * Also see the feature flag `mergeTreeReferencesCanSlideToEndpoint` to allow
1049
- * endpoints to slide to the special endpoint segments.
1050
- *
1051
- * The default value is false.
1052
- */
1053
- intervalStickinessEnabled: boolean;
1054
- /**
1055
- * Enable the ability for interval endpoints to slide to the special endpoint
1056
- * segments that exist before and after the bounds of the string. This is
1057
- * primarily useful for workflows involving interval stickiness, and it is
1058
- * suggested to enable both this flag and `intervalStickinessEnabled` at the
1059
- * same time.
1060
- *
1061
- * The default value is false.
1062
- */
1063
- mergeTreeReferencesCanSlideToEndpoint: boolean;
1064
- [key: string]: boolean;
1065
- }
879
+ /* Excluded from this release type: SequenceOptions */
1066
880
 
1067
881
  /**
1068
882
  * Defines a position and side relative to a character in a sequence.
@@ -1087,81 +901,37 @@ export declare interface SequenceOptions {
1087
901
  * If a SequencePlace is the endpoint of a range (e.g. start/end of an interval or search range),
1088
902
  * the Side value means it is exclusive if it is nearer to the other position and inclusive if it is farther.
1089
903
  * E.g. the start of a range with Side.After is exclusive of the character at the position.
1090
- * @public
904
+ * @alpha
1091
905
  */
1092
906
  export declare type SequencePlace = number | "start" | "end" | InteriorSequencePlace;
1093
907
 
1094
908
  /* Excluded from this release type: SerializedIntervalDelta */
1095
909
 
1096
- /**
1097
- * @deprecated `SharedIntervalCollection` is not maintained and is planned to be removed.
1098
- * @public
1099
- */
1100
- export declare class SharedIntervalCollection extends SharedObject implements ISharedIntervalCollection<Interval> {
1101
- /**
1102
- * Create a SharedIntervalCollection
1103
- *
1104
- * @param runtime - data store runtime the new shared map belongs to
1105
- * @param id - optional name of the shared map
1106
- * @returns newly create shared map (but not attached yet)
1107
- */
1108
- static create(runtime: IFluidDataStoreRuntime, id?: string): SharedIntervalCollection;
1109
- /**
1110
- * Get a factory for SharedIntervalCollection to register with the data store.
1111
- *
1112
- * @returns a factory that creates and load SharedIntervalCollection
1113
- */
1114
- static getFactory(): IChannelFactory;
1115
- readonly [Symbol.toStringTag]: string;
1116
- private readonly intervalCollections;
1117
- /**
1118
- * Constructs a new shared SharedIntervalCollection. If the object is non-local an id and service interfaces will
1119
- * be provided
1120
- */
1121
- constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
1122
- getIntervalCollection(label: string): IIntervalCollection<Interval>;
1123
- protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
1124
- protected reSubmitCore(content: any, localOpMetadata: unknown): void;
1125
- protected onDisconnect(): void;
1126
- /**
1127
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
1128
- */
1129
- protected loadCore(storage: IChannelStorageService): Promise<void>;
1130
- protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
1131
- /**
1132
- * Creates the full path of the intervalCollection label
1133
- * @param label - the incoming label
1134
- */
1135
- protected getIntervalCollectionPath(label: string): string;
1136
- protected applyStashedOp(): void;
1137
- }
910
+ /* Excluded from this release type: SharedIntervalCollection */
1138
911
 
1139
- /**
1140
- * The factory that defines the SharedIntervalCollection.
1141
- * @deprecated `SharedIntervalCollection` is not maintained and is planned to be removed.
1142
- * @public
1143
- */
1144
- export declare class SharedIntervalCollectionFactory implements IChannelFactory {
1145
- static readonly Type = "https://graph.microsoft.com/types/sharedIntervalCollection";
1146
- static readonly Attributes: IChannelAttributes;
1147
- get type(): string;
1148
- get attributes(): IChannelAttributes;
1149
- /**
1150
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
1151
- */
1152
- load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<SharedIntervalCollection>;
1153
- create(runtime: IFluidDataStoreRuntime, id: string): SharedIntervalCollection;
1154
- }
912
+ /* Excluded from this release type: SharedIntervalCollectionFactory */
1155
913
 
1156
914
  /**
1157
- * @public
915
+ * @alpha
1158
916
  */
1159
917
  export declare abstract class SharedSegmentSequence<T extends ISegment> extends SharedObject<ISharedSegmentSequenceEvents> implements ISharedIntervalCollection<SequenceInterval>, MergeTreeRevertibleDriver {
1160
918
  private readonly dataStoreRuntime;
1161
919
  id: string;
1162
920
  readonly segmentFromSpec: (spec: IJSONSegment) => ISegment;
1163
921
  get loaded(): Promise<void>;
1164
- /* Excluded from this release type: guardReentrancy */
922
+ /**
923
+ * This is a safeguard to avoid problematic reentrancy of local ops. This type of scenario occurs if the user of SharedString subscribes
924
+ * to the `sequenceDelta` event and uses the callback for a local op to submit further local ops.
925
+ * Historically (before 2.0.0-internal.6.1.0), doing so would result in eventual consistency issues or a corrupted document.
926
+ * 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,
927
+ * but there is still little test coverage for reentrant scenarios.
928
+ * Additionally, applications submitting ops from inside change events need to take extreme care that their data models also support reentrancy.
929
+ * Since this is likely not the case, by default SharedString throws when encountering reentrant ops.
930
+ *
931
+ * An application using SharedString which explicitly wants to opt in to allowing reentrancy anyway can set `sharedStringPreventReentrancy`
932
+ * on the data store options to `false`.
933
+ */
934
+ protected guardReentrancy: <TRet>(callback: () => TRet) => TRet;
1165
935
  private static createOpsFromDelta;
1166
936
  protected client: Client;
1167
937
  /** `Deferred` that triggers once the object is loaded */
@@ -1368,36 +1138,7 @@ export declare abstract class SharedSegmentSequence<T extends ISegment> extends
1368
1138
  private initializeIntervalCollections;
1369
1139
  }
1370
1140
 
1371
- /**
1372
- * @deprecated SharedSequence will be removed in a upcoming release. It has been moved to the fluid-experimental/sequence-deprecated package
1373
- * @public
1374
- */
1375
- export declare class SharedSequence<T> extends SharedSegmentSequence<SubSequence<T>> {
1376
- id: string;
1377
- constructor(document: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes, specToSegment: (spec: IJSONSegment) => ISegment);
1378
- /**
1379
- * @param pos - The position to insert the items at.
1380
- * @param items - The items to insert.
1381
- * @param props - Optional. Properties to set on the inserted items.
1382
- */
1383
- insert(pos: number, items: Serializable<T>[], props?: PropertySet): void;
1384
- /**
1385
- * @param start - The inclusive start of the range to remove
1386
- * @param end - The exclusive end of the range to remove
1387
- */
1388
- remove(start: number, end: number): void;
1389
- /**
1390
- * Returns the total count of items in the sequence
1391
- */
1392
- getItemCount(): number;
1393
- /**
1394
- * Gets the items in the specified range
1395
- *
1396
- * @param start - The inclusive start of the range
1397
- * @param end - The exclusive end of the range
1398
- */
1399
- getItems(start: number, end?: number): Serializable<T>[];
1400
- }
1141
+ /* Excluded from this release type: SharedSequence */
1401
1142
 
1402
1143
  /**
1403
1144
  * The Shared String is a specialized data structure for handling collaborative
@@ -1407,8 +1148,7 @@ export declare class SharedSequence<T> extends SharedSegmentSequence<SubSequence
1407
1148
  * In addition to text, a Shared String can also contain markers. Markers can be
1408
1149
  * used to store metadata at positions within the text, like the details of an
1409
1150
  * image or Fluid object that should be rendered with the text.
1410
- *
1411
- * @public
1151
+ * @alpha
1412
1152
  */
1413
1153
  export declare class SharedString extends SharedSegmentSequence<SharedStringSegment> implements ISharedString {
1414
1154
  id: string;
@@ -1469,6 +1209,10 @@ export declare class SharedString extends SharedSegmentSequence<SharedStringSegm
1469
1209
  * @param marker - The marker to annotate
1470
1210
  * @param props - The properties to annotate the marker with
1471
1211
  * @param consensusCallback - The callback called when consensus is reached
1212
+ *
1213
+ * @deprecated We no longer intend to support this functionality and it will
1214
+ * be removed in a future release. There is no replacement for this
1215
+ * functionality.
1472
1216
  */
1473
1217
  annotateMarkerNotifyConsensus(marker: Marker, props: PropertySet, callback: (m: Marker) => void): void;
1474
1218
  /**
@@ -1524,7 +1268,7 @@ export declare class SharedString extends SharedSegmentSequence<SharedStringSegm
1524
1268
  }
1525
1269
 
1526
1270
  /**
1527
- * @public
1271
+ * @alpha
1528
1272
  */
1529
1273
  export declare class SharedStringFactory implements IChannelFactory {
1530
1274
  static Type: string;
@@ -1539,15 +1283,10 @@ export declare class SharedStringFactory implements IChannelFactory {
1539
1283
  create(document: IFluidDataStoreRuntime, id: string): SharedString;
1540
1284
  }
1541
1285
 
1542
- /**
1543
- * Data for undoing edits on SharedStrings and Intervals.
1544
- *
1545
- * @alpha
1546
- */
1547
- export declare type SharedStringRevertible = MergeTreeDeltaRevertible | IntervalRevertible;
1286
+ /* Excluded from this release type: SharedStringRevertible */
1548
1287
 
1549
1288
  /**
1550
- * @public
1289
+ * @alpha
1551
1290
  */
1552
1291
  export declare type SharedStringSegment = TextSegment | Marker;
1553
1292
 
@@ -1555,33 +1294,13 @@ export declare type SharedStringSegment = TextSegment | Marker;
1555
1294
  * Defines a side relative to a character in a sequence.
1556
1295
  *
1557
1296
  * @remarks See {@link SequencePlace} for additional context on usage.
1558
- * @public
1297
+ * @alpha
1559
1298
  */
1560
1299
  export declare enum Side {
1561
1300
  Before = 0,
1562
1301
  After = 1
1563
1302
  }
1564
1303
 
1565
- /**
1566
- * @deprecated SubSequence will be removed in a upcoming release. It has been moved to the fluid-experimental/sequence-deprecated package
1567
- * @public
1568
- */
1569
- export declare class SubSequence<T> extends BaseSegment {
1570
- items: Serializable<T>[];
1571
- static readonly typeString: string;
1572
- static is(segment: ISegment): segment is SubSequence<any>;
1573
- static fromJSONObject<U>(spec: Serializable): SubSequence<U> | undefined;
1574
- readonly type: string;
1575
- constructor(items: Serializable<T>[]);
1576
- toJSONObject(): IJSONRunSegment<T>;
1577
- clone(start?: number, end?: number): SubSequence<T>;
1578
- canAppend(segment: ISegment): boolean;
1579
- toString(): string;
1580
- append(segment: ISegment): void;
1581
- removeRange(start: number, end: number): boolean;
1582
- protected createSplitSegmentAt(pos: number): SubSequence<T> | undefined;
1583
- }
1584
-
1585
- /* Excluded from this release type: TypedEventEmitter */
1304
+ /* Excluded from this release type: SubSequence */
1586
1305
 
1587
1306
  export { }