@fluidframework/map 2.0.0-rc.2.0.1 → 2.0.0-rc.3.0.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.
- package/CHANGELOG.md +44 -0
- package/api-report/map.api.md +17 -158
- package/dist/directory.d.ts +7 -51
- package/dist/directory.d.ts.map +1 -1
- package/dist/directory.js +39 -107
- package/dist/directory.js.map +1 -1
- package/dist/directoryFactory.d.ts +54 -0
- package/dist/directoryFactory.d.ts.map +1 -0
- package/dist/directoryFactory.js +91 -0
- package/dist/directoryFactory.js.map +1 -0
- package/dist/index.d.ts +3 -45
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -55
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +7 -57
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/internalInterfaces.d.ts +50 -1
- package/dist/internalInterfaces.d.ts.map +1 -1
- package/dist/internalInterfaces.js.map +1 -1
- package/dist/legacy.d.ts +25 -0
- package/dist/localValues.d.ts +1 -1
- package/dist/localValues.d.ts.map +1 -1
- package/dist/localValues.js +6 -6
- package/dist/localValues.js.map +1 -1
- package/dist/map.d.ts +4 -36
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +9 -60
- package/dist/map.js.map +1 -1
- package/dist/mapFactory.d.ts +52 -0
- package/dist/mapFactory.d.ts.map +1 -0
- package/dist/mapFactory.js +71 -0
- package/dist/mapFactory.js.map +1 -0
- package/dist/mapKernel.d.ts +3 -3
- package/dist/mapKernel.d.ts.map +1 -1
- package/dist/mapKernel.js +14 -14
- package/dist/mapKernel.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/public.d.ts +12 -0
- package/internal.d.ts +11 -0
- package/legacy.d.ts +11 -0
- package/lib/directory.d.ts +7 -51
- package/lib/directory.d.ts.map +1 -1
- package/lib/directory.js +6 -73
- package/lib/directory.js.map +1 -1
- package/lib/directoryFactory.d.ts +54 -0
- package/lib/directoryFactory.d.ts.map +1 -0
- package/lib/directoryFactory.js +87 -0
- package/lib/directoryFactory.js.map +1 -0
- package/lib/index.d.ts +3 -45
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -50
- package/lib/index.js.map +1 -1
- package/lib/interfaces.d.ts +7 -57
- package/lib/interfaces.d.ts.map +1 -1
- package/lib/interfaces.js.map +1 -1
- package/lib/internalInterfaces.d.ts +50 -1
- package/lib/internalInterfaces.d.ts.map +1 -1
- package/lib/internalInterfaces.js.map +1 -1
- package/lib/legacy.d.ts +25 -0
- package/lib/localValues.d.ts +1 -1
- package/lib/localValues.d.ts.map +1 -1
- package/lib/localValues.js +1 -1
- package/lib/localValues.js.map +1 -1
- package/lib/map.d.ts +4 -36
- package/lib/map.d.ts.map +1 -1
- package/lib/map.js +4 -54
- package/lib/map.js.map +1 -1
- package/lib/mapFactory.d.ts +52 -0
- package/lib/mapFactory.d.ts.map +1 -0
- package/lib/mapFactory.js +67 -0
- package/lib/mapFactory.js.map +1 -0
- package/lib/mapKernel.d.ts +3 -3
- package/lib/mapKernel.d.ts.map +1 -1
- package/lib/mapKernel.js +2 -2
- package/lib/mapKernel.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/lib/public.d.ts +12 -0
- package/package.json +105 -59
- package/src/directory.ts +16 -100
- package/src/directoryFactory.ts +120 -0
- package/src/index.ts +2 -73
- package/src/interfaces.ts +7 -62
- package/src/internalInterfaces.ts +55 -2
- package/src/localValues.ts +6 -5
- package/src/map.ts +8 -71
- package/src/mapFactory.ts +101 -0
- package/src/mapKernel.ts +13 -9
- package/src/packageVersion.ts +1 -1
- package/api-extractor-cjs.json +0 -8
- package/dist/map-alpha.d.ts +0 -898
- package/dist/map-beta.d.ts +0 -195
- package/dist/map-public.d.ts +0 -195
- package/dist/map-untrimmed.d.ts +0 -912
- package/lib/map-alpha.d.ts +0 -898
- package/lib/map-beta.d.ts +0 -195
- package/lib/map-public.d.ts +0 -195
- package/lib/map-untrimmed.d.ts +0 -912
- package/lib/test/memory/directory.spec.js +0 -71
- package/lib/test/memory/directory.spec.js.map +0 -1
- package/lib/test/memory/map.spec.js +0 -71
- package/lib/test/memory/map.spec.js.map +0 -1
- package/lib/test/mocha/directory.order.spec.js +0 -422
- package/lib/test/mocha/directory.order.spec.js.map +0 -1
- package/lib/test/mocha/directory.snapshot.spec.js +0 -111
- package/lib/test/mocha/directory.snapshot.spec.js.map +0 -1
- package/lib/test/mocha/directory.spec.js +0 -1406
- package/lib/test/mocha/directory.spec.js.map +0 -1
- package/lib/test/mocha/directoryEquivalenceUtils.js +0 -36
- package/lib/test/mocha/directoryEquivalenceUtils.js.map +0 -1
- package/lib/test/mocha/directoryFuzzTests.spec.js +0 -337
- package/lib/test/mocha/directoryFuzzTests.spec.js.map +0 -1
- package/lib/test/mocha/dirname.cjs +0 -16
- package/lib/test/mocha/dirname.cjs.map +0 -1
- package/lib/test/mocha/map.fuzz.spec.js +0 -114
- package/lib/test/mocha/map.fuzz.spec.js.map +0 -1
- package/lib/test/mocha/map.spec.js +0 -685
- package/lib/test/mocha/map.spec.js.map +0 -1
- package/lib/test/mocha/rebasing.spec.js +0 -158
- package/lib/test/mocha/rebasing.spec.js.map +0 -1
- package/lib/test/mocha/reconnection.spec.js +0 -327
- package/lib/test/mocha/reconnection.spec.js.map +0 -1
- package/lib/test/types/validateMapPrevious.generated.js +0 -66
- package/lib/test/types/validateMapPrevious.generated.js.map +0 -1
- /package/{dist → lib}/tsdoc-metadata.json +0 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* eslint-disable import/no-deprecated */
|
|
7
|
+
|
|
8
|
+
import type {
|
|
9
|
+
IChannelAttributes,
|
|
10
|
+
IChannelFactory,
|
|
11
|
+
IChannelServices,
|
|
12
|
+
IFluidDataStoreRuntime,
|
|
13
|
+
} from "@fluidframework/datastore-definitions";
|
|
14
|
+
import type { ISharedObjectKind } from "@fluidframework/shared-object-base";
|
|
15
|
+
|
|
16
|
+
import type { ISharedMap } from "./interfaces.js";
|
|
17
|
+
import { SharedMap as SharedMapInternal } from "./map.js";
|
|
18
|
+
import { pkgVersion } from "./packageVersion.js";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link ISharedMap}.
|
|
22
|
+
*
|
|
23
|
+
* @sealed
|
|
24
|
+
* @alpha
|
|
25
|
+
*/
|
|
26
|
+
export class MapFactory implements IChannelFactory<ISharedMap> {
|
|
27
|
+
/**
|
|
28
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
|
|
29
|
+
*/
|
|
30
|
+
public static readonly Type = "https://graph.microsoft.com/types/map";
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
|
|
34
|
+
*/
|
|
35
|
+
public static readonly Attributes: IChannelAttributes = {
|
|
36
|
+
type: MapFactory.Type,
|
|
37
|
+
snapshotFormatVersion: "0.2",
|
|
38
|
+
packageVersion: pkgVersion,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
|
|
43
|
+
*/
|
|
44
|
+
public get type(): string {
|
|
45
|
+
return MapFactory.Type;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
|
|
50
|
+
*/
|
|
51
|
+
public get attributes(): IChannelAttributes {
|
|
52
|
+
return MapFactory.Attributes;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
|
|
57
|
+
*/
|
|
58
|
+
public async load(
|
|
59
|
+
runtime: IFluidDataStoreRuntime,
|
|
60
|
+
id: string,
|
|
61
|
+
services: IChannelServices,
|
|
62
|
+
attributes: IChannelAttributes,
|
|
63
|
+
): Promise<ISharedMap> {
|
|
64
|
+
const map = new SharedMapInternal(id, runtime, attributes);
|
|
65
|
+
await map.load(services);
|
|
66
|
+
|
|
67
|
+
return map;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
|
|
72
|
+
*/
|
|
73
|
+
public create(runtime: IFluidDataStoreRuntime, id: string): ISharedMap {
|
|
74
|
+
const map = new SharedMapInternal(id, runtime, MapFactory.Attributes);
|
|
75
|
+
map.initializeLocal();
|
|
76
|
+
|
|
77
|
+
return map;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Entrypoint for {@link ISharedMap} creation.
|
|
83
|
+
* @alpha
|
|
84
|
+
*/
|
|
85
|
+
export const SharedMap: ISharedObjectKind<ISharedMap> = {
|
|
86
|
+
getFactory(): IChannelFactory<ISharedMap> {
|
|
87
|
+
return new MapFactory();
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
create(runtime: IFluidDataStoreRuntime, id?: string): ISharedMap {
|
|
91
|
+
return runtime.createChannel(id, MapFactory.Type) as ISharedMap;
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Entrypoint for {@link ISharedMap} creation.
|
|
97
|
+
* @alpha
|
|
98
|
+
* @privateRemarks
|
|
99
|
+
* This alias is for legacy compat from when the SharedMap class was exported as public.
|
|
100
|
+
*/
|
|
101
|
+
export type SharedMap = ISharedMap;
|
package/src/mapKernel.ts
CHANGED
|
@@ -3,19 +3,23 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { IFluidHandle } from "@fluidframework/core-interfaces";
|
|
7
|
-
import { IFluidSerializer, ValueType, bindHandles } from "@fluidframework/shared-object-base";
|
|
8
|
-
import { assert, unreachableCase } from "@fluidframework/core-utils";
|
|
9
6
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
10
|
-
|
|
11
|
-
import {
|
|
7
|
+
import { IFluidHandle } from "@fluidframework/core-interfaces";
|
|
8
|
+
import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
9
|
+
import { IFluidSerializer } from "@fluidframework/shared-object-base";
|
|
10
|
+
import { ValueType, bindHandles } from "@fluidframework/shared-object-base/internal";
|
|
11
|
+
|
|
12
|
+
import { ISharedMapEvents } from "./interfaces.js";
|
|
12
13
|
import {
|
|
13
|
-
|
|
14
|
-
IMapDeleteOperation,
|
|
14
|
+
IMapClearLocalOpMetadata,
|
|
15
15
|
IMapClearOperation,
|
|
16
|
-
|
|
16
|
+
IMapDeleteOperation,
|
|
17
17
|
IMapKeyAddLocalOpMetadata,
|
|
18
|
-
|
|
18
|
+
IMapKeyEditLocalOpMetadata,
|
|
19
|
+
IMapSetOperation,
|
|
20
|
+
// eslint-disable-next-line import/no-deprecated
|
|
21
|
+
ISerializableValue,
|
|
22
|
+
ISerializedValue,
|
|
19
23
|
} from "./internalInterfaces.js";
|
|
20
24
|
import { ILocalValue, LocalValueMaker, makeSerializable } from "./localValues.js";
|
|
21
25
|
|
package/src/packageVersion.ts
CHANGED
package/api-extractor-cjs.json
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "../../../common/build/build-common/api-extractor-base.cjs.primary.json",
|
|
4
|
-
// CJS is actually secondary; so, no report.
|
|
5
|
-
"apiReport": {
|
|
6
|
-
"enabled": false
|
|
7
|
-
}
|
|
8
|
-
}
|