@fluidframework/map 2.0.0-internal.3.0.2 → 2.0.0-internal.3.2.0

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