@fluidframework/map 2.0.0-dev.2.3.0.115467 → 2.0.0-dev.4.1.0.148229

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 (72) hide show
  1. package/.eslintrc.js +12 -14
  2. package/.mocharc.js +2 -2
  3. package/README.md +3 -3
  4. package/api-extractor.json +2 -2
  5. package/dist/directory.d.ts +38 -5
  6. package/dist/directory.d.ts.map +1 -1
  7. package/dist/directory.js +285 -88
  8. package/dist/directory.js.map +1 -1
  9. package/dist/index.d.ts +1 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/interfaces.d.ts +27 -17
  13. package/dist/interfaces.d.ts.map +1 -1
  14. package/dist/interfaces.js.map +1 -1
  15. package/dist/internalInterfaces.d.ts +39 -0
  16. package/dist/internalInterfaces.d.ts.map +1 -1
  17. package/dist/internalInterfaces.js.map +1 -1
  18. package/dist/localValues.d.ts +12 -3
  19. package/dist/localValues.d.ts.map +1 -1
  20. package/dist/localValues.js +10 -0
  21. package/dist/localValues.js.map +1 -1
  22. package/dist/map.d.ts +5 -5
  23. package/dist/map.d.ts.map +1 -1
  24. package/dist/map.js +15 -2
  25. package/dist/map.js.map +1 -1
  26. package/dist/mapKernel.d.ts +5 -5
  27. package/dist/mapKernel.d.ts.map +1 -1
  28. package/dist/mapKernel.js +58 -33
  29. package/dist/mapKernel.js.map +1 -1
  30. package/dist/packageVersion.d.ts +1 -1
  31. package/dist/packageVersion.js +1 -1
  32. package/dist/packageVersion.js.map +1 -1
  33. package/lib/directory.d.ts +38 -5
  34. package/lib/directory.d.ts.map +1 -1
  35. package/lib/directory.js +287 -90
  36. package/lib/directory.js.map +1 -1
  37. package/lib/index.d.ts +1 -1
  38. package/lib/index.d.ts.map +1 -1
  39. package/lib/index.js.map +1 -1
  40. package/lib/interfaces.d.ts +27 -17
  41. package/lib/interfaces.d.ts.map +1 -1
  42. package/lib/interfaces.js.map +1 -1
  43. package/lib/internalInterfaces.d.ts +39 -0
  44. package/lib/internalInterfaces.d.ts.map +1 -1
  45. package/lib/internalInterfaces.js.map +1 -1
  46. package/lib/localValues.d.ts +12 -3
  47. package/lib/localValues.d.ts.map +1 -1
  48. package/lib/localValues.js +10 -0
  49. package/lib/localValues.js.map +1 -1
  50. package/lib/map.d.ts +5 -5
  51. package/lib/map.d.ts.map +1 -1
  52. package/lib/map.js +16 -3
  53. package/lib/map.js.map +1 -1
  54. package/lib/mapKernel.d.ts +5 -5
  55. package/lib/mapKernel.d.ts.map +1 -1
  56. package/lib/mapKernel.js +59 -34
  57. package/lib/mapKernel.js.map +1 -1
  58. package/lib/packageVersion.d.ts +1 -1
  59. package/lib/packageVersion.js +1 -1
  60. package/lib/packageVersion.js.map +1 -1
  61. package/package.json +60 -59
  62. package/prettier.config.cjs +1 -1
  63. package/src/directory.ts +2207 -1848
  64. package/src/index.ts +1 -0
  65. package/src/interfaces.ts +309 -288
  66. package/src/internalInterfaces.ts +83 -38
  67. package/src/localValues.ts +95 -93
  68. package/src/map.ts +364 -345
  69. package/src/mapKernel.ts +729 -676
  70. package/src/packageVersion.ts +1 -1
  71. package/tsconfig.esnext.json +5 -5
  72. package/tsconfig.json +9 -15
package/src/interfaces.ts CHANGED
@@ -4,97 +4,110 @@
4
4
  */
5
5
 
6
6
  import { ISharedObject, ISharedObjectEvents } from "@fluidframework/shared-object-base";
7
- import { IDisposable, IEvent, IEventProvider, IEventThisPlaceHolder } from "@fluidframework/common-definitions";
7
+ import {
8
+ IDisposable,
9
+ IEvent,
10
+ IEventProvider,
11
+ IEventThisPlaceHolder,
12
+ } from "@fluidframework/common-definitions";
8
13
 
9
14
  /**
10
15
  * Type of "valueChanged" event parameter.
11
16
  */
12
17
  export interface IValueChanged {
13
- /**
14
- * The key storing the value that changed.
15
- */
16
- key: string;
17
-
18
- /**
19
- * The value that was stored at the key prior to the change.
20
- */
21
- previousValue: any;
18
+ /**
19
+ * The key storing the value that changed.
20
+ */
21
+ key: string;
22
+
23
+ /**
24
+ * The value that was stored at the key prior to the change.
25
+ */
26
+ // TODO: Use `unknown` instead (breaking change).
27
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
28
+ previousValue: any;
22
29
  }
23
30
 
24
31
  /**
25
32
  * Interface describing actions on a directory.
26
33
  *
27
- * @remarks
28
- * When used as a Map, operates on its keys.
34
+ * @remarks When used as a Map, operates on its keys.
29
35
  */
30
- export interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryEvents>, Partial<IDisposable> {
31
- /**
32
- * The absolute path of the directory.
33
- */
34
- readonly absolutePath: string;
35
-
36
- /**
37
- * Retrieves the value stored at the given key from the directory.
38
- * @param key - Key to retrieve from
39
- * @returns The stored value, or undefined if the key is not set
40
- */
41
- get<T = any>(key: string): T | undefined;
42
-
43
- /**
44
- * Sets the value stored at key to the provided value.
45
- * @param key - Key to set at
46
- * @param value - Value to set
47
- * @returns The IDirectory itself
48
- */
49
- set<T = any>(key: string, value: T): this;
50
-
51
- /**
52
- * Get the number of sub directory within the directory.
53
- * @returns The number of sub directory within a directory.
54
- */
55
- countSubDirectory?(): number;
56
-
57
- /**
58
- * Creates an IDirectory child of this IDirectory, or retrieves the existing IDirectory child if one with the
59
- * same name already exists.
60
- * @param subdirName - Name of the new child directory to create
61
- * @returns The IDirectory child that was created or retrieved
62
- */
63
- createSubDirectory(subdirName: string): IDirectory;
64
-
65
- /**
66
- * Gets an IDirectory child of this IDirectory, if it exists.
67
- * @param subdirName - Name of the child directory to get
68
- * @returns The requested IDirectory
69
- */
70
- getSubDirectory(subdirName: string): IDirectory | undefined;
71
-
72
- /**
73
- * Checks whether this directory has a child directory with the given name.
74
- * @param subdirName - Name of the child directory to check
75
- * @returns True if it exists, false otherwise
76
- */
77
- hasSubDirectory(subdirName: string): boolean;
78
-
79
- /**
80
- * Deletes an IDirectory child of this IDirectory, if it exists, along with all descendent keys and directories.
81
- * @param subdirName - Name of the child directory to delete
82
- * @returns True if the IDirectory existed and was deleted, false if it did not exist
83
- */
84
- deleteSubDirectory(subdirName: string): boolean;
85
-
86
- /**
87
- * Gets an iterator over the IDirectory children of this IDirectory.
88
- * @returns The IDirectory iterator
89
- */
90
- subdirectories(): IterableIterator<[string, IDirectory]>;
91
-
92
- /**
93
- * Get an IDirectory within the directory, in order to use relative paths from that location.
94
- * @param relativePath - Path of the IDirectory to get, relative to this IDirectory
95
- * @returns The requested IDirectory
96
- */
97
- getWorkingDirectory(relativePath: string): IDirectory | undefined;
36
+ // TODO: Use `unknown` instead (breaking change).
37
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
38
+ export interface IDirectory
39
+ extends Map<string, any>,
40
+ IEventProvider<IDirectoryEvents>,
41
+ Partial<IDisposable> {
42
+ /**
43
+ * The absolute path of the directory.
44
+ */
45
+ readonly absolutePath: string;
46
+
47
+ /**
48
+ * Retrieves the value stored at the given key from the directory.
49
+ * @param key - Key to retrieve from
50
+ * @returns The stored value, or undefined if the key is not set
51
+ */
52
+ // TODO: Use `unknown` instead (breaking change).
53
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
54
+ get<T = any>(key: string): T | undefined;
55
+
56
+ /**
57
+ * Sets the value stored at key to the provided value.
58
+ * @param key - Key to set at
59
+ * @param value - Value to set
60
+ * @returns The IDirectory itself
61
+ */
62
+ set<T = unknown>(key: string, value: T): this;
63
+
64
+ /**
65
+ * Get the number of sub directory within the directory.
66
+ * @returns The number of sub directory within a directory.
67
+ */
68
+ countSubDirectory?(): number;
69
+
70
+ /**
71
+ * Creates an IDirectory child of this IDirectory, or retrieves the existing IDirectory child if one with the
72
+ * same name already exists.
73
+ * @param subdirName - Name of the new child directory to create
74
+ * @returns The IDirectory child that was created or retrieved
75
+ */
76
+ createSubDirectory(subdirName: string): IDirectory;
77
+
78
+ /**
79
+ * Gets an IDirectory child of this IDirectory, if it exists.
80
+ * @param subdirName - Name of the child directory to get
81
+ * @returns The requested IDirectory
82
+ */
83
+ getSubDirectory(subdirName: string): IDirectory | undefined;
84
+
85
+ /**
86
+ * Checks whether this directory has a child directory with the given name.
87
+ * @param subdirName - Name of the child directory to check
88
+ * @returns True if it exists, false otherwise
89
+ */
90
+ hasSubDirectory(subdirName: string): boolean;
91
+
92
+ /**
93
+ * Deletes an IDirectory child of this IDirectory, if it exists, along with all descendent keys and directories.
94
+ * @param subdirName - Name of the child directory to delete
95
+ * @returns True if the IDirectory existed and was deleted, false if it did not exist
96
+ */
97
+ deleteSubDirectory(subdirName: string): boolean;
98
+
99
+ /**
100
+ * Gets an iterator over the IDirectory children of this IDirectory.
101
+ * @returns The IDirectory iterator
102
+ */
103
+ subdirectories(): IterableIterator<[string, IDirectory]>;
104
+
105
+ /**
106
+ * Get an IDirectory within the directory, in order to use relative paths from that location.
107
+ * @param relativePath - Path of the IDirectory to get, relative to this IDirectory
108
+ * @returns The requested IDirectory
109
+ */
110
+ getWorkingDirectory(relativePath: string): IDirectory | undefined;
98
111
  }
99
112
 
100
113
  /**
@@ -102,147 +115,150 @@ export interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryE
102
115
  * These events only emit on the {@link ISharedDirectory} itself, and not on subdirectories.
103
116
  */
104
117
  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
- */
118
- (event: "valueChanged", listener: (
119
- changed: IDirectoryValueChanged,
120
- local: boolean,
121
- target: IEventThisPlaceHolder,
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
- */
133
- (event: "clear", listener: (
134
- local: boolean,
135
- target: IEventThisPlaceHolder,
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
- */
150
- (event: "subDirectoryCreated", listener: (
151
- path: string,
152
- local: boolean,
153
- target: IEventThisPlaceHolder,
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
- */
168
- // eslint-disable-next-line @typescript-eslint/unified-signatures
169
- (event: "subDirectoryDeleted", listener: (
170
- path: string,
171
- local: boolean,
172
- target: IEventThisPlaceHolder,
173
- ) => void);
118
+ /**
119
+ * Emitted when a key is set or deleted. This is emitted for any key in the {@link ISharedDirectory} or any
120
+ * subdirectory.
121
+ *
122
+ * @remarks Listener parameters:
123
+ *
124
+ * - `changed` - Information on the key that changed, its value prior to the change, and the path to the
125
+ * key that changed.
126
+ *
127
+ * - `local` - Whether the change originated from this client.
128
+ *
129
+ * - `target` - The {@link ISharedDirectory} itself.
130
+ */
131
+ (
132
+ event: "valueChanged",
133
+ listener: (
134
+ changed: IDirectoryValueChanged,
135
+ local: boolean,
136
+ target: IEventThisPlaceHolder,
137
+ ) => void,
138
+ );
139
+
140
+ /**
141
+ * Emitted when the {@link ISharedDirectory} is cleared.
142
+ *
143
+ * @remarks Listener parameters:
144
+ *
145
+ * - `local` - Whether the clear originated from this client.
146
+ *
147
+ * - `target` - The {@link ISharedDirectory} itself.
148
+ */
149
+ (event: "clear", listener: (local: boolean, target: IEventThisPlaceHolder) => void);
150
+
151
+ /**
152
+ * Emitted when a subdirectory is created.
153
+ *
154
+ * @remarks Listener parameters:
155
+ *
156
+ * - `path` - The relative path to the subdirectory that is created.
157
+ * It is relative from the object which raises the event.
158
+ *
159
+ * - `local` - Whether the create originated from the this client.
160
+ *
161
+ * - `target` - The {@link ISharedDirectory} itself.
162
+ */
163
+ (
164
+ event: "subDirectoryCreated",
165
+ listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void,
166
+ );
167
+
168
+ /**
169
+ * Emitted when a subdirectory is deleted.
170
+ *
171
+ * @remarks Listener parameters:
172
+ *
173
+ * - `path` - The relative path to the subdirectory that is deleted.
174
+ * It is relative from the object which raises the event.
175
+ *
176
+ * - `local` - Whether the delete originated from the this client.
177
+ *
178
+ * - `target` - The {@link ISharedDirectory} itself.
179
+ */
180
+ (
181
+ event: "subDirectoryDeleted",
182
+ listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void,
183
+ );
174
184
  }
175
185
 
176
186
  /**
177
187
  * Events emitted in response to changes to the directory data.
178
188
  */
179
189
  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
- */
193
- (event: "containedValueChanged", listener: (
194
- changed: IValueChanged,
195
- local: boolean,
196
- target: IEventThisPlaceHolder,
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
- */
211
- (event: "subDirectoryCreated", listener: (
212
- path: string,
213
- local: boolean,
214
- target: IEventThisPlaceHolder,
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
- */
229
- // eslint-disable-next-line @typescript-eslint/unified-signatures
230
- (event: "subDirectoryDeleted", listener: (
231
- path: string,
232
- local: boolean,
233
- target: IEventThisPlaceHolder,
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
- */
243
- (event: "disposed", listener: (
244
- target: IEventThisPlaceHolder,
245
- ) => void);
190
+ /**
191
+ * Emitted when a key is set or deleted. As opposed to the
192
+ * {@link SharedDirectory}'s valueChanged event, this is emitted only on the {@link IDirectory} that directly
193
+ * contains the key.
194
+ *
195
+ * @remarks Listener parameters:
196
+ *
197
+ * - `changed` - Information on the key that changed and its value prior to the change.
198
+ *
199
+ * - `local` - Whether the change originated from this client.
200
+ *
201
+ * - `target` - The {@link IDirectory} itself.
202
+ */
203
+ (
204
+ event: "containedValueChanged",
205
+ listener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void,
206
+ );
207
+
208
+ /**
209
+ * Emitted when a subdirectory is created. Also emitted when a delete
210
+ * of a subdirectory is rolled back.
211
+ *
212
+ * @remarks Listener parameters:
213
+ *
214
+ * - `path` - The relative path to the subdirectory that is created.
215
+ * It is relative from the object which raises the event.
216
+ *
217
+ * - `local` - Whether the creation originated from the this client.
218
+ *
219
+ * - `target` - The {@link ISharedDirectory} itself.
220
+ */
221
+ (
222
+ event: "subDirectoryCreated",
223
+ listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void,
224
+ );
225
+
226
+ /**
227
+ * Emitted when a subdirectory is deleted.
228
+ *
229
+ * @remarks Listener parameters:
230
+ *
231
+ * - `path` - The relative path to the subdirectory that is deleted.
232
+ * It is relative from the object which raises the event.
233
+ *
234
+ * - `local` - Whether the delete originated from the this client.
235
+ *
236
+ * - `target` - The {@link ISharedDirectory} itself.
237
+ */
238
+ (
239
+ event: "subDirectoryDeleted",
240
+ listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void,
241
+ );
242
+
243
+ /**
244
+ * Emitted when this sub directory is deleted.
245
+ *
246
+ * @remarks Listener parameters:
247
+ *
248
+ * - `target` - The {@link IDirectory} itself.
249
+ */
250
+ (event: "disposed", listener: (target: IEventThisPlaceHolder) => void);
251
+
252
+ /**
253
+ * Emitted when this previously deleted sub directory is restored.
254
+ * This event only needs to be handled in the case of rollback. If your application does
255
+ * not use the local rollback feature, you can ignore this event.
256
+ *
257
+ * @remarks Listener parameters:
258
+ *
259
+ * - `target` - The {@link IDirectory} itself.
260
+ */
261
+ (event: "undisposed", listener: (target: IEventThisPlaceHolder) => void);
246
262
  }
247
263
 
248
264
  /**
@@ -250,57 +266,57 @@ export interface IDirectoryEvents extends IEvent {
250
266
  * The values stored within can be accessed like a map, and the hierarchy can be navigated using path syntax.
251
267
  * SubDirectories can be retrieved for use as working directories.
252
268
  */
253
- export interface ISharedDirectory extends
254
- ISharedObject<ISharedDirectoryEvents & IDirectoryEvents>,
255
- Omit<IDirectory, "on" | "once" | "off"> {
256
- // The Omit type excludes symbols, which we don't want to exclude. Adding them back here manually.
257
- // https://github.com/microsoft/TypeScript/issues/31671
258
- [Symbol.iterator](): IterableIterator<[string, any]>;
259
- readonly [Symbol.toStringTag]: string;
269
+ export interface ISharedDirectory
270
+ extends ISharedObject<ISharedDirectoryEvents & IDirectoryEvents>,
271
+ Omit<IDirectory, "on" | "once" | "off"> {
272
+ // The Omit type excludes symbols, which we don't want to exclude. Adding them back here manually.
273
+ // https://github.com/microsoft/TypeScript/issues/31671
274
+ // TODO: Use `unknown` instead (breaking change).
275
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
276
+ [Symbol.iterator](): IterableIterator<[string, any]>;
277
+ readonly [Symbol.toStringTag]: string;
260
278
  }
261
279
 
262
280
  /**
263
281
  * Type of "valueChanged" event parameter for {@link ISharedDirectory}
264
282
  */
265
283
  export interface IDirectoryValueChanged extends IValueChanged {
266
- /**
267
- * The absolute path to the IDirectory storing the key which changed.
268
- */
269
- path: string;
284
+ /**
285
+ * The absolute path to the IDirectory storing the key which changed.
286
+ */
287
+ path: string;
270
288
  }
271
289
 
272
290
  /**
273
291
  * Events emitted in response to changes to the {@link ISharedMap | map} data.
274
292
  */
275
293
  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
- */
287
- (event: "valueChanged", listener: (
288
- changed: IValueChanged,
289
- local: boolean,
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
- */
301
- (event: "clear", listener: (
302
- local: boolean,
303
- target: IEventThisPlaceHolder) => void);
294
+ /**
295
+ * Emitted when a key is set or deleted.
296
+ *
297
+ * @remarks Listener parameters:
298
+ *
299
+ * - `changed` - Information on the key that changed and its value prior to the change.
300
+ *
301
+ * - `local` - Whether the change originated from this client.
302
+ *
303
+ * - `target` - The {@link ISharedMap} itself.
304
+ */
305
+ (
306
+ event: "valueChanged",
307
+ listener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void,
308
+ );
309
+
310
+ /**
311
+ * Emitted when the map is cleared.
312
+ *
313
+ * @remarks Listener parameters:
314
+ *
315
+ * - `local` - Whether the clear originated from this client.
316
+ *
317
+ * - `target` - The {@link ISharedMap} itself.
318
+ */
319
+ (event: "clear", listener: (local: boolean, target: IEventThisPlaceHolder) => void);
304
320
  }
305
321
 
306
322
  /**
@@ -312,21 +328,25 @@ export interface ISharedMapEvents extends ISharedObjectEvents {
312
328
  *
313
329
  * For more information, including example usages, see {@link https://fluidframework.com/docs/data-structures/map/}.
314
330
  */
331
+ // TODO: Use `unknown` instead (breaking change).
332
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
315
333
  export interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {
316
- /**
317
- * Retrieves the given key from the map if it exists.
318
- * @param key - Key to retrieve from
319
- * @returns The stored value, or undefined if the key is not set
320
- */
321
- get<T = any>(key: string): T | undefined;
322
-
323
- /**
324
- * Sets the value stored at key to the provided value.
325
- * @param key - Key to set
326
- * @param value - Value to set
327
- * @returns The {@link ISharedMap} itself
328
- */
329
- set<T = any>(key: string, value: T): this;
334
+ /**
335
+ * Retrieves the given key from the map if it exists.
336
+ * @param key - Key to retrieve from
337
+ * @returns The stored value, or undefined if the key is not set
338
+ */
339
+ // TODO: Use `unknown` instead (breaking change).
340
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
341
+ get<T = any>(key: string): T | undefined;
342
+
343
+ /**
344
+ * Sets the value stored at key to the provided value.
345
+ * @param key - Key to set
346
+ * @param value - Value to set
347
+ * @returns The {@link ISharedMap} itself
348
+ */
349
+ set<T = unknown>(key: string, value: T): this;
330
350
  }
331
351
 
332
352
  /**
@@ -353,30 +373,31 @@ export interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string,
353
373
  * @deprecated This type is legacy and deprecated.
354
374
  */
355
375
  export interface ISerializableValue {
356
- /**
357
- * A type annotation to help indicate how the value serializes.
358
- */
359
- type: string;
360
-
361
- /**
362
- * The JSONable representation of the value.
363
- */
364
- value: any;
376
+ /**
377
+ * A type annotation to help indicate how the value serializes.
378
+ */
379
+ type: string;
380
+
381
+ /**
382
+ * The JSONable representation of the value.
383
+ */
384
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
385
+ value: any;
365
386
  }
366
387
 
367
388
  /**
368
389
  * Serialized {@link ISerializableValue} counterpart.
369
390
  */
370
391
  export interface ISerializedValue {
371
- /**
372
- * A type annotation to help indicate how the value serializes.
373
- */
374
- type: string;
375
-
376
- /**
377
- * String representation of the value.
378
- *
379
- * @remarks Will be undefined if the original value was undefined.
380
- */
381
- value: string | undefined;
392
+ /**
393
+ * A type annotation to help indicate how the value serializes.
394
+ */
395
+ type: string;
396
+
397
+ /**
398
+ * String representation of the value.
399
+ *
400
+ * @remarks Will be undefined if the original value was undefined.
401
+ */
402
+ value: string | undefined;
382
403
  }