@fluidframework/map 1.4.0-115997 → 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
package/.eslintrc.js
CHANGED
|
@@ -4,14 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
7
|
+
extends: [require.resolve("@fluidframework/eslint-config-fluid/minimal"), "prettier"],
|
|
8
|
+
parserOptions: {
|
|
9
|
+
project: ["./tsconfig.json", "./src/test/tsconfig.json"],
|
|
10
|
+
},
|
|
11
|
+
rules: {
|
|
12
|
+
"@typescript-eslint/no-use-before-define": "off",
|
|
13
|
+
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
14
|
+
|
|
15
|
+
// TODO: consider re-enabling once we have addressed how this rule conflicts with our error codes.
|
|
16
|
+
"unicorn/numeric-separators-style": "off",
|
|
17
|
+
},
|
|
18
|
+
};
|
package/.mocharc.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
const getFluidTestMochaConfig = require("@fluidframework/mocha-test-setup/mocharc-common");
|
|
9
|
+
|
|
10
|
+
const packageDir = __dirname;
|
|
11
|
+
const config = getFluidTestMochaConfig(packageDir);
|
|
12
|
+
module.exports = config;
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# @fluidframework/map
|
|
2
|
+
|
|
3
|
+
## 2.0.0-internal.8.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- datastore-definitions: Jsonable and Serializable now require a generic parameter [9a451d4946](https://github.com/microsoft/FluidFramework/commits/9a451d4946b5c51a52e4d1ab5bf51e7b285b0d74)
|
|
8
|
+
|
|
9
|
+
The `Jsonable` and `Serializable` types from @fluidframework/datastore-definitions now require a generic parameter and
|
|
10
|
+
if that type is `any` or `unknown`will return a new result `JsonableTypeWith<>` that more accurately represents the
|
|
11
|
+
limitation of serialization.
|
|
12
|
+
|
|
13
|
+
Additional modifications:
|
|
14
|
+
|
|
15
|
+
- `Jsonable`'s `TReplacement` parameter default has also been changed from `void` to `never`, which now disallows
|
|
16
|
+
`void`.
|
|
17
|
+
- Unrecognized primitive types like `symbol` are now filtered to `never` instead of `{}`.
|
|
18
|
+
- Recursive types with arrays (`[]`) are now supported.
|
|
19
|
+
|
|
20
|
+
`Serializable` is commonly used for DDS values and now requires more precision when using them. For example SharedMatrix
|
|
21
|
+
(unqualified) has an `any` default that meant values were `Serializable<any>` (i.e. `any`), but now `Serializable<any>`
|
|
22
|
+
is `JsonableTypeWith<IFluidHandle>` which may be problematic for reading or writing. Preferred correction is to specify
|
|
23
|
+
the value type but casting through `any` may provide a quick fix.
|
|
24
|
+
|
|
25
|
+
## 2.0.0-internal.7.4.0
|
|
26
|
+
|
|
27
|
+
Dependency updates only.
|
|
28
|
+
|
|
29
|
+
## 2.0.0-internal.7.3.0
|
|
30
|
+
|
|
31
|
+
Dependency updates only.
|
|
32
|
+
|
|
33
|
+
## 2.0.0-internal.7.2.0
|
|
34
|
+
|
|
35
|
+
Dependency updates only.
|
|
36
|
+
|
|
37
|
+
## 2.0.0-internal.7.1.0
|
|
38
|
+
|
|
39
|
+
Dependency updates only.
|
|
40
|
+
|
|
41
|
+
## 2.0.0-internal.7.0.0
|
|
42
|
+
|
|
43
|
+
### Major Changes
|
|
44
|
+
|
|
45
|
+
- Dependencies on @fluidframework/protocol-definitions package updated to 3.0.0 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
46
|
+
|
|
47
|
+
This included the following changes from the protocol-definitions release:
|
|
48
|
+
|
|
49
|
+
- Updating signal interfaces for some planned improvements. The intention is split the interface between signals
|
|
50
|
+
submitted by clients to the server and the resulting signals sent from the server to clients.
|
|
51
|
+
- A new optional type member is available on the ISignalMessage interface and a new ISentSignalMessage interface has
|
|
52
|
+
been added, which will be the typing for signals sent from the client to the server. Both extend a new
|
|
53
|
+
ISignalMessageBase interface that contains common members.
|
|
54
|
+
- The @fluidframework/common-definitions package dependency has been updated to version 1.0.0.
|
|
55
|
+
|
|
56
|
+
- Server upgrade: dependencies on Fluid server packages updated to 2.0.1 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
57
|
+
|
|
58
|
+
Dependencies on the following Fluid server package have been updated to version 2.0.1:
|
|
59
|
+
|
|
60
|
+
- @fluidframework/gitresources: 2.0.1
|
|
61
|
+
- @fluidframework/server-kafka-orderer: 2.0.1
|
|
62
|
+
- @fluidframework/server-lambdas: 2.0.1
|
|
63
|
+
- @fluidframework/server-lambdas-driver: 2.0.1
|
|
64
|
+
- @fluidframework/server-local-server: 2.0.1
|
|
65
|
+
- @fluidframework/server-memory-orderer: 2.0.1
|
|
66
|
+
- @fluidframework/protocol-base: 2.0.1
|
|
67
|
+
- @fluidframework/server-routerlicious: 2.0.1
|
|
68
|
+
- @fluidframework/server-routerlicious-base: 2.0.1
|
|
69
|
+
- @fluidframework/server-services: 2.0.1
|
|
70
|
+
- @fluidframework/server-services-client: 2.0.1
|
|
71
|
+
- @fluidframework/server-services-core: 2.0.1
|
|
72
|
+
- @fluidframework/server-services-ordering-kafkanode: 2.0.1
|
|
73
|
+
- @fluidframework/server-services-ordering-rdkafka: 2.0.1
|
|
74
|
+
- @fluidframework/server-services-ordering-zookeeper: 2.0.1
|
|
75
|
+
- @fluidframework/server-services-shared: 2.0.1
|
|
76
|
+
- @fluidframework/server-services-telemetry: 2.0.1
|
|
77
|
+
- @fluidframework/server-services-utils: 2.0.1
|
|
78
|
+
- @fluidframework/server-test-utils: 2.0.1
|
|
79
|
+
- tinylicious: 2.0.1
|
|
80
|
+
|
|
81
|
+
- Minimum TypeScript version now 5.1.6 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
82
|
+
|
|
83
|
+
The minimum supported TypeScript version for Fluid 2.0 clients is now 5.1.6.
|
|
84
|
+
|
|
85
|
+
## 2.0.0-internal.6.4.0
|
|
86
|
+
|
|
87
|
+
Dependency updates only.
|
|
88
|
+
|
|
89
|
+
## 2.0.0-internal.6.3.0
|
|
90
|
+
|
|
91
|
+
Dependency updates only.
|
|
92
|
+
|
|
93
|
+
## 2.0.0-internal.6.2.0
|
|
94
|
+
|
|
95
|
+
### Minor Changes
|
|
96
|
+
|
|
97
|
+
- Remove use of @fluidframework/common-definitions ([#16638](https://github.com/microsoft/FluidFramework/issues/16638)) [a8c81509c9](https://github.com/microsoft/FluidFramework/commits/a8c81509c9bf09cfb2092ebcf7265205f9eb6dbf)
|
|
98
|
+
|
|
99
|
+
The **@fluidframework/common-definitions** package is being deprecated, so the following interfaces and types are now
|
|
100
|
+
imported from the **@fluidframework/core-interfaces** package:
|
|
101
|
+
|
|
102
|
+
- interface IDisposable
|
|
103
|
+
- interface IErrorEvent
|
|
104
|
+
- interface IErrorEvent
|
|
105
|
+
- interface IEvent
|
|
106
|
+
- interface IEventProvider
|
|
107
|
+
- interface ILoggingError
|
|
108
|
+
- interface ITaggedTelemetryPropertyType
|
|
109
|
+
- interface ITelemetryBaseEvent
|
|
110
|
+
- interface ITelemetryBaseLogger
|
|
111
|
+
- interface ITelemetryErrorEvent
|
|
112
|
+
- interface ITelemetryGenericEvent
|
|
113
|
+
- interface ITelemetryLogger
|
|
114
|
+
- interface ITelemetryPerformanceEvent
|
|
115
|
+
- interface ITelemetryProperties
|
|
116
|
+
- type ExtendEventProvider
|
|
117
|
+
- type IEventThisPlaceHolder
|
|
118
|
+
- type IEventTransformer
|
|
119
|
+
- type ReplaceIEventThisPlaceHolder
|
|
120
|
+
- type ReplaceIEventThisPlaceHolder
|
|
121
|
+
- type TelemetryEventCategory
|
|
122
|
+
- type TelemetryEventPropertyType
|
|
123
|
+
|
|
124
|
+
## 2.0.0-internal.6.1.0
|
|
125
|
+
|
|
126
|
+
Dependency updates only.
|
|
127
|
+
|
|
128
|
+
## 2.0.0-internal.6.0.0
|
|
129
|
+
|
|
130
|
+
### Major Changes
|
|
131
|
+
|
|
132
|
+
- Upgraded typescript transpilation target to ES2020 [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
|
|
133
|
+
|
|
134
|
+
Upgraded typescript transpilation target to ES2020. This is done in order to decrease the bundle sizes of Fluid Framework packages. This has provided size improvements across the board for ex. Loader, Driver, Runtime etc. Reduced bundle sizes helps to load lesser code in apps and hence also helps to improve the perf.If any app wants to target any older versions of browsers with which this target version is not compatible, then they can use packages like babel to transpile to a older target.
|
|
135
|
+
|
|
136
|
+
## 2.0.0-internal.5.4.0
|
|
137
|
+
|
|
138
|
+
Dependency updates only.
|
|
139
|
+
|
|
140
|
+
## 2.0.0-internal.5.3.0
|
|
141
|
+
|
|
142
|
+
Dependency updates only.
|
|
143
|
+
|
|
144
|
+
## 2.0.0-internal.5.2.0
|
|
145
|
+
|
|
146
|
+
Dependency updates only.
|
|
147
|
+
|
|
148
|
+
## 2.0.0-internal.5.1.0
|
|
149
|
+
|
|
150
|
+
Dependency updates only.
|
|
151
|
+
|
|
152
|
+
## 2.0.0-internal.5.0.0
|
|
153
|
+
|
|
154
|
+
Dependency updates only.
|
|
155
|
+
|
|
156
|
+
## 2.0.0-internal.4.4.0
|
|
157
|
+
|
|
158
|
+
Dependency updates only.
|
|
159
|
+
|
|
160
|
+
## 2.0.0-internal.4.1.0
|
|
161
|
+
|
|
162
|
+
Dependency updates only.
|
package/README.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @fluidframework/map
|
|
2
2
|
|
|
3
|
+
<!-- AUTO-GENERATED-CONTENT:START (README_DEPENDENCY_GUIDELINES_SECTION:includeHeading=TRUE) -->
|
|
4
|
+
|
|
5
|
+
<!-- prettier-ignore-start -->
|
|
6
|
+
<!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
|
|
7
|
+
|
|
8
|
+
## Using Fluid Framework libraries
|
|
9
|
+
|
|
10
|
+
When taking a dependency on a Fluid Framework library, we recommend using a `^` (caret) version range, such as `^1.3.4`.
|
|
11
|
+
While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
|
|
12
|
+
library consumers should always prefer `^`.
|
|
13
|
+
|
|
14
|
+
Note that when depending on a library version of the form `2.0.0-internal.x.y.z`, called the Fluid internal version scheme,
|
|
15
|
+
you must use a `>= <` dependency range (such as `>=2.0.0-internal.x.y.z <2.0.0-internal.w.0.0` where `w` is `x+1`).
|
|
16
|
+
Standard `^` and `~` ranges will not work as expected.
|
|
17
|
+
See the [@fluid-tools/version-tools](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/version-tools/README.md)
|
|
18
|
+
package for more information including tools to convert between version schemes.
|
|
19
|
+
|
|
20
|
+
<!-- prettier-ignore-end -->
|
|
21
|
+
|
|
22
|
+
<!-- AUTO-GENERATED-CONTENT:END -->
|
|
23
|
+
|
|
3
24
|
## SharedMap
|
|
4
25
|
|
|
5
26
|
The SharedMap distributed data structure can be used to store key-value pairs. It provides the same API for setting and
|
|
@@ -20,18 +41,13 @@ Unlike the JavaScript `Map`, a `SharedMap`'s keys must be strings. The value mus
|
|
|
20
41
|
|
|
21
42
|
In collaborative scenarios, the value is settled with a policy of _last write wins_.
|
|
22
43
|
|
|
23
|
-
#### `.wait()`
|
|
24
|
-
|
|
25
|
-
`SharedMap` has a `wait` method in addition to the normal `get`, which returns a `Promise` that resolves to the value
|
|
26
|
-
when the key becomes available.
|
|
27
|
-
|
|
28
44
|
### Eventing
|
|
29
45
|
|
|
30
|
-
`SharedMap` is an `EventEmitter`, and will emit events when other clients make modifications.
|
|
46
|
+
`SharedMap` is an `EventEmitter`, and will emit events when other clients make modifications. You should register for these events and respond appropriately as the data is modified. `valueChanged` will be emitted in response to a `set` or `delete`, and provide the key and previous value that was stored at that key. `clear` will be emitted in response to a `clear`.
|
|
31
47
|
|
|
32
48
|
## SharedDirectory and IDirectory
|
|
33
49
|
|
|
34
|
-
A `SharedDirectory` is a map-like DDS that additionally supports storing key/value pairs within a tree of subdirectories.
|
|
50
|
+
A `SharedDirectory` is a map-like DDS that additionally supports storing key/value pairs within a tree of subdirectories. This subdirectory tree can be used to give hierarchical structure to stored key/value pairs rather than storing them on a flat map. Both the `SharedDirectory` and any subdirectories are `IDirectories`.
|
|
35
51
|
|
|
36
52
|
### Creation
|
|
37
53
|
|
|
@@ -43,7 +59,7 @@ const myDirectory = SharedDirectory.create(this.runtime, id);
|
|
|
43
59
|
|
|
44
60
|
### Usage
|
|
45
61
|
|
|
46
|
-
The map operations on an `IDirectory` refer to the key/value pairs stored in that `IDirectory`, and function just like `SharedMap` including the same extra functionality and restrictions on keys and values.
|
|
62
|
+
The map operations on an `IDirectory` refer to the key/value pairs stored in that `IDirectory`, and function just like `SharedMap` including the same extra functionality and restrictions on keys and values. To operate on the subdirectory structure, use the corresponding subdirectory methods.
|
|
47
63
|
|
|
48
64
|
#### `getWorkingDirectory()`
|
|
49
65
|
|
package/api-extractor.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "../../../common/build/build-common/api-extractor-base.json"
|
|
4
4
|
}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
## API Report File for "@fluidframework/map"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import { IChannelAttributes } from '@fluidframework/datastore-definitions';
|
|
8
|
+
import { IChannelFactory } from '@fluidframework/datastore-definitions';
|
|
9
|
+
import { IChannelServices } from '@fluidframework/datastore-definitions';
|
|
10
|
+
import { IChannelStorageService } from '@fluidframework/datastore-definitions';
|
|
11
|
+
import { IDisposable } from '@fluidframework/core-interfaces';
|
|
12
|
+
import { IEvent } from '@fluidframework/core-interfaces';
|
|
13
|
+
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
14
|
+
import { IEventThisPlaceHolder } from '@fluidframework/core-interfaces';
|
|
15
|
+
import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
|
|
16
|
+
import { IFluidHandle } from '@fluidframework/core-interfaces';
|
|
17
|
+
import { IFluidSerializer } from '@fluidframework/shared-object-base';
|
|
18
|
+
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
19
|
+
import { ISharedObject } from '@fluidframework/shared-object-base';
|
|
20
|
+
import { ISharedObjectEvents } from '@fluidframework/shared-object-base';
|
|
21
|
+
import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
|
|
22
|
+
import { ITelemetryContext } from '@fluidframework/runtime-definitions';
|
|
23
|
+
import { SharedObject } from '@fluidframework/shared-object-base';
|
|
24
|
+
|
|
25
|
+
// @alpha @sealed
|
|
26
|
+
export class DirectoryFactory implements IChannelFactory {
|
|
27
|
+
// (undocumented)
|
|
28
|
+
static readonly Attributes: IChannelAttributes;
|
|
29
|
+
// (undocumented)
|
|
30
|
+
get attributes(): IChannelAttributes;
|
|
31
|
+
// (undocumented)
|
|
32
|
+
create(runtime: IFluidDataStoreRuntime, id: string): ISharedDirectory;
|
|
33
|
+
// (undocumented)
|
|
34
|
+
load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<ISharedDirectory>;
|
|
35
|
+
// (undocumented)
|
|
36
|
+
static readonly Type = "https://graph.microsoft.com/types/directory";
|
|
37
|
+
// (undocumented)
|
|
38
|
+
get type(): string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// @alpha
|
|
42
|
+
export interface ICreateInfo {
|
|
43
|
+
ccIds: string[];
|
|
44
|
+
csn: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// @alpha
|
|
48
|
+
export interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryEvents>, Partial<IDisposable> {
|
|
49
|
+
readonly absolutePath: string;
|
|
50
|
+
countSubDirectory?(): number;
|
|
51
|
+
createSubDirectory(subdirName: string): IDirectory;
|
|
52
|
+
deleteSubDirectory(subdirName: string): boolean;
|
|
53
|
+
get<T = any>(key: string): T | undefined;
|
|
54
|
+
getSubDirectory(subdirName: string): IDirectory | undefined;
|
|
55
|
+
getWorkingDirectory(relativePath: string): IDirectory | undefined;
|
|
56
|
+
hasSubDirectory(subdirName: string): boolean;
|
|
57
|
+
set<T = unknown>(key: string, value: T): this;
|
|
58
|
+
subdirectories(): IterableIterator<[string, IDirectory]>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// @alpha
|
|
62
|
+
export interface IDirectoryClearOperation {
|
|
63
|
+
path: string;
|
|
64
|
+
type: "clear";
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// @alpha
|
|
68
|
+
export interface IDirectoryCreateSubDirectoryOperation {
|
|
69
|
+
path: string;
|
|
70
|
+
subdirName: string;
|
|
71
|
+
type: "createSubDirectory";
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// @alpha
|
|
75
|
+
export interface IDirectoryDataObject {
|
|
76
|
+
ci?: ICreateInfo;
|
|
77
|
+
storage?: {
|
|
78
|
+
[key: string]: ISerializableValue;
|
|
79
|
+
};
|
|
80
|
+
subdirectories?: {
|
|
81
|
+
[subdirName: string]: IDirectoryDataObject;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// @alpha
|
|
86
|
+
export interface IDirectoryDeleteOperation {
|
|
87
|
+
key: string;
|
|
88
|
+
path: string;
|
|
89
|
+
type: "delete";
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// @alpha
|
|
93
|
+
export interface IDirectoryDeleteSubDirectoryOperation {
|
|
94
|
+
path: string;
|
|
95
|
+
subdirName: string;
|
|
96
|
+
type: "deleteSubDirectory";
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// @alpha
|
|
100
|
+
export interface IDirectoryEvents extends IEvent {
|
|
101
|
+
(event: "containedValueChanged", listener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
102
|
+
(event: "subDirectoryCreated", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
103
|
+
(event: "subDirectoryDeleted", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
104
|
+
(event: "disposed", listener: (target: IEventThisPlaceHolder) => void): any;
|
|
105
|
+
(event: "undisposed", listener: (target: IEventThisPlaceHolder) => void): any;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// @alpha
|
|
109
|
+
export type IDirectoryKeyOperation = IDirectorySetOperation | IDirectoryDeleteOperation;
|
|
110
|
+
|
|
111
|
+
// @internal
|
|
112
|
+
export interface IDirectoryNewStorageFormat {
|
|
113
|
+
blobs: string[];
|
|
114
|
+
content: IDirectoryDataObject;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// @alpha
|
|
118
|
+
export type IDirectoryOperation = IDirectoryStorageOperation | IDirectorySubDirectoryOperation;
|
|
119
|
+
|
|
120
|
+
// @alpha
|
|
121
|
+
export interface IDirectorySetOperation {
|
|
122
|
+
key: string;
|
|
123
|
+
path: string;
|
|
124
|
+
type: "set";
|
|
125
|
+
value: ISerializableValue;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// @alpha
|
|
129
|
+
export type IDirectoryStorageOperation = IDirectoryKeyOperation | IDirectoryClearOperation;
|
|
130
|
+
|
|
131
|
+
// @alpha
|
|
132
|
+
export type IDirectorySubDirectoryOperation = IDirectoryCreateSubDirectoryOperation | IDirectoryDeleteSubDirectoryOperation;
|
|
133
|
+
|
|
134
|
+
// @alpha
|
|
135
|
+
export interface IDirectoryValueChanged extends IValueChanged {
|
|
136
|
+
path: string;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// @alpha
|
|
140
|
+
export interface ILocalValue {
|
|
141
|
+
makeSerialized(serializer: IFluidSerializer, bind: IFluidHandle): ISerializedValue;
|
|
142
|
+
readonly type: string;
|
|
143
|
+
readonly value: any;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// @alpha @deprecated
|
|
147
|
+
export interface ISerializableValue {
|
|
148
|
+
type: string;
|
|
149
|
+
value: any;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// @alpha
|
|
153
|
+
export interface ISerializedValue {
|
|
154
|
+
type: string;
|
|
155
|
+
value: string | undefined;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// @alpha
|
|
159
|
+
export interface ISharedDirectory extends ISharedObject<ISharedDirectoryEvents & IDirectoryEvents>, Omit<IDirectory, "on" | "once" | "off"> {
|
|
160
|
+
// (undocumented)
|
|
161
|
+
[Symbol.iterator](): IterableIterator<[string, any]>;
|
|
162
|
+
// (undocumented)
|
|
163
|
+
readonly [Symbol.toStringTag]: string;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// @alpha
|
|
167
|
+
export interface ISharedDirectoryEvents extends ISharedObjectEvents {
|
|
168
|
+
(event: "valueChanged", listener: (changed: IDirectoryValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
169
|
+
(event: "clear", listener: (local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
170
|
+
(event: "subDirectoryCreated", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
171
|
+
(event: "subDirectoryDeleted", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// @public @sealed
|
|
175
|
+
export interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {
|
|
176
|
+
get<T = any>(key: string): T | undefined;
|
|
177
|
+
set<T = unknown>(key: string, value: T): this;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// @public @sealed
|
|
181
|
+
export interface ISharedMapEvents extends ISharedObjectEvents {
|
|
182
|
+
(event: "valueChanged", listener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
183
|
+
(event: "clear", listener: (local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// @public @sealed
|
|
187
|
+
export interface IValueChanged {
|
|
188
|
+
key: string;
|
|
189
|
+
previousValue: any;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// @alpha
|
|
193
|
+
export class LocalValueMaker {
|
|
194
|
+
constructor(serializer: IFluidSerializer);
|
|
195
|
+
fromInMemory(value: unknown): ILocalValue;
|
|
196
|
+
fromSerializable(serializable: ISerializableValue): ILocalValue;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// @alpha @sealed
|
|
200
|
+
export class MapFactory implements IChannelFactory {
|
|
201
|
+
// (undocumented)
|
|
202
|
+
static readonly Attributes: IChannelAttributes;
|
|
203
|
+
// (undocumented)
|
|
204
|
+
get attributes(): IChannelAttributes;
|
|
205
|
+
// (undocumented)
|
|
206
|
+
create(runtime: IFluidDataStoreRuntime, id: string): ISharedMap;
|
|
207
|
+
// (undocumented)
|
|
208
|
+
load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<ISharedMap>;
|
|
209
|
+
// (undocumented)
|
|
210
|
+
static readonly Type = "https://graph.microsoft.com/types/map";
|
|
211
|
+
// (undocumented)
|
|
212
|
+
get type(): string;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// @alpha @sealed
|
|
216
|
+
export class SharedDirectory extends SharedObject<ISharedDirectoryEvents> implements ISharedDirectory {
|
|
217
|
+
[Symbol.iterator](): IterableIterator<[string, any]>;
|
|
218
|
+
[Symbol.toStringTag]: string;
|
|
219
|
+
constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
|
|
220
|
+
get absolutePath(): string;
|
|
221
|
+
// (undocumented)
|
|
222
|
+
protected applyStashedOp(op: unknown): unknown;
|
|
223
|
+
clear(): void;
|
|
224
|
+
countSubDirectory(): number;
|
|
225
|
+
static create(runtime: IFluidDataStoreRuntime, id?: string): SharedDirectory;
|
|
226
|
+
createSubDirectory(subdirName: string): IDirectory;
|
|
227
|
+
delete(key: string): boolean;
|
|
228
|
+
deleteSubDirectory(subdirName: string): boolean;
|
|
229
|
+
// (undocumented)
|
|
230
|
+
dispose(error?: Error): void;
|
|
231
|
+
// (undocumented)
|
|
232
|
+
get disposed(): boolean;
|
|
233
|
+
entries(): IterableIterator<[string, any]>;
|
|
234
|
+
forEach(callback: (value: any, key: string, map: Map<string, any>) => void): void;
|
|
235
|
+
get<T = any>(key: string): T | undefined;
|
|
236
|
+
static getFactory(): IChannelFactory;
|
|
237
|
+
getSubDirectory(subdirName: string): IDirectory | undefined;
|
|
238
|
+
getWorkingDirectory(relativePath: string): IDirectory | undefined;
|
|
239
|
+
has(key: string): boolean;
|
|
240
|
+
hasSubDirectory(subdirName: string): boolean;
|
|
241
|
+
keys(): IterableIterator<string>;
|
|
242
|
+
// (undocumented)
|
|
243
|
+
protected loadCore(storage: IChannelStorageService): Promise<void>;
|
|
244
|
+
// (undocumented)
|
|
245
|
+
readonly localValueMaker: LocalValueMaker;
|
|
246
|
+
// (undocumented)
|
|
247
|
+
protected onDisconnect(): void;
|
|
248
|
+
protected populate(data: IDirectoryDataObject): void;
|
|
249
|
+
// (undocumented)
|
|
250
|
+
protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
|
|
251
|
+
// (undocumented)
|
|
252
|
+
protected reSubmitCore(content: unknown, localOpMetadata: unknown): void;
|
|
253
|
+
// (undocumented)
|
|
254
|
+
protected rollback(content: unknown, localOpMetadata: unknown): void;
|
|
255
|
+
set<T = unknown>(key: string, value: T): this;
|
|
256
|
+
get size(): number;
|
|
257
|
+
subdirectories(): IterableIterator<[string, IDirectory]>;
|
|
258
|
+
submitDirectoryMessage(op: IDirectoryOperation, localOpMetadata: unknown): void;
|
|
259
|
+
// (undocumented)
|
|
260
|
+
protected summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
261
|
+
values(): IterableIterator<any>;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// @public
|
|
265
|
+
export class SharedMap extends SharedObject<ISharedMapEvents> implements ISharedMap {
|
|
266
|
+
[Symbol.iterator](): IterableIterator<[string, any]>;
|
|
267
|
+
readonly [Symbol.toStringTag]: string;
|
|
268
|
+
constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
|
|
269
|
+
// (undocumented)
|
|
270
|
+
protected applyStashedOp(content: unknown): unknown;
|
|
271
|
+
clear(): void;
|
|
272
|
+
static create(runtime: IFluidDataStoreRuntime, id?: string): SharedMap;
|
|
273
|
+
delete(key: string): boolean;
|
|
274
|
+
entries(): IterableIterator<[string, any]>;
|
|
275
|
+
forEach(callbackFn: (value: any, key: string, map: Map<string, any>) => void): void;
|
|
276
|
+
get<T = any>(key: string): T | undefined;
|
|
277
|
+
static getFactory(): IChannelFactory;
|
|
278
|
+
has(key: string): boolean;
|
|
279
|
+
keys(): IterableIterator<string>;
|
|
280
|
+
// (undocumented)
|
|
281
|
+
protected loadCore(storage: IChannelStorageService): Promise<void>;
|
|
282
|
+
// (undocumented)
|
|
283
|
+
protected onDisconnect(): void;
|
|
284
|
+
// (undocumented)
|
|
285
|
+
protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
|
|
286
|
+
// (undocumented)
|
|
287
|
+
protected reSubmitCore(content: unknown, localOpMetadata: unknown): void;
|
|
288
|
+
// (undocumented)
|
|
289
|
+
protected rollback(content: unknown, localOpMetadata: unknown): void;
|
|
290
|
+
set(key: string, value: unknown): this;
|
|
291
|
+
get size(): number;
|
|
292
|
+
// (undocumented)
|
|
293
|
+
protected summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
294
|
+
values(): IterableIterator<any>;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
```
|