@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.
- package/CHANGELOG.md +52 -0
- package/api-extractor.json +10 -1
- package/api-report/counter.api.md +49 -0
- package/dist/counter-alpha.d.ts +131 -0
- package/dist/counter-beta.d.ts +131 -0
- package/dist/counter-public.d.ts +131 -0
- package/dist/counter-untrimmed.d.ts +162 -0
- package/dist/counter.d.ts +5 -5
- package/dist/counter.d.ts.map +1 -1
- package/dist/counter.js +9 -6
- package/dist/counter.js.map +1 -1
- package/dist/counterFactory.d.ts +2 -2
- package/dist/counterFactory.d.ts.map +1 -1
- package/dist/counterFactory.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/interfaces.d.ts +1 -1
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/counter.d.ts +5 -5
- package/lib/counter.d.ts.map +1 -1
- package/lib/counter.js +9 -6
- package/lib/counter.js.map +1 -1
- package/lib/counterFactory.d.ts +2 -2
- package/lib/counterFactory.d.ts.map +1 -1
- package/lib/counterFactory.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/interfaces.d.ts +1 -1
- package/lib/interfaces.d.ts.map +1 -1
- package/lib/interfaces.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +21 -22
- package/src/counter.ts +14 -10
- package/src/counterFactory.ts +5 -5
- package/src/index.ts +1 -1
- package/src/interfaces.ts +1 -1
- 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
|
|
package/src/counterFactory.ts
CHANGED
|
@@ -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
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}.
|
package/src/packageVersion.ts
CHANGED