@fluidframework/map 1.4.0-121020 → 2.0.0-dev-rc.1.0.0.224419
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/.eslintrc.js +12 -11
- package/.mocharc.js +12 -0
- package/CHANGELOG.md +162 -0
- package/README.md +24 -8
- package/api-extractor-lint.json +4 -0
- package/api-extractor.json +2 -2
- package/api-report/map.api.md +297 -0
- package/dist/{directory.js → directory.cjs} +749 -228
- package/dist/directory.cjs.map +1 -0
- package/dist/directory.d.ts +567 -34
- package/dist/directory.d.ts.map +1 -1
- package/dist/index.cjs +27 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/{interfaces.js → interfaces.cjs} +1 -1
- package/dist/interfaces.cjs.map +1 -0
- package/dist/interfaces.d.ts +167 -184
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/internalInterfaces.cjs +7 -0
- package/dist/internalInterfaces.cjs.map +1 -0
- package/dist/internalInterfaces.d.ts +101 -0
- package/dist/internalInterfaces.d.ts.map +1 -0
- package/dist/{localValues.js → localValues.cjs} +15 -3
- package/dist/localValues.cjs.map +1 -0
- package/dist/localValues.d.ts +17 -6
- package/dist/localValues.d.ts.map +1 -1
- package/dist/map-alpha.d.ts +982 -0
- package/dist/map-beta.d.ts +275 -0
- package/dist/map-public.d.ts +275 -0
- package/dist/map-untrimmed.d.ts +996 -0
- package/dist/{map.js → map.cjs} +39 -34
- package/dist/map.cjs.map +1 -0
- package/dist/map.d.ts +10 -17
- package/dist/map.d.ts.map +1 -1
- package/dist/{mapKernel.js → mapKernel.cjs} +122 -79
- package/dist/mapKernel.cjs.map +1 -0
- package/dist/mapKernel.d.ts +17 -48
- package/dist/mapKernel.d.ts.map +1 -1
- package/dist/{packageVersion.js → packageVersion.cjs} +2 -2
- package/dist/packageVersion.cjs.map +1 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/tsdoc-metadata.json +11 -0
- package/lib/directory.d.mts +902 -0
- package/lib/directory.d.mts.map +1 -0
- package/lib/{directory.js → directory.mjs} +736 -199
- package/lib/directory.mjs.map +1 -0
- package/lib/index.d.mts +9 -0
- package/lib/index.d.mts.map +1 -0
- package/lib/index.mjs +8 -0
- package/lib/index.mjs.map +1 -0
- package/lib/{interfaces.d.ts → interfaces.d.mts} +167 -184
- package/lib/interfaces.d.mts.map +1 -0
- package/lib/{interfaces.js → interfaces.mjs} +1 -1
- package/lib/interfaces.mjs.map +1 -0
- package/lib/internalInterfaces.d.mts +101 -0
- package/lib/internalInterfaces.d.mts.map +1 -0
- package/lib/internalInterfaces.mjs +6 -0
- package/lib/internalInterfaces.mjs.map +1 -0
- package/lib/{localValues.d.ts → localValues.d.mts} +18 -7
- package/lib/localValues.d.mts.map +1 -0
- package/lib/{localValues.js → localValues.mjs} +15 -3
- package/lib/localValues.mjs.map +1 -0
- package/lib/map-alpha.d.mts +982 -0
- package/lib/map-beta.d.mts +275 -0
- package/lib/map-public.d.mts +275 -0
- package/lib/map-untrimmed.d.mts +996 -0
- package/lib/{map.d.ts → map.d.mts} +11 -18
- package/lib/map.d.mts.map +1 -0
- package/lib/{map.js → map.mjs} +40 -35
- package/lib/map.mjs.map +1 -0
- package/lib/{mapKernel.d.ts → mapKernel.d.mts} +18 -49
- package/lib/mapKernel.d.mts.map +1 -0
- package/lib/{mapKernel.js → mapKernel.mjs} +116 -73
- package/lib/mapKernel.mjs.map +1 -0
- package/lib/{packageVersion.d.ts → packageVersion.d.mts} +1 -1
- package/lib/{packageVersion.d.ts.map → packageVersion.d.mts.map} +1 -1
- package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
- package/lib/packageVersion.mjs.map +1 -0
- package/map.test-files.tar +0 -0
- package/package.json +105 -65
- package/prettier.config.cjs +8 -0
- package/src/directory.ts +2544 -1727
- package/src/index.ts +31 -5
- package/src/interfaces.ts +346 -345
- package/src/internalInterfaces.ts +119 -0
- package/src/localValues.ts +103 -96
- package/src/map.ts +362 -351
- package/src/mapKernel.ts +755 -722
- package/src/packageVersion.ts +1 -1
- package/tsc-multi.test.json +4 -0
- package/tsconfig.json +10 -15
- package/dist/directory.js.map +0 -1
- package/dist/index.js +0 -34
- package/dist/index.js.map +0 -1
- package/dist/interfaces.js.map +0 -1
- package/dist/localValues.js.map +0 -1
- package/dist/map.js.map +0 -1
- package/dist/mapKernel.js.map +0 -1
- package/dist/packageVersion.js.map +0 -1
- package/lib/directory.d.ts +0 -369
- package/lib/directory.d.ts.map +0 -1
- package/lib/directory.js.map +0 -1
- package/lib/index.d.ts +0 -20
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -20
- package/lib/index.js.map +0 -1
- package/lib/interfaces.d.ts.map +0 -1
- package/lib/interfaces.js.map +0 -1
- package/lib/localValues.d.ts.map +0 -1
- package/lib/localValues.js.map +0 -1
- package/lib/map.d.ts.map +0 -1
- package/lib/map.js.map +0 -1
- package/lib/mapKernel.d.ts.map +0 -1
- package/lib/mapKernel.js.map +0 -1
- package/lib/packageVersion.js.map +0 -1
- package/tsconfig.esnext.json +0 -7
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { ISerializableValue } from "./interfaces";
|
|
6
|
+
import { ILocalValue } from "./localValues";
|
|
7
|
+
/**
|
|
8
|
+
* Operation indicating a value should be set for a key.
|
|
9
|
+
*/
|
|
10
|
+
export interface IMapSetOperation {
|
|
11
|
+
/**
|
|
12
|
+
* String identifier of the operation type.
|
|
13
|
+
*/
|
|
14
|
+
type: "set";
|
|
15
|
+
/**
|
|
16
|
+
* Map key being modified.
|
|
17
|
+
*/
|
|
18
|
+
key: string;
|
|
19
|
+
/**
|
|
20
|
+
* Value to be set on the key.
|
|
21
|
+
*/
|
|
22
|
+
value: ISerializableValue;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Operation indicating the map should be cleared.
|
|
26
|
+
*/
|
|
27
|
+
export interface IMapClearOperation {
|
|
28
|
+
/**
|
|
29
|
+
* String identifier of the operation type.
|
|
30
|
+
*/
|
|
31
|
+
type: "clear";
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Operation indicating a key should be deleted from the map.
|
|
35
|
+
*/
|
|
36
|
+
export interface IMapDeleteOperation {
|
|
37
|
+
/**
|
|
38
|
+
* String identifier of the operation type.
|
|
39
|
+
*/
|
|
40
|
+
type: "delete";
|
|
41
|
+
/**
|
|
42
|
+
* Map key being modified.
|
|
43
|
+
*/
|
|
44
|
+
key: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Metadata for an local `edit` operation.
|
|
48
|
+
*/
|
|
49
|
+
export interface IMapKeyEditLocalOpMetadata {
|
|
50
|
+
/**
|
|
51
|
+
* String identifier of the operation type.
|
|
52
|
+
*/
|
|
53
|
+
type: "edit";
|
|
54
|
+
/**
|
|
55
|
+
* Unique identifier for the local operation.
|
|
56
|
+
*/
|
|
57
|
+
pendingMessageId: number;
|
|
58
|
+
/**
|
|
59
|
+
* Local value prior to the edit.
|
|
60
|
+
*/
|
|
61
|
+
previousValue: ILocalValue;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Metadata for an local `add` operation.
|
|
65
|
+
*/
|
|
66
|
+
export interface IMapKeyAddLocalOpMetadata {
|
|
67
|
+
/**
|
|
68
|
+
* String identifier of the operation type.
|
|
69
|
+
*/
|
|
70
|
+
type: "add";
|
|
71
|
+
/**
|
|
72
|
+
* Unique identifier for the local operation.
|
|
73
|
+
*/
|
|
74
|
+
pendingMessageId: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Metadata for an local `clear` operation.
|
|
78
|
+
*/
|
|
79
|
+
export interface IMapClearLocalOpMetadata {
|
|
80
|
+
/**
|
|
81
|
+
* String identifier of the operation type.
|
|
82
|
+
*/
|
|
83
|
+
type: "clear";
|
|
84
|
+
/**
|
|
85
|
+
* Unique identifier for the local operation.
|
|
86
|
+
*/
|
|
87
|
+
pendingMessageId: number;
|
|
88
|
+
/**
|
|
89
|
+
* Local map contents prior to clearing it.
|
|
90
|
+
*/
|
|
91
|
+
previousMap?: Map<string, ILocalValue>;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Metadata for a local operation associated with a specific key entry in the map.
|
|
95
|
+
*/
|
|
96
|
+
export type MapKeyLocalOpMetadata = IMapKeyEditLocalOpMetadata | IMapKeyAddLocalOpMetadata;
|
|
97
|
+
/**
|
|
98
|
+
* Metadata for a local operation.
|
|
99
|
+
*/
|
|
100
|
+
export type MapLocalOpMetadata = IMapClearLocalOpMetadata | MapKeyLocalOpMetadata;
|
|
101
|
+
//# sourceMappingURL=internalInterfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internalInterfaces.d.ts","sourceRoot":"","sources":["../src/internalInterfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;IAEZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IAEH,KAAK,EAAE,kBAAkB,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC;IAEf;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,aAAa,EAAE,WAAW,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;IAEZ;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,0BAA0B,GAAG,yBAAyB,CAAC;AAE3F;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,GAAG,qBAAqB,CAAC"}
|
|
@@ -6,10 +6,20 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.LocalValueMaker = exports.PlainLocalValue = exports.makeSerializable = void 0;
|
|
8
8
|
const shared_object_base_1 = require("@fluidframework/shared-object-base");
|
|
9
|
+
/**
|
|
10
|
+
* Converts the provided `localValue` to its serialized form.
|
|
11
|
+
*
|
|
12
|
+
* @param localValue - The value to serialize.
|
|
13
|
+
* @param serializer - Data store runtime's serializer.
|
|
14
|
+
* @param bind - Container type's handle.
|
|
15
|
+
*
|
|
16
|
+
* @see {@link ILocalValue.makeSerialized}
|
|
17
|
+
*/
|
|
9
18
|
function makeSerializable(localValue, serializer, bind) {
|
|
10
19
|
const value = localValue.makeSerialized(serializer, bind);
|
|
11
20
|
return {
|
|
12
21
|
type: value.type,
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
13
23
|
value: value.value && JSON.parse(value.value),
|
|
14
24
|
};
|
|
15
25
|
}
|
|
@@ -46,8 +56,9 @@ class PlainLocalValue {
|
|
|
46
56
|
}
|
|
47
57
|
exports.PlainLocalValue = PlainLocalValue;
|
|
48
58
|
/**
|
|
49
|
-
*
|
|
50
|
-
* those objects are stored, serialized, and deserialized.
|
|
59
|
+
* Enables a container type {@link https://fluidframework.com/docs/build/dds/ | DDS} to produce and store local
|
|
60
|
+
* values with minimal awareness of how those objects are stored, serialized, and deserialized.
|
|
61
|
+
* @alpha
|
|
51
62
|
*/
|
|
52
63
|
class LocalValueMaker {
|
|
53
64
|
/**
|
|
@@ -61,6 +72,7 @@ class LocalValueMaker {
|
|
|
61
72
|
* Create a new local value from an incoming serialized value.
|
|
62
73
|
* @param serializable - The serializable value to make local
|
|
63
74
|
*/
|
|
75
|
+
// eslint-disable-next-line import/no-deprecated
|
|
64
76
|
fromSerializable(serializable) {
|
|
65
77
|
// Migrate from old shared value to handles
|
|
66
78
|
if (serializable.type === shared_object_base_1.ValueType[shared_object_base_1.ValueType.Shared]) {
|
|
@@ -84,4 +96,4 @@ class LocalValueMaker {
|
|
|
84
96
|
}
|
|
85
97
|
}
|
|
86
98
|
exports.LocalValueMaker = LocalValueMaker;
|
|
87
|
-
//# sourceMappingURL=localValues.
|
|
99
|
+
//# sourceMappingURL=localValues.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localValues.cjs","sourceRoot":"","sources":["../src/localValues.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,2EAM4C;AA8B5C;;;;;;;;GAQG;AACH,SAAgB,gBAAgB,CAC/B,UAAuB,EACvB,UAA4B,EAC5B,IAAkB;IAGlB,MAAM,KAAK,GAAG,UAAU,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAC1D,OAAO;QACN,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,mEAAmE;QACnE,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK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AO,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACD;AApCD,0CAoCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport {\n\tIFluidSerializer,\n\tISerializedHandle,\n\tparseHandles,\n\tserializeHandles,\n\tValueType,\n} from \"@fluidframework/shared-object-base\";\n// eslint-disable-next-line import/no-deprecated\nimport { ISerializableValue, ISerializedValue } from \"./interfaces\";\n\n/**\n * A local value to be stored in a container type Distributed Data Store (DDS).\n * @alpha\n */\nexport interface ILocalValue {\n\t/**\n\t * Type indicator of the value stored within.\n\t */\n\treadonly type: string;\n\n\t/**\n\t * The in-memory value stored within.\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\treadonly value: any;\n\n\t/**\n\t * Retrieve the serialized form of the value stored within.\n\t * @param serializer - Data store runtime's serializer\n\t * @param bind - Container type's handle\n\t * @returns The serialized form of the contained value\n\t */\n\tmakeSerialized(serializer: IFluidSerializer, bind: IFluidHandle): ISerializedValue;\n}\n\n/**\n * Converts the provided `localValue` to its serialized form.\n *\n * @param localValue - The value to serialize.\n * @param serializer - Data store runtime's serializer.\n * @param bind - Container type's handle.\n *\n * @see {@link ILocalValue.makeSerialized}\n */\nexport function makeSerializable(\n\tlocalValue: ILocalValue,\n\tserializer: IFluidSerializer,\n\tbind: IFluidHandle,\n\t// eslint-disable-next-line import/no-deprecated\n): ISerializableValue {\n\tconst value = localValue.makeSerialized(serializer, bind);\n\treturn {\n\t\ttype: value.type,\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\tvalue: value.value && JSON.parse(value.value),\n\t};\n}\n\n/**\n * Manages a contained plain value. May also contain shared object handles.\n */\nexport class PlainLocalValue implements ILocalValue {\n\t/**\n\t * Create a new PlainLocalValue.\n\t * @param value - The value to store, which may contain shared object handles\n\t */\n\tpublic constructor(public readonly value: unknown) {}\n\n\t/**\n\t * {@inheritDoc ILocalValue.\"type\"}\n\t */\n\tpublic get type(): string {\n\t\treturn ValueType[ValueType.Plain];\n\t}\n\n\t/**\n\t * {@inheritDoc ILocalValue.makeSerialized}\n\t */\n\tpublic makeSerialized(serializer: IFluidSerializer, bind: IFluidHandle): ISerializedValue {\n\t\t// Stringify to convert to the serialized handle values - and then parse in order to create\n\t\t// a POJO for the op\n\t\tconst value = serializeHandles(this.value, serializer, bind);\n\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\tvalue,\n\t\t};\n\t}\n}\n\n/**\n * Enables a container type {@link https://fluidframework.com/docs/build/dds/ | DDS} to produce and store local\n * values with minimal awareness of how those objects are stored, serialized, and deserialized.\n * @alpha\n */\nexport class LocalValueMaker {\n\t/**\n\t * Create a new LocalValueMaker.\n\t * @param serializer - The serializer to serialize / parse handles.\n\t */\n\tpublic constructor(private readonly serializer: IFluidSerializer) {}\n\n\t/**\n\t * Create a new local value from an incoming serialized value.\n\t * @param serializable - The serializable value to make local\n\t */\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic fromSerializable(serializable: ISerializableValue): ILocalValue {\n\t\t// Migrate from old shared value to handles\n\t\tif (serializable.type === ValueType[ValueType.Shared]) {\n\t\t\tserializable.type = ValueType[ValueType.Plain];\n\t\t\tconst handle: ISerializedHandle = {\n\t\t\t\ttype: \"__fluid_handle__\",\n\t\t\t\turl: serializable.value as string,\n\t\t\t};\n\t\t\tserializable.value = handle;\n\t\t}\n\n\t\tconst translatedValue: unknown = parseHandles(serializable.value, this.serializer);\n\n\t\treturn new PlainLocalValue(translatedValue);\n\t}\n\n\t/**\n\t * Create a new local value containing a given plain object.\n\t * @param value - The value to store\n\t * @returns An ILocalValue containing the value\n\t */\n\tpublic fromInMemory(value: unknown): ILocalValue {\n\t\treturn new PlainLocalValue(value);\n\t}\n}\n"]}
|
package/dist/localValues.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ import { IFluidHandle } from "@fluidframework/core-interfaces";
|
|
|
6
6
|
import { IFluidSerializer } from "@fluidframework/shared-object-base";
|
|
7
7
|
import { ISerializableValue, ISerializedValue } from "./interfaces";
|
|
8
8
|
/**
|
|
9
|
-
* A local value to be stored in a container type DDS.
|
|
9
|
+
* A local value to be stored in a container type Distributed Data Store (DDS).
|
|
10
|
+
* @alpha
|
|
10
11
|
*/
|
|
11
12
|
export interface ILocalValue {
|
|
12
13
|
/**
|
|
@@ -25,17 +26,26 @@ export interface ILocalValue {
|
|
|
25
26
|
*/
|
|
26
27
|
makeSerialized(serializer: IFluidSerializer, bind: IFluidHandle): ISerializedValue;
|
|
27
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Converts the provided `localValue` to its serialized form.
|
|
31
|
+
*
|
|
32
|
+
* @param localValue - The value to serialize.
|
|
33
|
+
* @param serializer - Data store runtime's serializer.
|
|
34
|
+
* @param bind - Container type's handle.
|
|
35
|
+
*
|
|
36
|
+
* @see {@link ILocalValue.makeSerialized}
|
|
37
|
+
*/
|
|
28
38
|
export declare function makeSerializable(localValue: ILocalValue, serializer: IFluidSerializer, bind: IFluidHandle): ISerializableValue;
|
|
29
39
|
/**
|
|
30
40
|
* Manages a contained plain value. May also contain shared object handles.
|
|
31
41
|
*/
|
|
32
42
|
export declare class PlainLocalValue implements ILocalValue {
|
|
33
|
-
readonly value:
|
|
43
|
+
readonly value: unknown;
|
|
34
44
|
/**
|
|
35
45
|
* Create a new PlainLocalValue.
|
|
36
46
|
* @param value - The value to store, which may contain shared object handles
|
|
37
47
|
*/
|
|
38
|
-
constructor(value:
|
|
48
|
+
constructor(value: unknown);
|
|
39
49
|
/**
|
|
40
50
|
* {@inheritDoc ILocalValue."type"}
|
|
41
51
|
*/
|
|
@@ -46,8 +56,9 @@ export declare class PlainLocalValue implements ILocalValue {
|
|
|
46
56
|
makeSerialized(serializer: IFluidSerializer, bind: IFluidHandle): ISerializedValue;
|
|
47
57
|
}
|
|
48
58
|
/**
|
|
49
|
-
*
|
|
50
|
-
* those objects are stored, serialized, and deserialized.
|
|
59
|
+
* Enables a container type {@link https://fluidframework.com/docs/build/dds/ | DDS} to produce and store local
|
|
60
|
+
* values with minimal awareness of how those objects are stored, serialized, and deserialized.
|
|
61
|
+
* @alpha
|
|
51
62
|
*/
|
|
52
63
|
export declare class LocalValueMaker {
|
|
53
64
|
private readonly serializer;
|
|
@@ -66,6 +77,6 @@ export declare class LocalValueMaker {
|
|
|
66
77
|
* @param value - The value to store
|
|
67
78
|
* @returns An ILocalValue containing the value
|
|
68
79
|
*/
|
|
69
|
-
fromInMemory(value:
|
|
80
|
+
fromInMemory(value: unknown): ILocalValue;
|
|
70
81
|
}
|
|
71
82
|
//# sourceMappingURL=localValues.d.ts.map
|
|
@@ -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;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"localValues.d.ts","sourceRoot":"","sources":["../src/localValues.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EACN,gBAAgB,EAKhB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEpE;;;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,UA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