@fluidframework/map 2.0.0-rc.2.0.2 → 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,54 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import type { IChannelAttributes, IChannelFactory, IChannelServices, IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions";
|
|
6
|
+
import type { ISharedObjectKind } from "@fluidframework/shared-object-base";
|
|
7
|
+
import type { ISharedDirectory } from "./interfaces.js";
|
|
8
|
+
/**
|
|
9
|
+
* {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link ISharedDirectory}.
|
|
10
|
+
*
|
|
11
|
+
* @sealed
|
|
12
|
+
* @alpha
|
|
13
|
+
*/
|
|
14
|
+
export declare class DirectoryFactory implements IChannelFactory<ISharedDirectory> {
|
|
15
|
+
/**
|
|
16
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
|
|
17
|
+
*/
|
|
18
|
+
static readonly Type = "https://graph.microsoft.com/types/directory";
|
|
19
|
+
/**
|
|
20
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
|
|
21
|
+
*/
|
|
22
|
+
static readonly Attributes: IChannelAttributes;
|
|
23
|
+
/**
|
|
24
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
|
|
25
|
+
*/
|
|
26
|
+
get type(): string;
|
|
27
|
+
/**
|
|
28
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
|
|
29
|
+
*/
|
|
30
|
+
get attributes(): IChannelAttributes;
|
|
31
|
+
/**
|
|
32
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
|
|
33
|
+
*/
|
|
34
|
+
load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<ISharedDirectory>;
|
|
35
|
+
/**
|
|
36
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
|
|
37
|
+
*/
|
|
38
|
+
create(runtime: IFluidDataStoreRuntime, id: string): ISharedDirectory;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Entrypoint for {@link ISharedDirectory} creation.
|
|
42
|
+
* @sealed
|
|
43
|
+
* @alpha
|
|
44
|
+
*/
|
|
45
|
+
export declare const SharedDirectory: ISharedObjectKind<ISharedDirectory>;
|
|
46
|
+
/**
|
|
47
|
+
* Entrypoint for {@link ISharedDirectory} creation.
|
|
48
|
+
* @alpha
|
|
49
|
+
* @deprecated Use ISharedDirectory instead.
|
|
50
|
+
* @privateRemarks
|
|
51
|
+
* This alias is for legacy compat from when the SharedDirectory class was exported as public.
|
|
52
|
+
*/
|
|
53
|
+
export type SharedDirectory = ISharedDirectory;
|
|
54
|
+
//# sourceMappingURL=directoryFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directoryFactory.d.ts","sourceRoot":"","sources":["../src/directoryFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAG5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGxD;;;;;GAKG;AACH,qBAAa,gBAAiB,YAAW,eAAe,CAAC,gBAAgB,CAAC;IACzE;;OAEG;IACH,gBAAuB,IAAI,iDAAiD;IAE5E;;OAEG;IACH,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF;;OAEG;IACH,IAAW,IAAI,IAAI,MAAM,CAExB;IAED;;OAEG;IACH,IAAW,UAAU,IAAI,kBAAkB,CAE1C;IAED;;OAEG;IACU,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC5B,OAAO,CAAC,gBAAgB,CAAC;IAO5B;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,gBAAgB;CAM5E;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,gBAAgB,CA2B/D,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.SharedDirectory = exports.DirectoryFactory = void 0;
|
|
8
|
+
const directory_js_1 = require("./directory.js");
|
|
9
|
+
const packageVersion_js_1 = require("./packageVersion.js");
|
|
10
|
+
/**
|
|
11
|
+
* {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link ISharedDirectory}.
|
|
12
|
+
*
|
|
13
|
+
* @sealed
|
|
14
|
+
* @alpha
|
|
15
|
+
*/
|
|
16
|
+
class DirectoryFactory {
|
|
17
|
+
/**
|
|
18
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
|
|
19
|
+
*/
|
|
20
|
+
get type() {
|
|
21
|
+
return DirectoryFactory.Type;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
|
|
25
|
+
*/
|
|
26
|
+
get attributes() {
|
|
27
|
+
return DirectoryFactory.Attributes;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
|
|
31
|
+
*/
|
|
32
|
+
async load(runtime, id, services, attributes) {
|
|
33
|
+
const directory = new directory_js_1.SharedDirectory(id, runtime, attributes);
|
|
34
|
+
await directory.load(services);
|
|
35
|
+
return directory;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
|
|
39
|
+
*/
|
|
40
|
+
create(runtime, id) {
|
|
41
|
+
const directory = new directory_js_1.SharedDirectory(id, runtime, DirectoryFactory.Attributes);
|
|
42
|
+
directory.initializeLocal();
|
|
43
|
+
return directory;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.DirectoryFactory = DirectoryFactory;
|
|
47
|
+
/**
|
|
48
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
|
|
49
|
+
*/
|
|
50
|
+
DirectoryFactory.Type = "https://graph.microsoft.com/types/directory";
|
|
51
|
+
/**
|
|
52
|
+
* {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
|
|
53
|
+
*/
|
|
54
|
+
DirectoryFactory.Attributes = {
|
|
55
|
+
type: DirectoryFactory.Type,
|
|
56
|
+
snapshotFormatVersion: "0.1",
|
|
57
|
+
packageVersion: packageVersion_js_1.pkgVersion,
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Entrypoint for {@link ISharedDirectory} creation.
|
|
61
|
+
* @sealed
|
|
62
|
+
* @alpha
|
|
63
|
+
*/
|
|
64
|
+
exports.SharedDirectory = {
|
|
65
|
+
/**
|
|
66
|
+
* Create a new shared directory
|
|
67
|
+
*
|
|
68
|
+
* @param runtime - Data store runtime the new shared directory belongs to
|
|
69
|
+
* @param id - Optional name of the shared directory
|
|
70
|
+
* @returns Newly create shared directory (but not attached yet)
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* To create a `SharedDirectory`, call the static create method:
|
|
74
|
+
*
|
|
75
|
+
* ```typescript
|
|
76
|
+
* const myDirectory = SharedDirectory.create(this.runtime, id);
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
create(runtime, id) {
|
|
80
|
+
return runtime.createChannel(id, DirectoryFactory.Type);
|
|
81
|
+
},
|
|
82
|
+
/**
|
|
83
|
+
* Get a factory for SharedDirectory to register with the data store.
|
|
84
|
+
*
|
|
85
|
+
* @returns A factory that creates and load SharedDirectory
|
|
86
|
+
*/
|
|
87
|
+
getFactory() {
|
|
88
|
+
return new DirectoryFactory();
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=directoryFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directoryFactory.js","sourceRoot":"","sources":["../src/directoryFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAUH,iDAA4E;AAE5E,2DAAiD;AAEjD;;;;;GAKG;AACH,MAAa,gBAAgB;IAe5B;;OAEG;IACH,IAAW,IAAI;QACd,OAAO,gBAAgB,CAAC,IAAI,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,gBAAgB,CAAC,UAAU,CAAC;IACpC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,SAAS,GAAG,IAAI,8BAAuB,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACvE,MAAM,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAE/B,OAAO,SAAS,CAAC;IAClB,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,OAA+B,EAAE,EAAU;QACxD,MAAM,SAAS,GAAG,IAAI,8BAAuB,CAAC,EAAE,EAAE,OAAO,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACxF,SAAS,CAAC,eAAe,EAAE,CAAC;QAE5B,OAAO,SAAS,CAAC;IAClB,CAAC;;AApDF,4CAqDC;AApDA;;GAEG;AACoB,qBAAI,GAAG,6CAA6C,CAAC;AAE5E;;GAEG;AACoB,2BAAU,GAAuB;IACvD,IAAI,EAAE,gBAAgB,CAAC,IAAI;IAC3B,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,8BAAU;CAC1B,CAAC;AA0CH;;;;GAIG;AACU,QAAA,eAAe,GAAwC;IACnE;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,OAA+B,EAAE,EAAW;QAClD,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,gBAAgB,CAAC,IAAI,CAAqB,CAAC;IAC7E,CAAC;IAED;;;;OAIG;IACH,UAAU;QACT,OAAO,IAAI,gBAAgB,EAAE,CAAC;IAC/B,CAAC;CACD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIChannelAttributes,\n\tIChannelFactory,\n\tIChannelServices,\n\tIFluidDataStoreRuntime,\n} from \"@fluidframework/datastore-definitions\";\nimport type { ISharedObjectKind } from \"@fluidframework/shared-object-base\";\n\nimport { SharedDirectory as SharedDirectoryInternal } from \"./directory.js\";\nimport type { ISharedDirectory } from \"./interfaces.js\";\nimport { pkgVersion } from \"./packageVersion.js\";\n\n/**\n * {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link ISharedDirectory}.\n *\n * @sealed\n * @alpha\n */\nexport class DirectoryFactory implements IChannelFactory<ISharedDirectory> {\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/directory\";\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: DirectoryFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic get type(): string {\n\t\treturn DirectoryFactory.Type;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic get attributes(): IChannelAttributes {\n\t\treturn DirectoryFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<ISharedDirectory> {\n\t\tconst directory = new SharedDirectoryInternal(id, runtime, attributes);\n\t\tawait directory.load(services);\n\n\t\treturn directory;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}\n\t */\n\tpublic create(runtime: IFluidDataStoreRuntime, id: string): ISharedDirectory {\n\t\tconst directory = new SharedDirectoryInternal(id, runtime, DirectoryFactory.Attributes);\n\t\tdirectory.initializeLocal();\n\n\t\treturn directory;\n\t}\n}\n\n/**\n * Entrypoint for {@link ISharedDirectory} creation.\n * @sealed\n * @alpha\n */\nexport const SharedDirectory: ISharedObjectKind<ISharedDirectory> = {\n\t/**\n\t * Create a new shared directory\n\t *\n\t * @param runtime - Data store runtime the new shared directory belongs to\n\t * @param id - Optional name of the shared directory\n\t * @returns Newly create shared directory (but not attached yet)\n\t *\n\t * @example\n\t * To create a `SharedDirectory`, call the static create method:\n\t *\n\t * ```typescript\n\t * const myDirectory = SharedDirectory.create(this.runtime, id);\n\t * ```\n\t */\n\tcreate(runtime: IFluidDataStoreRuntime, id?: string): ISharedDirectory {\n\t\treturn runtime.createChannel(id, DirectoryFactory.Type) as ISharedDirectory;\n\t},\n\n\t/**\n\t * Get a factory for SharedDirectory to register with the data store.\n\t *\n\t * @returns A factory that creates and load SharedDirectory\n\t */\n\tgetFactory(): IChannelFactory<ISharedDirectory> {\n\t\treturn new DirectoryFactory();\n\t},\n};\n\n/**\n * Entrypoint for {@link ISharedDirectory} creation.\n * @alpha\n * @deprecated Use ISharedDirectory instead.\n * @privateRemarks\n * This alias is for legacy compat from when the SharedDirectory class was exported as public.\n */\nexport type SharedDirectory = ISharedDirectory;\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,49 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* @packageDocumentation
|
|
15
15
|
*/
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export { MapFactory } from "./map.js";
|
|
20
|
-
import type { IChannelFactory, IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions";
|
|
21
|
-
import { ISharedMap } from "./interfaces.js";
|
|
22
|
-
/**
|
|
23
|
-
* {@inheritDoc ISharedMap}
|
|
24
|
-
* @public
|
|
25
|
-
* @deprecated Please use SharedTree for new containers. SharedMap is supported for loading preexisting Fluid Framework 1.0 containers only.
|
|
26
|
-
*/
|
|
27
|
-
export declare const SharedMap: {
|
|
28
|
-
/**
|
|
29
|
-
* Get a factory for SharedMap to register with the data store.
|
|
30
|
-
* @returns A factory that creates SharedMaps and loads them from storage.
|
|
31
|
-
*/
|
|
32
|
-
getFactory(): IChannelFactory<ISharedMap>;
|
|
33
|
-
/**
|
|
34
|
-
* Create a new shared map.
|
|
35
|
-
* @param runtime - The data store runtime that the new shared map belongs to.
|
|
36
|
-
* @param id - Optional name of the shared map.
|
|
37
|
-
* @returns Newly created shared map.
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* To create a `SharedMap`, call the static create method:
|
|
41
|
-
*
|
|
42
|
-
* ```typescript
|
|
43
|
-
* const myMap = SharedMap.create(this.runtime, id);
|
|
44
|
-
* ```
|
|
45
|
-
* @privateRemarks
|
|
46
|
-
* TODO:
|
|
47
|
-
* Clarify how this differs from `MapFactory.create`.
|
|
48
|
-
* They are different since making this forward to MapFactory.create breaks some things,
|
|
49
|
-
* but the difference is unclear from the documentation.
|
|
50
|
-
*/
|
|
51
|
-
create(runtime: IFluidDataStoreRuntime, id?: string): ISharedMap;
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* {@inheritDoc ISharedMap}
|
|
55
|
-
* @public
|
|
56
|
-
* @deprecated Use ISharedMap instead.
|
|
57
|
-
* @privateRemarks
|
|
58
|
-
* This alias is for legacy compat from when the SharedMap class was exported as public.
|
|
59
|
-
*/
|
|
60
|
-
export type SharedMap = ISharedMap;
|
|
16
|
+
export { IDirectory, IDirectoryEvents, IDirectoryValueChanged, ISharedDirectory, ISharedDirectoryEvents, ISharedMap, ISharedMapEvents, IValueChanged, } from "./interfaces.js";
|
|
17
|
+
export { MapFactory, SharedMap } from "./mapFactory.js";
|
|
18
|
+
export { DirectoryFactory, SharedDirectory } from "./directoryFactory.js";
|
|
61
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH,OAAO,EACN,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH,OAAO,EACN,UAAU,EACV,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,UAAU,EACV,gBAAgB,EAChB,aAAa,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,59 +4,11 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
* - {@link SharedDirectory}
|
|
16
|
-
*
|
|
17
|
-
* @packageDocumentation
|
|
18
|
-
*/
|
|
19
|
-
var directory_js_1 = require("./directory.js");
|
|
20
|
-
Object.defineProperty(exports, "DirectoryFactory", { enumerable: true, get: function () { return directory_js_1.DirectoryFactory; } });
|
|
21
|
-
Object.defineProperty(exports, "SharedDirectory", { enumerable: true, get: function () { return directory_js_1.SharedDirectory; } });
|
|
22
|
-
var localValues_js_1 = require("./localValues.js");
|
|
23
|
-
Object.defineProperty(exports, "LocalValueMaker", { enumerable: true, get: function () { return localValues_js_1.LocalValueMaker; } });
|
|
24
|
-
var map_js_1 = require("./map.js");
|
|
25
|
-
Object.defineProperty(exports, "MapFactory", { enumerable: true, get: function () { return map_js_1.MapFactory; } });
|
|
26
|
-
const map_js_2 = require("./map.js");
|
|
27
|
-
/**
|
|
28
|
-
* {@inheritDoc ISharedMap}
|
|
29
|
-
* @public
|
|
30
|
-
* @deprecated Please use SharedTree for new containers. SharedMap is supported for loading preexisting Fluid Framework 1.0 containers only.
|
|
31
|
-
*/
|
|
32
|
-
exports.SharedMap = {
|
|
33
|
-
/**
|
|
34
|
-
* Get a factory for SharedMap to register with the data store.
|
|
35
|
-
* @returns A factory that creates SharedMaps and loads them from storage.
|
|
36
|
-
*/
|
|
37
|
-
getFactory() {
|
|
38
|
-
return new map_js_2.MapFactory();
|
|
39
|
-
},
|
|
40
|
-
/**
|
|
41
|
-
* Create a new shared map.
|
|
42
|
-
* @param runtime - The data store runtime that the new shared map belongs to.
|
|
43
|
-
* @param id - Optional name of the shared map.
|
|
44
|
-
* @returns Newly created shared map.
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* To create a `SharedMap`, call the static create method:
|
|
48
|
-
*
|
|
49
|
-
* ```typescript
|
|
50
|
-
* const myMap = SharedMap.create(this.runtime, id);
|
|
51
|
-
* ```
|
|
52
|
-
* @privateRemarks
|
|
53
|
-
* TODO:
|
|
54
|
-
* Clarify how this differs from `MapFactory.create`.
|
|
55
|
-
* They are different since making this forward to MapFactory.create breaks some things,
|
|
56
|
-
* but the difference is unclear from the documentation.
|
|
57
|
-
*/
|
|
58
|
-
create(runtime, id) {
|
|
59
|
-
return runtime.createChannel(id, map_js_2.MapFactory.Type);
|
|
60
|
-
},
|
|
61
|
-
};
|
|
7
|
+
exports.SharedDirectory = exports.DirectoryFactory = exports.SharedMap = exports.MapFactory = void 0;
|
|
8
|
+
var mapFactory_js_1 = require("./mapFactory.js");
|
|
9
|
+
Object.defineProperty(exports, "MapFactory", { enumerable: true, get: function () { return mapFactory_js_1.MapFactory; } });
|
|
10
|
+
Object.defineProperty(exports, "SharedMap", { enumerable: true, get: function () { return mapFactory_js_1.SharedMap; } });
|
|
11
|
+
var directoryFactory_js_1 = require("./directoryFactory.js");
|
|
12
|
+
Object.defineProperty(exports, "DirectoryFactory", { enumerable: true, get: function () { return directoryFactory_js_1.DirectoryFactory; } });
|
|
13
|
+
Object.defineProperty(exports, "SharedDirectory", { enumerable: true, get: function () { return directoryFactory_js_1.SharedDirectory; } });
|
|
62
14
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAwBH,iDAAwD;AAA/C,2GAAA,UAAU,OAAA;AAAE,0GAAA,SAAS,OAAA;AAC9B,6DAA0E;AAAjE,uHAAA,gBAAgB,OAAA;AAAE,sHAAA,eAAe,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * The `map` library provides interfaces and implementing classes for map-like distributed data structures.\n *\n * @remarks The following distributed data structures are defined in this library:\n *\n * - {@link SharedMap}\n *\n * - {@link SharedDirectory}\n *\n * @packageDocumentation\n */\n\nexport {\n\tIDirectory,\n\tIDirectoryEvents,\n\tIDirectoryValueChanged,\n\tISharedDirectory,\n\tISharedDirectoryEvents,\n\tISharedMap,\n\tISharedMapEvents,\n\tIValueChanged,\n} from \"./interfaces.js\";\nexport { MapFactory, SharedMap } from \"./mapFactory.js\";\nexport { DirectoryFactory, SharedDirectory } from \"./directoryFactory.js\";\n"]}
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { ISharedObject, ISharedObjectEvents } from "@fluidframework/shared-object-base";
|
|
6
5
|
import { IDisposable, IEvent, IEventProvider, IEventThisPlaceHolder } from "@fluidframework/core-interfaces";
|
|
6
|
+
import { ISharedObject, ISharedObjectEvents } from "@fluidframework/shared-object-base";
|
|
7
7
|
/**
|
|
8
8
|
* Type of "valueChanged" event parameter.
|
|
9
9
|
* @sealed
|
|
10
|
-
* @
|
|
10
|
+
* @alpha
|
|
11
11
|
*/
|
|
12
12
|
export interface IValueChanged {
|
|
13
13
|
/**
|
|
14
14
|
* The key storing the value that changed.
|
|
15
15
|
*/
|
|
16
|
-
key: string;
|
|
16
|
+
readonly key: string;
|
|
17
17
|
/**
|
|
18
18
|
* The value that was stored at the key prior to the change.
|
|
19
19
|
*/
|
|
20
|
-
previousValue: any;
|
|
20
|
+
readonly previousValue: any;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Interface describing actions on a directory.
|
|
@@ -151,7 +151,7 @@ export interface ISharedDirectoryEvents extends ISharedObjectEvents {
|
|
|
151
151
|
export interface IDirectoryEvents extends IEvent {
|
|
152
152
|
/**
|
|
153
153
|
* Emitted when a key is set or deleted. As opposed to the
|
|
154
|
-
* {@link
|
|
154
|
+
* {@link ISharedDirectory}'s valueChanged event, this is emitted only on the {@link IDirectory} that directly
|
|
155
155
|
* contains the key.
|
|
156
156
|
*
|
|
157
157
|
* @remarks Listener parameters:
|
|
@@ -232,7 +232,7 @@ export interface IDirectoryValueChanged extends IValueChanged {
|
|
|
232
232
|
/**
|
|
233
233
|
* Events emitted in response to changes to the {@link ISharedMap | map} data.
|
|
234
234
|
* @sealed
|
|
235
|
-
* @
|
|
235
|
+
* @alpha
|
|
236
236
|
*/
|
|
237
237
|
export interface ISharedMapEvents extends ISharedObjectEvents {
|
|
238
238
|
/**
|
|
@@ -267,7 +267,7 @@ export interface ISharedMapEvents extends ISharedObjectEvents {
|
|
|
267
267
|
*
|
|
268
268
|
* For more information, including example usages, see {@link https://fluidframework.com/docs/data-structures/map/}.
|
|
269
269
|
* @sealed
|
|
270
|
-
* @
|
|
270
|
+
* @alpha
|
|
271
271
|
*/
|
|
272
272
|
export interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {
|
|
273
273
|
/**
|
|
@@ -284,54 +284,4 @@ export interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string,
|
|
|
284
284
|
*/
|
|
285
285
|
set<T = unknown>(key: string, value: T): this;
|
|
286
286
|
}
|
|
287
|
-
/**
|
|
288
|
-
* The _ready-for-serialization_ format of values contained in DDS contents. This allows us to use
|
|
289
|
-
* {@link ISerializableValue."type"} to understand whether they're storing a Plain JavaScript object,
|
|
290
|
-
* a {@link @fluidframework/shared-object-base#SharedObject}, or a value type.
|
|
291
|
-
*
|
|
292
|
-
* @remarks
|
|
293
|
-
*
|
|
294
|
-
* Note that the in-memory equivalent of ISerializableValue is ILocalValue (similarly holding a type, but with
|
|
295
|
-
* the _in-memory representation_ of the value instead). An ISerializableValue is what gets passed to
|
|
296
|
-
* JSON.stringify and comes out of JSON.parse. This format is used both for snapshots (loadCore/populate)
|
|
297
|
-
* and ops (set).
|
|
298
|
-
*
|
|
299
|
-
* If type is Plain, it must be a plain JS object that can survive a JSON.stringify/parse. E.g. a URL object will
|
|
300
|
-
* just get stringified to a URL string and not rehydrate as a URL object on the other side. It may contain members
|
|
301
|
-
* that are ISerializedHandle (the serialized form of a handle).
|
|
302
|
-
*
|
|
303
|
-
* If type is a value type then it must be amongst the types registered via registerValueType or we won't know how
|
|
304
|
-
* to serialize/deserialize it (we rely on its factory via .load() and .store()). Its value will be type-dependent.
|
|
305
|
-
* If type is Shared, then the in-memory value will just be a reference to the SharedObject. Its value will be a
|
|
306
|
-
* channel ID.
|
|
307
|
-
*
|
|
308
|
-
* @deprecated This type is legacy and deprecated.
|
|
309
|
-
* @alpha
|
|
310
|
-
*/
|
|
311
|
-
export interface ISerializableValue {
|
|
312
|
-
/**
|
|
313
|
-
* A type annotation to help indicate how the value serializes.
|
|
314
|
-
*/
|
|
315
|
-
type: string;
|
|
316
|
-
/**
|
|
317
|
-
* The JSONable representation of the value.
|
|
318
|
-
*/
|
|
319
|
-
value: any;
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* Serialized {@link ISerializableValue} counterpart.
|
|
323
|
-
* @alpha
|
|
324
|
-
*/
|
|
325
|
-
export interface ISerializedValue {
|
|
326
|
-
/**
|
|
327
|
-
* A type annotation to help indicate how the value serializes.
|
|
328
|
-
*/
|
|
329
|
-
type: string;
|
|
330
|
-
/**
|
|
331
|
-
* String representation of the value.
|
|
332
|
-
*
|
|
333
|
-
* @remarks Will be undefined if the original value was undefined.
|
|
334
|
-
*/
|
|
335
|
-
value: string | undefined;
|
|
336
|
-
}
|
|
337
287
|
//# sourceMappingURL=interfaces.d.ts.map
|
package/dist/interfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,WAAW,EACX,MAAM,EACN,cAAc,EACd,qBAAqB,EACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAExF;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC7B;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE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ANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISharedObject, ISharedObjectEvents } from \"@fluidframework/shared-object-base\";\nimport {\n\tIDisposable,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n} from \"@fluidframework/core-interfaces\";\n\n/**\n * Type of \"valueChanged\" event parameter.\n * @sealed\n * @public\n */\nexport interface IValueChanged {\n\t/**\n\t * The key storing the value that changed.\n\t */\n\tkey: string;\n\n\t/**\n\t * The value that was stored at the key prior to the change.\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpreviousValue: any;\n}\n\n/**\n * Interface describing actions on a directory.\n *\n * @remarks When used as a Map, operates on its keys.\n * @alpha\n */\nexport interface IDirectory\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\textends Map<string, any>,\n\t\tIEventProvider<IDirectoryEvents>,\n\t\tPartial<IDisposable> {\n\t/**\n\t * The absolute path of the directory.\n\t */\n\treadonly absolutePath: string;\n\n\t/**\n\t * Retrieves the value stored at the given key from the directory.\n\t * @param key - Key to retrieve from\n\t * @returns The stored value, or undefined if the key is not set\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tget<T = any>(key: string): T | undefined;\n\n\t/**\n\t * Sets the value stored at key to the provided value.\n\t * @param key - Key to set at\n\t * @param value - Value to set\n\t * @returns The IDirectory itself\n\t */\n\tset<T = unknown>(key: string, value: T): this;\n\n\t/**\n\t * Get the number of sub directory within the directory.\n\t * @returns The number of sub directory within a directory.\n\t */\n\tcountSubDirectory?(): number;\n\n\t/**\n\t * Creates an IDirectory child of this IDirectory, or retrieves the existing IDirectory child if one with the\n\t * same name already exists.\n\t * @param subdirName - Name of the new child directory to create\n\t * @returns The IDirectory child that was created or retrieved\n\t */\n\tcreateSubDirectory(subdirName: string): IDirectory;\n\n\t/**\n\t * Gets an IDirectory child of this IDirectory, if it exists.\n\t * @param subdirName - Name of the child directory to get\n\t * @returns The requested IDirectory\n\t */\n\tgetSubDirectory(subdirName: string): IDirectory | undefined;\n\n\t/**\n\t * Checks whether this directory has a child directory with the given name.\n\t * @param subdirName - Name of the child directory to check\n\t * @returns True if it exists, false otherwise\n\t */\n\thasSubDirectory(subdirName: string): boolean;\n\n\t/**\n\t * Deletes an IDirectory child of this IDirectory, if it exists, along with all descendent keys and directories.\n\t * @param subdirName - Name of the child directory to delete\n\t * @returns True if the IDirectory existed and was deleted, false if it did not exist\n\t */\n\tdeleteSubDirectory(subdirName: string): boolean;\n\n\t/**\n\t * Gets an iterator over the IDirectory children of this IDirectory.\n\t * @returns The IDirectory iterator\n\t */\n\tsubdirectories(): IterableIterator<[string, IDirectory]>;\n\n\t/**\n\t * Get an IDirectory within the directory, in order to use relative paths from that location.\n\t * @param relativePath - Path of the IDirectory to get, relative to this IDirectory\n\t * @returns The requested IDirectory\n\t */\n\tgetWorkingDirectory(relativePath: string): IDirectory | undefined;\n}\n\n/**\n * Events emitted in response to changes to the directory data.\n *\n * @remarks\n * These events only emit on the {@link ISharedDirectory} itself, and not on subdirectories.\n * @alpha\n */\nexport interface ISharedDirectoryEvents extends ISharedObjectEvents {\n\t/**\n\t * Emitted when a key is set or deleted. This is emitted for any key in the {@link ISharedDirectory} or any\n\t * subdirectory.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `changed` - Information on the key that changed, its value prior to the change, and the path to the\n\t * key that changed.\n\t *\n\t * - `local` - Whether the change originated from this client.\n\t *\n\t * - `target` - The {@link ISharedDirectory} itself.\n\t */\n\t(\n\t\tevent: \"valueChanged\",\n\t\tlistener: (\n\t\t\tchanged: IDirectoryValueChanged,\n\t\t\tlocal: boolean,\n\t\t\ttarget: IEventThisPlaceHolder,\n\t\t) => void,\n\t);\n\n\t/**\n\t * Emitted when the {@link ISharedDirectory} is cleared.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `local` - Whether the clear originated from this client.\n\t *\n\t * - `target` - The {@link ISharedDirectory} itself.\n\t */\n\t(event: \"clear\", listener: (local: boolean, target: IEventThisPlaceHolder) => void);\n\n\t/**\n\t * Emitted when a subdirectory is created.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `path` - The relative path to the subdirectory that is created.\n\t * It is relative from the object which raises the event.\n\t *\n\t * - `local` - Whether the create originated from the this client.\n\t *\n\t * - `target` - The {@link ISharedDirectory} itself.\n\t */\n\t(\n\t\tevent: \"subDirectoryCreated\",\n\t\tlistener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void,\n\t);\n\n\t/**\n\t * Emitted when a subdirectory is deleted.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `path` - The relative path to the subdirectory that is deleted.\n\t * It is relative from the object which raises the event.\n\t *\n\t * - `local` - Whether the delete originated from the this client.\n\t *\n\t * - `target` - The {@link ISharedDirectory} itself.\n\t */\n\t(\n\t\tevent: \"subDirectoryDeleted\",\n\t\tlistener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void,\n\t);\n}\n\n/**\n * Events emitted in response to changes to the directory data.\n * @alpha\n */\nexport interface IDirectoryEvents extends IEvent {\n\t/**\n\t * Emitted when a key is set or deleted. As opposed to the\n\t * {@link SharedDirectory}'s valueChanged event, this is emitted only on the {@link IDirectory} that directly\n\t * contains the key.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `changed` - Information on the key that changed and its value prior to the change.\n\t *\n\t * - `local` - Whether the change originated from this client.\n\t *\n\t * - `target` - The {@link IDirectory} itself.\n\t */\n\t(\n\t\tevent: \"containedValueChanged\",\n\t\tlistener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void,\n\t);\n\n\t/**\n\t * Emitted when a subdirectory is created. Also emitted when a delete\n\t * of a subdirectory is rolled back.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `path` - The relative path to the subdirectory that is created.\n\t * It is relative from the object which raises the event.\n\t *\n\t * - `local` - Whether the creation originated from the this client.\n\t *\n\t * - `target` - The {@link ISharedDirectory} itself.\n\t */\n\t(\n\t\tevent: \"subDirectoryCreated\",\n\t\tlistener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void,\n\t);\n\n\t/**\n\t * Emitted when a subdirectory is deleted.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `path` - The relative path to the subdirectory that is deleted.\n\t * It is relative from the object which raises the event.\n\t *\n\t * - `local` - Whether the delete originated from the this client.\n\t *\n\t * - `target` - The {@link ISharedDirectory} itself.\n\t */\n\t(\n\t\tevent: \"subDirectoryDeleted\",\n\t\tlistener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void,\n\t);\n\n\t/**\n\t * Emitted when this sub directory is deleted.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `target` - The {@link IDirectory} itself.\n\t */\n\t(event: \"disposed\", listener: (target: IEventThisPlaceHolder) => void);\n\n\t/**\n\t * Emitted when this previously deleted sub directory is restored.\n\t * This event only needs to be handled in the case of rollback. If your application does\n\t * not use the local rollback feature, you can ignore this event.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `target` - The {@link IDirectory} itself.\n\t */\n\t(event: \"undisposed\", listener: (target: IEventThisPlaceHolder) => void);\n}\n\n/**\n * Provides a hierarchical organization of map-like data structures as SubDirectories.\n * The values stored within can be accessed like a map, and the hierarchy can be navigated using path syntax.\n * SubDirectories can be retrieved for use as working directories.\n * @alpha\n */\nexport interface ISharedDirectory\n\textends ISharedObject<ISharedDirectoryEvents & IDirectoryEvents>,\n\t\tOmit<IDirectory, \"on\" | \"once\" | \"off\"> {\n\t// The Omit type excludes symbols, which we don't want to exclude. Adding them back here manually.\n\t// https://github.com/microsoft/TypeScript/issues/31671\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t[Symbol.iterator](): IterableIterator<[string, any]>;\n\treadonly [Symbol.toStringTag]: string;\n}\n\n/**\n * Type of \"valueChanged\" event parameter for {@link ISharedDirectory}.\n * @alpha\n */\nexport interface IDirectoryValueChanged extends IValueChanged {\n\t/**\n\t * The absolute path to the IDirectory storing the key which changed.\n\t */\n\tpath: string;\n}\n\n/**\n * Events emitted in response to changes to the {@link ISharedMap | map} data.\n * @sealed\n * @public\n */\nexport interface ISharedMapEvents extends ISharedObjectEvents {\n\t/**\n\t * Emitted when a key is set or deleted.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `changed` - Information on the key that changed and its value prior to the change.\n\t *\n\t * - `local` - Whether the change originated from this client.\n\t *\n\t * - `target` - The {@link ISharedMap} itself.\n\t */\n\t(\n\t\tevent: \"valueChanged\",\n\t\tlistener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void,\n\t);\n\n\t/**\n\t * Emitted when the map is cleared.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `local` - Whether the clear originated from this client.\n\t *\n\t * - `target` - The {@link ISharedMap} itself.\n\t */\n\t(event: \"clear\", listener: (local: boolean, target: IEventThisPlaceHolder) => void);\n}\n\n/**\n * The SharedMap distributed data structure can be used to store key-value pairs. It provides the same API for setting\n * and retrieving values that JavaScript developers are accustomed to with the\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map | Map} built-in object.\n * However, the keys of a SharedMap must be strings, and the values must either be a JSON-serializable object or a\n * {@link @fluidframework/datastore#FluidObjectHandle}.\n *\n * For more information, including example usages, see {@link https://fluidframework.com/docs/data-structures/map/}.\n * @sealed\n * @public\n */\n// TODO: Use `unknown` instead (breaking change).\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {\n\t/**\n\t * Retrieves the given key from the map if it exists.\n\t * @param key - Key to retrieve from\n\t * @returns The stored value, or undefined if the key is not set\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tget<T = any>(key: string): T | undefined;\n\n\t/**\n\t * Sets the value stored at key to the provided value.\n\t * @param key - Key to set\n\t * @param value - Value to set\n\t * @returns The {@link ISharedMap} itself\n\t */\n\tset<T = unknown>(key: string, value: T): this;\n}\n\n/**\n * The _ready-for-serialization_ format of values contained in DDS contents. This allows us to use\n * {@link ISerializableValue.\"type\"} to understand whether they're storing a Plain JavaScript object,\n * a {@link @fluidframework/shared-object-base#SharedObject}, or a value type.\n *\n * @remarks\n *\n * Note that the in-memory equivalent of ISerializableValue is ILocalValue (similarly holding a type, but with\n * the _in-memory representation_ of the value instead). An ISerializableValue is what gets passed to\n * JSON.stringify and comes out of JSON.parse. This format is used both for snapshots (loadCore/populate)\n * and ops (set).\n *\n * If type is Plain, it must be a plain JS object that can survive a JSON.stringify/parse. E.g. a URL object will\n * just get stringified to a URL string and not rehydrate as a URL object on the other side. It may contain members\n * that are ISerializedHandle (the serialized form of a handle).\n *\n * If type is a value type then it must be amongst the types registered via registerValueType or we won't know how\n * to serialize/deserialize it (we rely on its factory via .load() and .store()). Its value will be type-dependent.\n * If type is Shared, then the in-memory value will just be a reference to the SharedObject. Its value will be a\n * channel ID.\n *\n * @deprecated This type is legacy and deprecated.\n * @alpha\n */\nexport interface ISerializableValue {\n\t/**\n\t * A type annotation to help indicate how the value serializes.\n\t */\n\ttype: string;\n\n\t/**\n\t * The JSONable representation of the value.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tvalue: any;\n}\n\n/**\n * Serialized {@link ISerializableValue} counterpart.\n * @alpha\n */\nexport interface ISerializedValue {\n\t/**\n\t * A type annotation to help indicate how the value serializes.\n\t */\n\ttype: string;\n\n\t/**\n\t * String representation of the value.\n\t *\n\t * @remarks Will be undefined if the original value was undefined.\n\t */\n\tvalue: string | undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDisposable,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n} from \"@fluidframework/core-interfaces\";\nimport { ISharedObject, ISharedObjectEvents } from \"@fluidframework/shared-object-base\";\n\n/**\n * Type of \"valueChanged\" event parameter.\n * @sealed\n * @alpha\n */\nexport interface IValueChanged {\n\t/**\n\t * The key storing the value that changed.\n\t */\n\treadonly key: string;\n\n\t/**\n\t * The value that was stored at the key prior to the change.\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\treadonly previousValue: any;\n}\n\n/**\n * Interface describing actions on a directory.\n *\n * @remarks When used as a Map, operates on its keys.\n * @alpha\n */\nexport interface IDirectory\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\textends Map<string, any>,\n\t\tIEventProvider<IDirectoryEvents>,\n\t\tPartial<IDisposable> {\n\t/**\n\t * The absolute path of the directory.\n\t */\n\treadonly absolutePath: string;\n\n\t/**\n\t * Retrieves the value stored at the given key from the directory.\n\t * @param key - Key to retrieve from\n\t * @returns The stored value, or undefined if the key is not set\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tget<T = any>(key: string): T | undefined;\n\n\t/**\n\t * Sets the value stored at key to the provided value.\n\t * @param key - Key to set at\n\t * @param value - Value to set\n\t * @returns The IDirectory itself\n\t */\n\tset<T = unknown>(key: string, value: T): this;\n\n\t/**\n\t * Get the number of sub directory within the directory.\n\t * @returns The number of sub directory within a directory.\n\t */\n\tcountSubDirectory?(): number;\n\n\t/**\n\t * Creates an IDirectory child of this IDirectory, or retrieves the existing IDirectory child if one with the\n\t * same name already exists.\n\t * @param subdirName - Name of the new child directory to create\n\t * @returns The IDirectory child that was created or retrieved\n\t */\n\tcreateSubDirectory(subdirName: string): IDirectory;\n\n\t/**\n\t * Gets an IDirectory child of this IDirectory, if it exists.\n\t * @param subdirName - Name of the child directory to get\n\t * @returns The requested IDirectory\n\t */\n\tgetSubDirectory(subdirName: string): IDirectory | undefined;\n\n\t/**\n\t * Checks whether this directory has a child directory with the given name.\n\t * @param subdirName - Name of the child directory to check\n\t * @returns True if it exists, false otherwise\n\t */\n\thasSubDirectory(subdirName: string): boolean;\n\n\t/**\n\t * Deletes an IDirectory child of this IDirectory, if it exists, along with all descendent keys and directories.\n\t * @param subdirName - Name of the child directory to delete\n\t * @returns True if the IDirectory existed and was deleted, false if it did not exist\n\t */\n\tdeleteSubDirectory(subdirName: string): boolean;\n\n\t/**\n\t * Gets an iterator over the IDirectory children of this IDirectory.\n\t * @returns The IDirectory iterator\n\t */\n\tsubdirectories(): IterableIterator<[string, IDirectory]>;\n\n\t/**\n\t * Get an IDirectory within the directory, in order to use relative paths from that location.\n\t * @param relativePath - Path of the IDirectory to get, relative to this IDirectory\n\t * @returns The requested IDirectory\n\t */\n\tgetWorkingDirectory(relativePath: string): IDirectory | undefined;\n}\n\n/**\n * Events emitted in response to changes to the directory data.\n *\n * @remarks\n * These events only emit on the {@link ISharedDirectory} itself, and not on subdirectories.\n * @alpha\n */\nexport interface ISharedDirectoryEvents extends ISharedObjectEvents {\n\t/**\n\t * Emitted when a key is set or deleted. This is emitted for any key in the {@link ISharedDirectory} or any\n\t * subdirectory.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `changed` - Information on the key that changed, its value prior to the change, and the path to the\n\t * key that changed.\n\t *\n\t * - `local` - Whether the change originated from this client.\n\t *\n\t * - `target` - The {@link ISharedDirectory} itself.\n\t */\n\t(\n\t\tevent: \"valueChanged\",\n\t\tlistener: (\n\t\t\tchanged: IDirectoryValueChanged,\n\t\t\tlocal: boolean,\n\t\t\ttarget: IEventThisPlaceHolder,\n\t\t) => void,\n\t);\n\n\t/**\n\t * Emitted when the {@link ISharedDirectory} is cleared.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `local` - Whether the clear originated from this client.\n\t *\n\t * - `target` - The {@link ISharedDirectory} itself.\n\t */\n\t(event: \"clear\", listener: (local: boolean, target: IEventThisPlaceHolder) => void);\n\n\t/**\n\t * Emitted when a subdirectory is created.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `path` - The relative path to the subdirectory that is created.\n\t * It is relative from the object which raises the event.\n\t *\n\t * - `local` - Whether the create originated from the this client.\n\t *\n\t * - `target` - The {@link ISharedDirectory} itself.\n\t */\n\t(\n\t\tevent: \"subDirectoryCreated\",\n\t\tlistener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void,\n\t);\n\n\t/**\n\t * Emitted when a subdirectory is deleted.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `path` - The relative path to the subdirectory that is deleted.\n\t * It is relative from the object which raises the event.\n\t *\n\t * - `local` - Whether the delete originated from the this client.\n\t *\n\t * - `target` - The {@link ISharedDirectory} itself.\n\t */\n\t(\n\t\tevent: \"subDirectoryDeleted\",\n\t\tlistener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void,\n\t);\n}\n\n/**\n * Events emitted in response to changes to the directory data.\n * @alpha\n */\nexport interface IDirectoryEvents extends IEvent {\n\t/**\n\t * Emitted when a key is set or deleted. As opposed to the\n\t * {@link ISharedDirectory}'s valueChanged event, this is emitted only on the {@link IDirectory} that directly\n\t * contains the key.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `changed` - Information on the key that changed and its value prior to the change.\n\t *\n\t * - `local` - Whether the change originated from this client.\n\t *\n\t * - `target` - The {@link IDirectory} itself.\n\t */\n\t(\n\t\tevent: \"containedValueChanged\",\n\t\tlistener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void,\n\t);\n\n\t/**\n\t * Emitted when a subdirectory is created. Also emitted when a delete\n\t * of a subdirectory is rolled back.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `path` - The relative path to the subdirectory that is created.\n\t * It is relative from the object which raises the event.\n\t *\n\t * - `local` - Whether the creation originated from the this client.\n\t *\n\t * - `target` - The {@link ISharedDirectory} itself.\n\t */\n\t(\n\t\tevent: \"subDirectoryCreated\",\n\t\tlistener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void,\n\t);\n\n\t/**\n\t * Emitted when a subdirectory is deleted.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `path` - The relative path to the subdirectory that is deleted.\n\t * It is relative from the object which raises the event.\n\t *\n\t * - `local` - Whether the delete originated from the this client.\n\t *\n\t * - `target` - The {@link ISharedDirectory} itself.\n\t */\n\t(\n\t\tevent: \"subDirectoryDeleted\",\n\t\tlistener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void,\n\t);\n\n\t/**\n\t * Emitted when this sub directory is deleted.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `target` - The {@link IDirectory} itself.\n\t */\n\t(event: \"disposed\", listener: (target: IEventThisPlaceHolder) => void);\n\n\t/**\n\t * Emitted when this previously deleted sub directory is restored.\n\t * This event only needs to be handled in the case of rollback. If your application does\n\t * not use the local rollback feature, you can ignore this event.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `target` - The {@link IDirectory} itself.\n\t */\n\t(event: \"undisposed\", listener: (target: IEventThisPlaceHolder) => void);\n}\n\n/**\n * Provides a hierarchical organization of map-like data structures as SubDirectories.\n * The values stored within can be accessed like a map, and the hierarchy can be navigated using path syntax.\n * SubDirectories can be retrieved for use as working directories.\n * @alpha\n */\nexport interface ISharedDirectory\n\textends ISharedObject<ISharedDirectoryEvents & IDirectoryEvents>,\n\t\tOmit<IDirectory, \"on\" | \"once\" | \"off\"> {\n\t// The Omit type excludes symbols, which we don't want to exclude. Adding them back here manually.\n\t// https://github.com/microsoft/TypeScript/issues/31671\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t[Symbol.iterator](): IterableIterator<[string, any]>;\n\treadonly [Symbol.toStringTag]: string;\n}\n\n/**\n * Type of \"valueChanged\" event parameter for {@link ISharedDirectory}.\n * @alpha\n */\nexport interface IDirectoryValueChanged extends IValueChanged {\n\t/**\n\t * The absolute path to the IDirectory storing the key which changed.\n\t */\n\tpath: string;\n}\n\n/**\n * Events emitted in response to changes to the {@link ISharedMap | map} data.\n * @sealed\n * @alpha\n */\nexport interface ISharedMapEvents extends ISharedObjectEvents {\n\t/**\n\t * Emitted when a key is set or deleted.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `changed` - Information on the key that changed and its value prior to the change.\n\t *\n\t * - `local` - Whether the change originated from this client.\n\t *\n\t * - `target` - The {@link ISharedMap} itself.\n\t */\n\t(\n\t\tevent: \"valueChanged\",\n\t\tlistener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void,\n\t);\n\n\t/**\n\t * Emitted when the map is cleared.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `local` - Whether the clear originated from this client.\n\t *\n\t * - `target` - The {@link ISharedMap} itself.\n\t */\n\t(event: \"clear\", listener: (local: boolean, target: IEventThisPlaceHolder) => void);\n}\n\n/**\n * The SharedMap distributed data structure can be used to store key-value pairs. It provides the same API for setting\n * and retrieving values that JavaScript developers are accustomed to with the\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map | Map} built-in object.\n * However, the keys of a SharedMap must be strings, and the values must either be a JSON-serializable object or a\n * {@link @fluidframework/datastore#FluidObjectHandle}.\n *\n * For more information, including example usages, see {@link https://fluidframework.com/docs/data-structures/map/}.\n * @sealed\n * @alpha\n */\n// TODO: Use `unknown` instead (breaking change).\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {\n\t/**\n\t * Retrieves the given key from the map if it exists.\n\t * @param key - Key to retrieve from\n\t * @returns The stored value, or undefined if the key is not set\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tget<T = any>(key: string): T | undefined;\n\n\t/**\n\t * Sets the value stored at key to the provided value.\n\t * @param key - Key to set\n\t * @param value - Value to set\n\t * @returns The {@link ISharedMap} itself\n\t */\n\tset<T = unknown>(key: string, value: T): this;\n}\n"]}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { ISerializableValue } from "./interfaces.js";
|
|
6
5
|
import { ILocalValue } from "./localValues.js";
|
|
7
6
|
/**
|
|
8
7
|
* Operation indicating a value should be set for a key.
|
|
@@ -98,4 +97,54 @@ export type MapKeyLocalOpMetadata = IMapKeyEditLocalOpMetadata | IMapKeyAddLocal
|
|
|
98
97
|
* Metadata for a local operation.
|
|
99
98
|
*/
|
|
100
99
|
export type MapLocalOpMetadata = IMapClearLocalOpMetadata | MapKeyLocalOpMetadata;
|
|
100
|
+
/**
|
|
101
|
+
* The _ready-for-serialization_ format of values contained in DDS contents. This allows us to use
|
|
102
|
+
* {@link ISerializableValue."type"} to understand whether they're storing a Plain JavaScript object,
|
|
103
|
+
* a {@link @fluidframework/shared-object-base#SharedObject}, or a value type.
|
|
104
|
+
*
|
|
105
|
+
* @remarks
|
|
106
|
+
*
|
|
107
|
+
* Note that the in-memory equivalent of ISerializableValue is ILocalValue (similarly holding a type, but with
|
|
108
|
+
* the _in-memory representation_ of the value instead). An ISerializableValue is what gets passed to
|
|
109
|
+
* JSON.stringify and comes out of JSON.parse. This format is used both for snapshots (loadCore/populate)
|
|
110
|
+
* and ops (set).
|
|
111
|
+
*
|
|
112
|
+
* If type is Plain, it must be a plain JS object that can survive a JSON.stringify/parse. E.g. a URL object will
|
|
113
|
+
* just get stringified to a URL string and not rehydrate as a URL object on the other side. It may contain members
|
|
114
|
+
* that are ISerializedHandle (the serialized form of a handle).
|
|
115
|
+
*
|
|
116
|
+
* If type is a value type then it must be amongst the types registered via registerValueType or we won't know how
|
|
117
|
+
* to serialize/deserialize it (we rely on its factory via .load() and .store()). Its value will be type-dependent.
|
|
118
|
+
* If type is Shared, then the in-memory value will just be a reference to the SharedObject. Its value will be a
|
|
119
|
+
* channel ID.
|
|
120
|
+
*
|
|
121
|
+
* @deprecated This type is legacy and deprecated.
|
|
122
|
+
* @alpha
|
|
123
|
+
*/
|
|
124
|
+
export interface ISerializableValue {
|
|
125
|
+
/**
|
|
126
|
+
* A type annotation to help indicate how the value serializes.
|
|
127
|
+
*/
|
|
128
|
+
type: string;
|
|
129
|
+
/**
|
|
130
|
+
* The JSONable representation of the value.
|
|
131
|
+
*/
|
|
132
|
+
value: any;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Serialized {@link ISerializableValue} counterpart.
|
|
136
|
+
* @alpha
|
|
137
|
+
*/
|
|
138
|
+
export interface ISerializedValue {
|
|
139
|
+
/**
|
|
140
|
+
* A type annotation to help indicate how the value serializes.
|
|
141
|
+
*/
|
|
142
|
+
type: string;
|
|
143
|
+
/**
|
|
144
|
+
* String representation of the value.
|
|
145
|
+
*
|
|
146
|
+
* @remarks Will be undefined if the original value was undefined.
|
|
147
|
+
*/
|
|
148
|
+
value: string | undefined;
|
|
149
|
+
}
|
|
101
150
|
//# sourceMappingURL=internalInterfaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internalInterfaces.d.ts","sourceRoot":"","sources":["../src/internalInterfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"internalInterfaces.d.ts","sourceRoot":"","sources":["../src/internalInterfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAA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C;CACX;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internalInterfaces.js","sourceRoot":"","sources":["../src/internalInterfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\
|
|
1
|
+
{"version":3,"file":"internalInterfaces.js","sourceRoot":"","sources":["../src/internalInterfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ILocalValue } from \"./localValues.js\";\n\n/**\n * Operation indicating a value should be set for a key.\n */\nexport interface IMapSetOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"set\";\n\n\t/**\n\t * Map key being modified.\n\t */\n\tkey: string;\n\n\t/**\n\t * Value to be set on the key.\n\t */\n\t// eslint-disable-next-line import/no-deprecated\n\tvalue: ISerializableValue;\n}\n\n/**\n * Operation indicating the map should be cleared.\n */\nexport interface IMapClearOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"clear\";\n}\n\n/**\n * Operation indicating a key should be deleted from the map.\n */\nexport interface IMapDeleteOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"delete\";\n\n\t/**\n\t * Map key being modified.\n\t */\n\tkey: string;\n}\n\n/**\n * Metadata for an local `edit` operation.\n */\nexport interface IMapKeyEditLocalOpMetadata {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"edit\";\n\n\t/**\n\t * Unique identifier for the local operation.\n\t */\n\tpendingMessageId: number;\n\n\t/**\n\t * Local value prior to the edit.\n\t */\n\tpreviousValue: ILocalValue;\n}\n\n/**\n * Metadata for an local `add` operation.\n */\nexport interface IMapKeyAddLocalOpMetadata {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"add\";\n\n\t/**\n\t * Unique identifier for the local operation.\n\t */\n\tpendingMessageId: number;\n}\n\n/**\n * Metadata for an local `clear` operation.\n */\nexport interface IMapClearLocalOpMetadata {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"clear\";\n\n\t/**\n\t * Unique identifier for the local operation.\n\t */\n\tpendingMessageId: number;\n\n\t/**\n\t * Local map contents prior to clearing it.\n\t */\n\tpreviousMap?: Map<string, ILocalValue>;\n}\n\n/**\n * Metadata for a local operation associated with a specific key entry in the map.\n */\nexport type MapKeyLocalOpMetadata = IMapKeyEditLocalOpMetadata | IMapKeyAddLocalOpMetadata;\n\n/**\n * Metadata for a local operation.\n */\nexport type MapLocalOpMetadata = IMapClearLocalOpMetadata | MapKeyLocalOpMetadata;\n\n/**\n * The _ready-for-serialization_ format of values contained in DDS contents. This allows us to use\n * {@link ISerializableValue.\"type\"} to understand whether they're storing a Plain JavaScript object,\n * a {@link @fluidframework/shared-object-base#SharedObject}, or a value type.\n *\n * @remarks\n *\n * Note that the in-memory equivalent of ISerializableValue is ILocalValue (similarly holding a type, but with\n * the _in-memory representation_ of the value instead). An ISerializableValue is what gets passed to\n * JSON.stringify and comes out of JSON.parse. This format is used both for snapshots (loadCore/populate)\n * and ops (set).\n *\n * If type is Plain, it must be a plain JS object that can survive a JSON.stringify/parse. E.g. a URL object will\n * just get stringified to a URL string and not rehydrate as a URL object on the other side. It may contain members\n * that are ISerializedHandle (the serialized form of a handle).\n *\n * If type is a value type then it must be amongst the types registered via registerValueType or we won't know how\n * to serialize/deserialize it (we rely on its factory via .load() and .store()). Its value will be type-dependent.\n * If type is Shared, then the in-memory value will just be a reference to the SharedObject. Its value will be a\n * channel ID.\n *\n * @deprecated This type is legacy and deprecated.\n * @alpha\n */\nexport interface ISerializableValue {\n\t/**\n\t * A type annotation to help indicate how the value serializes.\n\t */\n\ttype: string;\n\n\t/**\n\t * The JSONable representation of the value.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tvalue: any;\n}\n\n/**\n * Serialized {@link ISerializableValue} counterpart.\n * @alpha\n */\nexport interface ISerializedValue {\n\t/**\n\t * A type annotation to help indicate how the value serializes.\n\t */\n\ttype: string;\n\n\t/**\n\t * String representation of the value.\n\t *\n\t * @remarks Will be undefined if the original value was undefined.\n\t */\n\tvalue: string | undefined;\n}\n"]}
|
package/dist/legacy.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
+
* Generated by "flub generate entrypoints" in @fluidframework/build-tools.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
// alpha APIs
|
|
13
|
+
DirectoryFactory,
|
|
14
|
+
IDirectory,
|
|
15
|
+
IDirectoryEvents,
|
|
16
|
+
IDirectoryValueChanged,
|
|
17
|
+
ISharedDirectory,
|
|
18
|
+
ISharedDirectoryEvents,
|
|
19
|
+
ISharedMap,
|
|
20
|
+
ISharedMapEvents,
|
|
21
|
+
IValueChanged,
|
|
22
|
+
MapFactory,
|
|
23
|
+
SharedDirectory,
|
|
24
|
+
SharedMap
|
|
25
|
+
} from "./index.js";
|
package/dist/localValues.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { IFluidHandle } from "@fluidframework/core-interfaces";
|
|
6
6
|
import { IFluidSerializer } from "@fluidframework/shared-object-base";
|
|
7
|
-
import { ISerializableValue, ISerializedValue } from "./
|
|
7
|
+
import { ISerializableValue, ISerializedValue } from "./internalInterfaces.js";
|
|
8
8
|
/**
|
|
9
9
|
* A local value to be stored in a container type Distributed Data Store (DDS).
|
|
10
10
|
* @alpha
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localValues.d.ts","sourceRoot":"","sources":["../src/localValues.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"localValues.d.ts","sourceRoot":"","sources":["../src/localValues.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAQtE,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE/E;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;OAEG;IAGH,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC;IAEpB;;;;;OAKG;IACH,cAAc,CAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,YAAY,GAAG,gBAAgB,CAAC;CACnF;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC/B,UAAU,EAAE,WAAW,EACvB,UAAU,EAAE,gBAAgB,EAC5B,IAAI,EAAE,YAAY,GAEhB,kBAAkB,CAOpB;AAED;;GAEG;AACH,qBAAa,eAAgB,YAAW,WAAW;aAKf,KAAK,EAAE,OAAO;IAJjD;;;OAGG;gBACgC,KAAK,EAAE,OAAO;IAEjD;;OAEG;IACH,IAAW,IAAI,IAAI,MAAM,CAExB;IAED;;OAEG;IACI,cAAc,CAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,YAAY,GAAG,gBAAgB;CAUzF;AAED;;;;GAIG;AACH,qBAAa,eAAe;IAC3B;;OAEG;;IAGH;;;OAGG;IAC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