@fluidframework/counter 2.0.0-dev.6.4.0.192049 → 2.0.0-dev.7.2.0.203917

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 (46) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/api-extractor.json +10 -1
  3. package/api-report/counter.api.md +49 -0
  4. package/dist/counter-alpha.d.ts +131 -0
  5. package/dist/counter-beta.d.ts +131 -0
  6. package/dist/counter-public.d.ts +131 -0
  7. package/dist/counter-untrimmed.d.ts +162 -0
  8. package/dist/counter.d.ts +5 -5
  9. package/dist/counter.d.ts.map +1 -1
  10. package/dist/counter.js +9 -6
  11. package/dist/counter.js.map +1 -1
  12. package/dist/counterFactory.d.ts +2 -2
  13. package/dist/counterFactory.d.ts.map +1 -1
  14. package/dist/counterFactory.js.map +1 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js.map +1 -1
  18. package/dist/interfaces.d.ts +1 -1
  19. package/dist/interfaces.d.ts.map +1 -1
  20. package/dist/interfaces.js.map +1 -1
  21. package/dist/packageVersion.d.ts +1 -1
  22. package/dist/packageVersion.js +1 -1
  23. package/dist/packageVersion.js.map +1 -1
  24. package/dist/tsdoc-metadata.json +1 -1
  25. package/lib/counter.d.ts +5 -5
  26. package/lib/counter.d.ts.map +1 -1
  27. package/lib/counter.js +9 -6
  28. package/lib/counter.js.map +1 -1
  29. package/lib/counterFactory.d.ts +2 -2
  30. package/lib/counterFactory.d.ts.map +1 -1
  31. package/lib/counterFactory.js.map +1 -1
  32. package/lib/index.d.ts +1 -1
  33. package/lib/index.d.ts.map +1 -1
  34. package/lib/index.js.map +1 -1
  35. package/lib/interfaces.d.ts +1 -1
  36. package/lib/interfaces.d.ts.map +1 -1
  37. package/lib/interfaces.js.map +1 -1
  38. package/lib/packageVersion.d.ts +1 -1
  39. package/lib/packageVersion.js +1 -1
  40. package/lib/packageVersion.js.map +1 -1
  41. package/package.json +21 -22
  42. package/src/counter.ts +14 -10
  43. package/src/counterFactory.ts +5 -5
  44. package/src/index.ts +1 -1
  45. package/src/interfaces.ts +1 -1
  46. package/src/packageVersion.ts +1 -1
package/src/counter.ts CHANGED
@@ -4,22 +4,22 @@
4
4
  */
5
5
 
6
6
  import { assert } from "@fluidframework/core-utils";
7
- import { ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
7
+ import { type ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
8
8
  import {
9
- IFluidDataStoreRuntime,
10
- IChannelStorageService,
11
- IChannelFactory,
12
- IChannelAttributes,
9
+ type IFluidDataStoreRuntime,
10
+ type IChannelStorageService,
11
+ type IChannelFactory,
12
+ type IChannelAttributes,
13
13
  } from "@fluidframework/datastore-definitions";
14
14
  import { readAndParse } from "@fluidframework/driver-utils";
15
- import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
15
+ import { type ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
16
16
  import {
17
17
  createSingleBlobSummary,
18
- IFluidSerializer,
18
+ type IFluidSerializer,
19
19
  SharedObject,
20
20
  } from "@fluidframework/shared-object-base";
21
21
  import { CounterFactory } from "./counterFactory";
22
- import { ISharedCounter, ISharedCounterEvents } from "./interfaces";
22
+ import { type ISharedCounter, type ISharedCounterEvents } from "./interfaces";
23
23
 
24
24
  /**
25
25
  * Describes the operation (op) format for incrementing the {@link SharedCounter}.
@@ -194,16 +194,19 @@ export class SharedCounter extends SharedObject<ISharedCounterEvents> implements
194
194
  local: boolean,
195
195
  localOpMetadata: unknown,
196
196
  ): void {
197
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
197
198
  if (message.type === MessageType.Operation && !local) {
198
199
  const op = message.contents as IIncrementOperation;
199
200
 
200
201
  switch (op.type) {
201
- case "increment":
202
+ case "increment": {
202
203
  this.incrementCore(op.incrementAmount);
203
204
  break;
205
+ }
204
206
 
205
- default:
207
+ default: {
206
208
  throw new Error("Unknown operation");
209
+ }
207
210
  }
208
211
  }
209
212
  }
@@ -216,6 +219,7 @@ export class SharedCounter extends SharedObject<ISharedCounterEvents> implements
216
219
  const counterOp = op as IIncrementOperation;
217
220
 
218
221
  // TODO: Clean up error code linter violations repo-wide.
222
+
219
223
  // eslint-disable-next-line unicorn/numeric-separators-style
220
224
  assert(counterOp.type === "increment", 0x3ec /* Op type is not increment */);
221
225
 
@@ -4,13 +4,13 @@
4
4
  */
5
5
 
6
6
  import {
7
- IChannelAttributes,
8
- IFluidDataStoreRuntime,
9
- IChannelServices,
10
- IChannelFactory,
7
+ type IChannelAttributes,
8
+ type IFluidDataStoreRuntime,
9
+ type IChannelServices,
10
+ type IChannelFactory,
11
11
  } from "@fluidframework/datastore-definitions";
12
12
  import { SharedCounter } from "./counter";
13
- import { ISharedCounter } from "./interfaces";
13
+ import { type ISharedCounter } from "./interfaces";
14
14
  import { pkgVersion } from "./packageVersion";
15
15
 
16
16
  /**
package/src/index.ts CHANGED
@@ -11,4 +11,4 @@
11
11
  */
12
12
 
13
13
  export { SharedCounter } from "./counter";
14
- export { ISharedCounter, ISharedCounterEvents } from "./interfaces";
14
+ export type { ISharedCounter, ISharedCounterEvents } from "./interfaces";
package/src/interfaces.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ISharedObject, ISharedObjectEvents } from "@fluidframework/shared-object-base";
6
+ import { type ISharedObject, type ISharedObjectEvents } from "@fluidframework/shared-object-base";
7
7
 
8
8
  /**
9
9
  * Events sent by {@link SharedCounter}.
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/counter";
9
- export const pkgVersion = "2.0.0-dev.6.4.0.192049";
9
+ export const pkgVersion = "2.0.0-dev.7.2.0.203917";