@fluidframework/sequence 2.0.0-internal.7.1.0 → 2.0.0-internal.7.2.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 (180) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/api-extractor.json +1 -16
  3. package/api-report/sequence.api.md +2 -0
  4. package/dist/defaultMapInterfaces.d.ts +1 -0
  5. package/dist/defaultMapInterfaces.d.ts.map +1 -1
  6. package/dist/defaultMapInterfaces.js.map +1 -1
  7. package/dist/intervalCollection.d.ts +12 -2
  8. package/dist/intervalCollection.d.ts.map +1 -1
  9. package/dist/intervalCollection.js +2 -0
  10. package/dist/intervalCollection.js.map +1 -1
  11. package/dist/intervalIndex/endpointInRangeIndex.d.ts +4 -0
  12. package/dist/intervalIndex/endpointInRangeIndex.d.ts.map +1 -1
  13. package/dist/intervalIndex/endpointInRangeIndex.js +3 -0
  14. package/dist/intervalIndex/endpointInRangeIndex.js.map +1 -1
  15. package/dist/intervalIndex/endpointIndex.d.ts +6 -0
  16. package/dist/intervalIndex/endpointIndex.d.ts.map +1 -1
  17. package/dist/intervalIndex/endpointIndex.js +3 -0
  18. package/dist/intervalIndex/endpointIndex.js.map +1 -1
  19. package/dist/intervalIndex/idIntervalIndex.d.ts +6 -0
  20. package/dist/intervalIndex/idIntervalIndex.d.ts.map +1 -1
  21. package/dist/intervalIndex/idIntervalIndex.js +3 -0
  22. package/dist/intervalIndex/idIntervalIndex.js.map +1 -1
  23. package/dist/intervalIndex/intervalIndex.d.ts +1 -0
  24. package/dist/intervalIndex/intervalIndex.d.ts.map +1 -1
  25. package/dist/intervalIndex/intervalIndex.js.map +1 -1
  26. package/dist/intervalIndex/overlappingIntervalsIndex.d.ts +9 -0
  27. package/dist/intervalIndex/overlappingIntervalsIndex.d.ts.map +1 -1
  28. package/dist/intervalIndex/overlappingIntervalsIndex.js +6 -0
  29. package/dist/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
  30. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.d.ts +3 -0
  31. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.d.ts.map +1 -1
  32. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.js +6 -0
  33. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.js.map +1 -1
  34. package/dist/intervalIndex/sequenceIntervalIndexes.d.ts +1 -0
  35. package/dist/intervalIndex/sequenceIntervalIndexes.d.ts.map +1 -1
  36. package/dist/intervalIndex/sequenceIntervalIndexes.js.map +1 -1
  37. package/dist/intervalIndex/startpointInRangeIndex.d.ts +4 -0
  38. package/dist/intervalIndex/startpointInRangeIndex.d.ts.map +1 -1
  39. package/dist/intervalIndex/startpointInRangeIndex.js +3 -0
  40. package/dist/intervalIndex/startpointInRangeIndex.js.map +1 -1
  41. package/dist/intervals/interval.d.ts +1 -0
  42. package/dist/intervals/interval.d.ts.map +1 -1
  43. package/dist/intervals/interval.js +1 -0
  44. package/dist/intervals/interval.js.map +1 -1
  45. package/dist/intervals/intervalUtils.d.ts +9 -1
  46. package/dist/intervals/intervalUtils.d.ts.map +1 -1
  47. package/dist/intervals/intervalUtils.js +4 -1
  48. package/dist/intervals/intervalUtils.js.map +1 -1
  49. package/dist/intervals/sequenceInterval.d.ts +2 -0
  50. package/dist/intervals/sequenceInterval.d.ts.map +1 -1
  51. package/dist/intervals/sequenceInterval.js +2 -0
  52. package/dist/intervals/sequenceInterval.js.map +1 -1
  53. package/dist/packageVersion.d.ts +1 -1
  54. package/dist/packageVersion.js +1 -1
  55. package/dist/packageVersion.js.map +1 -1
  56. package/dist/sequence.d.ts +7 -3
  57. package/dist/sequence.d.ts.map +1 -1
  58. package/dist/sequence.js +8 -4
  59. package/dist/sequence.js.map +1 -1
  60. package/dist/sequenceDeltaEvent.d.ts +4 -0
  61. package/dist/sequenceDeltaEvent.d.ts.map +1 -1
  62. package/dist/sequenceDeltaEvent.js +3 -0
  63. package/dist/sequenceDeltaEvent.js.map +1 -1
  64. package/dist/sequenceFactory.d.ts +3 -0
  65. package/dist/sequenceFactory.d.ts.map +1 -1
  66. package/dist/sequenceFactory.js +3 -0
  67. package/dist/sequenceFactory.js.map +1 -1
  68. package/dist/sharedIntervalCollection.d.ts +5 -0
  69. package/dist/sharedIntervalCollection.d.ts.map +1 -1
  70. package/dist/sharedIntervalCollection.js +2 -0
  71. package/dist/sharedIntervalCollection.js.map +1 -1
  72. package/dist/sharedSequence.d.ts +6 -3
  73. package/dist/sharedSequence.d.ts.map +1 -1
  74. package/dist/sharedSequence.js +4 -2
  75. package/dist/sharedSequence.js.map +1 -1
  76. package/dist/sharedString.d.ts +16 -1
  77. package/dist/sharedString.d.ts.map +1 -1
  78. package/dist/sharedString.js +14 -1
  79. package/dist/sharedString.js.map +1 -1
  80. package/lib/defaultMapInterfaces.d.ts +1 -0
  81. package/lib/defaultMapInterfaces.d.ts.map +1 -1
  82. package/lib/defaultMapInterfaces.js.map +1 -1
  83. package/lib/intervalCollection.d.ts +12 -2
  84. package/lib/intervalCollection.d.ts.map +1 -1
  85. package/lib/intervalCollection.js +2 -0
  86. package/lib/intervalCollection.js.map +1 -1
  87. package/lib/intervalIndex/endpointInRangeIndex.d.ts +4 -0
  88. package/lib/intervalIndex/endpointInRangeIndex.d.ts.map +1 -1
  89. package/lib/intervalIndex/endpointInRangeIndex.js +3 -0
  90. package/lib/intervalIndex/endpointInRangeIndex.js.map +1 -1
  91. package/lib/intervalIndex/endpointIndex.d.ts +6 -0
  92. package/lib/intervalIndex/endpointIndex.d.ts.map +1 -1
  93. package/lib/intervalIndex/endpointIndex.js +3 -0
  94. package/lib/intervalIndex/endpointIndex.js.map +1 -1
  95. package/lib/intervalIndex/idIntervalIndex.d.ts +6 -0
  96. package/lib/intervalIndex/idIntervalIndex.d.ts.map +1 -1
  97. package/lib/intervalIndex/idIntervalIndex.js +3 -0
  98. package/lib/intervalIndex/idIntervalIndex.js.map +1 -1
  99. package/lib/intervalIndex/intervalIndex.d.ts +1 -0
  100. package/lib/intervalIndex/intervalIndex.d.ts.map +1 -1
  101. package/lib/intervalIndex/intervalIndex.js.map +1 -1
  102. package/lib/intervalIndex/overlappingIntervalsIndex.d.ts +9 -0
  103. package/lib/intervalIndex/overlappingIntervalsIndex.d.ts.map +1 -1
  104. package/lib/intervalIndex/overlappingIntervalsIndex.js +6 -0
  105. package/lib/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
  106. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.d.ts +3 -0
  107. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.d.ts.map +1 -1
  108. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.js +6 -0
  109. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.js.map +1 -1
  110. package/lib/intervalIndex/sequenceIntervalIndexes.d.ts +1 -0
  111. package/lib/intervalIndex/sequenceIntervalIndexes.d.ts.map +1 -1
  112. package/lib/intervalIndex/sequenceIntervalIndexes.js.map +1 -1
  113. package/lib/intervalIndex/startpointInRangeIndex.d.ts +4 -0
  114. package/lib/intervalIndex/startpointInRangeIndex.d.ts.map +1 -1
  115. package/lib/intervalIndex/startpointInRangeIndex.js +3 -0
  116. package/lib/intervalIndex/startpointInRangeIndex.js.map +1 -1
  117. package/lib/intervals/interval.d.ts +1 -0
  118. package/lib/intervals/interval.d.ts.map +1 -1
  119. package/lib/intervals/interval.js +1 -0
  120. package/lib/intervals/interval.js.map +1 -1
  121. package/lib/intervals/intervalUtils.d.ts +9 -1
  122. package/lib/intervals/intervalUtils.d.ts.map +1 -1
  123. package/lib/intervals/intervalUtils.js +4 -1
  124. package/lib/intervals/intervalUtils.js.map +1 -1
  125. package/lib/intervals/sequenceInterval.d.ts +2 -0
  126. package/lib/intervals/sequenceInterval.d.ts.map +1 -1
  127. package/lib/intervals/sequenceInterval.js +2 -0
  128. package/lib/intervals/sequenceInterval.js.map +1 -1
  129. package/lib/packageVersion.d.ts +1 -1
  130. package/lib/packageVersion.js +1 -1
  131. package/lib/packageVersion.js.map +1 -1
  132. package/lib/sequence.d.ts +7 -3
  133. package/lib/sequence.d.ts.map +1 -1
  134. package/lib/sequence.js +8 -4
  135. package/lib/sequence.js.map +1 -1
  136. package/lib/sequenceDeltaEvent.d.ts +4 -0
  137. package/lib/sequenceDeltaEvent.d.ts.map +1 -1
  138. package/lib/sequenceDeltaEvent.js +3 -0
  139. package/lib/sequenceDeltaEvent.js.map +1 -1
  140. package/lib/sequenceFactory.d.ts +3 -0
  141. package/lib/sequenceFactory.d.ts.map +1 -1
  142. package/lib/sequenceFactory.js +3 -0
  143. package/lib/sequenceFactory.js.map +1 -1
  144. package/lib/sharedIntervalCollection.d.ts +5 -0
  145. package/lib/sharedIntervalCollection.d.ts.map +1 -1
  146. package/lib/sharedIntervalCollection.js +2 -0
  147. package/lib/sharedIntervalCollection.js.map +1 -1
  148. package/lib/sharedSequence.d.ts +6 -3
  149. package/lib/sharedSequence.d.ts.map +1 -1
  150. package/lib/sharedSequence.js +4 -2
  151. package/lib/sharedSequence.js.map +1 -1
  152. package/lib/sharedString.d.ts +16 -1
  153. package/lib/sharedString.d.ts.map +1 -1
  154. package/lib/sharedString.js +14 -1
  155. package/lib/sharedString.js.map +1 -1
  156. package/package.json +24 -21
  157. package/src/defaultMapInterfaces.ts +1 -0
  158. package/src/intervalCollection.ts +12 -2
  159. package/src/intervalIndex/endpointInRangeIndex.ts +4 -0
  160. package/src/intervalIndex/endpointIndex.ts +6 -0
  161. package/src/intervalIndex/idIntervalIndex.ts +6 -0
  162. package/src/intervalIndex/intervalIndex.ts +1 -0
  163. package/src/intervalIndex/overlappingIntervalsIndex.ts +9 -0
  164. package/src/intervalIndex/overlappingSequenceIntervalsIndex.ts +6 -0
  165. package/src/intervalIndex/sequenceIntervalIndexes.ts +1 -0
  166. package/src/intervalIndex/startpointInRangeIndex.ts +4 -1
  167. package/src/intervals/interval.ts +1 -0
  168. package/src/intervals/intervalUtils.ts +9 -1
  169. package/src/intervals/sequenceInterval.ts +2 -0
  170. package/src/packageVersion.ts +1 -1
  171. package/src/sequence.ts +9 -4
  172. package/src/sequenceDeltaEvent.ts +4 -0
  173. package/src/sequenceFactory.ts +3 -0
  174. package/src/sharedIntervalCollection.ts +5 -0
  175. package/src/sharedSequence.ts +6 -3
  176. package/src/sharedString.ts +23 -1
  177. package/dist/sequence-alpha.d.ts +0 -1500
  178. package/dist/sequence-beta.d.ts +0 -1420
  179. package/dist/sequence-public.d.ts +0 -1420
  180. package/dist/sequence-untrimmed.d.ts +0 -1672
@@ -1,1420 +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 { ICombiningOp } from '@fluidframework/merge-tree';
22
- import { IEvent } from '@fluidframework/core-interfaces';
23
- import { IEventThisPlaceHolder } from '@fluidframework/core-interfaces';
24
- import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
25
- import { IFluidSerializer } from '@fluidframework/shared-object-base';
26
- import { IJSONSegment } from '@fluidframework/merge-tree';
27
- import { IMergeTreeDeltaCallbackArgs } from '@fluidframework/merge-tree';
28
- import { IMergeTreeDeltaOpArgs } from '@fluidframework/merge-tree';
29
- import { IMergeTreeGroupMsg } from '@fluidframework/merge-tree';
30
- import { IMergeTreeInsertMsg } from '@fluidframework/merge-tree';
31
- import { IMergeTreeMaintenanceCallbackArgs } from '@fluidframework/merge-tree';
32
- import { IMergeTreeOp } from '@fluidframework/merge-tree';
33
- import { IMergeTreeRemoveMsg } from '@fluidframework/merge-tree';
34
- import { IRelativePosition } from '@fluidframework/merge-tree';
35
- import { ISegment } from '@fluidframework/merge-tree';
36
- import { ISegmentAction } from '@fluidframework/merge-tree';
37
- import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
38
- import { ISharedObjectEvents } from '@fluidframework/shared-object-base';
39
- import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
40
- import { ITelemetryContext } from '@fluidframework/runtime-definitions';
41
- import { LocalReferencePosition } from '@fluidframework/merge-tree';
42
- import { Marker } from '@fluidframework/merge-tree';
43
- import { MergeTreeDeltaOperationType } from '@fluidframework/merge-tree';
44
- import { MergeTreeDeltaOperationTypes } from '@fluidframework/merge-tree';
45
- import { MergeTreeMaintenanceType } from '@fluidframework/merge-tree';
46
- import { PropertiesManager } from '@fluidframework/merge-tree';
47
- import { PropertySet } from '@fluidframework/merge-tree';
48
- import { RangeStackMap } from '@fluidframework/merge-tree';
49
- import { ReferencePosition } from '@fluidframework/merge-tree';
50
- import { ReferenceType } from '@fluidframework/merge-tree';
51
- import { Serializable } from '@fluidframework/datastore-definitions';
52
- import { SharedObject } from '@fluidframework/shared-object-base';
53
- import { SlidingPreference } from '@fluidframework/merge-tree';
54
- import { SummarySerializer } from '@fluidframework/shared-object-base';
55
- import { TextSegment } from '@fluidframework/merge-tree';
56
-
57
- /* Excluded from this release type: appendAddIntervalToRevertibles */
58
-
59
- /* Excluded from this release type: appendChangeIntervalToRevertibles */
60
-
61
- /* Excluded from this release type: appendDeleteIntervalToRevertibles */
62
-
63
- /* Excluded from this release type: appendIntervalPropertyChangedToRevertibles */
64
-
65
- /* Excluded from this release type: appendSharedStringDeltaToRevertibles */
66
-
67
- export declare function createEndpointIndex(sharedString: SharedString): IEndpointIndex<SequenceInterval>;
68
-
69
- export declare function createEndpointInRangeIndex(sharedString: SharedString): IEndpointInRangeIndex<SequenceInterval>;
70
-
71
- export declare function createIdIntervalIndex<TInterval extends ISerializableInterval>(): IIdIntervalIndex<TInterval>;
72
-
73
- export declare function createOverlappingIntervalsIndex(sharedString: SharedString): IOverlappingIntervalsIndex<SequenceInterval>;
74
-
75
- export declare function createOverlappingSequenceIntervalsIndex(sharedString: SharedString): SequenceIntervalIndexes.Overlapping;
76
-
77
- export declare function createStartpointInRangeIndex(sharedString: SharedString): IStartpointInRangeIndex<SequenceInterval>;
78
-
79
- export declare type DeserializeCallback = (properties: PropertySet) => void;
80
-
81
- /* Excluded from this release type: discardSharedStringRevertibles */
82
-
83
- /**
84
- * Splits the text into regions ending with markers with the given `label`.
85
- * @param sharedString - String to retrieve text and markers from
86
- * @param label - label to split on
87
- * @returns Two parallel lists of text and markers, split by markers with the provided `label`.
88
- *
89
- * For example:
90
- * ```typescript
91
- * // Say sharedstring has contents "hello<paragraph marker 1>world<paragraph marker 2>missing".
92
- * const { parallelText, parallelMarkers } = getTextAndMarkers(sharedString, "paragraph");
93
- * // parallelText === ["hello", "world"]
94
- * // parallelMarkers === [<paragraph marker 1 object>, <paragraph marker 2 object>]
95
- * // Note parallelText does not include "missing".
96
- * ```
97
- */
98
- export declare function getTextAndMarkers(sharedString: SharedString, label: string, start?: number, end?: number): {
99
- parallelText: string[];
100
- parallelMarkers: Marker[];
101
- };
102
-
103
- export declare interface IEndpointIndex<TInterval extends ISerializableInterval> extends IntervalIndex<TInterval> {
104
- /**
105
- * @returns the previous interval based on the given position number.
106
- * If no such interval exists in this index, returns `undefined`
107
- */
108
- previousInterval(pos: number): TInterval | undefined;
109
- /**
110
- * @returns the next interval based on the given position number.
111
- * If no such interval exists in this index, returns `undefined`
112
- */
113
- nextInterval(pos: number): TInterval | undefined;
114
- }
115
-
116
- /**
117
- * Collection of intervals.
118
- *
119
- * Provide additional APIs to support efficiently querying a collection of intervals whose endpoints fall within a specified range.
120
- */
121
- export declare interface IEndpointInRangeIndex<TInterval extends ISerializableInterval> extends IntervalIndex<TInterval> {
122
- /**
123
- * @returns an array of all intervals contained in this collection whose endpoints locate in the range [start, end] (includes both ends)
124
- */
125
- findIntervalsWithEndpointInRange(start: number, end: number): TInterval[];
126
- }
127
-
128
- export declare interface IIdIntervalIndex<TInterval extends ISerializableInterval> extends IntervalIndex<TInterval>, Iterable<TInterval> {
129
- getIntervalById(id: string): TInterval | undefined;
130
- [Symbol.iterator](): Iterator<TInterval>;
131
- }
132
-
133
- /**
134
- * Basic interval abstraction
135
- */
136
- export declare interface IInterval {
137
- /**
138
- * @returns a new interval object with identical semantics.
139
- */
140
- clone(): IInterval;
141
- /**
142
- * Compares this interval to `b` with standard comparator semantics:
143
- * - returns -1 if this is less than `b`
144
- * - returns 1 if this is greater than `b`
145
- * - returns 0 if this is equivalent to `b`
146
- * @param b - Interval to compare against
147
- */
148
- compare(b: IInterval): number;
149
- /**
150
- * Compares the start endpoint of this interval to `b`'s start endpoint.
151
- * Standard comparator semantics apply.
152
- * @param b - Interval to compare against
153
- */
154
- compareStart(b: IInterval): number;
155
- /**
156
- * Compares the end endpoint of this interval to `b`'s end endpoint.
157
- * Standard comparator semantics apply.
158
- * @param b - Interval to compare against
159
- */
160
- compareEnd(b: IInterval): number;
161
- /* Excluded from this release type: modify */
162
- /**
163
- * @returns whether this interval overlaps with `b`.
164
- * Intervals are considered to overlap if their intersection is non-empty.
165
- */
166
- overlaps(b: IInterval): boolean;
167
- /* Excluded from this release type: union */
168
- }
169
-
170
- /**
171
- * Collection of intervals that supports addition, modification, removal, and efficient spatial querying.
172
- * Changes to this collection will be incur updates on collaborating clients (i.e. they are not local-only).
173
- */
174
- export declare interface IIntervalCollection<TInterval extends ISerializableInterval> extends TypedEventEmitter<IIntervalCollectionEvent<TInterval>> {
175
- readonly attached: boolean;
176
- /**
177
- * Attaches an index to this collection.
178
- * All intervals which are part of this collection will be added to the index, and the index will automatically
179
- * be updated when this collection updates due to local or remote changes.
180
- *
181
- * @remarks After attaching an index to an interval collection, applications should typically store this
182
- * index somewhere in their in-memory data model for future reference and querying.
183
- */
184
- attachIndex(index: IntervalIndex<TInterval>): void;
185
- /**
186
- * Detaches an index from this collection.
187
- * All intervals which are part of this collection will be removed from the index, and updates to this collection
188
- * due to local or remote changes will no longer incur updates to the index.
189
- *
190
- * @returns `false` if the target index cannot be found in the indexes, otherwise remove all intervals in the index and return `true`.
191
- */
192
- detachIndex(index: IntervalIndex<TInterval>): boolean;
193
- /**
194
- * @returns the interval in this collection that has the provided `id`.
195
- * If no interval in the collection has this `id`, returns `undefined`.
196
- */
197
- getIntervalById(id: string): TInterval | undefined;
198
- /**
199
- * Creates a new interval and add it to the collection.
200
- * @deprecated - call IntervalCollection.add without specifying an intervalType
201
- * @param start - interval start position (inclusive)
202
- * @param end - interval end position (exclusive)
203
- * @param intervalType - type of the interval. All intervals are SlideOnRemove. Intervals may not be Transient.
204
- * @param props - properties of the interval
205
- * @returns The created interval
206
- * @remarks See documentation on {@link SequenceInterval} for comments on
207
- * interval endpoint semantics: there are subtleties with how the current
208
- * half-open behavior is represented.
209
- *
210
- * Note that intervals may behave unexpectedly if the entire contents
211
- * of the string are deleted. In this case, it is possible for one endpoint
212
- * of the interval to become detached, while the other remains on the string.
213
- *
214
- * By adjusting the `side` and `pos` values of the `start` and `end` parameters,
215
- * it is possible to control whether the interval expands to include content
216
- * inserted at its start or end.
217
- *
218
- * See {@link SequencePlace} for more details on the model.
219
- *
220
- * @example
221
- *
222
- * Given the string "ABCD":
223
- *
224
- *```typescript
225
- * // Refers to "BC". If any content is inserted before B or after C, this
226
- * // interval will include that content
227
- * //
228
- * // Picture:
229
- * // \{start\} - A[- B - C -]D - \{end\}
230
- * // \{start\} - A - B - C - D - \{end\}
231
- * collection.add(\{ pos: 0, side: Side.After \}, \{ pos: 3, side: Side.Before \}, IntervalType.SlideOnRemove);
232
- * // Equivalent to specifying the same positions and Side.Before.
233
- * // Refers to "ABC". Content inserted after C will be included in the
234
- * // interval, but content inserted before A will not.
235
- * // \{start\} -[A - B - C -]D - \{end\}
236
- * // \{start\} - A - B - C - D - \{end\}
237
- * collection.add(0, 3, IntervalType.SlideOnRemove);
238
- *```
239
- *
240
- * In the case of the first example, if text is deleted,
241
- *
242
- * ```typescript
243
- * // Delete the character "B"
244
- * string.removeRange(1, 2);
245
- * ```
246
- *
247
- * The start point of the interval will slide to the position immediately
248
- * before "C", and the same will be true.
249
- *
250
- * ```
251
- * \{start\} - A[- C -]D - \{end\}
252
- * ```
253
- *
254
- * In this case, text inserted immediately before "C" would be included in
255
- * the interval.
256
- *
257
- * ```typescript
258
- * string.insertText(1, "EFG");
259
- * ```
260
- *
261
- * With the string now being,
262
- *
263
- * ```
264
- * \{start\} - A[- E - F - G - C -]D - \{end\}
265
- * ```
266
- *
267
- * @privateRemarks TODO: ADO:5205 the above comment regarding behavior in
268
- * the case that the entire interval has been deleted should be resolved at
269
- * the same time as this ticket
270
- */
271
- add(start: SequencePlace, end: SequencePlace, intervalType: IntervalType, props?: PropertySet): TInterval;
272
- /**
273
- * Creates a new interval and add it to the collection.
274
- * @param start - interval start position (inclusive)
275
- * @param end - interval end position (exclusive)
276
- * @param props - properties of the interval
277
- * @returns - the created interval
278
- * @remarks - See documentation on {@link SequenceInterval} for comments on interval endpoint semantics: there are subtleties
279
- * with how the current half-open behavior is represented.
280
- */
281
- add({ start, end, props, }: {
282
- start: SequencePlace;
283
- end: SequencePlace;
284
- props?: PropertySet;
285
- }): TInterval;
286
- /**
287
- * Removes an interval from the collection.
288
- * @param id - Id of the interval to remove
289
- * @returns the removed interval
290
- */
291
- removeIntervalById(id: string): TInterval | undefined;
292
- /**
293
- * Changes the properties on an existing interval.
294
- * @param id - Id of the interval whose properties should be changed
295
- * @param props - Property set to apply to the interval. Shallow merging is used between any existing properties
296
- * and `prop`, i.e. the interval will end up with a property object equivalent to `{ ...oldProps, ...props }`.
297
- */
298
- changeProperties(id: string, props: PropertySet): any;
299
- /**
300
- * Changes the endpoints of an existing interval.
301
- * @param id - Id of the interval to change
302
- * @param start - New start value. To leave the endpoint unchanged, pass the current value.
303
- * @param end - New end value. To leave the endpoint unchanged, pass the current value.
304
- * @returns the interval that was changed, if it existed in the collection.
305
- */
306
- change(id: string, start: SequencePlace, end: SequencePlace): TInterval | undefined;
307
- attachDeserializer(onDeserialize: DeserializeCallback): void;
308
- /**
309
- * @returns an iterator over all intervals in this collection.
310
- */
311
- [Symbol.iterator](): Iterator<TInterval>;
312
- /**
313
- * @returns a forward iterator over all intervals in this collection with start point equal to `startPosition`.
314
- */
315
- CreateForwardIteratorWithStartPosition(startPosition: number): Iterator<TInterval>;
316
- /**
317
- * @returns a backward iterator over all intervals in this collection with start point equal to `startPosition`.
318
- */
319
- CreateBackwardIteratorWithStartPosition(startPosition: number): Iterator<TInterval>;
320
- /**
321
- * @returns a forward iterator over all intervals in this collection with end point equal to `endPosition`.
322
- */
323
- CreateForwardIteratorWithEndPosition(endPosition: number): Iterator<TInterval>;
324
- /**
325
- * @returns a backward iterator over all intervals in this collection with end point equal to `endPosition`.
326
- */
327
- CreateBackwardIteratorWithEndPosition(endPosition: number): Iterator<TInterval>;
328
- /**
329
- * Gathers iteration results that optionally match a start/end criteria into the provided array.
330
- * @param results - Array to gather the results into. In lieu of a return value, this array will be populated with
331
- * intervals matching the query upon edit.
332
- * @param iteratesForward - whether or not iteration should be in the forward direction
333
- * @param start - If provided, only match intervals whose start point is equal to `start`.
334
- * @param end - If provided, only match intervals whose end point is equal to `end`.
335
- */
336
- gatherIterationResults(results: TInterval[], iteratesForward: boolean, start?: number, end?: number): void;
337
- /**
338
- * @returns an array of all intervals in this collection that overlap with the interval
339
- * `[startPosition, endPosition]`.
340
- */
341
- findOverlappingIntervals(startPosition: number, endPosition: number): TInterval[];
342
- /**
343
- * Applies a function to each interval in this collection.
344
- */
345
- map(fn: (interval: TInterval) => void): void;
346
- previousInterval(pos: number): TInterval | undefined;
347
- nextInterval(pos: number): TInterval | undefined;
348
- }
349
-
350
- /**
351
- * Change events emitted by `IntervalCollection`s
352
- */
353
- export declare interface IIntervalCollectionEvent<TInterval extends ISerializableInterval> extends IEvent {
354
- /**
355
- * This event is invoked whenever the endpoints of an interval may have changed.
356
- * This can happen on:
357
- * - local endpoint modification
358
- * - ack of a remote endpoint modification
359
- * - position change due to segment sliding (slides due to mergeTree segment deletion will always appear local)
360
- * The `interval` argument reflects the new values.
361
- * `previousInterval` contains transient `ReferencePosition`s at the same location as the interval's original
362
- * endpoints. These references should be used for position information only.
363
- * `local` reflects whether the change originated locally.
364
- * `op` is defined if and only if the server has acked this change.
365
- * `slide` is true if the change is due to sliding on removal of position
366
- */
367
- (event: "changeInterval", listener: (interval: TInterval, previousInterval: TInterval, local: boolean, op: ISequencedDocumentMessage | undefined, slide: boolean) => void): any;
368
- /**
369
- * This event is invoked whenever an interval is added or removed from the collection.
370
- * `local` reflects whether the change originated locally.
371
- * `op` is defined if and only if the server has acked this change.
372
- */
373
- (event: "addInterval" | "deleteInterval", listener: (interval: TInterval, local: boolean, op: ISequencedDocumentMessage | undefined) => void): any;
374
- /**
375
- * This event is invoked whenever an interval's properties have changed.
376
- * `interval` reflects the state of the updated properties.
377
- * `propertyDeltas` is a map-like whose keys contain all values that were changed, and whose
378
- * values contain all previous values of the property set.
379
- * This object can be used directly in a call to `changeProperties` to revert the property change if desired.
380
- * `local` reflects whether the change originated locally.
381
- * `op` is defined if and only if the server has acked this change.
382
- */
383
- (event: "propertyChanged", listener: (interval: TInterval, propertyDeltas: PropertySet, local: boolean, op: ISequencedDocumentMessage | undefined) => void): any;
384
- }
385
-
386
- /**
387
- * @sealed
388
- * @deprecated The methods within have substitutions
389
- */
390
- export declare interface IIntervalHelpers<TInterval extends ISerializableInterval> {
391
- /**
392
- *
393
- * @param label - label of the interval collection this interval is being added to. This parameter is
394
- * irrelevant for transient intervals.
395
- * @param start - numerical start position of the interval
396
- * @param end - numerical end position of the interval
397
- * @param client - client creating the interval
398
- * @param intervalType - Type of interval to create. Default is SlideOnRemove
399
- * @param op - If this create came from a remote client, op that created it. Default is undefined (i.e. local)
400
- * @param fromSnapshot - If this create came from loading a snapshot. Default is false.
401
- * @param startSide - The side on which the start position lays. See
402
- * {@link SequencePlace} for additional context
403
- * @param endSide - The side on which the end position lays. See
404
- * {@link SequencePlace} for additional context
405
- */
406
- create(label: string, start: SequencePlace | undefined, end: SequencePlace | undefined, client: Client | undefined, intervalType: IntervalType, op?: ISequencedDocumentMessage, fromSnapshot?: boolean, useNewSlidingBehavior?: boolean): TInterval;
407
- }
408
-
409
- /**
410
- * @deprecated - IJSONRunSegment will be removed in a upcoming release. It has been moved to the fluid-experimental/sequence-deprecated package
411
- */
412
- export declare interface IJSONRunSegment<T> extends IJSONSegment {
413
- items: Serializable<T>[];
414
- }
415
-
416
- /* Excluded from this release type: IMapMessageLocalMetadata */
417
-
418
- /**
419
- * A sequence place that does not refer to the special endpoint segments.
420
- *
421
- * See {@link SequencePlace} for additional context.
422
- */
423
- export declare interface InteriorSequencePlace {
424
- pos: number;
425
- side: Side;
426
- }
427
-
428
- /**
429
- * Serializable interval whose endpoints are plain-old numbers.
430
- */
431
- export declare class Interval implements ISerializableInterval {
432
- start: number;
433
- end: number;
434
- /**
435
- * {@inheritDoc ISerializableInterval.properties}
436
- */
437
- properties: PropertySet;
438
- /* Excluded from this release type: auxProps */
439
- /* Excluded from this release type: propertyManager */
440
- constructor(start: number, end: number, props?: PropertySet);
441
- /**
442
- * {@inheritDoc ISerializableInterval.getIntervalId}
443
- */
444
- getIntervalId(): string;
445
- /**
446
- * @returns an array containing any auxiliary property sets added with `addPropertySet`.
447
- */
448
- getAdditionalPropertySets(): PropertySet[];
449
- /**
450
- * Adds an auxiliary set of properties to this interval.
451
- * These properties can be recovered using `getAdditionalPropertySets`
452
- * @param props - set of properties to add
453
- * @remarks This gets called as part of the default conflict resolver for `IIntervalCollection<Interval>`
454
- * (i.e. non-sequence-based interval collections). However, the additional properties don't get serialized.
455
- * This functionality seems half-baked.
456
- */
457
- addPropertySet(props: PropertySet): void;
458
- /* Excluded from this release type: serialize */
459
- /**
460
- * {@inheritDoc IInterval.clone}
461
- */
462
- clone(): Interval;
463
- /**
464
- * {@inheritDoc IInterval.compare}
465
- */
466
- compare(b: Interval): number;
467
- /**
468
- * {@inheritDoc IInterval.compareStart}
469
- */
470
- compareStart(b: Interval): number;
471
- /**
472
- * {@inheritDoc IInterval.compareEnd}
473
- */
474
- compareEnd(b: Interval): number;
475
- /**
476
- * {@inheritDoc IInterval.overlaps}
477
- */
478
- overlaps(b: Interval): boolean;
479
- /* Excluded from this release type: union */
480
- getProperties(): PropertySet;
481
- /* Excluded from this release type: addProperties */
482
- /* Excluded from this release type: modify */
483
- private initializeProperties;
484
- }
485
-
486
- /**
487
- * Collection of intervals.
488
- *
489
- * Implementers of this interface will typically implement additional APIs to support efficiently querying a collection
490
- * of intervals in some manner, for example:
491
- * - "find all intervals with start endpoint between these two points"
492
- * - "find all intervals which overlap this range"
493
- * etc.
494
- */
495
- export declare interface IntervalIndex<TInterval extends ISerializableInterval> {
496
- /**
497
- * Adds an interval to the index.
498
- * @remarks Application code should never need to invoke this method on their index for production scenarios:
499
- * Fluid handles adding and removing intervals from an index in response to sequence or interval changes.
500
- */
501
- add(interval: TInterval): void;
502
- /**
503
- * Removes an interval from the index.
504
- * @remarks Application code should never need to invoke this method on their index for production scenarios:
505
- * Fluid handles adding and removing intervals from an index in response to sequence or interval changes.
506
- */
507
- remove(interval: TInterval): void;
508
- }
509
-
510
- /**
511
- * Information that identifies an interval within a `Sequence`.
512
- */
513
- export declare interface IntervalLocator {
514
- /**
515
- * Label for the collection the interval is a part of
516
- */
517
- label: string;
518
- /**
519
- * Interval within that collection
520
- */
521
- interval: SequenceInterval;
522
- }
523
-
524
- /**
525
- * Returns an object that can be used to find the interval a given LocalReferencePosition belongs to.
526
- * @returns undefined if the reference position is not the endpoint of any interval (e.g. it was created
527
- * on the merge tree directly by app code), otherwise an {@link IntervalLocator} for the interval this
528
- * endpoint is a part of.
529
- */
530
- export declare function intervalLocatorFromEndpoint(potentialEndpoint: LocalReferencePosition): IntervalLocator | undefined;
531
-
532
- /* Excluded from this release type: IntervalOpType */
533
-
534
- /* Excluded from this release type: IntervalRevertible */
535
-
536
- /* Excluded from this release type: IntervalStickiness */
537
-
538
- export declare enum IntervalType {
539
- Simple = 0,
540
- /**
541
- * @deprecated - this functionality is no longer supported and will be removed
542
- */
543
- Nest = 1,
544
- /**
545
- * SlideOnRemove indicates that the ends of the interval will slide if the segment
546
- * they reference is removed and acked.
547
- * See `packages\dds\merge-tree\docs\REFERENCEPOSITIONS.md` for details
548
- * SlideOnRemove is the default interval behavior and does not need to be specified.
549
- */
550
- SlideOnRemove = 2,
551
- /* Excluded from this release type: Transient */
552
- }
553
-
554
- export declare interface IOverlappingIntervalsIndex<TInterval extends ISerializableInterval> extends IntervalIndex<TInterval> {
555
- /**
556
- * @returns an array of all intervals contained in this collection that overlap the range
557
- * `[start end]`.
558
- */
559
- findOverlappingIntervals(start: SequencePlace, end: SequencePlace): TInterval[];
560
- /**
561
- * Gathers the interval results based on specified parameters.
562
- */
563
- gatherIterationResults(results: TInterval[], iteratesForward: boolean, start?: SequencePlace, end?: SequencePlace): void;
564
- }
565
-
566
- /**
567
- * A range that has changed corresponding to a segment modification.
568
- */
569
- export declare interface ISequenceDeltaRange<TOperation extends MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationTypes> {
570
- /**
571
- * The type of operation that changed this range.
572
- *
573
- * @remarks Consuming code should typically compare this to the enum values defined in
574
- * `MergeTreeDeltaOperationTypes`.
575
- */
576
- operation: TOperation;
577
- /**
578
- * The index of the start of the range.
579
- */
580
- position: number;
581
- /**
582
- * The segment that corresponds to the range.
583
- */
584
- segment: ISegment;
585
- /**
586
- * Deltas object which contains all modified properties with their previous values.
587
- * Since `undefined` doesn't survive a round-trip through JSON serialization, the old value being absent
588
- * is instead encoded with `null`.
589
- *
590
- * @remarks This object is motivated by undo/redo scenarios, and provides a convenient "inverse op" to apply to
591
- * undo a property change.
592
- *
593
- * @example
594
- *
595
- * If a segment initially had properties `{ foo: "1", bar: 2 }` and it was annotated with
596
- * `{ foo: 3, baz: 5 }`, the corresponding event would have a `propertyDeltas` of `{ foo: "1", baz: null }`.
597
- */
598
- propertyDeltas: PropertySet;
599
- }
600
-
601
- export declare interface ISerializableInterval extends IInterval {
602
- /** Serializable bag of properties associated with the interval. */
603
- properties: PropertySet;
604
- /* Excluded from this release type: propertyManager */
605
- /* Excluded from this release type: serialize */
606
- /* Excluded from this release type: addProperties */
607
- /**
608
- * Gets the id associated with this interval.
609
- * When the interval is used as part of an interval collection, this id can be used to modify or remove the
610
- * interval.
611
- * @remarks This signature includes `undefined` strictly for backwards-compatibility reasons, as older versions
612
- * of Fluid didn't always write interval ids.
613
- */
614
- getIntervalId(): string | undefined;
615
- }
616
-
617
- /* Excluded from this release type: ISerializedInterval */
618
-
619
- export declare interface ISharedIntervalCollection<TInterval extends ISerializableInterval> {
620
- getIntervalCollection(label: string): IIntervalCollection<TInterval>;
621
- }
622
-
623
- /**
624
- * Events emitted in response to changes to the sequence data.
625
- *
626
- * @remarks
627
- *
628
- * The following is the list of events emitted.
629
- *
630
- * ### "sequenceDelta"
631
- *
632
- * The sequenceDelta event is emitted when segments are inserted, annotated, or removed.
633
- *
634
- * #### Listener signature
635
- *
636
- * ```typescript
637
- * (event: SequenceDeltaEvent, target: IEventThisPlaceHolder) => void
638
- * ```
639
- * - `event` - Various information on the segments that were modified.
640
- *
641
- * - `target` - The sequence itself.
642
- *
643
- * ### "maintenance"
644
- *
645
- * The maintenance event is emitted when segments are modified during merge-tree maintenance.
646
- *
647
- * #### Listener signature
648
- *
649
- * ```typescript
650
- * (event: SequenceMaintenanceEvent, target: IEventThisPlaceHolder) => void
651
- * ```
652
- * - `event` - Various information on the segments that were modified.
653
- *
654
- * - `target` - The sequence itself.
655
- */
656
- export declare interface ISharedSegmentSequenceEvents extends ISharedObjectEvents {
657
- (event: "createIntervalCollection", listener: (label: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
658
- (event: "sequenceDelta", listener: (event: SequenceDeltaEvent, target: IEventThisPlaceHolder) => void): any;
659
- (event: "maintenance", listener: (event: SequenceMaintenanceEvent, target: IEventThisPlaceHolder) => void): any;
660
- }
661
-
662
- /**
663
- * Fluid object interface describing access methods on a SharedString
664
- */
665
- export declare interface ISharedString extends SharedSegmentSequence<SharedStringSegment> {
666
- /**
667
- * Inserts the text at the position.
668
- * @param pos - The position to insert the text at
669
- * @param text - The text to insert
670
- * @param props - The properties of the text
671
- */
672
- insertText(pos: number, text: string, props?: PropertySet): void;
673
- /**
674
- * Inserts a marker at the position.
675
- * @param pos - The position to insert the marker at
676
- * @param refType - The reference type of the marker
677
- * @param props - The properties of the marker
678
- */
679
- insertMarker(pos: number, refType: ReferenceType, props?: PropertySet): IMergeTreeInsertMsg | undefined;
680
- /**
681
- * {@inheritDoc SharedSegmentSequence.posFromRelativePos}
682
- */
683
- posFromRelativePos(relativePos: IRelativePosition): number;
684
- }
685
-
686
- /**
687
- * Collection of intervals.
688
- *
689
- * Provide additional APIs to support efficiently querying a collection of intervals whose startpoints fall within a specified range.
690
- */
691
- export declare interface IStartpointInRangeIndex<TInterval extends ISerializableInterval> extends IntervalIndex<TInterval> {
692
- /**
693
- * @returns an array of all intervals contained in this collection whose startpoints locate in the range [start, end] (includes both ends)
694
- */
695
- findIntervalsWithStartpointInRange(start: number, end: number): TInterval[];
696
- }
697
-
698
- /* Excluded from this release type: IValueOpEmitter */
699
-
700
- /* Excluded from this release type: MergeTreeDeltaRevertible */
701
-
702
- /* Excluded from this release type: MergeTreeRevertibleDriver */
703
-
704
- /* Excluded from this release type: revertSharedStringRevertibles */
705
-
706
- /**
707
- * The event object returned on sequenceDelta events.
708
- *
709
- * The properties of this object and its sub-objects represent the state of the sequence at the
710
- * point in time at which the operation was applied.
711
- * They will not take into consideration any future modifications performed to the underlying sequence and merge tree.
712
- *
713
- * For group ops, each op will get its own event, and the group op property will be set on the op args.
714
- *
715
- * Ops may get multiple events. For instance, an insert-replace will get a remove then an insert event.
716
- */
717
- export declare class SequenceDeltaEvent extends SequenceEvent<MergeTreeDeltaOperationType> {
718
- readonly opArgs: IMergeTreeDeltaOpArgs;
719
- /**
720
- * Whether the event was caused by a locally-made change.
721
- */
722
- readonly isLocal: boolean;
723
- constructor(opArgs: IMergeTreeDeltaOpArgs, deltaArgs: IMergeTreeDeltaCallbackArgs, mergeTreeClient: Client);
724
- }
725
-
726
- /**
727
- * Base class for SequenceDeltaEvent and SequenceMaintenanceEvent.
728
- *
729
- * The properties of this object and its sub-objects represent the state of the sequence at the
730
- * point in time at which the operation was applied.
731
- * They will not take into any future modifications performed to the underlying sequence and merge tree.
732
- */
733
- export declare abstract class SequenceEvent<TOperation extends MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationTypes> {
734
- readonly deltaArgs: IMergeTreeDeltaCallbackArgs<TOperation>;
735
- private readonly mergeTreeClient;
736
- readonly deltaOperation: TOperation;
737
- private readonly sortedRanges;
738
- private readonly pFirst;
739
- private readonly pLast;
740
- constructor(deltaArgs: IMergeTreeDeltaCallbackArgs<TOperation>, mergeTreeClient: Client);
741
- /**
742
- * The in-order ranges affected by this delta.
743
- * These may not be continuous.
744
- */
745
- get ranges(): readonly Readonly<ISequenceDeltaRange<TOperation>>[];
746
- /**
747
- * The client id of the client that made the change which caused the delta event
748
- */
749
- get clientId(): string | undefined;
750
- /**
751
- * The first of the modified ranges.
752
- */
753
- get first(): Readonly<ISequenceDeltaRange<TOperation>>;
754
- /**
755
- * The last of the modified ranges.
756
- */
757
- get last(): Readonly<ISequenceDeltaRange<TOperation>>;
758
- }
759
-
760
- /**
761
- * Interval implementation whose ends are associated with positions in a mutatable sequence.
762
- * As such, when content is inserted into the middle of the interval, the interval expands to
763
- * include that content.
764
- *
765
- * @remarks The endpoints' positions should be treated exclusively to get
766
- * reasonable behavior. E.g., an interval referring to "hello" in "hello world"
767
- * should have a start position of 0 and an end position of 5.
768
- *
769
- * To see why, consider what happens if "llo wor" is removed from the string to make "held".
770
- * The interval's startpoint remains on the "h" (it isn't altered), but the interval's endpoint
771
- * slides forward to the next unremoved position, which is the "l" in "held".
772
- * Users would generally expect the interval to now refer to "he" (as it is the subset of content
773
- * remaining after the removal), hence the "l" should be excluded.
774
- * If the interval endpoint was treated inclusively, the interval would now refer to "hel", which
775
- * is undesirable.
776
- *
777
- * Since the endpoints of an interval are treated exclusively but cannot be greater
778
- * than or equal to the length of the associated sequence, there exist special
779
- * endpoint segments, "start" and "end", which represent the position immediately
780
- * before or immediately after the string respectively.
781
- *
782
- * If a `SequenceInterval` is created on a sequence with the
783
- * `mergeTreeReferencesCanSlideToEndpoint` feature flag set to true, the endpoints
784
- * of the interval that are exclusive will have the ability to slide to these
785
- * special endpoint segments.
786
- */
787
- export declare class SequenceInterval implements ISerializableInterval {
788
- private readonly client;
789
- /**
790
- * Start endpoint of this interval.
791
- * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.
792
- */
793
- start: LocalReferencePosition;
794
- /**
795
- * End endpoint of this interval.
796
- * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.
797
- */
798
- end: LocalReferencePosition;
799
- intervalType: IntervalType;
800
- readonly startSide: Side;
801
- readonly endSide: Side;
802
- /**
803
- * {@inheritDoc ISerializableInterval.properties}
804
- */
805
- properties: PropertySet;
806
- /* Excluded from this release type: propertyManager */
807
- /* Excluded from this release type: stickiness */
808
- constructor(client: Client,
809
- /**
810
- * Start endpoint of this interval.
811
- * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.
812
- */
813
- start: LocalReferencePosition,
814
- /**
815
- * End endpoint of this interval.
816
- * @remarks This endpoint can be resolved into a character position using the SharedString it's a part of.
817
- */
818
- end: LocalReferencePosition, intervalType: IntervalType, props?: PropertySet, startSide?: Side, endSide?: Side);
819
- private callbacks?;
820
- /* Excluded from this release type: addPositionChangeListeners */
821
- /* Excluded from this release type: removePositionChangeListeners */
822
- /* Excluded from this release type: serialize */
823
- /**
824
- * {@inheritDoc IInterval.clone}
825
- */
826
- clone(): SequenceInterval;
827
- /**
828
- * {@inheritDoc IInterval.compare}
829
- */
830
- compare(b: SequenceInterval): number;
831
- /**
832
- * {@inheritDoc IInterval.compareStart}
833
- */
834
- compareStart(b: SequenceInterval): number;
835
- /**
836
- * {@inheritDoc IInterval.compareEnd}
837
- */
838
- compareEnd(b: SequenceInterval): number;
839
- /**
840
- * {@inheritDoc IInterval.overlaps}
841
- */
842
- overlaps(b: SequenceInterval): boolean;
843
- /**
844
- * {@inheritDoc ISerializableInterval.getIntervalId}
845
- */
846
- getIntervalId(): string;
847
- /* Excluded from this release type: union */
848
- /* Excluded from this release type: addProperties */
849
- /**
850
- * @returns whether this interval overlaps two numerical positions.
851
- */
852
- overlapsPos(bstart: number, bend: number): boolean;
853
- /* Excluded from this release type: modify */
854
- private initializeProperties;
855
- }
856
-
857
- /**
858
- * @deprecated The methods within have substitutions
859
- */
860
- export declare const sequenceIntervalHelpers: IIntervalHelpers<SequenceInterval>;
861
-
862
- /**
863
- * This namespace contains specialiazations of indexes which support spatial queries
864
- * specifically for `SequenceInterval`s.
865
- */
866
- export declare namespace SequenceIntervalIndexes {
867
- /**
868
- * Collection of intervals.
869
- *
870
- * Provides additional APIs to support efficiently querying a collection of intervals based on segments and offset.
871
- */
872
- export interface Overlapping extends IOverlappingIntervalsIndex<SequenceInterval> {
873
- /**
874
- * Finds overlapping intervals within the specified range.
875
- *
876
- * @returns an array of all intervals that overlap with the specified SegOff range (includes both ends)
877
- */
878
- findOverlappingIntervalsBySegoff(startSegoff: {
879
- segment: ISegment | undefined;
880
- offset: number | undefined;
881
- }, endSegoff: {
882
- segment: ISegment | undefined;
883
- offset: number | undefined;
884
- }): Iterable<SequenceInterval>;
885
- }
886
- }
887
-
888
- /**
889
- * The event object returned on maintenance events.
890
- *
891
- * The properties of this object and its sub-objects represent the state of the sequence at the
892
- * point in time at which the operation was applied.
893
- * They will not take into consideration any future modifications performed to the underlying sequence and merge tree.
894
- */
895
- export declare class SequenceMaintenanceEvent extends SequenceEvent<MergeTreeMaintenanceType> {
896
- readonly opArgs: IMergeTreeDeltaOpArgs | undefined;
897
- constructor(opArgs: IMergeTreeDeltaOpArgs | undefined, deltaArgs: IMergeTreeMaintenanceCallbackArgs, mergeTreeClient: Client);
898
- }
899
-
900
- /**
901
- * Optional flags that configure options for sequence DDSs
902
- */
903
- export declare interface SequenceOptions {
904
- /**
905
- * Enable the ability to use interval APIs that rely on positions before and
906
- * after individual characters, referred to as "sides". See {@link SequencePlace}
907
- * for additional context.
908
- *
909
- * This flag must be enabled to pass instances of {@link SequencePlace} to
910
- * any IIntervalCollection API.
911
- *
912
- * Also see the feature flag `mergeTreeReferencesCanSlideToEndpoint` to allow
913
- * endpoints to slide to the special endpoint segments.
914
- *
915
- * The default value is false.
916
- */
917
- intervalStickinessEnabled: boolean;
918
- /**
919
- * Enable the ability for interval endpoints to slide to the special endpoint
920
- * segments that exist before and after the bounds of the string. This is
921
- * primarily useful for workflows involving interval stickiness, and it is
922
- * suggested to enable both this flag and `intervalStickinessEnabled` at the
923
- * same time.
924
- *
925
- * The default value is false.
926
- */
927
- mergeTreeReferencesCanSlideToEndpoint: boolean;
928
- [key: string]: boolean;
929
- }
930
-
931
- /**
932
- * Defines a position and side relative to a character in a sequence.
933
- *
934
- * For this purpose, sequences look like:
935
- *
936
- * `{start} - {character 0} - {character 1} - ... - {character N} - {end}`
937
- *
938
- * Each `{value}` in the diagram is a character within a sequence.
939
- * Each `-` in the above diagram is a position where text could be inserted.
940
- * Each position between a `{value}` and a `-` is a `SequencePlace`.
941
- *
942
- * The special endpoints `{start}` and `{end}` refer to positions outside the
943
- * contents of the string.
944
- *
945
- * This gives us 2N + 2 possible positions to refer to within a string, where N
946
- * is the number of characters.
947
- *
948
- * If the position is specified with a bare number, the side defaults to
949
- * `Side.Before`.
950
- *
951
- * If a SequencePlace is the endpoint of a range (e.g. start/end of an interval or search range),
952
- * the Side value means it is exclusive if it is nearer to the other position and inclusive if it is farther.
953
- * E.g. the start of a range with Side.After is exclusive of the character at the position.
954
- */
955
- export declare type SequencePlace = number | "start" | "end" | InteriorSequencePlace;
956
-
957
- /* Excluded from this release type: SerializedIntervalDelta */
958
-
959
- /**
960
- * @deprecated `SharedIntervalCollection` is not maintained and is planned to be removed.
961
- */
962
- export declare class SharedIntervalCollection extends SharedObject implements ISharedIntervalCollection<Interval> {
963
- /**
964
- * Create a SharedIntervalCollection
965
- *
966
- * @param runtime - data store runtime the new shared map belongs to
967
- * @param id - optional name of the shared map
968
- * @returns newly create shared map (but not attached yet)
969
- */
970
- static create(runtime: IFluidDataStoreRuntime, id?: string): SharedIntervalCollection;
971
- /**
972
- * Get a factory for SharedIntervalCollection to register with the data store.
973
- *
974
- * @returns a factory that creates and load SharedIntervalCollection
975
- */
976
- static getFactory(): IChannelFactory;
977
- readonly [Symbol.toStringTag]: string;
978
- private readonly intervalCollections;
979
- /**
980
- * Constructs a new shared SharedIntervalCollection. If the object is non-local an id and service interfaces will
981
- * be provided
982
- */
983
- constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
984
- getIntervalCollection(label: string): IIntervalCollection<Interval>;
985
- protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
986
- protected reSubmitCore(content: any, localOpMetadata: unknown): void;
987
- protected onDisconnect(): void;
988
- /**
989
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
990
- */
991
- protected loadCore(storage: IChannelStorageService): Promise<void>;
992
- protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
993
- /**
994
- * Creates the full path of the intervalCollection label
995
- * @param label - the incoming label
996
- */
997
- protected getIntervalCollectionPath(label: string): string;
998
- protected applyStashedOp(): void;
999
- }
1000
-
1001
- /**
1002
- * The factory that defines the SharedIntervalCollection.
1003
- * @deprecated `SharedIntervalCollection` is not maintained and is planned to be removed.
1004
- */
1005
- export declare class SharedIntervalCollectionFactory implements IChannelFactory {
1006
- static readonly Type = "https://graph.microsoft.com/types/sharedIntervalCollection";
1007
- static readonly Attributes: IChannelAttributes;
1008
- get type(): string;
1009
- get attributes(): IChannelAttributes;
1010
- /**
1011
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
1012
- */
1013
- load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<SharedIntervalCollection>;
1014
- create(runtime: IFluidDataStoreRuntime, id: string): SharedIntervalCollection;
1015
- }
1016
-
1017
- export declare abstract class SharedSegmentSequence<T extends ISegment> extends SharedObject<ISharedSegmentSequenceEvents> implements ISharedIntervalCollection<SequenceInterval>, MergeTreeRevertibleDriver {
1018
- private readonly dataStoreRuntime;
1019
- id: string;
1020
- readonly segmentFromSpec: (spec: IJSONSegment) => ISegment;
1021
- get loaded(): Promise<void>;
1022
- /* Excluded from this release type: guardReentrancy */
1023
- private static createOpsFromDelta;
1024
- protected client: Client;
1025
- /** `Deferred` that triggers once the object is loaded */
1026
- protected loadedDeferred: Deferred<void>;
1027
- private readonly loadedDeferredOutgoingOps;
1028
- private deferIncomingOps;
1029
- private readonly loadedDeferredIncomingOps;
1030
- private messagesSinceMSNChange;
1031
- private readonly intervalCollections;
1032
- constructor(dataStoreRuntime: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes, segmentFromSpec: (spec: IJSONSegment) => ISegment);
1033
- /**
1034
- * @param start - The inclusive start of the range to remove
1035
- * @param end - The exclusive end of the range to remove
1036
- */
1037
- removeRange(start: number, end: number): IMergeTreeRemoveMsg;
1038
- /**
1039
- * @deprecated - The ability to create group ops will be removed in an upcoming release, as group ops are redundant with the native batching capabilities of the runtime
1040
- */
1041
- groupOperation(groupOp: IMergeTreeGroupMsg): void;
1042
- /**
1043
- * Finds the segment information (i.e. segment + offset) corresponding to a character position in the SharedString.
1044
- * If the position is past the end of the string, `segment` and `offset` on the returned object may be undefined.
1045
- * @param pos - Character position (index) into the current local view of the SharedString.
1046
- */
1047
- getContainingSegment(pos: number): {
1048
- segment: T | undefined;
1049
- offset: number | undefined;
1050
- };
1051
- /**
1052
- * Returns the length of the current sequence for the client
1053
- */
1054
- getLength(): number;
1055
- /**
1056
- * Returns the current position of a segment, and -1 if the segment
1057
- * does not exist in this sequence
1058
- * @param segment - The segment to get the position of
1059
- */
1060
- getPosition(segment: ISegment): number;
1061
- /**
1062
- * Annotates the range with the provided properties
1063
- *
1064
- * @param start - The inclusive start position of the range to annotate
1065
- * @param end - The exclusive end position of the range to annotate
1066
- * @param props - The properties to annotate the range with
1067
- * @param combiningOp - Optional. Specifies how to combine values for the property, such as "incr" for increment.
1068
- *
1069
- */
1070
- annotateRange(start: number, end: number, props: PropertySet, combiningOp?: ICombiningOp): void;
1071
- getPropertiesAtPosition(pos: number): PropertySet | undefined;
1072
- getRangeExtentsOfPosition(pos: number): {
1073
- posStart: number | undefined;
1074
- posAfterEnd: number | undefined;
1075
- };
1076
- /**
1077
- * Creates a `LocalReferencePosition` on this SharedString. If the refType does not include
1078
- * ReferenceType.Transient, the returned reference will be added to the localRefs on the provided segment.
1079
- * @param segment - Segment to add the local reference on
1080
- * @param offset - Offset on the segment at which to place the local reference
1081
- * @param refType - ReferenceType for the created local reference
1082
- * @param properties - PropertySet to place on the created local reference
1083
- */
1084
- createLocalReferencePosition(segment: T, offset: number, refType: ReferenceType, properties: PropertySet | undefined, slidingPreference?: SlidingPreference, canSlideToEndpoint?: boolean): LocalReferencePosition;
1085
- /**
1086
- * Resolves a `ReferencePosition` into a character position using this client's perspective.
1087
- */
1088
- localReferencePositionToPosition(lref: ReferencePosition): number;
1089
- /**
1090
- * Removes a `LocalReferencePosition` from this SharedString.
1091
- */
1092
- removeLocalReferencePosition(lref: LocalReferencePosition): LocalReferencePosition | undefined;
1093
- /**
1094
- * Resolves a remote client's position against the local sequence
1095
- * and returns the remote client's position relative to the local
1096
- * sequence. The client ref seq must be above the minimum sequence number
1097
- * or the return value will be undefined.
1098
- * Generally this method is used in conjunction with signals which provide
1099
- * point in time values for the below parameters, and is useful for things
1100
- * like displaying user position. It should not be used with persisted values
1101
- * as persisted values will quickly become invalid as the remoteClientRefSeq
1102
- * moves below the minimum sequence number
1103
- * @param remoteClientPosition - The remote client's position to resolve
1104
- * @param remoteClientRefSeq - The reference sequence number of the remote client
1105
- * @param remoteClientId - The client id of the remote client
1106
- */
1107
- resolveRemoteClientPosition(remoteClientPosition: number, remoteClientRefSeq: number, remoteClientId: string): number | undefined;
1108
- /**
1109
- * @deprecated - This method will no longer be public in an upcoming release as it is not safe to use outside of this class
1110
- */
1111
- submitSequenceMessage(message: IMergeTreeOp): void;
1112
- /**
1113
- * Given a position specified relative to a marker id, lookup the marker
1114
- * and convert the position to a character position.
1115
- * @param relativePos - Id of marker (may be indirect) and whether position is before or after marker.
1116
- */
1117
- posFromRelativePos(relativePos: IRelativePosition): number;
1118
- /**
1119
- * Walk the underlying segments of the sequence.
1120
- * The walked segments may extend beyond the range
1121
- * if the segments cross the ranges start or end boundaries.
1122
- * Set split range to true to ensure only segments within the
1123
- * range are walked.
1124
- *
1125
- * @param handler - The function to handle each segment
1126
- * @param start - Optional. The start of range walk.
1127
- * @param end - Optional. The end of range walk
1128
- * @param accum - Optional. An object that will be passed to the handler for accumulation
1129
- * @param splitRange - Optional. Splits boundary segments on the range boundaries
1130
- */
1131
- walkSegments<TClientData>(handler: ISegmentAction<TClientData>, start?: number, end?: number, accum?: TClientData, splitRange?: boolean): void;
1132
- /**
1133
- * @deprecated - this functionality is no longer supported and will be removed
1134
- */
1135
- getStackContext(startPos: number, rangeLabels: string[]): RangeStackMap;
1136
- /**
1137
- * @returns The most recent sequence number which has been acked by the server and processed by this
1138
- * SharedSegmentSequence.
1139
- */
1140
- getCurrentSeq(): number;
1141
- /**
1142
- * Inserts a segment directly before a `ReferencePosition`.
1143
- * @param refPos - The reference position to insert the segment at
1144
- * @param segment - The segment to insert
1145
- */
1146
- insertAtReferencePosition(pos: ReferencePosition, segment: T): void;
1147
- /**
1148
- * Inserts a segment
1149
- * @param start - The position to insert the segment at
1150
- * @param spec - The segment to inserts spec
1151
- */
1152
- insertFromSpec(pos: number, spec: IJSONSegment): void;
1153
- /**
1154
- * Retrieves the interval collection keyed on `label`. If no such interval collection exists,
1155
- * creates one.
1156
- */
1157
- getIntervalCollection(label: string): IIntervalCollection<SequenceInterval>;
1158
- /**
1159
- * @returns An iterable object that enumerates the IntervalCollection labels.
1160
- *
1161
- * @example
1162
- *
1163
- * ```typescript
1164
- * const iter = this.getIntervalCollectionKeys();
1165
- * for (key of iter)
1166
- * const collection = this.getIntervalCollection(key);
1167
- * ...
1168
- * ```
1169
- */
1170
- getIntervalCollectionLabels(): IterableIterator<string>;
1171
- /**
1172
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
1173
- */
1174
- protected summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
1175
- /**
1176
- * Runs serializer over the GC data for this SharedMatrix.
1177
- * All the IFluidHandle's represent routes to other objects.
1178
- */
1179
- protected processGCDataCore(serializer: SummarySerializer): void;
1180
- /**
1181
- * Replace the range specified from start to end with the provided segment
1182
- * This is done by inserting the segment at the end of the range, followed
1183
- * by removing the contents of the range
1184
- * For a zero or reverse range (start \>= end), insert at end do not remove anything
1185
- * @param start - The start of the range to replace
1186
- * @param end - The end of the range to replace
1187
- * @param segment - The segment that will replace the range
1188
- */
1189
- protected replaceRange(start: number, end: number, segment: ISegment): void;
1190
- /**
1191
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onConnect}
1192
- */
1193
- protected onConnect(): void;
1194
- /**
1195
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
1196
- */
1197
- protected onDisconnect(): void;
1198
- /**
1199
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}
1200
- */
1201
- protected reSubmitCore(content: any, localOpMetadata: unknown): void;
1202
- /**
1203
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
1204
- */
1205
- protected loadCore(storage: IChannelStorageService): Promise<void>;
1206
- /**
1207
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
1208
- */
1209
- protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
1210
- /**
1211
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.didAttach}
1212
- */
1213
- protected didAttach(): void;
1214
- /**
1215
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.initializeLocalCore}
1216
- */
1217
- protected initializeLocalCore(): void;
1218
- /**
1219
- * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
1220
- */
1221
- protected applyStashedOp(content: any): unknown;
1222
- private summarizeMergeTree;
1223
- private processMergeTreeMsg;
1224
- private processMinSequenceNumberChanged;
1225
- private loadFinished;
1226
- private initializeIntervalCollections;
1227
- }
1228
-
1229
- /**
1230
- * @deprecated - SharedSequence will be removed in a upcoming release. It has been moved to the fluid-experimental/sequence-deprecated package
1231
- */
1232
- export declare class SharedSequence<T> extends SharedSegmentSequence<SubSequence<T>> {
1233
- id: string;
1234
- constructor(document: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes, specToSegment: (spec: IJSONSegment) => ISegment);
1235
- /**
1236
- * @param pos - The position to insert the items at.
1237
- * @param items - The items to insert.
1238
- * @param props - Optional. Properties to set on the inserted items.
1239
- */
1240
- insert(pos: number, items: Serializable<T>[], props?: PropertySet): void;
1241
- /**
1242
- * @param start - The inclusive start of the range to remove
1243
- * @param end - The exclusive end of the range to remove
1244
- */
1245
- remove(start: number, end: number): void;
1246
- /**
1247
- * Returns the total count of items in the sequence
1248
- */
1249
- getItemCount(): number;
1250
- /**
1251
- * Gets the items in the specified range
1252
- *
1253
- * @param start - The inclusive start of the range
1254
- * @param end - The exclusive end of the range
1255
- */
1256
- getItems(start: number, end?: number): Serializable<T>[];
1257
- }
1258
-
1259
- /**
1260
- * The Shared String is a specialized data structure for handling collaborative
1261
- * text. It is based on a more general Sequence data structure but has
1262
- * additional features that make working with text easier.
1263
- *
1264
- * In addition to text, a Shared String can also contain markers. Markers can be
1265
- * used to store metadata at positions within the text, like the details of an
1266
- * image or Fluid object that should be rendered with the text.
1267
- *
1268
- */
1269
- export declare class SharedString extends SharedSegmentSequence<SharedStringSegment> implements ISharedString {
1270
- id: string;
1271
- /**
1272
- * Create a new shared string.
1273
- * @param runtime - data store runtime the new shared string belongs to
1274
- * @param id - optional name of the shared string
1275
- * @returns newly create shared string (but not attached yet)
1276
- */
1277
- static create(runtime: IFluidDataStoreRuntime, id?: string): SharedString;
1278
- /**
1279
- * Get a factory for SharedString to register with the data store.
1280
- * @returns a factory that creates and load SharedString
1281
- */
1282
- static getFactory(): SharedStringFactory;
1283
- get ISharedString(): ISharedString;
1284
- private readonly mergeTreeTextHelper;
1285
- constructor(document: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes);
1286
- /**
1287
- * Inserts a marker at a relative position.
1288
- * @param relativePos1 - The relative position to insert the marker at
1289
- * @param refType - The reference type of the marker
1290
- * @param props - The properties of the marker
1291
- */
1292
- insertMarkerRelative(relativePos1: IRelativePosition, refType: ReferenceType, props?: PropertySet): void;
1293
- /**
1294
- * {@inheritDoc ISharedString.insertMarker}
1295
- */
1296
- insertMarker(pos: number, refType: ReferenceType, props?: PropertySet): IMergeTreeInsertMsg | undefined;
1297
- /**
1298
- * Inserts the text at the position.
1299
- * @param relativePos1 - The relative position to insert the text at
1300
- * @param text - The text to insert
1301
- * @param props - The properties of text
1302
- */
1303
- insertTextRelative(relativePos1: IRelativePosition, text: string, props?: PropertySet): void;
1304
- /**
1305
- * {@inheritDoc ISharedString.insertText}
1306
- */
1307
- insertText(pos: number, text: string, props?: PropertySet): void;
1308
- /**
1309
- * Replaces a range with the provided text.
1310
- * @param start - The inclusive start of the range to replace
1311
- * @param end - The exclusive end of the range to replace
1312
- * @param text - The text to replace the range with
1313
- * @param props - Optional. The properties of the replacement text
1314
- */
1315
- replaceText(start: number, end: number, text: string, props?: PropertySet): void;
1316
- /**
1317
- * Removes the text in the given range.
1318
- * @param start - The inclusive start of the range to remove
1319
- * @param end - The exclusive end of the range to replace
1320
- * @returns the message sent.
1321
- */
1322
- removeText(start: number, end: number): IMergeTreeRemoveMsg;
1323
- /**
1324
- * Annotates the marker with the provided properties and calls the callback on consensus.
1325
- * @param marker - The marker to annotate
1326
- * @param props - The properties to annotate the marker with
1327
- * @param consensusCallback - The callback called when consensus is reached
1328
- */
1329
- annotateMarkerNotifyConsensus(marker: Marker, props: PropertySet, callback: (m: Marker) => void): void;
1330
- /**
1331
- * Annotates the marker with the provided properties.
1332
- * @param marker - The marker to annotate
1333
- * @param props - The properties to annotate the marker with
1334
- * @param combiningOp - Optional. Specifies how to combine values for the property, such as "incr" for increment.
1335
- */
1336
- annotateMarker(marker: Marker, props: PropertySet, combiningOp?: ICombiningOp): void;
1337
- /**
1338
- * Finds the nearest reference with ReferenceType.Tile to `startPos` in the direction dictated by `tilePrecedesPos`.
1339
- * Note that Markers receive `ReferenceType.Tile` by default.
1340
- * @param startPos - Position at which to start the search
1341
- * @param clientId - clientId dictating the perspective to search from
1342
- * @param tileLabel - Label of the tile to search for
1343
- * @param preceding - Whether the desired tile comes before (true) or after (false) `startPos`
1344
- */
1345
- findTile(startPos: number | undefined, tileLabel: string, preceding?: boolean): {
1346
- tile: ReferencePosition;
1347
- pos: number;
1348
- } | undefined;
1349
- /**
1350
- * Retrieve text from the SharedString in string format.
1351
- * @param start - The starting index of the text to retrieve, or 0 if omitted.
1352
- * @param end - The ending index of the text to retrieve, or the end of the string if omitted
1353
- * @returns The requested text content as a string.
1354
- */
1355
- getText(start?: number, end?: number): string;
1356
- /**
1357
- * Adds spaces for markers and handles, so that position calculations account for them.
1358
- */
1359
- getTextWithPlaceholders(start?: number, end?: number): string;
1360
- getTextRangeWithMarkers(start: number, end: number): string;
1361
- /**
1362
- * Looks up and returns a `Marker` using its id. Returns `undefined` if there is no marker with the provided
1363
- * id in this `SharedString`.
1364
- */
1365
- getMarkerFromId(id: string): ISegment | undefined;
1366
- /**
1367
- * Revert an op
1368
- */
1369
- protected rollback(content: any, localOpMetadata: unknown): void;
1370
- }
1371
-
1372
- export declare class SharedStringFactory implements IChannelFactory {
1373
- static Type: string;
1374
- static readonly Attributes: IChannelAttributes;
1375
- static segmentFromSpec(spec: any): SharedStringSegment;
1376
- get type(): string;
1377
- get attributes(): IChannelAttributes;
1378
- /**
1379
- * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
1380
- */
1381
- load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<SharedString>;
1382
- create(document: IFluidDataStoreRuntime, id: string): SharedString;
1383
- }
1384
-
1385
- /* Excluded from this release type: SharedStringRevertible */
1386
-
1387
- export declare type SharedStringSegment = TextSegment | Marker;
1388
-
1389
- /**
1390
- * Defines a side relative to a character in a sequence.
1391
- *
1392
- * @remarks See {@link SequencePlace} for additional context on usage.
1393
- */
1394
- export declare enum Side {
1395
- Before = 0,
1396
- After = 1
1397
- }
1398
-
1399
- /**
1400
- * @deprecated - SubSequence will be removed in a upcoming release. It has been moved to the fluid-experimental/sequence-deprecated package
1401
- */
1402
- export declare class SubSequence<T> extends BaseSegment {
1403
- items: Serializable<T>[];
1404
- static readonly typeString: string;
1405
- static is(segment: ISegment): segment is SubSequence<any>;
1406
- static fromJSONObject<U>(spec: Serializable): SubSequence<U> | undefined;
1407
- readonly type: string;
1408
- constructor(items: Serializable<T>[]);
1409
- toJSONObject(): IJSONRunSegment<T>;
1410
- clone(start?: number, end?: number): SubSequence<T>;
1411
- canAppend(segment: ISegment): boolean;
1412
- toString(): string;
1413
- append(segment: ISegment): void;
1414
- removeRange(start: number, end: number): boolean;
1415
- protected createSplitSegmentAt(pos: number): SubSequence<T> | undefined;
1416
- }
1417
-
1418
- /* Excluded from this release type: TypedEventEmitter */
1419
-
1420
- export { }