@fluidframework/map 1.1.0 → 1.2.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/api-extractor.json +1 -1
- package/dist/directory.d.ts +14 -10
- package/dist/directory.d.ts.map +1 -1
- package/dist/directory.js +289 -80
- package/dist/directory.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +29 -14
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/directory.d.ts +14 -10
- package/lib/directory.d.ts.map +1 -1
- package/lib/directory.js +289 -80
- package/lib/directory.js.map +1 -1
- package/lib/index.d.ts +5 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/lib/interfaces.d.ts +29 -14
- package/lib/interfaces.d.ts.map +1 -1
- package/lib/interfaces.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +13 -13
- package/src/directory.ts +358 -94
- package/src/index.ts +5 -5
- package/src/interfaces.ts +29 -14
- package/src/packageVersion.ts +1 -1
package/src/index.ts
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* The `map` package provides interfaces and implementing classes for map-like distributed data structures.
|
|
8
8
|
*
|
|
9
|
-
* @remarks
|
|
10
|
-
* The following distributed data structures are defined in this package:
|
|
9
|
+
* @remarks The following distributed data structures are defined in this package:
|
|
11
10
|
*
|
|
12
|
-
* - {@link
|
|
13
|
-
*
|
|
11
|
+
* - {@link SharedMap}
|
|
12
|
+
*
|
|
13
|
+
* - {@link SharedDirectory}
|
|
14
14
|
*
|
|
15
15
|
* @packageDocumentation
|
|
16
16
|
*/
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
export * from "./interfaces";
|
|
19
19
|
export * from "./map";
|
|
20
20
|
export * from "./directory";
|
|
21
|
-
export { LocalValueMaker } from "./localValues";
|
|
21
|
+
export { LocalValueMaker, ILocalValue } from "./localValues";
|
package/src/interfaces.ts
CHANGED
|
@@ -98,9 +98,13 @@ export interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryE
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
|
-
* Events emitted in response to changes to the directory data.
|
|
101
|
+
* Events emitted in response to changes to the directory data. These events only emit on the ISharedDirectory itself,
|
|
102
102
|
* and not on subdirectories.
|
|
103
103
|
*
|
|
104
|
+
* @remarks
|
|
105
|
+
*
|
|
106
|
+
* The following is the list of events emitted.
|
|
107
|
+
*
|
|
104
108
|
* ### "valueChanged"
|
|
105
109
|
*
|
|
106
110
|
* The valueChanged event is emitted when a key is set or deleted. This is emitted for any key in the ISharedDirectory
|
|
@@ -118,7 +122,7 @@ export interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryE
|
|
|
118
122
|
* - `changed` - Information on the key that changed, its value prior to the change, and the path to the key that
|
|
119
123
|
* changed.
|
|
120
124
|
*
|
|
121
|
-
* - `local` - Whether the change originated from
|
|
125
|
+
* - `local` - Whether the change originated from this client.
|
|
122
126
|
*
|
|
123
127
|
* - `target` - The ISharedDirectory itself.
|
|
124
128
|
*
|
|
@@ -131,7 +135,7 @@ export interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryE
|
|
|
131
135
|
* ```typescript
|
|
132
136
|
* (local: boolean, target: IEventThisPlaceHolder) => void
|
|
133
137
|
* ```
|
|
134
|
-
* - `local` - Whether the clear originated from
|
|
138
|
+
* - `local` - Whether the clear originated from this client.
|
|
135
139
|
*
|
|
136
140
|
* - `target` - The ISharedDirectory itself.
|
|
137
141
|
*
|
|
@@ -151,7 +155,7 @@ export interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryE
|
|
|
151
155
|
*
|
|
152
156
|
* - `target` - The ISharedDirectory itself.
|
|
153
157
|
*
|
|
154
|
-
*
|
|
158
|
+
* ###"subDirectoryDeleted"
|
|
155
159
|
*
|
|
156
160
|
* The subDirectoryDeleted event is emitted when a subdirectory is deleted.
|
|
157
161
|
*
|
|
@@ -193,6 +197,10 @@ export interface ISharedDirectoryEvents extends ISharedObjectEvents {
|
|
|
193
197
|
/**
|
|
194
198
|
* Events emitted in response to changes to the directory data.
|
|
195
199
|
*
|
|
200
|
+
* @remarks
|
|
201
|
+
*
|
|
202
|
+
* The following is the list of events emitted.
|
|
203
|
+
*
|
|
196
204
|
* ### "containedValueChanged"
|
|
197
205
|
*
|
|
198
206
|
* The containedValueChanged event is emitted when a key is set or deleted. As opposed to the SharedDirectory's
|
|
@@ -205,10 +213,10 @@ export interface ISharedDirectoryEvents extends ISharedObjectEvents {
|
|
|
205
213
|
* ```
|
|
206
214
|
* - `changed` - Information on the key that changed and its value prior to the change.
|
|
207
215
|
*
|
|
208
|
-
* - `local` - Whether the change originated from
|
|
209
|
-
*
|
|
216
|
+
* - `local` - Whether the change originated from this client.
|
|
210
217
|
*
|
|
211
218
|
* - `target` - The IDirectory itself.
|
|
219
|
+
*
|
|
212
220
|
* ### "subDirectoryCreated"
|
|
213
221
|
*
|
|
214
222
|
* The subDirectoryCreated event is emitted when a subdirectory is created.
|
|
@@ -225,7 +233,7 @@ export interface ISharedDirectoryEvents extends ISharedObjectEvents {
|
|
|
225
233
|
*
|
|
226
234
|
* - `target` - The ISharedDirectory itself.
|
|
227
235
|
*
|
|
228
|
-
*
|
|
236
|
+
* ### "subDirectoryDeleted"
|
|
229
237
|
*
|
|
230
238
|
* The subDirectoryDeleted event is emitted when a subdirectory is deleted.
|
|
231
239
|
*
|
|
@@ -288,7 +296,7 @@ export interface ISharedDirectory extends
|
|
|
288
296
|
}
|
|
289
297
|
|
|
290
298
|
/**
|
|
291
|
-
* Type of "valueChanged" event parameter for SharedDirectory
|
|
299
|
+
* Type of "valueChanged" event parameter for SharedDirectory.
|
|
292
300
|
*/
|
|
293
301
|
export interface IDirectoryValueChanged extends IValueChanged {
|
|
294
302
|
/**
|
|
@@ -300,6 +308,10 @@ export interface IDirectoryValueChanged extends IValueChanged {
|
|
|
300
308
|
/**
|
|
301
309
|
* Events emitted in response to changes to the map data.
|
|
302
310
|
*
|
|
311
|
+
* @remarks
|
|
312
|
+
*
|
|
313
|
+
* The following is the list of events emitted.
|
|
314
|
+
*
|
|
303
315
|
* ### "valueChanged"
|
|
304
316
|
*
|
|
305
317
|
* The valueChanged event is emitted when a key is set or deleted.
|
|
@@ -315,7 +327,7 @@ export interface IDirectoryValueChanged extends IValueChanged {
|
|
|
315
327
|
* ```
|
|
316
328
|
* - `changed` - Information on the key that changed and its value prior to the change.
|
|
317
329
|
*
|
|
318
|
-
* - `local` - Whether the change originated from
|
|
330
|
+
* - `local` - Whether the change originated from this client.
|
|
319
331
|
*
|
|
320
332
|
* - `target` - The map itself.
|
|
321
333
|
*
|
|
@@ -328,7 +340,7 @@ export interface IDirectoryValueChanged extends IValueChanged {
|
|
|
328
340
|
* ```typescript
|
|
329
341
|
* (local: boolean, target: IEventThisPlaceHolder) => void
|
|
330
342
|
* ```
|
|
331
|
-
* - `local` - Whether the clear originated from
|
|
343
|
+
* - `local` - Whether the clear originated from this client.
|
|
332
344
|
*
|
|
333
345
|
* - `target` - The map itself.
|
|
334
346
|
*/
|
|
@@ -363,19 +375,22 @@ export interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string,
|
|
|
363
375
|
}
|
|
364
376
|
|
|
365
377
|
/**
|
|
366
|
-
* The _ready-for-serialization_ format of values contained in DDS contents.
|
|
378
|
+
* The _ready-for-serialization_ format of values contained in DDS contents. This allows us to use
|
|
367
379
|
* ISerializableValue.type to understand whether they're storing a Plain JS object, a SharedObject, or a value type.
|
|
380
|
+
*
|
|
381
|
+
* @remarks
|
|
382
|
+
*
|
|
368
383
|
* Note that the in-memory equivalent of ISerializableValue is ILocalValue (similarly holding a type, but with
|
|
369
384
|
* the _in-memory representation_ of the value instead). An ISerializableValue is what gets passed to
|
|
370
|
-
* JSON.stringify and comes out of JSON.parse.
|
|
385
|
+
* JSON.stringify and comes out of JSON.parse. This format is used both for snapshots (loadCore/populate)
|
|
371
386
|
* and ops (set).
|
|
372
387
|
* If type is Plain, it must be a plain JS object that can survive a JSON.stringify/parse. E.g. a URL object will
|
|
373
|
-
* just get stringified to a URL string and not rehydrate as a URL object on the other side.
|
|
388
|
+
* just get stringified to a URL string and not rehydrate as a URL object on the other side. It may contain members
|
|
374
389
|
* that are ISerializedHandle (the serialized form of a handle).
|
|
375
390
|
* If type is a value type then it must be amongst the types registered via registerValueType or we won't know how
|
|
376
391
|
* to serialize/deserialize it (we rely on its factory via .load() and .store()). Its value will be type-dependent.
|
|
377
392
|
* If type is Shared, then the in-memory value will just be a reference to the SharedObject. Its value will be a
|
|
378
|
-
* channel ID.
|
|
393
|
+
* channel ID. This type is legacy and deprecated.
|
|
379
394
|
*/
|
|
380
395
|
export interface ISerializableValue {
|
|
381
396
|
/**
|
package/src/packageVersion.ts
CHANGED