@fluidframework/map 1.2.2 → 2.0.0-internal.1.0.0.82159

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.
Files changed (51) hide show
  1. package/dist/directory.d.ts +26 -7
  2. package/dist/directory.d.ts.map +1 -1
  3. package/dist/directory.js +4 -11
  4. package/dist/directory.js.map +1 -1
  5. package/dist/interfaces.d.ts +139 -181
  6. package/dist/interfaces.d.ts.map +1 -1
  7. package/dist/interfaces.js.map +1 -1
  8. package/dist/localValues.d.ts +3 -3
  9. package/dist/localValues.js +2 -2
  10. package/dist/localValues.js.map +1 -1
  11. package/dist/map.d.ts +3 -5
  12. package/dist/map.d.ts.map +1 -1
  13. package/dist/map.js +4 -7
  14. package/dist/map.js.map +1 -1
  15. package/dist/mapKernel.d.ts +9 -2
  16. package/dist/mapKernel.d.ts.map +1 -1
  17. package/dist/mapKernel.js +28 -13
  18. package/dist/mapKernel.js.map +1 -1
  19. package/dist/packageVersion.d.ts +1 -1
  20. package/dist/packageVersion.d.ts.map +1 -1
  21. package/dist/packageVersion.js +1 -1
  22. package/dist/packageVersion.js.map +1 -1
  23. package/lib/directory.d.ts +26 -7
  24. package/lib/directory.d.ts.map +1 -1
  25. package/lib/directory.js +4 -11
  26. package/lib/directory.js.map +1 -1
  27. package/lib/interfaces.d.ts +139 -181
  28. package/lib/interfaces.d.ts.map +1 -1
  29. package/lib/interfaces.js.map +1 -1
  30. package/lib/localValues.d.ts +3 -3
  31. package/lib/localValues.js +2 -2
  32. package/lib/localValues.js.map +1 -1
  33. package/lib/map.d.ts +3 -5
  34. package/lib/map.d.ts.map +1 -1
  35. package/lib/map.js +4 -7
  36. package/lib/map.js.map +1 -1
  37. package/lib/mapKernel.d.ts +9 -2
  38. package/lib/mapKernel.d.ts.map +1 -1
  39. package/lib/mapKernel.js +28 -13
  40. package/lib/mapKernel.js.map +1 -1
  41. package/lib/packageVersion.d.ts +1 -1
  42. package/lib/packageVersion.d.ts.map +1 -1
  43. package/lib/packageVersion.js +1 -1
  44. package/lib/packageVersion.js.map +1 -1
  45. package/package.json +53 -16
  46. package/src/directory.ts +30 -15
  47. package/src/interfaces.ts +146 -181
  48. package/src/localValues.ts +3 -3
  49. package/src/map.ts +8 -11
  50. package/src/mapKernel.ts +42 -16
  51. package/src/packageVersion.ts +1 -1
@@ -84,167 +84,125 @@ export interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryE
84
84
  getWorkingDirectory(relativePath: string): IDirectory | undefined;
85
85
  }
86
86
  /**
87
- * Events emitted in response to changes to the directory data. These events only emit on the ISharedDirectory itself,
88
- * and not on subdirectories.
89
- *
90
- * @remarks
91
- *
92
- * The following is the list of events emitted.
93
- *
94
- * ### "valueChanged"
95
- *
96
- * The valueChanged event is emitted when a key is set or deleted. This is emitted for any key in the ISharedDirectory
97
- * or any subdirectory.
98
- *
99
- * #### Listener signature
100
- *
101
- * ```typescript
102
- * (
103
- * changed: IDirectoryValueChanged,
104
- * local: boolean,
105
- * target: IEventThisPlaceHolder,
106
- * ) => void
107
- * ```
108
- * - `changed` - Information on the key that changed, its value prior to the change, and the path to the key that
109
- * changed.
110
- *
111
- * - `local` - Whether the change originated from this client.
112
- *
113
- * - `target` - The ISharedDirectory itself.
114
- *
115
- * ### "clear"
116
- *
117
- * The clear event is emitted when the ISharedDirectory is cleared.
118
- *
119
- * #### Listener signature
120
- *
121
- * ```typescript
122
- * (local: boolean, target: IEventThisPlaceHolder) => void
123
- * ```
124
- * - `local` - Whether the clear originated from this client.
125
- *
126
- * - `target` - The ISharedDirectory itself.
127
- *
128
- * ### "subDirectoryCreated"
129
- *
130
- * The subDirectoryCreated event is emitted when a subdirectory is created.
131
- *
132
- * #### Listener signature
133
- *
134
- * ```typescript
135
- * (path: string, local: boolean, target: IEventThisPlaceHolder) => void
136
- * ```
137
- * - `path` - The relative path to the subdirectory that is created.
138
- * It is relative from the object which raises the event.
139
- *
140
- * - `local` - Whether the create originated from the this client.
141
- *
142
- * - `target` - The ISharedDirectory itself.
143
- *
144
- * ###"subDirectoryDeleted"
145
- *
146
- * The subDirectoryDeleted event is emitted when a subdirectory is deleted.
147
- *
148
- * #### Listener signature
149
- *
150
- * ```typescript
151
- * (path: string, local: boolean, target: IEventThisPlaceHolder) => void
152
- * ```
153
- * - `path` - The relative path to the subdirectory that is deleted.
154
- * It is relative from the object which raises the event.
155
- *
156
- * - `local` - Whether the delete originated from the this client.
157
- *
158
- * - `target` - The ISharedDirectory itself.
87
+ * Events emitted in response to changes to the directory data.
88
+ * These events only emit on the {@link ISharedDirectory} itself, and not on subdirectories.
159
89
  */
160
90
  export interface ISharedDirectoryEvents extends ISharedObjectEvents {
91
+ /**
92
+ * Emitted when a key is set or deleted. This is emitted for any key in the {@link ISharedDirectory} or any
93
+ * subdirectory.
94
+ *
95
+ * @remarks Listener parameters:
96
+ *
97
+ * - `changed` - Information on the key that changed, its value prior to the change, and the path to the
98
+ * key that changed.
99
+ *
100
+ * - `local` - Whether the change originated from this client.
101
+ *
102
+ * - `target` - The {@link ISharedDirectory} itself.
103
+ */
161
104
  (event: "valueChanged", listener: (changed: IDirectoryValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): any;
105
+ /**
106
+ * Emitted when the {@link ISharedDirectory} is cleared.
107
+ *
108
+ * @remarks Listener parameters:
109
+ *
110
+ * - `local` - Whether the clear originated from this client.
111
+ *
112
+ * - `target` - The {@link ISharedDirectory} itself.
113
+ */
162
114
  (event: "clear", listener: (local: boolean, target: IEventThisPlaceHolder) => void): any;
115
+ /**
116
+ * Emitted when a subdirectory is created.
117
+ *
118
+ * @remarks Listener parameters:
119
+ *
120
+ * - `path` - The relative path to the subdirectory that is created.
121
+ * It is relative from the object which raises the event.
122
+ *
123
+ * - `local` - Whether the create originated from the this client.
124
+ *
125
+ * - `target` - The {@link ISharedDirectory} itself.
126
+ */
163
127
  (event: "subDirectoryCreated", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
128
+ /**
129
+ * Emitted when a subdirectory is deleted.
130
+ *
131
+ * @remarks Listener parameters:
132
+ *
133
+ * - `path` - The relative path to the subdirectory that is deleted.
134
+ * It is relative from the object which raises the event.
135
+ *
136
+ * - `local` - Whether the delete originated from the this client.
137
+ *
138
+ * - `target` - The {@link ISharedDirectory} itself.
139
+ */
164
140
  (event: "subDirectoryDeleted", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
165
141
  }
166
142
  /**
167
143
  * Events emitted in response to changes to the directory data.
168
- *
169
- * @remarks
170
- *
171
- * The following is the list of events emitted.
172
- *
173
- * ### "containedValueChanged"
174
- *
175
- * The containedValueChanged event is emitted when a key is set or deleted. As opposed to the SharedDirectory's
176
- * valueChanged event, this is emitted only on the IDirectory that directly contains the key.
177
- *
178
- * #### Listener signature
179
- *
180
- * ```typescript
181
- * (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void
182
- * ```
183
- * - `changed` - Information on the key that changed and its value prior to the change.
184
- *
185
- * - `local` - Whether the change originated from this client.
186
- *
187
- * - `target` - The IDirectory itself.
188
- *
189
- * ### "subDirectoryCreated"
190
- *
191
- * The subDirectoryCreated event is emitted when a subdirectory is created.
192
- *
193
- * #### Listener signature
194
- *
195
- * ```typescript
196
- * (path: string, local: boolean, target: IEventThisPlaceHolder) => void
197
- * ```
198
- * - `path` - The relative path to the subdirectory that is created.
199
- * It is relative from the object which raises the event.
200
- *
201
- * - `local` - Whether the creation originated from the this client.
202
- *
203
- * - `target` - The ISharedDirectory itself.
204
- *
205
- * ### "subDirectoryDeleted"
206
- *
207
- * The subDirectoryDeleted event is emitted when a subdirectory is deleted.
208
- *
209
- * #### Listener signature
210
- *
211
- * ```typescript
212
- * (path: string, local: boolean, target: IEventThisPlaceHolder) => void
213
- * ```
214
- * - `path` - The relative path to the subdirectory that is deleted.
215
- * It is relative from the object which raises the event.
216
- *
217
- * - `local` - Whether the delete originated from the this client.
218
- *
219
- * - `target` - The ISharedDirectory itself.
220
- *
221
- * ### "disposed"
222
- *
223
- * The dispose event is emitted when this sub directory is deleted.
224
- *
225
- * #### Listener signature
226
- *
227
- * ```typescript
228
- * (local: boolean, target: IEventThisPlaceHolder) => void
229
- * ```
230
- *
231
- * - `target` - The IDirectory itself.
232
144
  */
233
145
  export interface IDirectoryEvents extends IEvent {
146
+ /**
147
+ * Emitted when a key is set or deleted. As opposed to the
148
+ * {@link SharedDirectory}'s valueChanged event, this is emitted only on the {@link IDirectory} that directly
149
+ * contains the key.
150
+ *
151
+ * @remarks Listener parameters:
152
+ *
153
+ * - `changed` - Information on the key that changed and its value prior to the change.
154
+ *
155
+ * - `local` - Whether the change originated from this client.
156
+ *
157
+ * - `target` - The {@link IDirectory} itself.
158
+ */
234
159
  (event: "containedValueChanged", listener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): any;
160
+ /**
161
+ * Emitted when a subdirectory is created.
162
+ *
163
+ * @remarks Listener parameters:
164
+ *
165
+ * - `path` - The relative path to the subdirectory that is created.
166
+ * It is relative from the object which raises the event.
167
+ *
168
+ * - `local` - Whether the creation originated from the this client.
169
+ *
170
+ * - `target` - The {@link ISharedDirectory} itself.
171
+ */
235
172
  (event: "subDirectoryCreated", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
173
+ /**
174
+ * Emitted when a subdirectory is deleted.
175
+ *
176
+ * @remarks Listener parameters:
177
+ *
178
+ * - `path` - The relative path to the subdirectory that is deleted.
179
+ * It is relative from the object which raises the event.
180
+ *
181
+ * - `local` - Whether the delete originated from the this client.
182
+ *
183
+ * - `target` - The {@link ISharedDirectory} itself.
184
+ */
236
185
  (event: "subDirectoryDeleted", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
186
+ /**
187
+ * Emitted when this sub directory is deleted.
188
+ *
189
+ * @remarks Listener parameters:
190
+ *
191
+ * - `target` - The {@link IDirectory} itself.
192
+ */
237
193
  (event: "disposed", listener: (target: IEventThisPlaceHolder) => void): any;
238
194
  }
239
195
  /**
240
- * Interface describing a shared directory.
196
+ * Provides a hierarchical organization of map-like data structures as SubDirectories.
197
+ * The values stored within can be accessed like a map, and the hierarchy can be navigated using path syntax.
198
+ * SubDirectories can be retrieved for use as working directories.
241
199
  */
242
200
  export interface ISharedDirectory extends ISharedObject<ISharedDirectoryEvents & IDirectoryEvents>, Omit<IDirectory, "on" | "once" | "off"> {
243
201
  [Symbol.iterator](): IterableIterator<[string, any]>;
244
202
  readonly [Symbol.toStringTag]: string;
245
203
  }
246
204
  /**
247
- * Type of "valueChanged" event parameter for SharedDirectory.
205
+ * Type of "valueChanged" event parameter for {@link ISharedDirectory}
248
206
  */
249
207
  export interface IDirectoryValueChanged extends IValueChanged {
250
208
  /**
@@ -253,69 +211,60 @@ export interface IDirectoryValueChanged extends IValueChanged {
253
211
  path: string;
254
212
  }
255
213
  /**
256
- * Events emitted in response to changes to the map data.
257
- *
258
- * @remarks
259
- *
260
- * The following is the list of events emitted.
261
- *
262
- * ### "valueChanged"
263
- *
264
- * The valueChanged event is emitted when a key is set or deleted.
265
- *
266
- * #### Listener signature
267
- *
268
- * ```typescript
269
- * (
270
- * changed: IValueChanged,
271
- * local: boolean,
272
- * target: IEventThisPlaceHolder,
273
- * ) => void
274
- * ```
275
- * - `changed` - Information on the key that changed and its value prior to the change.
276
- *
277
- * - `local` - Whether the change originated from this client.
278
- *
279
- * - `target` - The map itself.
280
- *
281
- * ### "clear"
282
- *
283
- * The clear event is emitted when the map is cleared.
284
- *
285
- * #### Listener signature
286
- *
287
- * ```typescript
288
- * (local: boolean, target: IEventThisPlaceHolder) => void
289
- * ```
290
- * - `local` - Whether the clear originated from this client.
291
- *
292
- * - `target` - The map itself.
214
+ * Events emitted in response to changes to the {@link ISharedMap | map} data.
293
215
  */
294
216
  export interface ISharedMapEvents extends ISharedObjectEvents {
217
+ /**
218
+ * Emitted when a key is set or deleted.
219
+ *
220
+ * @remarks Listener parameters:
221
+ *
222
+ * - `changed` - Information on the key that changed and its value prior to the change.
223
+ *
224
+ * - `local` - Whether the change originated from this client.
225
+ *
226
+ * - `target` - The {@link ISharedMap} itself.
227
+ */
295
228
  (event: "valueChanged", listener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): any;
229
+ /**
230
+ * Emitted when the map is cleared.
231
+ *
232
+ * @remarks Listener parameters:
233
+ *
234
+ * - `local` - Whether the clear originated from this client.
235
+ *
236
+ * - `target` - The {@link ISharedMap} itself.
237
+ */
296
238
  (event: "clear", listener: (local: boolean, target: IEventThisPlaceHolder) => void): any;
297
239
  }
298
240
  /**
299
- * Shared map interface
241
+ * The SharedMap distributed data structure can be used to store key-value pairs. It provides the same API for setting
242
+ * and retrieving values that JavaScript developers are accustomed to with the
243
+ * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map | Map} built-in object.
244
+ * However, the keys of a SharedMap must be strings, and the values must either be a JSON-serializable object or a
245
+ * {@link @fluidframework/shared-object-base#SharedObjectHandle}.
246
+ *
247
+ * For more information, including example usages, see {@link https://fluidframework.com/docs/data-structures/map/}.
300
248
  */
301
249
  export interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {
302
250
  /**
303
- * Retrieves the given key from the map.
251
+ * Retrieves the given key from the map if it exists.
304
252
  * @param key - Key to retrieve from
305
253
  * @returns The stored value, or undefined if the key is not set
306
254
  */
307
255
  get<T = any>(key: string): T | undefined;
308
256
  /**
309
257
  * Sets the value stored at key to the provided value.
310
- * @param key - Key to set at
258
+ * @param key - Key to set
311
259
  * @param value - Value to set
312
- * @returns The ISharedMap itself
260
+ * @returns The {@link ISharedMap} itself
313
261
  */
314
262
  set<T = any>(key: string, value: T): this;
315
263
  }
316
264
  /**
317
265
  * The _ready-for-serialization_ format of values contained in DDS contents. This allows us to use
318
- * ISerializableValue.type to understand whether they're storing a Plain JS object, a SharedObject, or a value type.
266
+ * {@link ISerializableValue."type"} to understand whether they're storing a Plain JavaScript object,
267
+ * a {@link @fluidframework/shared-object-base#SharedObject}, or a value type.
319
268
  *
320
269
  * @remarks
321
270
  *
@@ -323,13 +272,17 @@ export interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string,
323
272
  * the _in-memory representation_ of the value instead). An ISerializableValue is what gets passed to
324
273
  * JSON.stringify and comes out of JSON.parse. This format is used both for snapshots (loadCore/populate)
325
274
  * and ops (set).
275
+ *
326
276
  * If type is Plain, it must be a plain JS object that can survive a JSON.stringify/parse. E.g. a URL object will
327
277
  * just get stringified to a URL string and not rehydrate as a URL object on the other side. It may contain members
328
278
  * that are ISerializedHandle (the serialized form of a handle).
279
+ *
329
280
  * If type is a value type then it must be amongst the types registered via registerValueType or we won't know how
330
281
  * to serialize/deserialize it (we rely on its factory via .load() and .store()). Its value will be type-dependent.
331
282
  * If type is Shared, then the in-memory value will just be a reference to the SharedObject. Its value will be a
332
- * channel ID. This type is legacy and deprecated.
283
+ * channel ID.
284
+ *
285
+ * @deprecated This type is legacy and deprecated.
333
286
  */
334
287
  export interface ISerializableValue {
335
288
  /**
@@ -341,6 +294,9 @@ export interface ISerializableValue {
341
294
  */
342
295
  value: any;
343
296
  }
297
+ /**
298
+ * Serialized {@link ISerializableValue} counterpart.
299
+ */
344
300
  export interface ISerializedValue {
345
301
  /**
346
302
  * A type annotation to help indicate how the value serializes.
@@ -348,6 +304,8 @@ export interface ISerializedValue {
348
304
  type: string;
349
305
  /**
350
306
  * String representation of the value.
307
+ *
308
+ * @remarks Will be undefined if the original value was undefined.
351
309
  */
352
310
  value: string | undefined;
353
311
  }
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAEhH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B;;OAEG;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AAE,GAAG,CAAC;IACjF;;;;OAIG;IACH,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC;IAEzC;;;;;OAKG;IACH,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,GAAG,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B"}
@@ -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 { IDisposable, IEvent, IEventProvider, IEventThisPlaceHolder } from \"@fluidframework/common-definitions\";\n\n/**\n * Type of \"valueChanged\" event parameter.\n */\nexport interface IValueChanged {\n /**\n * The key storing the value that changed.\n */\n key: string;\n\n /**\n * The value that was stored at the key prior to the change.\n */\n previousValue: any;\n}\n\n/**\n * Interface describing actions on a directory.\n *\n * @remarks\n * When used as a Map, operates on its keys.\n */\nexport interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryEvents>, Partial<IDisposable> {\n /**\n * The absolute path of the directory.\n */\n readonly absolutePath: string;\n\n /**\n * Retrieves the value stored at the given key from the directory.\n * @param key - Key to retrieve from\n * @returns The stored value, or undefined if the key is not set\n */\n get<T = any>(key: string): T | undefined;\n\n /**\n * Sets the value stored at key to the provided value.\n * @param key - Key to set at\n * @param value - Value to set\n * @returns The IDirectory itself\n */\n set<T = any>(key: string, value: T): this;\n\n /**\n * Get the number of sub directory within the directory.\n * @returns The number of sub directory within a directory.\n */\n countSubDirectory?(): number;\n\n /**\n * Creates an IDirectory child of this IDirectory, or retrieves the existing IDirectory child if one with the\n * same name already exists.\n * @param subdirName - Name of the new child directory to create\n * @returns The IDirectory child that was created or retrieved\n */\n createSubDirectory(subdirName: string): IDirectory;\n\n /**\n * Gets an IDirectory child of this IDirectory, if it exists.\n * @param subdirName - Name of the child directory to get\n * @returns The requested IDirectory\n */\n getSubDirectory(subdirName: string): IDirectory | undefined;\n\n /**\n * Checks whether this directory has a child directory with the given name.\n * @param subdirName - Name of the child directory to check\n * @returns True if it exists, false otherwise\n */\n hasSubDirectory(subdirName: string): boolean;\n\n /**\n * Deletes an IDirectory child of this IDirectory, if it exists, along with all descendent keys and directories.\n * @param subdirName - Name of the child directory to delete\n * @returns True if the IDirectory existed and was deleted, false if it did not exist\n */\n deleteSubDirectory(subdirName: string): boolean;\n\n /**\n * Gets an iterator over the IDirectory children of this IDirectory.\n * @returns The IDirectory iterator\n */\n subdirectories(): IterableIterator<[string, IDirectory]>;\n\n /**\n * Get an IDirectory within the directory, in order to use relative paths from that location.\n * @param relativePath - Path of the IDirectory to get, relative to this IDirectory\n * @returns The requested IDirectory\n */\n getWorkingDirectory(relativePath: string): IDirectory | undefined;\n}\n\n/**\n * Events emitted in response to changes to the directory data. These events only emit on the ISharedDirectory itself,\n * and not on subdirectories.\n *\n * @remarks\n *\n * The following is the list of events emitted.\n *\n * ### \"valueChanged\"\n *\n * The valueChanged event is emitted when a key is set or deleted. This is emitted for any key in the ISharedDirectory\n * or any subdirectory.\n *\n * #### Listener signature\n *\n * ```typescript\n * (\n * changed: IDirectoryValueChanged,\n * local: boolean,\n * target: IEventThisPlaceHolder,\n * ) => void\n * ```\n * - `changed` - Information on the key that changed, its value prior to the change, and the path to the key that\n * changed.\n *\n * - `local` - Whether the change originated from this client.\n *\n * - `target` - The ISharedDirectory itself.\n *\n * ### \"clear\"\n *\n * The clear event is emitted when the ISharedDirectory is cleared.\n *\n * #### Listener signature\n *\n * ```typescript\n * (local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `local` - Whether the clear originated from this client.\n *\n * - `target` - The ISharedDirectory itself.\n *\n * ### \"subDirectoryCreated\"\n *\n * The subDirectoryCreated event is emitted when a subdirectory is created.\n *\n * #### Listener signature\n *\n * ```typescript\n * (path: string, local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `path` - The relative path to the subdirectory that is created.\n * It is relative from the object which raises the event.\n *\n * - `local` - Whether the create originated from the this client.\n *\n * - `target` - The ISharedDirectory itself.\n *\n * ###\"subDirectoryDeleted\"\n *\n * The subDirectoryDeleted event is emitted when a subdirectory is deleted.\n *\n * #### Listener signature\n *\n * ```typescript\n * (path: string, local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `path` - The relative path to the subdirectory that is deleted.\n * It is relative from the object which raises the event.\n *\n * - `local` - Whether the delete originated from the this client.\n *\n * - `target` - The ISharedDirectory itself.\n */\nexport interface ISharedDirectoryEvents extends ISharedObjectEvents {\n (event: \"valueChanged\", listener: (\n changed: IDirectoryValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n (event: \"clear\", listener: (\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n (event: \"subDirectoryCreated\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n (event: \"subDirectoryDeleted\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n}\n\n/**\n * Events emitted in response to changes to the directory data.\n *\n * @remarks\n *\n * The following is the list of events emitted.\n *\n * ### \"containedValueChanged\"\n *\n * The containedValueChanged event is emitted when a key is set or deleted. As opposed to the SharedDirectory's\n * valueChanged event, this is emitted only on the IDirectory that directly contains the key.\n *\n * #### Listener signature\n *\n * ```typescript\n * (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `changed` - Information on the key that changed and its value prior to the change.\n *\n * - `local` - Whether the change originated from this client.\n *\n * - `target` - The IDirectory itself.\n *\n * ### \"subDirectoryCreated\"\n *\n * The subDirectoryCreated event is emitted when a subdirectory is created.\n *\n * #### Listener signature\n *\n * ```typescript\n * (path: string, local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `path` - The relative path to the subdirectory that is created.\n * It is relative from the object which raises the event.\n *\n * - `local` - Whether the creation originated from the this client.\n *\n * - `target` - The ISharedDirectory itself.\n *\n * ### \"subDirectoryDeleted\"\n *\n * The subDirectoryDeleted event is emitted when a subdirectory is deleted.\n *\n * #### Listener signature\n *\n * ```typescript\n * (path: string, local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `path` - The relative path to the subdirectory that is deleted.\n * It is relative from the object which raises the event.\n *\n * - `local` - Whether the delete originated from the this client.\n *\n * - `target` - The ISharedDirectory itself.\n *\n * ### \"disposed\"\n *\n * The dispose event is emitted when this sub directory is deleted.\n *\n * #### Listener signature\n *\n * ```typescript\n * (local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n *\n * - `target` - The IDirectory itself.\n */\nexport interface IDirectoryEvents extends IEvent {\n (event: \"containedValueChanged\", listener: (\n changed: IValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n (event: \"subDirectoryCreated\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n (event: \"subDirectoryDeleted\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n (event: \"disposed\", listener: (\n target: IEventThisPlaceHolder,\n ) => void);\n}\n\n/**\n * Interface describing a shared directory.\n */\nexport interface ISharedDirectory extends\n ISharedObject<ISharedDirectoryEvents & IDirectoryEvents>,\n Omit<IDirectory, \"on\" | \"once\" | \"off\"> {\n // The Omit type excludes symbols, which we don't want to exclude. Adding them back here manually.\n // https://github.com/microsoft/TypeScript/issues/31671\n [Symbol.iterator](): IterableIterator<[string, any]>;\n readonly [Symbol.toStringTag]: string;\n}\n\n/**\n * Type of \"valueChanged\" event parameter for SharedDirectory.\n */\nexport interface IDirectoryValueChanged extends IValueChanged {\n /**\n * The absolute path to the IDirectory storing the key which changed.\n */\n path: string;\n}\n\n/**\n * Events emitted in response to changes to the map data.\n *\n * @remarks\n *\n * The following is the list of events emitted.\n *\n * ### \"valueChanged\"\n *\n * The valueChanged event is emitted when a key is set or deleted.\n *\n * #### Listener signature\n *\n * ```typescript\n * (\n * changed: IValueChanged,\n * local: boolean,\n * target: IEventThisPlaceHolder,\n * ) => void\n * ```\n * - `changed` - Information on the key that changed and its value prior to the change.\n *\n * - `local` - Whether the change originated from this client.\n *\n * - `target` - The map itself.\n *\n * ### \"clear\"\n *\n * The clear event is emitted when the map is cleared.\n *\n * #### Listener signature\n *\n * ```typescript\n * (local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `local` - Whether the clear originated from this client.\n *\n * - `target` - The map itself.\n */\nexport interface ISharedMapEvents extends ISharedObjectEvents {\n (event: \"valueChanged\", listener: (\n changed: IValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder) => void);\n (event: \"clear\", listener: (\n local: boolean,\n target: IEventThisPlaceHolder) => void);\n}\n\n/**\n * Shared map interface\n */\nexport interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {\n /**\n * Retrieves the given key from the map.\n * @param key - Key to retrieve from\n * @returns The stored value, or undefined if the key is not set\n */\n get<T = any>(key: string): T | undefined;\n\n /**\n * Sets the value stored at key to the provided value.\n * @param key - Key to set at\n * @param value - Value to set\n * @returns The ISharedMap itself\n */\n set<T = any>(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 * ISerializableValue.type to understand whether they're storing a Plain JS object, a 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 * 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 * 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. This type is legacy and deprecated.\n */\nexport interface ISerializableValue {\n /**\n * A type annotation to help indicate how the value serializes.\n */\n type: string;\n\n /**\n * The JSONable representation of the value.\n */\n value: any;\n}\n\nexport interface ISerializedValue {\n /**\n * A type annotation to help indicate how the value serializes.\n */\n type: string;\n\n /**\n * String representation of the value.\n */\n value: 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 { ISharedObject, ISharedObjectEvents } from \"@fluidframework/shared-object-base\";\nimport { IDisposable, IEvent, IEventProvider, IEventThisPlaceHolder } from \"@fluidframework/common-definitions\";\n\n/**\n * Type of \"valueChanged\" event parameter.\n */\nexport interface IValueChanged {\n /**\n * The key storing the value that changed.\n */\n key: string;\n\n /**\n * The value that was stored at the key prior to the change.\n */\n previousValue: any;\n}\n\n/**\n * Interface describing actions on a directory.\n *\n * @remarks\n * When used as a Map, operates on its keys.\n */\nexport interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryEvents>, Partial<IDisposable> {\n /**\n * The absolute path of the directory.\n */\n readonly absolutePath: string;\n\n /**\n * Retrieves the value stored at the given key from the directory.\n * @param key - Key to retrieve from\n * @returns The stored value, or undefined if the key is not set\n */\n get<T = any>(key: string): T | undefined;\n\n /**\n * Sets the value stored at key to the provided value.\n * @param key - Key to set at\n * @param value - Value to set\n * @returns The IDirectory itself\n */\n set<T = any>(key: string, value: T): this;\n\n /**\n * Get the number of sub directory within the directory.\n * @returns The number of sub directory within a directory.\n */\n countSubDirectory?(): number;\n\n /**\n * Creates an IDirectory child of this IDirectory, or retrieves the existing IDirectory child if one with the\n * same name already exists.\n * @param subdirName - Name of the new child directory to create\n * @returns The IDirectory child that was created or retrieved\n */\n createSubDirectory(subdirName: string): IDirectory;\n\n /**\n * Gets an IDirectory child of this IDirectory, if it exists.\n * @param subdirName - Name of the child directory to get\n * @returns The requested IDirectory\n */\n getSubDirectory(subdirName: string): IDirectory | undefined;\n\n /**\n * Checks whether this directory has a child directory with the given name.\n * @param subdirName - Name of the child directory to check\n * @returns True if it exists, false otherwise\n */\n hasSubDirectory(subdirName: string): boolean;\n\n /**\n * Deletes an IDirectory child of this IDirectory, if it exists, along with all descendent keys and directories.\n * @param subdirName - Name of the child directory to delete\n * @returns True if the IDirectory existed and was deleted, false if it did not exist\n */\n deleteSubDirectory(subdirName: string): boolean;\n\n /**\n * Gets an iterator over the IDirectory children of this IDirectory.\n * @returns The IDirectory iterator\n */\n subdirectories(): IterableIterator<[string, IDirectory]>;\n\n /**\n * Get an IDirectory within the directory, in order to use relative paths from that location.\n * @param relativePath - Path of the IDirectory to get, relative to this IDirectory\n * @returns The requested IDirectory\n */\n getWorkingDirectory(relativePath: string): IDirectory | undefined;\n}\n\n/**\n * Events emitted in response to changes to the directory data.\n * These events only emit on the {@link ISharedDirectory} itself, and not on subdirectories.\n */\nexport interface ISharedDirectoryEvents extends ISharedObjectEvents {\n /**\n * Emitted when a key is set or deleted. This is emitted for any key in the {@link ISharedDirectory} or any\n * subdirectory.\n *\n * @remarks Listener parameters:\n *\n * - `changed` - Information on the key that changed, its value prior to the change, and the path to the\n * key that changed.\n *\n * - `local` - Whether the change originated from this client.\n *\n * - `target` - The {@link ISharedDirectory} itself.\n */\n (event: \"valueChanged\", listener: (\n changed: IDirectoryValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n\n /**\n * Emitted when the {@link ISharedDirectory} is cleared.\n *\n * @remarks Listener parameters:\n *\n * - `local` - Whether the clear originated from this client.\n *\n * - `target` - The {@link ISharedDirectory} itself.\n */\n (event: \"clear\", listener: (\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n\n /**\n * Emitted when a subdirectory is created.\n *\n * @remarks Listener parameters:\n *\n * - `path` - The relative path to the subdirectory that is created.\n * It is relative from the object which raises the event.\n *\n * - `local` - Whether the create originated from the this client.\n *\n * - `target` - The {@link ISharedDirectory} itself.\n */\n (event: \"subDirectoryCreated\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n\n /**\n * Emitted when a subdirectory is deleted.\n *\n * @remarks Listener parameters:\n *\n * - `path` - The relative path to the subdirectory that is deleted.\n * It is relative from the object which raises the event.\n *\n * - `local` - Whether the delete originated from the this client.\n *\n * - `target` - The {@link ISharedDirectory} itself.\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n (event: \"subDirectoryDeleted\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n}\n\n/**\n * Events emitted in response to changes to the directory data.\n */\nexport interface IDirectoryEvents extends IEvent {\n /**\n * Emitted when a key is set or deleted. As opposed to the\n * {@link SharedDirectory}'s valueChanged event, this is emitted only on the {@link IDirectory} that directly\n * contains the key.\n *\n * @remarks Listener parameters:\n *\n * - `changed` - Information on the key that changed and its value prior to the change.\n *\n * - `local` - Whether the change originated from this client.\n *\n * - `target` - The {@link IDirectory} itself.\n */\n (event: \"containedValueChanged\", listener: (\n changed: IValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n\n /**\n * Emitted when a subdirectory is created.\n *\n * @remarks Listener parameters:\n *\n * - `path` - The relative path to the subdirectory that is created.\n * It is relative from the object which raises the event.\n *\n * - `local` - Whether the creation originated from the this client.\n *\n * - `target` - The {@link ISharedDirectory} itself.\n */\n (event: \"subDirectoryCreated\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n\n /**\n * Emitted when a subdirectory is deleted.\n *\n * @remarks Listener parameters:\n *\n * - `path` - The relative path to the subdirectory that is deleted.\n * It is relative from the object which raises the event.\n *\n * - `local` - Whether the delete originated from the this client.\n *\n * - `target` - The {@link ISharedDirectory} itself.\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n (event: \"subDirectoryDeleted\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n\n /**\n * Emitted when this sub directory is deleted.\n *\n * @remarks Listener parameters:\n *\n * - `target` - The {@link IDirectory} itself.\n */\n (event: \"disposed\", listener: (\n target: IEventThisPlaceHolder,\n ) => 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 */\nexport interface ISharedDirectory extends\n ISharedObject<ISharedDirectoryEvents & IDirectoryEvents>,\n Omit<IDirectory, \"on\" | \"once\" | \"off\"> {\n // The Omit type excludes symbols, which we don't want to exclude. Adding them back here manually.\n // https://github.com/microsoft/TypeScript/issues/31671\n [Symbol.iterator](): IterableIterator<[string, any]>;\n readonly [Symbol.toStringTag]: string;\n}\n\n/**\n * Type of \"valueChanged\" event parameter for {@link ISharedDirectory}\n */\nexport interface IDirectoryValueChanged extends IValueChanged {\n /**\n * The absolute path to the IDirectory storing the key which changed.\n */\n path: string;\n}\n\n/**\n * Events emitted in response to changes to the {@link ISharedMap | map} data.\n */\nexport interface ISharedMapEvents extends ISharedObjectEvents {\n /**\n * Emitted when a key is set or deleted.\n *\n * @remarks Listener parameters:\n *\n * - `changed` - Information on the key that changed and its value prior to the change.\n *\n * - `local` - Whether the change originated from this client.\n *\n * - `target` - The {@link ISharedMap} itself.\n */\n (event: \"valueChanged\", listener: (\n changed: IValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder) => void);\n\n /**\n * Emitted when the map is cleared.\n *\n * @remarks Listener parameters:\n *\n * - `local` - Whether the clear originated from this client.\n *\n * - `target` - The {@link ISharedMap} itself.\n */\n (event: \"clear\", listener: (\n local: boolean,\n 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/shared-object-base#SharedObjectHandle}.\n *\n * For more information, including example usages, see {@link https://fluidframework.com/docs/data-structures/map/}.\n */\nexport interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {\n /**\n * Retrieves the given key from the map if it exists.\n * @param key - Key to retrieve from\n * @returns The stored value, or undefined if the key is not set\n */\n get<T = any>(key: string): T | undefined;\n\n /**\n * Sets the value stored at key to the provided value.\n * @param key - Key to set\n * @param value - Value to set\n * @returns The {@link ISharedMap} itself\n */\n set<T = any>(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 */\nexport interface ISerializableValue {\n /**\n * A type annotation to help indicate how the value serializes.\n */\n type: string;\n\n /**\n * The JSONable representation of the value.\n */\n value: any;\n}\n\n/**\n * Serialized {@link ISerializableValue} counterpart.\n */\nexport interface ISerializedValue {\n /**\n * A type annotation to help indicate how the value serializes.\n */\n type: string;\n\n /**\n * String representation of the value.\n *\n * @remarks Will be undefined if the original value was undefined.\n */\n value: string | undefined;\n}\n"]}
@@ -6,7 +6,7 @@ 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
10
  */
11
11
  export interface ILocalValue {
12
12
  /**
@@ -46,8 +46,8 @@ export declare class PlainLocalValue implements ILocalValue {
46
46
  makeSerialized(serializer: IFluidSerializer, bind: IFluidHandle): ISerializedValue;
47
47
  }
48
48
  /**
49
- * A LocalValueMaker enables a container type DDS to produce and store local values with minimal awareness of how
50
- * those objects are stored, serialized, and deserialized.
49
+ * Enables a container type {@link https://fluidframework.com/docs/build/dds/ | DDS} to produce and store local
50
+ * values with minimal awareness of how those objects are stored, serialized, and deserialized.
51
51
  */
52
52
  export declare class LocalValueMaker {
53
53
  private readonly serializer;
@@ -41,8 +41,8 @@ export class PlainLocalValue {
41
41
  }
42
42
  }
43
43
  /**
44
- * A LocalValueMaker enables a container type DDS to produce and store local values with minimal awareness of how
45
- * those objects are stored, serialized, and deserialized.
44
+ * Enables a container type {@link https://fluidframework.com/docs/build/dds/ | DDS} to produce and store local
45
+ * values with minimal awareness of how those objects are stored, serialized, and deserialized.
46
46
  */
47
47
  export class LocalValueMaker {
48
48
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"localValues.js","sourceRoot":"","sources":["../src/localValues.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAGH,YAAY,EACZ,gBAAgB,EAChB,SAAS,GACZ,MAAM,oCAAoC,CAAC;AAgC5C,MAAM,UAAU,gBAAgB,CAC5B,UAAuB,EACvB,UAA4B,EAC5B,IAAkB;IAClB,MAAM,KAAK,GAAG,UAAU,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAC1D,OAAO;QACH,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;KAChD,CAAC;AACN,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,eAAe;IACxB;;;OAGG;IACH,YAA4B,KAAU;QAAV,UAAK,GAAL,KAAK,CAAK;IACtC,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,cAAc,CACjB,UAA4B,EAC5B,IAAkB;QAElB,2FAA2F;QAC3F,oBAAoB;QACpB,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;QAE7D,OAAO;YACH,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK;SACR,CAAC;IACN,CAAC;CACJ;AAED;;;GAGG;AACH,MAAM,OAAO,eAAe;IACxB;;;OAGG;IACH,YAA6B,UAA4B;QAA5B,eAAU,GAAV,UAAU,CAAkB;IACzD,CAAC;IAED;;;OAGG;IACI,gBAAgB,CAAC,YAAgC;QACpD,2CAA2C;QAC3C,IAAI,YAAY,CAAC,IAAI,KAAK,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;YACnD,YAAY,CAAC,IAAI,GAAG,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAC/C,MAAM,MAAM,GAAsB;gBAC9B,IAAI,EAAE,kBAAkB;gBACxB,GAAG,EAAE,YAAY,CAAC,KAAe;aACpC,CAAC;YACF,YAAY,CAAC,KAAK,GAAG,MAAM,CAAC;SAC/B;QAED,MAAM,eAAe,GAAG,YAAY,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAE1E,OAAO,IAAI,eAAe,CAAC,eAAe,CAAC,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACI,YAAY,CAAC,KAAU;QAC1B,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;CACJ","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 IFluidSerializer,\n ISerializedHandle,\n parseHandles,\n serializeHandles,\n ValueType,\n} from \"@fluidframework/shared-object-base\";\nimport {\n ISerializableValue,\n ISerializedValue,\n} from \"./interfaces\";\n\n/**\n * A local value to be stored in a container type DDS.\n */\nexport interface ILocalValue {\n /**\n * Type indicator of the value stored within.\n */\n readonly type: string;\n\n /**\n * The in-memory value stored within.\n */\n readonly value: any;\n\n /**\n * Retrieve the serialized form of the value stored within.\n * @param serializer - Data store runtime's serializer\n * @param bind - Container type's handle\n * @returns The serialized form of the contained value\n */\n makeSerialized(\n serializer: IFluidSerializer,\n bind: IFluidHandle,\n ): ISerializedValue;\n}\n\nexport function makeSerializable(\n localValue: ILocalValue,\n serializer: IFluidSerializer,\n bind: IFluidHandle): ISerializableValue {\n const value = localValue.makeSerialized(serializer, bind);\n return {\n type: value.type,\n value: value.value && JSON.parse(value.value),\n };\n}\n\n/**\n * Manages a contained plain value. May also contain shared object handles.\n */\nexport class PlainLocalValue implements ILocalValue {\n /**\n * Create a new PlainLocalValue.\n * @param value - The value to store, which may contain shared object handles\n */\n constructor(public readonly value: any) {\n }\n\n /**\n * {@inheritDoc ILocalValue.\"type\"}\n */\n public get type(): string {\n return ValueType[ValueType.Plain];\n }\n\n /**\n * {@inheritDoc ILocalValue.makeSerialized}\n */\n public makeSerialized(\n serializer: IFluidSerializer,\n bind: IFluidHandle,\n ): ISerializedValue {\n // Stringify to convert to the serialized handle values - and then parse in order to create\n // a POJO for the op\n const value = serializeHandles(this.value, serializer, bind);\n\n return {\n type: this.type,\n value,\n };\n }\n}\n\n/**\n * A LocalValueMaker enables a container type DDS to produce and store local values with minimal awareness of how\n * those objects are stored, serialized, and deserialized.\n */\nexport class LocalValueMaker {\n /**\n * Create a new LocalValueMaker.\n * @param serializer - The serializer to serialize / parse handles.\n */\n constructor(private readonly serializer: IFluidSerializer) {\n }\n\n /**\n * Create a new local value from an incoming serialized value.\n * @param serializable - The serializable value to make local\n */\n public fromSerializable(serializable: ISerializableValue): ILocalValue {\n // Migrate from old shared value to handles\n if (serializable.type === ValueType[ValueType.Shared]) {\n serializable.type = ValueType[ValueType.Plain];\n const handle: ISerializedHandle = {\n type: \"__fluid_handle__\",\n url: serializable.value as string,\n };\n serializable.value = handle;\n }\n\n const translatedValue = parseHandles(serializable.value, this.serializer);\n\n return new PlainLocalValue(translatedValue);\n }\n\n /**\n * Create a new local value containing a given plain object.\n * @param value - The value to store\n * @returns An ILocalValue containing the value\n */\n public fromInMemory(value: any): ILocalValue {\n return new PlainLocalValue(value);\n }\n}\n"]}
1
+ {"version":3,"file":"localValues.js","sourceRoot":"","sources":["../src/localValues.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAGH,YAAY,EACZ,gBAAgB,EAChB,SAAS,GACZ,MAAM,oCAAoC,CAAC;AAgC5C,MAAM,UAAU,gBAAgB,CAC5B,UAAuB,EACvB,UAA4B,EAC5B,IAAkB;IAClB,MAAM,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C,UAAU,CAAC,CAAC;QAE1E,OAAO,IAAI,eAAe,CAAC,eAAe,CAAC,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACI,YAAY,CAAC,KAAU;QAC1B,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;CACJ","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 IFluidSerializer,\n ISerializedHandle,\n parseHandles,\n serializeHandles,\n ValueType,\n} from \"@fluidframework/shared-object-base\";\nimport {\n ISerializableValue,\n ISerializedValue,\n} from \"./interfaces\";\n\n/**\n * A local value to be stored in a container type Distributed Data Store (DDS).\n */\nexport interface ILocalValue {\n /**\n * Type indicator of the value stored within.\n */\n readonly type: string;\n\n /**\n * The in-memory value stored within.\n */\n readonly value: any;\n\n /**\n * Retrieve the serialized form of the value stored within.\n * @param serializer - Data store runtime's serializer\n * @param bind - Container type's handle\n * @returns The serialized form of the contained value\n */\n makeSerialized(\n serializer: IFluidSerializer,\n bind: IFluidHandle,\n ): ISerializedValue;\n}\n\nexport function makeSerializable(\n localValue: ILocalValue,\n serializer: IFluidSerializer,\n bind: IFluidHandle): ISerializableValue {\n const value = localValue.makeSerialized(serializer, bind);\n return {\n type: value.type,\n value: value.value && JSON.parse(value.value),\n };\n}\n\n/**\n * Manages a contained plain value. May also contain shared object handles.\n */\nexport class PlainLocalValue implements ILocalValue {\n /**\n * Create a new PlainLocalValue.\n * @param value - The value to store, which may contain shared object handles\n */\n constructor(public readonly value: any) {\n }\n\n /**\n * {@inheritDoc ILocalValue.\"type\"}\n */\n public get type(): string {\n return ValueType[ValueType.Plain];\n }\n\n /**\n * {@inheritDoc ILocalValue.makeSerialized}\n */\n public makeSerialized(\n serializer: IFluidSerializer,\n bind: IFluidHandle,\n ): ISerializedValue {\n // Stringify to convert to the serialized handle values - and then parse in order to create\n // a POJO for the op\n const value = serializeHandles(this.value, serializer, bind);\n\n return {\n type: this.type,\n value,\n };\n }\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 */\nexport class LocalValueMaker {\n /**\n * Create a new LocalValueMaker.\n * @param serializer - The serializer to serialize / parse handles.\n */\n constructor(private readonly serializer: IFluidSerializer) {\n }\n\n /**\n * Create a new local value from an incoming serialized value.\n * @param serializable - The serializable value to make local\n */\n public fromSerializable(serializable: ISerializableValue): ILocalValue {\n // Migrate from old shared value to handles\n if (serializable.type === ValueType[ValueType.Shared]) {\n serializable.type = ValueType[ValueType.Plain];\n const handle: ISerializedHandle = {\n type: \"__fluid_handle__\",\n url: serializable.value as string,\n };\n serializable.value = handle;\n }\n\n const translatedValue = parseHandles(serializable.value, this.serializer);\n\n return new PlainLocalValue(translatedValue);\n }\n\n /**\n * Create a new local value containing a given plain object.\n * @param value - The value to store\n * @returns An ILocalValue containing the value\n */\n public fromInMemory(value: any): ILocalValue {\n return new PlainLocalValue(value);\n }\n}\n"]}
package/lib/map.d.ts CHANGED
@@ -8,7 +8,8 @@ import { ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtim
8
8
  import { IFluidSerializer, SharedObject } from "@fluidframework/shared-object-base";
9
9
  import { ISharedMap, ISharedMapEvents } from "./interfaces";
10
10
  /**
11
- * The factory that defines the map.
11
+ * {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link SharedMap}.
12
+ *
12
13
  * @sealed
13
14
  */
14
15
  export declare class MapFactory implements IChannelFactory {
@@ -38,10 +39,7 @@ export declare class MapFactory implements IChannelFactory {
38
39
  create(runtime: IFluidDataStoreRuntime, id: string): ISharedMap;
39
40
  }
40
41
  /**
41
- * The SharedMap distributed data structure can be used to store key-value pairs. It provides the same API for setting
42
- * and retrieving values that JavaScript developers are accustomed to with the
43
- * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map | Map} built-in object.
44
- * However, the keys of a SharedMap must be strings.
42
+ * {@inheritDoc ISharedMap}
45
43
  */
46
44
  export declare class SharedMap extends SharedObject<ISharedMapEvents> implements ISharedMap {
47
45
  /**
package/lib/map.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAe,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EAClB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAE/F,OAAO,EACH,gBAAgB,EAChB,YAAY,EACf,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACH,UAAU,EACV,gBAAgB,EACnB,MAAM,cAAc,CAAC;AAWtB;;;GAGG;AACH,qBAAa,UAAW,YAAW,eAAe;IAC9C;;OAEG;IACH,gBAAuB,IAAI,2CAA2C;IAEtE;;OAEG;IACH,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF;;OAEG;IACH,IAAW,IAAI,WAEd;IAED;;OAEG;IACH,IAAW,UAAU,uBAEpB;IAED;;OAEG;IACU,IAAI,CACb,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC;IAOxD;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,UAAU;CAMzE;AAED;;;;;GAKG;AACH,qBAAa,SAAU,SAAQ,YAAY,CAAC,gBAAgB,CAAE,YAAW,UAAU;IAC/E;;;;;;;;;;;;OAYG;WACW,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,CAAC,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AI/C;;;;OAIG;IACI,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIhC;;OAEG;IACI,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAKzC;;;;OAIG;IACI,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAInC;;OAEG;IACI,KAAK,IAAI,IAAI;IAIpB;;;OAGG;IACH,SAAS,CAAC,aAAa,CACnB,UAAU,EAAE,gBAAgB,EAC5B,gBAAgB,CAAC,EAAE,iBAAiB,GACrC,qBAAqB;IAsExB;;;OAGG;cACa,QAAQ,CAAC,OAAO,EAAE,sBAAsB;IAcxD;;;OAGG;IACH,SAAS,CAAC,YAAY;IAEtB;;;OAGG;IACH,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAI7D;;;OAGG;IACH,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO;IAI/C;;;OAGG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO;IAMlG;;;MAGE;IACF,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;CAG5D"}
package/lib/map.js CHANGED
@@ -11,7 +11,8 @@ import { MapKernel } from "./mapKernel";
11
11
  import { pkgVersion } from "./packageVersion";
12
12
  const snapshotFileName = "header";
13
13
  /**
14
- * The factory that defines the map.
14
+ * {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link SharedMap}.
15
+ *
15
16
  * @sealed
16
17
  */
17
18
  export class MapFactory {
@@ -57,10 +58,7 @@ MapFactory.Attributes = {
57
58
  packageVersion: pkgVersion,
58
59
  };
59
60
  /**
60
- * The SharedMap distributed data structure can be used to store key-value pairs. It provides the same API for setting
61
- * and retrieving values that JavaScript developers are accustomed to with the
62
- * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map | Map} built-in object.
63
- * However, the keys of a SharedMap must be strings.
61
+ * {@inheritDoc ISharedMap}
64
62
  */
65
63
  export class SharedMap extends SharedObject {
66
64
  /**
@@ -278,8 +276,7 @@ export class SharedMap extends SharedObject {
278
276
  * @internal
279
277
  */
280
278
  applyStashedOp(content) {
281
- this.kernel.tryProcessMessage(content, false, undefined);
282
- return this.kernel.tryGetStashedOpLocalMetadata(content);
279
+ return this.kernel.tryApplyStashedOp(content);
283
280
  }
284
281
  /**
285
282
  * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}