@fluidframework/sequence 2.0.0-dev-rc.5.0.0.263932 → 2.0.0-dev-rc.5.0.0.267932
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.
- package/api-report/sequence.api.md +69 -16
- package/dist/IntervalCollectionValues.d.ts +1 -1
- package/dist/IntervalCollectionValues.d.ts.map +1 -1
- package/dist/IntervalCollectionValues.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/intervalCollection.d.ts +1 -1
- package/dist/intervalCollection.d.ts.map +1 -1
- package/dist/intervalCollection.js.map +1 -1
- package/dist/intervalCollectionMap.d.ts +2 -2
- package/dist/intervalCollectionMap.d.ts.map +1 -1
- package/dist/intervalCollectionMap.js.map +1 -1
- package/dist/intervalCollectionMapInterfaces.d.ts +2 -2
- package/dist/intervalCollectionMapInterfaces.d.ts.map +1 -1
- package/dist/intervalCollectionMapInterfaces.js.map +1 -1
- package/dist/intervalIndex/endpointInRangeIndex.js.map +1 -1
- package/dist/intervalIndex/endpointIndex.js.map +1 -1
- package/dist/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
- package/dist/intervalIndex/overlappingSequenceIntervalsIndex.d.ts.map +1 -1
- package/dist/intervalIndex/overlappingSequenceIntervalsIndex.js +0 -3
- package/dist/intervalIndex/overlappingSequenceIntervalsIndex.js.map +1 -1
- package/dist/intervalIndex/startpointInRangeIndex.js.map +1 -1
- package/dist/intervalTree.js.map +1 -1
- package/dist/intervals/interval.d.ts +1 -1
- package/dist/intervals/interval.d.ts.map +1 -1
- package/dist/intervals/interval.js.map +1 -1
- package/dist/intervals/intervalUtils.d.ts +2 -2
- package/dist/intervals/intervalUtils.d.ts.map +1 -1
- package/dist/intervals/intervalUtils.js +0 -1
- package/dist/intervals/intervalUtils.js.map +1 -1
- package/dist/intervals/sequenceInterval.d.ts +1 -1
- package/dist/intervals/sequenceInterval.d.ts.map +1 -1
- package/dist/intervals/sequenceInterval.js +1 -1
- package/dist/intervals/sequenceInterval.js.map +1 -1
- package/dist/legacy.d.ts +1 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/revertibles.js.map +1 -1
- package/dist/sequence.d.ts +163 -125
- package/dist/sequence.d.ts.map +1 -1
- package/dist/sequence.js +23 -142
- package/dist/sequence.js.map +1 -1
- package/dist/sequenceDeltaEvent.js.map +1 -1
- package/dist/sequenceFactory.d.ts +2 -3
- package/dist/sequenceFactory.d.ts.map +1 -1
- package/dist/sequenceFactory.js.map +1 -1
- package/dist/sharedIntervalCollection.d.ts +4 -5
- package/dist/sharedIntervalCollection.d.ts.map +1 -1
- package/dist/sharedIntervalCollection.js +5 -5
- package/dist/sharedIntervalCollection.js.map +1 -1
- package/dist/sharedSequence.d.ts +1 -2
- package/dist/sharedSequence.d.ts.map +1 -1
- package/dist/sharedSequence.js.map +1 -1
- package/dist/sharedString.d.ts +3 -3
- package/dist/sharedString.d.ts.map +1 -1
- package/dist/sharedString.js.map +1 -1
- package/lib/IntervalCollectionValues.d.ts +1 -1
- package/lib/IntervalCollectionValues.d.ts.map +1 -1
- package/lib/IntervalCollectionValues.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/intervalCollection.d.ts +1 -1
- package/lib/intervalCollection.d.ts.map +1 -1
- package/lib/intervalCollection.js.map +1 -1
- package/lib/intervalCollectionMap.d.ts +2 -2
- package/lib/intervalCollectionMap.d.ts.map +1 -1
- package/lib/intervalCollectionMap.js.map +1 -1
- package/lib/intervalCollectionMapInterfaces.d.ts +2 -2
- package/lib/intervalCollectionMapInterfaces.d.ts.map +1 -1
- package/lib/intervalCollectionMapInterfaces.js.map +1 -1
- package/lib/intervalIndex/endpointInRangeIndex.js.map +1 -1
- package/lib/intervalIndex/endpointIndex.js.map +1 -1
- package/lib/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
- package/lib/intervalIndex/overlappingSequenceIntervalsIndex.d.ts.map +1 -1
- package/lib/intervalIndex/overlappingSequenceIntervalsIndex.js +0 -3
- package/lib/intervalIndex/overlappingSequenceIntervalsIndex.js.map +1 -1
- package/lib/intervalIndex/startpointInRangeIndex.js.map +1 -1
- package/lib/intervalTree.js.map +1 -1
- package/lib/intervals/interval.d.ts +1 -1
- package/lib/intervals/interval.d.ts.map +1 -1
- package/lib/intervals/interval.js.map +1 -1
- package/lib/intervals/intervalUtils.d.ts +2 -2
- package/lib/intervals/intervalUtils.d.ts.map +1 -1
- package/lib/intervals/intervalUtils.js +0 -1
- package/lib/intervals/intervalUtils.js.map +1 -1
- package/lib/intervals/sequenceInterval.d.ts +1 -1
- package/lib/intervals/sequenceInterval.d.ts.map +1 -1
- package/lib/intervals/sequenceInterval.js +1 -1
- package/lib/intervals/sequenceInterval.js.map +1 -1
- package/lib/legacy.d.ts +1 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/revertibles.js.map +1 -1
- package/lib/sequence.d.ts +163 -125
- package/lib/sequence.d.ts.map +1 -1
- package/lib/sequence.js +2 -121
- package/lib/sequence.js.map +1 -1
- package/lib/sequenceDeltaEvent.js.map +1 -1
- package/lib/sequenceFactory.d.ts +2 -3
- package/lib/sequenceFactory.d.ts.map +1 -1
- package/lib/sequenceFactory.js.map +1 -1
- package/lib/sharedIntervalCollection.d.ts +4 -5
- package/lib/sharedIntervalCollection.d.ts.map +1 -1
- package/lib/sharedIntervalCollection.js +2 -2
- package/lib/sharedIntervalCollection.js.map +1 -1
- package/lib/sharedSequence.d.ts +1 -2
- package/lib/sharedSequence.d.ts.map +1 -1
- package/lib/sharedSequence.js.map +1 -1
- package/lib/sharedString.d.ts +3 -3
- package/lib/sharedString.d.ts.map +1 -1
- package/lib/sharedString.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +62 -26
- package/src/IntervalCollectionValues.ts +1 -2
- package/src/index.ts +5 -1
- package/src/intervalCollection.ts +1 -1
- package/src/intervalCollectionMap.ts +2 -3
- package/src/intervalCollectionMapInterfaces.ts +2 -2
- package/src/intervalIndex/overlappingSequenceIntervalsIndex.ts +0 -3
- package/src/intervals/interval.ts +1 -1
- package/src/intervals/intervalUtils.ts +1 -1
- package/src/intervals/sequenceInterval.ts +2 -2
- package/src/packageVersion.ts +1 -1
- package/src/sequence.ts +231 -133
- package/src/sequenceFactory.ts +3 -5
- package/src/sharedIntervalCollection.ts +10 -6
- package/src/sharedSequence.ts +5 -2
- package/src/sharedString.ts +6 -3
package/dist/sequence.d.ts
CHANGED
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { IEventThisPlaceHolder } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { IChannelAttributes,
|
|
6
|
+
import { IChannelAttributes, IFluidDataStoreRuntime, IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
|
|
7
|
+
import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions";
|
|
7
8
|
import { Client, IJSONSegment, IMergeTreeGroupMsg, IRelativePosition, ISegment, ISegmentAction, LocalReferencePosition, MergeTreeRevertibleDriver, PropertySet, ReferencePosition, ReferenceType, SlidingPreference } from "@fluidframework/merge-tree/internal";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { IFluidSerializer, ISharedObjectEvents } from "@fluidframework/shared-object-base";
|
|
11
|
-
import { SharedObject } from "@fluidframework/shared-object-base/internal";
|
|
9
|
+
import { ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions/internal";
|
|
10
|
+
import { IFluidSerializer, ISharedObjectEvents, SharedObject, type ISharedObject } from "@fluidframework/shared-object-base/internal";
|
|
12
11
|
import { IIntervalCollection } from "./intervalCollection.js";
|
|
13
12
|
import { SequenceInterval } from "./intervals/index.js";
|
|
14
13
|
import { SequenceDeltaEvent, SequenceMaintenanceEvent } from "./sequenceDeltaEvent.js";
|
|
@@ -55,7 +54,165 @@ export interface ISharedSegmentSequenceEvents extends ISharedObjectEvents {
|
|
|
55
54
|
/**
|
|
56
55
|
* @alpha
|
|
57
56
|
*/
|
|
58
|
-
export
|
|
57
|
+
export interface ISharedSegmentSequence<T extends ISegment> extends ISharedObject<ISharedSegmentSequenceEvents>, ISharedIntervalCollection<SequenceInterval>, MergeTreeRevertibleDriver {
|
|
58
|
+
/**
|
|
59
|
+
* Creates a `LocalReferencePosition` on this SharedString. If the refType does not include
|
|
60
|
+
* ReferenceType.Transient, the returned reference will be added to the localRefs on the provided segment.
|
|
61
|
+
* @param segment - Segment to add the local reference on
|
|
62
|
+
* @param offset - Offset on the segment at which to place the local reference
|
|
63
|
+
* @param refType - ReferenceType for the created local reference
|
|
64
|
+
* @param properties - PropertySet to place on the created local reference
|
|
65
|
+
*/
|
|
66
|
+
createLocalReferencePosition(segment: T, offset: number, refType: ReferenceType, properties: PropertySet | undefined, slidingPreference?: SlidingPreference, canSlideToEndpoint?: boolean): LocalReferencePosition;
|
|
67
|
+
/**
|
|
68
|
+
* Removes a `LocalReferencePosition` from this SharedString.
|
|
69
|
+
*/
|
|
70
|
+
removeLocalReferencePosition(lref: LocalReferencePosition): LocalReferencePosition | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Returns the length of the current sequence for the client
|
|
73
|
+
*/
|
|
74
|
+
getLength(): number;
|
|
75
|
+
/**
|
|
76
|
+
* Returns the current position of a segment, and -1 if the segment
|
|
77
|
+
* does not exist in this sequence
|
|
78
|
+
* @param segment - The segment to get the position of
|
|
79
|
+
*/
|
|
80
|
+
getPosition(segment: ISegment): number;
|
|
81
|
+
/**
|
|
82
|
+
* Resolves a `ReferencePosition` into a character position using this client's perspective.
|
|
83
|
+
*
|
|
84
|
+
* Reference positions that point to a character that has been removed will
|
|
85
|
+
* always return the position of the nearest non-removed character, regardless
|
|
86
|
+
* of `ReferenceType`. To handle this case specifically, one may wish
|
|
87
|
+
* to look at the segment returned by `ReferencePosition.getSegment`.
|
|
88
|
+
*/
|
|
89
|
+
localReferencePositionToPosition(lref: ReferencePosition): number;
|
|
90
|
+
/**
|
|
91
|
+
* Walk the underlying segments of the sequence.
|
|
92
|
+
* The walked segments may extend beyond the range if the segments cross the
|
|
93
|
+
* ranges start or end boundaries.
|
|
94
|
+
*
|
|
95
|
+
* Set split range to true to ensure only segments within the range are walked.
|
|
96
|
+
*
|
|
97
|
+
* @param handler - The function to handle each segment. Traversal ends if
|
|
98
|
+
* this function returns true.
|
|
99
|
+
* @param start - Optional. The start of range walk.
|
|
100
|
+
* @param end - Optional. The end of range walk
|
|
101
|
+
* @param accum - Optional. An object that will be passed to the handler for accumulation
|
|
102
|
+
* @param splitRange - Optional. Splits boundary segments on the range boundaries. Defaults to false.
|
|
103
|
+
*/
|
|
104
|
+
walkSegments<TClientData>(handler: ISegmentAction<TClientData>, start?: number, end?: number, accum?: TClientData, splitRange?: boolean): void;
|
|
105
|
+
/**
|
|
106
|
+
* Inserts a segment directly before a `ReferencePosition`.
|
|
107
|
+
* @param refPos - The reference position to insert the segment at
|
|
108
|
+
* @param segment - The segment to insert
|
|
109
|
+
*/
|
|
110
|
+
insertAtReferencePosition(pos: ReferencePosition, segment: T): void;
|
|
111
|
+
/**
|
|
112
|
+
* Finds the segment information (i.e. segment + offset) corresponding to a character position in the SharedString.
|
|
113
|
+
* If the position is past the end of the string, `segment` and `offset` on the returned object may be undefined.
|
|
114
|
+
* @param pos - Character position (index) into the current local view of the SharedString.
|
|
115
|
+
*/
|
|
116
|
+
getContainingSegment(pos: number): {
|
|
117
|
+
segment: T | undefined;
|
|
118
|
+
offset: number | undefined;
|
|
119
|
+
};
|
|
120
|
+
getPropertiesAtPosition(pos: number): PropertySet | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* @returns An iterable object that enumerates the IntervalCollection labels.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
*
|
|
126
|
+
* ```typescript
|
|
127
|
+
* const iter = this.getIntervalCollectionKeys();
|
|
128
|
+
* for (key of iter)
|
|
129
|
+
* const collection = this.getIntervalCollection(key);
|
|
130
|
+
* ...
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
getIntervalCollectionLabels(): IterableIterator<string>;
|
|
134
|
+
/**
|
|
135
|
+
* Retrieves the interval collection keyed on `label`. If no such interval collection exists,
|
|
136
|
+
* creates one.
|
|
137
|
+
*/
|
|
138
|
+
getIntervalCollection(label: string): IIntervalCollection<SequenceInterval>;
|
|
139
|
+
/**
|
|
140
|
+
* Obliterate is similar to remove, but differs in that segments concurrently
|
|
141
|
+
* inserted into an obliterated range will also be removed
|
|
142
|
+
*
|
|
143
|
+
* @param start - The inclusive start of the range to obliterate
|
|
144
|
+
* @param end - The exclusive end of the range to obliterate
|
|
145
|
+
*/
|
|
146
|
+
obliterateRange(start: number, end: number): void;
|
|
147
|
+
/**
|
|
148
|
+
* @returns The most recent sequence number which has been acked by the server and processed by this
|
|
149
|
+
* SharedSegmentSequence.
|
|
150
|
+
*/
|
|
151
|
+
getCurrentSeq(): number;
|
|
152
|
+
/**
|
|
153
|
+
* Annotates the range with the provided properties
|
|
154
|
+
*
|
|
155
|
+
* @param start - The inclusive start position of the range to annotate
|
|
156
|
+
* @param end - The exclusive end position of the range to annotate
|
|
157
|
+
* @param props - The properties to annotate the range with
|
|
158
|
+
*
|
|
159
|
+
*/
|
|
160
|
+
annotateRange(start: number, end: number, props: PropertySet): void;
|
|
161
|
+
/**
|
|
162
|
+
* @param start - The inclusive start of the range to remove
|
|
163
|
+
* @param end - The exclusive end of the range to remove
|
|
164
|
+
*/
|
|
165
|
+
removeRange(start: number, end: number): void;
|
|
166
|
+
/**
|
|
167
|
+
* Resolves a remote client's position against the local sequence
|
|
168
|
+
* and returns the remote client's position relative to the local
|
|
169
|
+
* sequence. The client ref seq must be above the minimum sequence number
|
|
170
|
+
* or the return value will be undefined.
|
|
171
|
+
* Generally this method is used in conjunction with signals which provide
|
|
172
|
+
* point in time values for the below parameters, and is useful for things
|
|
173
|
+
* like displaying user position. It should not be used with persisted values
|
|
174
|
+
* as persisted values will quickly become invalid as the remoteClientRefSeq
|
|
175
|
+
* moves below the minimum sequence number
|
|
176
|
+
* @param remoteClientPosition - The remote client's position to resolve
|
|
177
|
+
* @param remoteClientRefSeq - The reference sequence number of the remote client
|
|
178
|
+
* @param remoteClientId - The client id of the remote client
|
|
179
|
+
*/
|
|
180
|
+
resolveRemoteClientPosition(remoteClientPosition: number, remoteClientRefSeq: number, remoteClientId: string): number | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* Initializes the object as a local, non-shared object. This object can become shared after
|
|
183
|
+
* it is attached to the document.
|
|
184
|
+
* @privateRemarks
|
|
185
|
+
* TODO: determine if this API (from SharedObject) is needed by users of the encapsulated API, declarative API or both,
|
|
186
|
+
* and handle exposing it in a consistent way for all SharedObjects if needed.
|
|
187
|
+
*/
|
|
188
|
+
initializeLocal(): void;
|
|
189
|
+
/**
|
|
190
|
+
* @deprecated The ability to create group ops will be removed in an upcoming
|
|
191
|
+
* release, as group ops are redundant with the native batching capabilities
|
|
192
|
+
* of the runtime
|
|
193
|
+
*/
|
|
194
|
+
groupOperation(groupOp: IMergeTreeGroupMsg): void;
|
|
195
|
+
getRangeExtentsOfPosition(pos: number): {
|
|
196
|
+
posStart: number | undefined;
|
|
197
|
+
posAfterEnd: number | undefined;
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Inserts a segment
|
|
201
|
+
* @param start - The position to insert the segment at
|
|
202
|
+
* @param spec - The segment to inserts spec
|
|
203
|
+
*/
|
|
204
|
+
insertFromSpec(pos: number, spec: IJSONSegment): void;
|
|
205
|
+
/**
|
|
206
|
+
* Given a position specified relative to a marker id, lookup the marker
|
|
207
|
+
* and convert the position to a character position.
|
|
208
|
+
* @param relativePos - Id of marker (may be indirect) and whether position is before or after marker.
|
|
209
|
+
*/
|
|
210
|
+
posFromRelativePos(relativePos: IRelativePosition): number;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* @alpha
|
|
214
|
+
*/
|
|
215
|
+
export declare abstract class SharedSegmentSequence<T extends ISegment> extends SharedObject<ISharedSegmentSequenceEvents> implements ISharedSegmentSequence<T> {
|
|
59
216
|
id: string;
|
|
60
217
|
readonly segmentFromSpec: (spec: IJSONSegment) => ISegment;
|
|
61
218
|
/**
|
|
@@ -111,151 +268,32 @@ export declare abstract class SharedSegmentSequence<T extends ISegment> extends
|
|
|
111
268
|
private messagesSinceMSNChange;
|
|
112
269
|
private readonly intervalCollections;
|
|
113
270
|
constructor(dataStoreRuntime: IFluidDataStoreRuntime, id: string, attributes: IChannelAttributes, segmentFromSpec: (spec: IJSONSegment) => ISegment);
|
|
114
|
-
/**
|
|
115
|
-
* @param start - The inclusive start of the range to remove
|
|
116
|
-
* @param end - The exclusive end of the range to remove
|
|
117
|
-
*/
|
|
118
271
|
removeRange(start: number, end: number): void;
|
|
119
|
-
/**
|
|
120
|
-
* Obliterate is similar to remove, but differs in that segments concurrently
|
|
121
|
-
* inserted into an obliterated range will also be removed
|
|
122
|
-
*
|
|
123
|
-
* @param start - The inclusive start of the range to obliterate
|
|
124
|
-
* @param end - The exclusive end of the range to obliterate
|
|
125
|
-
*/
|
|
126
272
|
obliterateRange(start: number, end: number): void;
|
|
127
|
-
/**
|
|
128
|
-
* @deprecated The ability to create group ops will be removed in an upcoming
|
|
129
|
-
* release, as group ops are redundant with the native batching capabilities
|
|
130
|
-
* of the runtime
|
|
131
|
-
*/
|
|
132
273
|
groupOperation(groupOp: IMergeTreeGroupMsg): void;
|
|
133
|
-
/**
|
|
134
|
-
* Finds the segment information (i.e. segment + offset) corresponding to a character position in the SharedString.
|
|
135
|
-
* If the position is past the end of the string, `segment` and `offset` on the returned object may be undefined.
|
|
136
|
-
* @param pos - Character position (index) into the current local view of the SharedString.
|
|
137
|
-
*/
|
|
138
274
|
getContainingSegment(pos: number): {
|
|
139
275
|
segment: T | undefined;
|
|
140
276
|
offset: number | undefined;
|
|
141
277
|
};
|
|
142
|
-
/**
|
|
143
|
-
* Returns the length of the current sequence for the client
|
|
144
|
-
*/
|
|
145
278
|
getLength(): number;
|
|
146
|
-
/**
|
|
147
|
-
* Returns the current position of a segment, and -1 if the segment
|
|
148
|
-
* does not exist in this sequence
|
|
149
|
-
* @param segment - The segment to get the position of
|
|
150
|
-
*/
|
|
151
279
|
getPosition(segment: ISegment): number;
|
|
152
|
-
/**
|
|
153
|
-
* Annotates the range with the provided properties
|
|
154
|
-
*
|
|
155
|
-
* @param start - The inclusive start position of the range to annotate
|
|
156
|
-
* @param end - The exclusive end position of the range to annotate
|
|
157
|
-
* @param props - The properties to annotate the range with
|
|
158
|
-
*
|
|
159
|
-
*/
|
|
160
280
|
annotateRange(start: number, end: number, props: PropertySet): void;
|
|
161
281
|
getPropertiesAtPosition(pos: number): PropertySet | undefined;
|
|
162
282
|
getRangeExtentsOfPosition(pos: number): {
|
|
163
283
|
posStart: number | undefined;
|
|
164
284
|
posAfterEnd: number | undefined;
|
|
165
285
|
};
|
|
166
|
-
/**
|
|
167
|
-
* Creates a `LocalReferencePosition` on this SharedString. If the refType does not include
|
|
168
|
-
* ReferenceType.Transient, the returned reference will be added to the localRefs on the provided segment.
|
|
169
|
-
* @param segment - Segment to add the local reference on
|
|
170
|
-
* @param offset - Offset on the segment at which to place the local reference
|
|
171
|
-
* @param refType - ReferenceType for the created local reference
|
|
172
|
-
* @param properties - PropertySet to place on the created local reference
|
|
173
|
-
*/
|
|
174
286
|
createLocalReferencePosition(segment: T, offset: number, refType: ReferenceType, properties: PropertySet | undefined, slidingPreference?: SlidingPreference, canSlideToEndpoint?: boolean): LocalReferencePosition;
|
|
175
|
-
/**
|
|
176
|
-
* Resolves a `ReferencePosition` into a character position using this client's perspective.
|
|
177
|
-
*
|
|
178
|
-
* Reference positions that point to a character that has been removed will
|
|
179
|
-
* always return the position of the nearest non-removed character, regardless
|
|
180
|
-
* of `ReferenceType`. To handle this case specifically, one may wish
|
|
181
|
-
* to look at the segment returned by `ReferencePosition.getSegment`.
|
|
182
|
-
*/
|
|
183
287
|
localReferencePositionToPosition(lref: ReferencePosition): number;
|
|
184
|
-
/**
|
|
185
|
-
* Removes a `LocalReferencePosition` from this SharedString.
|
|
186
|
-
*/
|
|
187
288
|
removeLocalReferencePosition(lref: LocalReferencePosition): LocalReferencePosition | undefined;
|
|
188
|
-
/**
|
|
189
|
-
* Resolves a remote client's position against the local sequence
|
|
190
|
-
* and returns the remote client's position relative to the local
|
|
191
|
-
* sequence. The client ref seq must be above the minimum sequence number
|
|
192
|
-
* or the return value will be undefined.
|
|
193
|
-
* Generally this method is used in conjunction with signals which provide
|
|
194
|
-
* point in time values for the below parameters, and is useful for things
|
|
195
|
-
* like displaying user position. It should not be used with persisted values
|
|
196
|
-
* as persisted values will quickly become invalid as the remoteClientRefSeq
|
|
197
|
-
* moves below the minimum sequence number
|
|
198
|
-
* @param remoteClientPosition - The remote client's position to resolve
|
|
199
|
-
* @param remoteClientRefSeq - The reference sequence number of the remote client
|
|
200
|
-
* @param remoteClientId - The client id of the remote client
|
|
201
|
-
*/
|
|
202
289
|
resolveRemoteClientPosition(remoteClientPosition: number, remoteClientRefSeq: number, remoteClientId: string): number | undefined;
|
|
203
290
|
private submitSequenceMessage;
|
|
204
|
-
/**
|
|
205
|
-
* Given a position specified relative to a marker id, lookup the marker
|
|
206
|
-
* and convert the position to a character position.
|
|
207
|
-
* @param relativePos - Id of marker (may be indirect) and whether position is before or after marker.
|
|
208
|
-
*/
|
|
209
291
|
posFromRelativePos(relativePos: IRelativePosition): number;
|
|
210
|
-
/**
|
|
211
|
-
* Walk the underlying segments of the sequence.
|
|
212
|
-
* The walked segments may extend beyond the range if the segments cross the
|
|
213
|
-
* ranges start or end boundaries.
|
|
214
|
-
*
|
|
215
|
-
* Set split range to true to ensure only segments within the range are walked.
|
|
216
|
-
*
|
|
217
|
-
* @param handler - The function to handle each segment. Traversal ends if
|
|
218
|
-
* this function returns true.
|
|
219
|
-
* @param start - Optional. The start of range walk.
|
|
220
|
-
* @param end - Optional. The end of range walk
|
|
221
|
-
* @param accum - Optional. An object that will be passed to the handler for accumulation
|
|
222
|
-
* @param splitRange - Optional. Splits boundary segments on the range boundaries
|
|
223
|
-
*/
|
|
224
292
|
walkSegments<TClientData>(handler: ISegmentAction<TClientData>, start?: number, end?: number, accum?: TClientData, splitRange?: boolean): void;
|
|
225
|
-
/**
|
|
226
|
-
* @returns The most recent sequence number which has been acked by the server and processed by this
|
|
227
|
-
* SharedSegmentSequence.
|
|
228
|
-
*/
|
|
229
293
|
getCurrentSeq(): number;
|
|
230
|
-
/**
|
|
231
|
-
* Inserts a segment directly before a `ReferencePosition`.
|
|
232
|
-
* @param refPos - The reference position to insert the segment at
|
|
233
|
-
* @param segment - The segment to insert
|
|
234
|
-
*/
|
|
235
294
|
insertAtReferencePosition(pos: ReferencePosition, segment: T): void;
|
|
236
|
-
/**
|
|
237
|
-
* Inserts a segment
|
|
238
|
-
* @param start - The position to insert the segment at
|
|
239
|
-
* @param spec - The segment to inserts spec
|
|
240
|
-
*/
|
|
241
295
|
insertFromSpec(pos: number, spec: IJSONSegment): void;
|
|
242
|
-
/**
|
|
243
|
-
* Retrieves the interval collection keyed on `label`. If no such interval collection exists,
|
|
244
|
-
* creates one.
|
|
245
|
-
*/
|
|
246
296
|
getIntervalCollection(label: string): IIntervalCollection<SequenceInterval>;
|
|
247
|
-
/**
|
|
248
|
-
* @returns An iterable object that enumerates the IntervalCollection labels.
|
|
249
|
-
*
|
|
250
|
-
* @example
|
|
251
|
-
*
|
|
252
|
-
* ```typescript
|
|
253
|
-
* const iter = this.getIntervalCollectionKeys();
|
|
254
|
-
* for (key of iter)
|
|
255
|
-
* const collection = this.getIntervalCollection(key);
|
|
256
|
-
* ...
|
|
257
|
-
* ```
|
|
258
|
-
*/
|
|
259
297
|
getIntervalCollectionLabels(): IterableIterator<string>;
|
|
260
298
|
/**
|
|
261
299
|
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
|
package/dist/sequence.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequence.d.ts","sourceRoot":"","sources":["../src/sequence.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,
|
|
1
|
+
{"version":3,"file":"sequence.d.ts","sourceRoot":"","sources":["../src/sequence.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAE/E,OAAO,EAEN,MAAM,EACN,YAAY,EAIZ,kBAAkB,EAKlB,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,sBAAsB,EAEtB,yBAAyB,EACzB,WAAW,EACX,iBAAiB,EACjB,aAAa,EAGb,iBAAiB,EAQjB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACN,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EACN,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACZ,KAAK,aAAa,EAClB,MAAM,6CAA6C,CAAC;AAIrD,OAAO,EAAE,mBAAmB,EAAuC,MAAM,yBAAyB,CAAC;AAGnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC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