@fluidframework/sequence 0.57.2 → 0.58.1000

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 (80) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +2 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/intervalCollection.d.ts +7 -3
  6. package/dist/intervalCollection.d.ts.map +1 -1
  7. package/dist/intervalCollection.js +16 -30
  8. package/dist/intervalCollection.js.map +1 -1
  9. package/dist/localValues.d.ts.map +1 -1
  10. package/dist/localValues.js +0 -1
  11. package/dist/localValues.js.map +1 -1
  12. package/dist/mapKernel.d.ts +1 -1
  13. package/dist/mapKernel.js +4 -4
  14. package/dist/mapKernel.js.map +1 -1
  15. package/dist/packageVersion.d.ts +1 -1
  16. package/dist/packageVersion.d.ts.map +1 -1
  17. package/dist/packageVersion.js +1 -1
  18. package/dist/packageVersion.js.map +1 -1
  19. package/dist/sequence.d.ts +7 -1
  20. package/dist/sequence.d.ts.map +1 -1
  21. package/dist/sequence.js +13 -7
  22. package/dist/sequence.js.map +1 -1
  23. package/dist/sequenceFactory.js +0 -3
  24. package/dist/sequenceFactory.js.map +1 -1
  25. package/dist/sharedIntervalCollection.d.ts +1 -1
  26. package/dist/sharedIntervalCollection.js +1 -1
  27. package/dist/sharedIntervalCollection.js.map +1 -1
  28. package/dist/sharedObjectSequence.js +0 -1
  29. package/dist/sharedObjectSequence.js.map +1 -1
  30. package/dist/sharedString.d.ts +1 -1
  31. package/dist/sharedString.d.ts.map +1 -1
  32. package/dist/sharedString.js.map +1 -1
  33. package/dist/sparsematrix.js +0 -3
  34. package/dist/sparsematrix.js.map +1 -1
  35. package/lib/index.d.ts +1 -1
  36. package/lib/index.d.ts.map +1 -1
  37. package/lib/index.js +1 -1
  38. package/lib/index.js.map +1 -1
  39. package/lib/intervalCollection.d.ts +7 -3
  40. package/lib/intervalCollection.d.ts.map +1 -1
  41. package/lib/intervalCollection.js +8 -22
  42. package/lib/intervalCollection.js.map +1 -1
  43. package/lib/localValues.d.ts.map +1 -1
  44. package/lib/localValues.js +0 -1
  45. package/lib/localValues.js.map +1 -1
  46. package/lib/mapKernel.d.ts +1 -1
  47. package/lib/mapKernel.js +4 -4
  48. package/lib/mapKernel.js.map +1 -1
  49. package/lib/packageVersion.d.ts +1 -1
  50. package/lib/packageVersion.d.ts.map +1 -1
  51. package/lib/packageVersion.js +1 -1
  52. package/lib/packageVersion.js.map +1 -1
  53. package/lib/sequence.d.ts +7 -1
  54. package/lib/sequence.d.ts.map +1 -1
  55. package/lib/sequence.js +13 -7
  56. package/lib/sequence.js.map +1 -1
  57. package/lib/sequenceFactory.js +0 -3
  58. package/lib/sequenceFactory.js.map +1 -1
  59. package/lib/sharedIntervalCollection.d.ts +1 -1
  60. package/lib/sharedIntervalCollection.js +1 -1
  61. package/lib/sharedIntervalCollection.js.map +1 -1
  62. package/lib/sharedObjectSequence.js +0 -1
  63. package/lib/sharedObjectSequence.js.map +1 -1
  64. package/lib/sharedString.d.ts +1 -1
  65. package/lib/sharedString.d.ts.map +1 -1
  66. package/lib/sharedString.js.map +1 -1
  67. package/lib/sparsematrix.js +0 -3
  68. package/lib/sparsematrix.js.map +1 -1
  69. package/package.json +13 -13
  70. package/src/index.ts +1 -0
  71. package/src/intervalCollection.ts +7 -26
  72. package/src/localValues.ts +0 -2
  73. package/src/mapKernel.ts +4 -4
  74. package/src/packageVersion.ts +1 -1
  75. package/src/sequence.ts +13 -7
  76. package/src/sequenceFactory.ts +3 -3
  77. package/src/sharedIntervalCollection.ts +1 -1
  78. package/src/sharedObjectSequence.ts +1 -1
  79. package/src/sharedString.ts +1 -3
  80. package/src/sparsematrix.ts +4 -4
package/src/sequence.ts CHANGED
@@ -156,7 +156,7 @@ export abstract class SharedSegmentSequence<T extends ISegment>
156
156
  protected client: Client;
157
157
  // Deferred that triggers once the object is loaded
158
158
  protected loadedDeferred = new Deferred<void>();
159
- // cache out going ops created when parital loading
159
+ // cache out going ops created when partial loading
160
160
  private readonly loadedDeferredOutgoingOps:
161
161
  [IMergeTreeOp, SegmentGroup | SegmentGroup[]][] = [];
162
162
  // cache incoming ops that arrive when partial loading
@@ -314,7 +314,13 @@ export abstract class SharedSegmentSequence<T extends ISegment>
314
314
  /**
315
315
  * Resolves a remote client's position against the local sequence
316
316
  * and returns the remote client's position relative to the local
317
- * sequence
317
+ * sequence. The client ref seq must be above the minimum sequence number
318
+ * or the return value will be undefined.
319
+ * Generally this method is used in conjunction with signals which provide
320
+ * point in time values for the below parameters, and is useful for things
321
+ * like displaying user position. It should not be used with persisted values
322
+ * as persisted values will quickly become invalid as the remoteClientRefSeq
323
+ * moves below the minimum sequence number
318
324
  * @param remoteClientPosition - The remote client's position to resolve
319
325
  * @param remoteClientRefSeq - The reference sequence number of the remote client
320
326
  * @param remoteClientId - The client id of the remote client
@@ -538,7 +544,7 @@ export abstract class SharedSegmentSequence<T extends ISegment>
538
544
  this.loadFinished(error);
539
545
  });
540
546
  if (this.dataStoreRuntime.options?.sequenceInitializeFromHeaderOnly !== true) {
541
- // if we not doing parital load, await the catch up ops,
547
+ // if we not doing partial load, await the catch up ops,
542
548
  // and the finalization of the load
543
549
  await loadCatchUpOps;
544
550
  }
@@ -594,14 +600,14 @@ export abstract class SharedSegmentSequence<T extends ISegment>
594
600
  const message = parseHandles(rawMessage, this.serializer);
595
601
 
596
602
  const ops: IMergeTreeDeltaOp[] = [];
597
- function transfromOps(event: SequenceDeltaEvent) {
603
+ function transformOps(event: SequenceDeltaEvent) {
598
604
  ops.push(...SharedSegmentSequence.createOpsFromDelta(event));
599
605
  }
600
606
  const needsTransformation = message.referenceSequenceNumber !== message.sequenceNumber - 1;
601
607
  let stashMessage: Readonly<ISequencedDocumentMessage> = message;
602
608
  if (this.runtime.options?.newMergeTreeSnapshotFormat !== true) {
603
609
  if (needsTransformation) {
604
- this.on("sequenceDelta", transfromOps);
610
+ this.on("sequenceDelta", transformOps);
605
611
  }
606
612
  }
607
613
 
@@ -609,7 +615,7 @@ export abstract class SharedSegmentSequence<T extends ISegment>
609
615
 
610
616
  if (this.runtime.options?.newMergeTreeSnapshotFormat !== true) {
611
617
  if (needsTransformation) {
612
- this.removeListener("sequenceDelta", transfromOps);
618
+ this.removeListener("sequenceDelta", transformOps);
613
619
  // shallow clone the message as we only overwrite top level properties,
614
620
  // like referenceSequenceNumber and content only
615
621
  stashMessage = {
@@ -654,7 +660,7 @@ export abstract class SharedSegmentSequence<T extends ISegment>
654
660
  throw error;
655
661
  } else {
656
662
  // it is important this series remains synchronous
657
- // first we stop defering incoming ops, and apply then all
663
+ // first we stop deferring incoming ops, and apply then all
658
664
  this.deferIncomingOps = false;
659
665
  while (this.loadedDeferredIncomingOps.length > 0) {
660
666
  this.processCore(this.loadedDeferredIncomingOps.shift(), false, undefined);
@@ -94,10 +94,10 @@ export class SharedObjectSequenceFactory implements IChannelFactory {
94
94
  * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
95
95
  */
96
96
  public static segmentFromSpec(segSpec: IJSONSegment) {
97
- // eslint-disable-next-line @typescript-eslint/ban-types
97
+
98
98
  const runSegment = segSpec as IJSONRunSegment<object>;
99
99
  if (runSegment.items) {
100
- // eslint-disable-next-line @typescript-eslint/ban-types
100
+
101
101
  const seg = new SubSequence<object>(runSegment.items);
102
102
  if (runSegment.props) {
103
103
  seg.addProperties(runSegment.props);
@@ -133,7 +133,7 @@ export class SharedObjectSequenceFactory implements IChannelFactory {
133
133
  id: string,
134
134
  services: IChannelServices,
135
135
  attributes: IChannelAttributes): Promise<ISharedObject> {
136
- // eslint-disable-next-line @typescript-eslint/ban-types
136
+
137
137
  const sharedSeq = new SharedObjectSequence<object>(runtime, id, attributes);
138
138
  await sharedSeq.load(services);
139
139
  return sharedSeq;
@@ -172,7 +172,7 @@ export class SharedIntervalCollection<TInterval extends ISerializableInterval =
172
172
 
173
173
  /**
174
174
  * Creates the full path of the intervalCollection label
175
- * @param label - the incoming lable
175
+ * @param label - the incoming label
176
176
  */
177
177
  protected getIntervalCollectionPath(label: string): string {
178
178
  return label;
@@ -27,7 +27,7 @@ export class SharedObjectSequence<T> extends SharedSequence<T> {
27
27
  * @deprecated SharedObjectSequence is not recommended for use and will be removed in an upcoming release.
28
28
  * For more info, please see [Github issue 8526](https://github.com/microsoft/FluidFramework/issues/8526)
29
29
  */
30
- // eslint-disable-next-line @typescript-eslint/no-shadow
30
+
31
31
  public static create<T>(runtime: IFluidDataStoreRuntime, id?: string) {
32
32
  return runtime.createChannel(id, SharedObjectSequenceFactory.Type) as SharedObjectSequence<T>;
33
33
  }
@@ -3,8 +3,6 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- // eslint-disable-next-line import/no-unassigned-import
7
- import { } from "@fluidframework/core-interfaces";
8
6
  import {
9
7
  ICombiningOp,
10
8
  IMergeTreeInsertMsg,
@@ -30,7 +28,7 @@ export interface ISharedString extends SharedSegmentSequence<SharedStringSegment
30
28
  * Inserts the text at the position.
31
29
  * @param pos - The position to insert the text at
32
30
  * @param text - The text to insert
33
- * @param props - The properties of text
31
+ * @param props - The properties of the text
34
32
  */
35
33
  insertText(pos: number, text: string, props?: PropertySet): void;
36
34
 
@@ -159,7 +159,7 @@ export class RunSegment extends SubSequence<SparseMatrixItem> {
159
159
  }
160
160
 
161
161
  public getTag(pos: number) {
162
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
162
+
163
163
  return this.tags[pos];
164
164
  }
165
165
 
@@ -276,13 +276,13 @@ export class SparseMatrix extends SharedSegmentSequence<MatrixSegment> {
276
276
 
277
277
  public getItem(row: number, col: number):
278
278
  // The return type is defined explicitly here to prevent TypeScript from generating dynamic imports
279
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-arguments
279
+
280
280
  Jsonable<string | number | boolean | IFluidHandle<IFluidObject & FluidObject & IFluidLoadable>> {
281
281
  const pos = rowColToPosition(row, col);
282
282
  const { segment, offset } =
283
283
  this.getContainingSegment(pos);
284
284
  if (RunSegment.is(segment)) {
285
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
285
+
286
286
  return segment.items[offset];
287
287
  } else if (PaddingSegment.is(segment)) {
288
288
  return undefined;
@@ -294,7 +294,7 @@ export class SparseMatrix extends SharedSegmentSequence<MatrixSegment> {
294
294
  public getTag(row: number, col: number) {
295
295
  const { segment, offset } = this.getSegment(row, col);
296
296
  if (RunSegment.is(segment)) {
297
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
297
+
298
298
  return segment.getTag(offset);
299
299
  }
300
300
  return undefined;