@fluidframework/map 1.2.1 → 2.0.0-internal.1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) 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/internalInterfaces.d.ts +62 -0
  9. package/dist/internalInterfaces.d.ts.map +1 -0
  10. package/dist/internalInterfaces.js +7 -0
  11. package/dist/internalInterfaces.js.map +1 -0
  12. package/dist/localValues.d.ts +3 -3
  13. package/dist/localValues.js +2 -2
  14. package/dist/localValues.js.map +1 -1
  15. package/dist/map.d.ts +3 -5
  16. package/dist/map.d.ts.map +1 -1
  17. package/dist/map.js +4 -7
  18. package/dist/map.js.map +1 -1
  19. package/dist/mapKernel.d.ts +10 -41
  20. package/dist/mapKernel.d.ts.map +1 -1
  21. package/dist/mapKernel.js +28 -13
  22. package/dist/mapKernel.js.map +1 -1
  23. package/dist/packageVersion.d.ts +1 -1
  24. package/dist/packageVersion.d.ts.map +1 -1
  25. package/dist/packageVersion.js +1 -1
  26. package/dist/packageVersion.js.map +1 -1
  27. package/lib/directory.d.ts +26 -7
  28. package/lib/directory.d.ts.map +1 -1
  29. package/lib/directory.js +4 -11
  30. package/lib/directory.js.map +1 -1
  31. package/lib/interfaces.d.ts +139 -181
  32. package/lib/interfaces.d.ts.map +1 -1
  33. package/lib/interfaces.js.map +1 -1
  34. package/lib/internalInterfaces.d.ts +62 -0
  35. package/lib/internalInterfaces.d.ts.map +1 -0
  36. package/lib/internalInterfaces.js +6 -0
  37. package/lib/internalInterfaces.js.map +1 -0
  38. package/lib/localValues.d.ts +3 -3
  39. package/lib/localValues.js +2 -2
  40. package/lib/localValues.js.map +1 -1
  41. package/lib/map.d.ts +3 -5
  42. package/lib/map.d.ts.map +1 -1
  43. package/lib/map.js +4 -7
  44. package/lib/map.js.map +1 -1
  45. package/lib/mapKernel.d.ts +10 -41
  46. package/lib/mapKernel.d.ts.map +1 -1
  47. package/lib/mapKernel.js +28 -13
  48. package/lib/mapKernel.js.map +1 -1
  49. package/lib/packageVersion.d.ts +1 -1
  50. package/lib/packageVersion.d.ts.map +1 -1
  51. package/lib/packageVersion.js +1 -1
  52. package/lib/packageVersion.js.map +1 -1
  53. package/package.json +54 -17
  54. package/src/directory.ts +30 -15
  55. package/src/interfaces.ts +146 -181
  56. package/src/internalInterfaces.ts +72 -0
  57. package/src/localValues.ts +3 -3
  58. package/src/map.ts +8 -11
  59. package/src/mapKernel.ts +58 -86
  60. package/src/packageVersion.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/map",
3
- "version": "1.2.1",
3
+ "version": "2.0.0-internal.1.0.0",
4
4
  "description": "Distributed map",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -61,25 +61,25 @@
61
61
  },
62
62
  "dependencies": {
63
63
  "@fluidframework/common-definitions": "^0.20.1",
64
- "@fluidframework/common-utils": "^0.32.1",
65
- "@fluidframework/container-utils": "^1.2.1",
66
- "@fluidframework/core-interfaces": "^1.2.1",
67
- "@fluidframework/datastore-definitions": "^1.2.1",
68
- "@fluidframework/driver-utils": "^1.2.1",
69
- "@fluidframework/protocol-definitions": "^0.1028.2000",
70
- "@fluidframework/runtime-definitions": "^1.2.1",
71
- "@fluidframework/runtime-utils": "^1.2.1",
72
- "@fluidframework/shared-object-base": "^1.2.1",
64
+ "@fluidframework/common-utils": "^1.0.0",
65
+ "@fluidframework/container-utils": "^2.0.0-internal.1.0.0",
66
+ "@fluidframework/core-interfaces": "^2.0.0-internal.1.0.0",
67
+ "@fluidframework/datastore-definitions": "^2.0.0-internal.1.0.0",
68
+ "@fluidframework/driver-utils": "^2.0.0-internal.1.0.0",
69
+ "@fluidframework/protocol-definitions": "^1.0.0",
70
+ "@fluidframework/runtime-definitions": "^2.0.0-internal.1.0.0",
71
+ "@fluidframework/runtime-utils": "^2.0.0-internal.1.0.0",
72
+ "@fluidframework/shared-object-base": "^2.0.0-internal.1.0.0",
73
73
  "path-browserify": "^1.0.1"
74
74
  },
75
75
  "devDependencies": {
76
- "@fluid-internal/test-dds-utils": "^1.2.1",
76
+ "@fluid-internal/test-dds-utils": "^2.0.0-internal.1.0.0",
77
77
  "@fluidframework/build-common": "^0.24.0",
78
- "@fluidframework/build-tools": "^0.2.74327",
78
+ "@fluidframework/build-tools": "^0.3.1000",
79
79
  "@fluidframework/eslint-config-fluid": "^0.28.2000",
80
- "@fluidframework/map-previous": "npm:@fluidframework/map@1.2.0",
81
- "@fluidframework/mocha-test-setup": "^1.2.1",
82
- "@fluidframework/test-runtime-utils": "^1.2.1",
80
+ "@fluidframework/map-previous": "npm:@fluidframework/map@^1.0.0",
81
+ "@fluidframework/mocha-test-setup": "^2.0.0-internal.1.0.0",
82
+ "@fluidframework/test-runtime-utils": "^2.0.0-internal.1.0.0",
83
83
  "@microsoft/api-extractor": "^7.22.2",
84
84
  "@rushstack/eslint-config": "^2.5.1",
85
85
  "@types/mocha": "^9.1.1",
@@ -95,7 +95,44 @@
95
95
  "typescript-formatter": "7.1.0"
96
96
  },
97
97
  "typeValidation": {
98
- "version": "1.2.1",
99
- "broken": {}
98
+ "version": "2.0.0",
99
+ "broken": {
100
+ "RemovedInterfaceDeclaration_IDirectoryClearOperation": {
101
+ "forwardCompat": false,
102
+ "backCompat": false
103
+ },
104
+ "RemovedInterfaceDeclaration_IDirectoryCreateSubDirectoryOperation": {
105
+ "forwardCompat": false,
106
+ "backCompat": false
107
+ },
108
+ "RemovedInterfaceDeclaration_IDirectoryDeleteOperation": {
109
+ "forwardCompat": false,
110
+ "backCompat": false
111
+ },
112
+ "RemovedInterfaceDeclaration_IDirectoryDeleteSubDirectoryOperation": {
113
+ "forwardCompat": false,
114
+ "backCompat": false
115
+ },
116
+ "RemovedTypeAliasDeclaration_IDirectoryKeyOperation": {
117
+ "forwardCompat": false,
118
+ "backCompat": false
119
+ },
120
+ "RemovedInterfaceDeclaration_IDirectorySetOperation": {
121
+ "forwardCompat": false,
122
+ "backCompat": false
123
+ },
124
+ "RemovedTypeAliasDeclaration_IDirectoryStorageOperation": {
125
+ "forwardCompat": false,
126
+ "backCompat": false
127
+ },
128
+ "RemovedTypeAliasDeclaration_IDirectorySubDirectoryOperation": {
129
+ "forwardCompat": false,
130
+ "backCompat": false
131
+ },
132
+ "RemovedInterfaceDeclaration_ILocalValue": {
133
+ "forwardCompat": false,
134
+ "backCompat": false
135
+ }
136
+ }
100
137
  }
101
138
  }
package/src/directory.ts CHANGED
@@ -192,24 +192,47 @@ export type IDirectoryOperation = IDirectoryStorageOperation | IDirectorySubDire
192
192
 
193
193
  /**
194
194
  * Defines the in-memory object structure to be used for the conversion to/from serialized.
195
- * @privateRemarks
196
- * Directly used in JSON.stringify, direct result from JSON.parse.
195
+ *
196
+ * @remarks Directly used in
197
+ * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
198
+ * | JSON.stringify}, direct result from
199
+ * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse | JSON.parse}.
197
200
  */
198
201
  export interface IDirectoryDataObject {
202
+ /**
203
+ * Key/value date set by the user.
204
+ */
199
205
  storage?: { [key: string]: ISerializableValue; };
206
+
207
+ /**
208
+ * Recursive sub-directories {@link IDirectoryDataObject | objects}.
209
+ */
200
210
  subdirectories?: { [subdirName: string]: IDirectoryDataObject; };
201
211
  }
202
212
 
213
+ /**
214
+ * {@link IDirectory} storage format.
215
+ *
216
+ * @internal
217
+ */
203
218
  export interface IDirectoryNewStorageFormat {
219
+ /**
220
+ * Blob IDs representing larger directory data that was serialized.
221
+ */
204
222
  blobs: string[];
223
+
224
+ /**
225
+ * Storage content representing directory data that was not serialized.
226
+ */
205
227
  content: IDirectoryDataObject;
206
228
  }
207
229
 
208
230
  /**
209
- * The factory that defines the directory.
231
+ * {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link SharedDirectory}.
232
+ *
210
233
  * @sealed
211
234
  */
212
- export class DirectoryFactory {
235
+ export class DirectoryFactory implements IChannelFactory {
213
236
  /**
214
237
  * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
215
238
  */
@@ -264,9 +287,7 @@ export class DirectoryFactory {
264
287
  }
265
288
 
266
289
  /**
267
- * SharedDirectory provides a hierarchical organization of map-like data structures as SubDirectories.
268
- * The values stored within can be accessed like a map, and the hierarchy can be navigated using path syntax.
269
- * SubDirectories can be retrieved for use as working directories.
290
+ * {@inheritDoc ISharedDirectory}
270
291
  *
271
292
  * @example
272
293
  * ```typescript
@@ -544,7 +565,7 @@ export class SharedDirectory extends SharedObject<ISharedDirectoryEvents> implem
544
565
  * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
545
566
  * @internal
546
567
  */
547
- protected onDisconnect() {}
568
+ protected onDisconnect() { }
548
569
 
549
570
  /**
550
571
  * {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}
@@ -1263,7 +1284,6 @@ class SubDirectory extends TypedEventEmitter<IDirectoryEvents> implements IDirec
1263
1284
  * Process a clear operation.
1264
1285
  * @param op - The op to process
1265
1286
  * @param local - Whether the message originated from the local client
1266
- * @param message - The message
1267
1287
  * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
1268
1288
  * For messages from a remote client, this will be undefined.
1269
1289
  * @internal
@@ -1276,7 +1296,7 @@ class SubDirectory extends TypedEventEmitter<IDirectoryEvents> implements IDirec
1276
1296
  this.throwIfDisposed();
1277
1297
  if (local) {
1278
1298
  assert(isClearLocalOpMetadata(localOpMetadata),
1279
- 0x00f /* `pendingMessageId is missing from the local client's ${op.type} operation` */);
1299
+ 0x00f /* pendingMessageId is missing from the local client's operation */);
1280
1300
  const pendingClearMessageId = this.pendingClearMessageIds.shift();
1281
1301
  assert(pendingClearMessageId === localOpMetadata.pendingMessageId,
1282
1302
  0x32a /* pendingMessageId does not match */);
@@ -1289,7 +1309,6 @@ class SubDirectory extends TypedEventEmitter<IDirectoryEvents> implements IDirec
1289
1309
  * Process a delete operation.
1290
1310
  * @param op - The op to process
1291
1311
  * @param local - Whether the message originated from the local client
1292
- * @param message - The message
1293
1312
  * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
1294
1313
  * For messages from a remote client, this will be undefined.
1295
1314
  * @internal
@@ -1310,7 +1329,6 @@ class SubDirectory extends TypedEventEmitter<IDirectoryEvents> implements IDirec
1310
1329
  * Process a set operation.
1311
1330
  * @param op - The op to process
1312
1331
  * @param local - Whether the message originated from the local client
1313
- * @param message - The message
1314
1332
  * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
1315
1333
  * For messages from a remote client, this will be undefined.
1316
1334
  * @internal
@@ -1337,7 +1355,6 @@ class SubDirectory extends TypedEventEmitter<IDirectoryEvents> implements IDirec
1337
1355
  * Process a create subdirectory operation.
1338
1356
  * @param op - The op to process
1339
1357
  * @param local - Whether the message originated from the local client
1340
- * @param message - The message
1341
1358
  * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
1342
1359
  * For messages from a remote client, this will be undefined.
1343
1360
  * @internal
@@ -1358,7 +1375,6 @@ class SubDirectory extends TypedEventEmitter<IDirectoryEvents> implements IDirec
1358
1375
  * Process a delete subdirectory operation.
1359
1376
  * @param op - The op to process
1360
1377
  * @param local - Whether the message originated from the local client
1361
- * @param message - The message
1362
1378
  * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
1363
1379
  * For messages from a remote client, this will be undefined.
1364
1380
  * @internal
@@ -1751,7 +1767,6 @@ class SubDirectory extends TypedEventEmitter<IDirectoryEvents> implements IDirec
1751
1767
  /**
1752
1768
  * Clear implementation used for both locally sourced clears as well as incoming remote clears.
1753
1769
  * @param local - Whether the message originated from the local client
1754
- * @param op - The message if from a remote clear, or null if from a local clear
1755
1770
  */
1756
1771
  private clearCore(local: boolean) {
1757
1772
  this._storage.clear();
package/src/interfaces.ts CHANGED
@@ -98,94 +98,73 @@ 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. These events only emit on the ISharedDirectory itself,
102
- * and not on subdirectories.
103
- *
104
- * @remarks
105
- *
106
- * The following is the list of events emitted.
107
- *
108
- * ### "valueChanged"
109
- *
110
- * The valueChanged event is emitted when a key is set or deleted. This is emitted for any key in the ISharedDirectory
111
- * or any subdirectory.
112
- *
113
- * #### Listener signature
114
- *
115
- * ```typescript
116
- * (
117
- * changed: IDirectoryValueChanged,
118
- * local: boolean,
119
- * target: IEventThisPlaceHolder,
120
- * ) => void
121
- * ```
122
- * - `changed` - Information on the key that changed, its value prior to the change, and the path to the key that
123
- * changed.
124
- *
125
- * - `local` - Whether the change originated from this client.
126
- *
127
- * - `target` - The ISharedDirectory itself.
128
- *
129
- * ### "clear"
130
- *
131
- * The clear event is emitted when the ISharedDirectory is cleared.
132
- *
133
- * #### Listener signature
134
- *
135
- * ```typescript
136
- * (local: boolean, target: IEventThisPlaceHolder) => void
137
- * ```
138
- * - `local` - Whether the clear originated from this client.
139
- *
140
- * - `target` - The ISharedDirectory itself.
141
- *
142
- * ### "subDirectoryCreated"
143
- *
144
- * The subDirectoryCreated event is emitted when a subdirectory is created.
145
- *
146
- * #### Listener signature
147
- *
148
- * ```typescript
149
- * (path: string, local: boolean, target: IEventThisPlaceHolder) => void
150
- * ```
151
- * - `path` - The relative path to the subdirectory that is created.
152
- * It is relative from the object which raises the event.
153
- *
154
- * - `local` - Whether the create originated from the this client.
155
- *
156
- * - `target` - The ISharedDirectory itself.
157
- *
158
- * ###"subDirectoryDeleted"
159
- *
160
- * The subDirectoryDeleted event is emitted when a subdirectory is deleted.
161
- *
162
- * #### Listener signature
163
- *
164
- * ```typescript
165
- * (path: string, local: boolean, target: IEventThisPlaceHolder) => void
166
- * ```
167
- * - `path` - The relative path to the subdirectory that is deleted.
168
- * It is relative from the object which raises the event.
169
- *
170
- * - `local` - Whether the delete originated from the this client.
171
- *
172
- * - `target` - The ISharedDirectory itself.
101
+ * Events emitted in response to changes to the directory data.
102
+ * These events only emit on the {@link ISharedDirectory} itself, and not on subdirectories.
173
103
  */
174
104
  export interface ISharedDirectoryEvents extends ISharedObjectEvents {
105
+ /**
106
+ * Emitted when a key is set or deleted. This is emitted for any key in the {@link ISharedDirectory} or any
107
+ * subdirectory.
108
+ *
109
+ * @remarks Listener parameters:
110
+ *
111
+ * - `changed` - Information on the key that changed, its value prior to the change, and the path to the
112
+ * key that changed.
113
+ *
114
+ * - `local` - Whether the change originated from this client.
115
+ *
116
+ * - `target` - The {@link ISharedDirectory} itself.
117
+ */
175
118
  (event: "valueChanged", listener: (
176
119
  changed: IDirectoryValueChanged,
177
120
  local: boolean,
178
121
  target: IEventThisPlaceHolder,
179
122
  ) => void);
123
+
124
+ /**
125
+ * Emitted when the {@link ISharedDirectory} is cleared.
126
+ *
127
+ * @remarks Listener parameters:
128
+ *
129
+ * - `local` - Whether the clear originated from this client.
130
+ *
131
+ * - `target` - The {@link ISharedDirectory} itself.
132
+ */
180
133
  (event: "clear", listener: (
181
134
  local: boolean,
182
135
  target: IEventThisPlaceHolder,
183
136
  ) => void);
137
+
138
+ /**
139
+ * Emitted when a subdirectory is created.
140
+ *
141
+ * @remarks Listener parameters:
142
+ *
143
+ * - `path` - The relative path to the subdirectory that is created.
144
+ * It is relative from the object which raises the event.
145
+ *
146
+ * - `local` - Whether the create originated from the this client.
147
+ *
148
+ * - `target` - The {@link ISharedDirectory} itself.
149
+ */
184
150
  (event: "subDirectoryCreated", listener: (
185
151
  path: string,
186
152
  local: boolean,
187
153
  target: IEventThisPlaceHolder,
188
154
  ) => void);
155
+
156
+ /**
157
+ * Emitted when a subdirectory is deleted.
158
+ *
159
+ * @remarks Listener parameters:
160
+ *
161
+ * - `path` - The relative path to the subdirectory that is deleted.
162
+ * It is relative from the object which raises the event.
163
+ *
164
+ * - `local` - Whether the delete originated from the this client.
165
+ *
166
+ * - `target` - The {@link ISharedDirectory} itself.
167
+ */
189
168
  // eslint-disable-next-line @typescript-eslint/unified-signatures
190
169
  (event: "subDirectoryDeleted", listener: (
191
170
  path: string,
@@ -196,95 +175,80 @@ export interface ISharedDirectoryEvents extends ISharedObjectEvents {
196
175
 
197
176
  /**
198
177
  * Events emitted in response to changes to the directory data.
199
- *
200
- * @remarks
201
- *
202
- * The following is the list of events emitted.
203
- *
204
- * ### "containedValueChanged"
205
- *
206
- * The containedValueChanged event is emitted when a key is set or deleted. As opposed to the SharedDirectory's
207
- * valueChanged event, this is emitted only on the IDirectory that directly contains the key.
208
- *
209
- * #### Listener signature
210
- *
211
- * ```typescript
212
- * (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void
213
- * ```
214
- * - `changed` - Information on the key that changed and its value prior to the change.
215
- *
216
- * - `local` - Whether the change originated from this client.
217
- *
218
- * - `target` - The IDirectory itself.
219
- *
220
- * ### "subDirectoryCreated"
221
- *
222
- * The subDirectoryCreated event is emitted when a subdirectory is created.
223
- *
224
- * #### Listener signature
225
- *
226
- * ```typescript
227
- * (path: string, local: boolean, target: IEventThisPlaceHolder) => void
228
- * ```
229
- * - `path` - The relative path to the subdirectory that is created.
230
- * It is relative from the object which raises the event.
231
- *
232
- * - `local` - Whether the creation originated from the this client.
233
- *
234
- * - `target` - The ISharedDirectory itself.
235
- *
236
- * ### "subDirectoryDeleted"
237
- *
238
- * The subDirectoryDeleted event is emitted when a subdirectory is deleted.
239
- *
240
- * #### Listener signature
241
- *
242
- * ```typescript
243
- * (path: string, local: boolean, target: IEventThisPlaceHolder) => void
244
- * ```
245
- * - `path` - The relative path to the subdirectory that is deleted.
246
- * It is relative from the object which raises the event.
247
- *
248
- * - `local` - Whether the delete originated from the this client.
249
- *
250
- * - `target` - The ISharedDirectory itself.
251
- *
252
- * ### "disposed"
253
- *
254
- * The dispose event is emitted when this sub directory is deleted.
255
- *
256
- * #### Listener signature
257
- *
258
- * ```typescript
259
- * (local: boolean, target: IEventThisPlaceHolder) => void
260
- * ```
261
- *
262
- * - `target` - The IDirectory itself.
263
178
  */
264
179
  export interface IDirectoryEvents extends IEvent {
180
+ /**
181
+ * Emitted when a key is set or deleted. As opposed to the
182
+ * {@link SharedDirectory}'s valueChanged event, this is emitted only on the {@link IDirectory} that directly
183
+ * contains the key.
184
+ *
185
+ * @remarks Listener parameters:
186
+ *
187
+ * - `changed` - Information on the key that changed and its value prior to the change.
188
+ *
189
+ * - `local` - Whether the change originated from this client.
190
+ *
191
+ * - `target` - The {@link IDirectory} itself.
192
+ */
265
193
  (event: "containedValueChanged", listener: (
266
194
  changed: IValueChanged,
267
195
  local: boolean,
268
196
  target: IEventThisPlaceHolder,
269
197
  ) => void);
198
+
199
+ /**
200
+ * Emitted when a subdirectory is created.
201
+ *
202
+ * @remarks Listener parameters:
203
+ *
204
+ * - `path` - The relative path to the subdirectory that is created.
205
+ * It is relative from the object which raises the event.
206
+ *
207
+ * - `local` - Whether the creation originated from the this client.
208
+ *
209
+ * - `target` - The {@link ISharedDirectory} itself.
210
+ */
270
211
  (event: "subDirectoryCreated", listener: (
271
212
  path: string,
272
213
  local: boolean,
273
214
  target: IEventThisPlaceHolder,
274
215
  ) => void);
216
+
217
+ /**
218
+ * Emitted when a subdirectory is deleted.
219
+ *
220
+ * @remarks Listener parameters:
221
+ *
222
+ * - `path` - The relative path to the subdirectory that is deleted.
223
+ * It is relative from the object which raises the event.
224
+ *
225
+ * - `local` - Whether the delete originated from the this client.
226
+ *
227
+ * - `target` - The {@link ISharedDirectory} itself.
228
+ */
275
229
  // eslint-disable-next-line @typescript-eslint/unified-signatures
276
230
  (event: "subDirectoryDeleted", listener: (
277
231
  path: string,
278
232
  local: boolean,
279
233
  target: IEventThisPlaceHolder,
280
234
  ) => void);
235
+
236
+ /**
237
+ * Emitted when this sub directory is deleted.
238
+ *
239
+ * @remarks Listener parameters:
240
+ *
241
+ * - `target` - The {@link IDirectory} itself.
242
+ */
281
243
  (event: "disposed", listener: (
282
244
  target: IEventThisPlaceHolder,
283
245
  ) => void);
284
246
  }
285
247
 
286
248
  /**
287
- * Interface describing a shared directory.
249
+ * Provides a hierarchical organization of map-like data structures as SubDirectories.
250
+ * The values stored within can be accessed like a map, and the hierarchy can be navigated using path syntax.
251
+ * SubDirectories can be retrieved for use as working directories.
288
252
  */
289
253
  export interface ISharedDirectory extends
290
254
  ISharedObject<ISharedDirectoryEvents & IDirectoryEvents>,
@@ -296,7 +260,7 @@ export interface ISharedDirectory extends
296
260
  }
297
261
 
298
262
  /**
299
- * Type of "valueChanged" event parameter for SharedDirectory.
263
+ * Type of "valueChanged" event parameter for {@link ISharedDirectory}
300
264
  */
301
265
  export interface IDirectoryValueChanged extends IValueChanged {
302
266
  /**
@@ -306,60 +270,51 @@ export interface IDirectoryValueChanged extends IValueChanged {
306
270
  }
307
271
 
308
272
  /**
309
- * Events emitted in response to changes to the map data.
310
- *
311
- * @remarks
312
- *
313
- * The following is the list of events emitted.
314
- *
315
- * ### "valueChanged"
316
- *
317
- * The valueChanged event is emitted when a key is set or deleted.
318
- *
319
- * #### Listener signature
320
- *
321
- * ```typescript
322
- * (
323
- * changed: IValueChanged,
324
- * local: boolean,
325
- * target: IEventThisPlaceHolder,
326
- * ) => void
327
- * ```
328
- * - `changed` - Information on the key that changed and its value prior to the change.
329
- *
330
- * - `local` - Whether the change originated from this client.
331
- *
332
- * - `target` - The map itself.
333
- *
334
- * ### "clear"
335
- *
336
- * The clear event is emitted when the map is cleared.
337
- *
338
- * #### Listener signature
339
- *
340
- * ```typescript
341
- * (local: boolean, target: IEventThisPlaceHolder) => void
342
- * ```
343
- * - `local` - Whether the clear originated from this client.
344
- *
345
- * - `target` - The map itself.
273
+ * Events emitted in response to changes to the {@link ISharedMap | map} data.
346
274
  */
347
275
  export interface ISharedMapEvents extends ISharedObjectEvents {
276
+ /**
277
+ * Emitted when a key is set or deleted.
278
+ *
279
+ * @remarks Listener parameters:
280
+ *
281
+ * - `changed` - Information on the key that changed and its value prior to the change.
282
+ *
283
+ * - `local` - Whether the change originated from this client.
284
+ *
285
+ * - `target` - The {@link ISharedMap} itself.
286
+ */
348
287
  (event: "valueChanged", listener: (
349
288
  changed: IValueChanged,
350
289
  local: boolean,
351
290
  target: IEventThisPlaceHolder) => void);
291
+
292
+ /**
293
+ * Emitted when the map is cleared.
294
+ *
295
+ * @remarks Listener parameters:
296
+ *
297
+ * - `local` - Whether the clear originated from this client.
298
+ *
299
+ * - `target` - The {@link ISharedMap} itself.
300
+ */
352
301
  (event: "clear", listener: (
353
302
  local: boolean,
354
303
  target: IEventThisPlaceHolder) => void);
355
304
  }
356
305
 
357
306
  /**
358
- * Shared map interface
307
+ * The SharedMap distributed data structure can be used to store key-value pairs. It provides the same API for setting
308
+ * and retrieving values that JavaScript developers are accustomed to with the
309
+ * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map | Map} built-in object.
310
+ * However, the keys of a SharedMap must be strings, and the values must either be a JSON-serializable object or a
311
+ * {@link @fluidframework/shared-object-base#SharedObjectHandle}.
312
+ *
313
+ * For more information, including example usages, see {@link https://fluidframework.com/docs/data-structures/map/}.
359
314
  */
360
315
  export interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {
361
316
  /**
362
- * Retrieves the given key from the map.
317
+ * Retrieves the given key from the map if it exists.
363
318
  * @param key - Key to retrieve from
364
319
  * @returns The stored value, or undefined if the key is not set
365
320
  */
@@ -367,16 +322,17 @@ export interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string,
367
322
 
368
323
  /**
369
324
  * Sets the value stored at key to the provided value.
370
- * @param key - Key to set at
325
+ * @param key - Key to set
371
326
  * @param value - Value to set
372
- * @returns The ISharedMap itself
327
+ * @returns The {@link ISharedMap} itself
373
328
  */
374
329
  set<T = any>(key: string, value: T): this;
375
330
  }
376
331
 
377
332
  /**
378
333
  * The _ready-for-serialization_ format of values contained in DDS contents. This allows us to use
379
- * ISerializableValue.type to understand whether they're storing a Plain JS object, a SharedObject, or a value type.
334
+ * {@link ISerializableValue."type"} to understand whether they're storing a Plain JavaScript object,
335
+ * a {@link @fluidframework/shared-object-base#SharedObject}, or a value type.
380
336
  *
381
337
  * @remarks
382
338
  *
@@ -384,13 +340,17 @@ export interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string,
384
340
  * the _in-memory representation_ of the value instead). An ISerializableValue is what gets passed to
385
341
  * JSON.stringify and comes out of JSON.parse. This format is used both for snapshots (loadCore/populate)
386
342
  * and ops (set).
343
+ *
387
344
  * If type is Plain, it must be a plain JS object that can survive a JSON.stringify/parse. E.g. a URL object will
388
345
  * just get stringified to a URL string and not rehydrate as a URL object on the other side. It may contain members
389
346
  * that are ISerializedHandle (the serialized form of a handle).
347
+ *
390
348
  * If type is a value type then it must be amongst the types registered via registerValueType or we won't know how
391
349
  * to serialize/deserialize it (we rely on its factory via .load() and .store()). Its value will be type-dependent.
392
350
  * If type is Shared, then the in-memory value will just be a reference to the SharedObject. Its value will be a
393
- * channel ID. This type is legacy and deprecated.
351
+ * channel ID.
352
+ *
353
+ * @deprecated This type is legacy and deprecated.
394
354
  */
395
355
  export interface ISerializableValue {
396
356
  /**
@@ -404,6 +364,9 @@ export interface ISerializableValue {
404
364
  value: any;
405
365
  }
406
366
 
367
+ /**
368
+ * Serialized {@link ISerializableValue} counterpart.
369
+ */
407
370
  export interface ISerializedValue {
408
371
  /**
409
372
  * A type annotation to help indicate how the value serializes.
@@ -412,6 +375,8 @@ export interface ISerializedValue {
412
375
 
413
376
  /**
414
377
  * String representation of the value.
378
+ *
379
+ * @remarks Will be undefined if the original value was undefined.
415
380
  */
416
381
  value: string | undefined;
417
382
  }