@fluidframework/shared-object-base 2.13.0 → 2.21.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 (45) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/api-report/shared-object-base.legacy.alpha.api.md +13 -14
  3. package/dist/package.json +2 -1
  4. package/dist/packageVersion.d.ts +1 -1
  5. package/dist/packageVersion.js +1 -1
  6. package/dist/packageVersion.js.map +1 -1
  7. package/dist/serializer.d.ts +6 -6
  8. package/dist/serializer.d.ts.map +1 -1
  9. package/dist/serializer.js +2 -6
  10. package/dist/serializer.js.map +1 -1
  11. package/dist/sharedObject.d.ts +9 -9
  12. package/dist/sharedObject.d.ts.map +1 -1
  13. package/dist/sharedObject.js +1 -4
  14. package/dist/sharedObject.js.map +1 -1
  15. package/dist/types.d.ts +0 -7
  16. package/dist/types.d.ts.map +1 -1
  17. package/dist/types.js.map +1 -1
  18. package/dist/utils.d.ts +2 -2
  19. package/dist/utils.d.ts.map +1 -1
  20. package/dist/utils.js +0 -1
  21. package/dist/utils.js.map +1 -1
  22. package/lib/packageVersion.d.ts +1 -1
  23. package/lib/packageVersion.js +1 -1
  24. package/lib/packageVersion.js.map +1 -1
  25. package/lib/serializer.d.ts +6 -6
  26. package/lib/serializer.d.ts.map +1 -1
  27. package/lib/serializer.js +3 -7
  28. package/lib/serializer.js.map +1 -1
  29. package/lib/sharedObject.d.ts +9 -9
  30. package/lib/sharedObject.d.ts.map +1 -1
  31. package/lib/sharedObject.js +1 -4
  32. package/lib/sharedObject.js.map +1 -1
  33. package/lib/types.d.ts +0 -7
  34. package/lib/types.d.ts.map +1 -1
  35. package/lib/types.js.map +1 -1
  36. package/lib/utils.d.ts +2 -2
  37. package/lib/utils.d.ts.map +1 -1
  38. package/lib/utils.js +0 -1
  39. package/lib/utils.js.map +1 -1
  40. package/package.json +18 -18
  41. package/src/packageVersion.ts +1 -1
  42. package/src/serializer.ts +9 -17
  43. package/src/sharedObject.ts +9 -16
  44. package/src/types.ts +0 -8
  45. package/src/utils.ts +2 -4
@@ -353,7 +353,7 @@ export abstract class SharedObjectCore<
353
353
  ): Promise<ISummaryTreeWithStats>;
354
354
 
355
355
  /**
356
- * {@inheritDoc (ISharedObject:interface).getGCData}
356
+ * {@inheritDoc @fluidframework/datastore-definitions#(IChannel:interface).getGCData}
357
357
  */
358
358
  public abstract getGCData(fullGC?: boolean): IGarbageCollectionData;
359
359
 
@@ -389,15 +389,13 @@ export abstract class SharedObjectCore<
389
389
  message: ISequencedDocumentMessage,
390
390
  local: boolean,
391
391
  localOpMetadata: unknown,
392
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO: AB#26129 use void instead of any (legacy breaking)
393
- ): any;
392
+ ): void;
394
393
 
395
394
  /**
396
395
  * Called when the object has disconnected from the delta stream.
397
396
  */
398
397
 
399
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO: AB#26129 change return type to void (legacy breaking)
400
- protected abstract onDisconnect(): any;
398
+ protected abstract onDisconnect(): void;
401
399
 
402
400
  /**
403
401
  * The serializer to serialize / parse handles.
@@ -412,8 +410,7 @@ export abstract class SharedObjectCore<
412
410
  * and not sent to the server. This will be sent back when this message is received back from the server. This is
413
411
  * also sent if we are asked to resubmit the message.
414
412
  */
415
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- TODO: AB#26129 use unknown instead of any (legacy breaking)
416
- protected submitLocalMessage(content: any, localOpMetadata: unknown = undefined): void {
413
+ protected submitLocalMessage(content: unknown, localOpMetadata: unknown = undefined): void {
417
414
  this.verifyNotClosed();
418
415
  if (this.isAttached()) {
419
416
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -451,8 +448,7 @@ export abstract class SharedObjectCore<
451
448
  * @param content - The content of the original message.
452
449
  * @param localOpMetadata - The local metadata associated with the original message.
453
450
  */
454
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- TODO: AB#26129 use unknown instead of any (legacy breaking)
455
- protected reSubmitCore(content: any, localOpMetadata: unknown): void {
451
+ protected reSubmitCore(content: unknown, localOpMetadata: unknown): void {
456
452
  this.submitLocalMessage(content, localOpMetadata);
457
453
  }
458
454
 
@@ -465,8 +461,7 @@ export abstract class SharedObjectCore<
465
461
  protected async newAckBasedPromise<T>(
466
462
  executor: (
467
463
  resolve: (value: T | PromiseLike<T>) => void,
468
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO: AB#26129 use unknown instead of any (legacy breaking)
469
- reject: (reason?: any) => void,
464
+ reject: (reason?: unknown) => void,
470
465
  ) => void,
471
466
  ): Promise<T> {
472
467
  let rejectBecauseDispose: () => void;
@@ -619,8 +614,7 @@ export abstract class SharedObjectCore<
619
614
  /**
620
615
  * Revert an op
621
616
  */
622
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- TODO: AB#26129 use unknown instead of any (legacy breaking)
623
- protected rollback(content: any, localOpMetadata: unknown): void {
617
+ protected rollback(content: unknown, localOpMetadata: unknown): void {
624
618
  throw new Error("rollback not supported");
625
619
  }
626
620
 
@@ -641,8 +635,7 @@ export abstract class SharedObjectCore<
641
635
  *
642
636
  * @param content - Contents of a stashed op.
643
637
  */
644
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- TODO: AB#26129 use unknown instead of any (legacy breaking)
645
- protected abstract applyStashedOp(content: any): void;
638
+ protected abstract applyStashedOp(content: unknown): void;
646
639
 
647
640
  /**
648
641
  * Emit an event. This function is only intended for use by DDS classes that extend SharedObject/SharedObjectCore,
@@ -773,7 +766,7 @@ export abstract class SharedObject<
773
766
  }
774
767
 
775
768
  /**
776
- * {@inheritDoc (ISharedObject:interface).getGCData}
769
+ * {@inheritDoc @fluidframework/datastore-definitions#(IChannel:interface).getGCData}
777
770
  */
778
771
  public getGCData(fullGC: boolean = false): IGarbageCollectionData {
779
772
  // Set _isGCing to true. This flag is used to ensure that we only use SummarySerializer to serialize handles
package/src/types.ts CHANGED
@@ -10,7 +10,6 @@ import {
10
10
  } from "@fluidframework/core-interfaces";
11
11
  import { IChannel } from "@fluidframework/datastore-definitions/internal";
12
12
  import { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
13
- import { IGarbageCollectionData } from "@fluidframework/runtime-definitions/internal";
14
13
 
15
14
  /**
16
15
  * Events emitted by {@link ISharedObject}.
@@ -66,11 +65,4 @@ export interface ISharedObject<TEvent extends ISharedObjectEvents = ISharedObjec
66
65
  * the runtime attaches.
67
66
  */
68
67
  bindToContext(): void;
69
-
70
- /**
71
- * Returns the GC data for this shared object. It contains a list of GC nodes that contains references to
72
- * other GC nodes.
73
- * @param fullGC - true to bypass optimizations and force full generation of GC data.
74
- */
75
- getGCData(fullGC?: boolean): IGarbageCollectionData;
76
68
  }
package/src/utils.ts CHANGED
@@ -45,8 +45,7 @@ export function makeHandlesSerializable(
45
45
  value: unknown,
46
46
  serializer: IFluidSerializer,
47
47
  bind: IFluidHandle,
48
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO: AB#26129 use unknown instead of any (legacy breaking)
49
- ): any {
48
+ ): unknown {
50
49
  return serializer.encode(value, bind);
51
50
  }
52
51
 
@@ -61,8 +60,7 @@ export function makeHandlesSerializable(
61
60
  * @legacy
62
61
  * @alpha
63
62
  */
64
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO: AB#26129 use unknown instead of any (legacy breaking)
65
- export function parseHandles(value: unknown, serializer: IFluidSerializer): any {
63
+ export function parseHandles(value: unknown, serializer: IFluidSerializer): unknown {
66
64
  return serializer.decode(value);
67
65
  }
68
66