@fluidframework/map 2.0.0-rc.2.0.2 → 2.0.0-rc.3.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 (129) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/api-report/map.api.md +17 -158
  3. package/dist/directory.d.ts +7 -51
  4. package/dist/directory.d.ts.map +1 -1
  5. package/dist/directory.js +39 -107
  6. package/dist/directory.js.map +1 -1
  7. package/dist/directoryFactory.d.ts +54 -0
  8. package/dist/directoryFactory.d.ts.map +1 -0
  9. package/dist/directoryFactory.js +91 -0
  10. package/dist/directoryFactory.js.map +1 -0
  11. package/dist/index.d.ts +3 -45
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +7 -55
  14. package/dist/index.js.map +1 -1
  15. package/dist/interfaces.d.ts +7 -57
  16. package/dist/interfaces.d.ts.map +1 -1
  17. package/dist/interfaces.js.map +1 -1
  18. package/dist/internalInterfaces.d.ts +50 -1
  19. package/dist/internalInterfaces.d.ts.map +1 -1
  20. package/dist/internalInterfaces.js.map +1 -1
  21. package/dist/legacy.d.ts +25 -0
  22. package/dist/localValues.d.ts +1 -1
  23. package/dist/localValues.d.ts.map +1 -1
  24. package/dist/localValues.js +6 -6
  25. package/dist/localValues.js.map +1 -1
  26. package/dist/map.d.ts +4 -36
  27. package/dist/map.d.ts.map +1 -1
  28. package/dist/map.js +9 -60
  29. package/dist/map.js.map +1 -1
  30. package/dist/mapFactory.d.ts +52 -0
  31. package/dist/mapFactory.d.ts.map +1 -0
  32. package/dist/mapFactory.js +71 -0
  33. package/dist/mapFactory.js.map +1 -0
  34. package/dist/mapKernel.d.ts +3 -3
  35. package/dist/mapKernel.d.ts.map +1 -1
  36. package/dist/mapKernel.js +14 -14
  37. package/dist/mapKernel.js.map +1 -1
  38. package/dist/packageVersion.d.ts +1 -1
  39. package/dist/packageVersion.js +1 -1
  40. package/dist/packageVersion.js.map +1 -1
  41. package/dist/public.d.ts +12 -0
  42. package/internal.d.ts +11 -0
  43. package/legacy.d.ts +11 -0
  44. package/lib/directory.d.ts +7 -51
  45. package/lib/directory.d.ts.map +1 -1
  46. package/lib/directory.js +6 -73
  47. package/lib/directory.js.map +1 -1
  48. package/lib/directoryFactory.d.ts +54 -0
  49. package/lib/directoryFactory.d.ts.map +1 -0
  50. package/lib/directoryFactory.js +87 -0
  51. package/lib/directoryFactory.js.map +1 -0
  52. package/lib/index.d.ts +3 -45
  53. package/lib/index.d.ts.map +1 -1
  54. package/lib/index.js +2 -50
  55. package/lib/index.js.map +1 -1
  56. package/lib/interfaces.d.ts +7 -57
  57. package/lib/interfaces.d.ts.map +1 -1
  58. package/lib/interfaces.js.map +1 -1
  59. package/lib/internalInterfaces.d.ts +50 -1
  60. package/lib/internalInterfaces.d.ts.map +1 -1
  61. package/lib/internalInterfaces.js.map +1 -1
  62. package/lib/legacy.d.ts +25 -0
  63. package/lib/localValues.d.ts +1 -1
  64. package/lib/localValues.d.ts.map +1 -1
  65. package/lib/localValues.js +1 -1
  66. package/lib/localValues.js.map +1 -1
  67. package/lib/map.d.ts +4 -36
  68. package/lib/map.d.ts.map +1 -1
  69. package/lib/map.js +4 -54
  70. package/lib/map.js.map +1 -1
  71. package/lib/mapFactory.d.ts +52 -0
  72. package/lib/mapFactory.d.ts.map +1 -0
  73. package/lib/mapFactory.js +67 -0
  74. package/lib/mapFactory.js.map +1 -0
  75. package/lib/mapKernel.d.ts +3 -3
  76. package/lib/mapKernel.d.ts.map +1 -1
  77. package/lib/mapKernel.js +2 -2
  78. package/lib/mapKernel.js.map +1 -1
  79. package/lib/packageVersion.d.ts +1 -1
  80. package/lib/packageVersion.js +1 -1
  81. package/lib/packageVersion.js.map +1 -1
  82. package/lib/public.d.ts +12 -0
  83. package/package.json +105 -59
  84. package/src/directory.ts +16 -100
  85. package/src/directoryFactory.ts +120 -0
  86. package/src/index.ts +2 -73
  87. package/src/interfaces.ts +7 -62
  88. package/src/internalInterfaces.ts +55 -2
  89. package/src/localValues.ts +6 -5
  90. package/src/map.ts +8 -71
  91. package/src/mapFactory.ts +101 -0
  92. package/src/mapKernel.ts +13 -9
  93. package/src/packageVersion.ts +1 -1
  94. package/api-extractor-cjs.json +0 -8
  95. package/dist/map-alpha.d.ts +0 -898
  96. package/dist/map-beta.d.ts +0 -195
  97. package/dist/map-public.d.ts +0 -195
  98. package/dist/map-untrimmed.d.ts +0 -912
  99. package/lib/map-alpha.d.ts +0 -898
  100. package/lib/map-beta.d.ts +0 -195
  101. package/lib/map-public.d.ts +0 -195
  102. package/lib/map-untrimmed.d.ts +0 -912
  103. package/lib/test/memory/directory.spec.js +0 -71
  104. package/lib/test/memory/directory.spec.js.map +0 -1
  105. package/lib/test/memory/map.spec.js +0 -71
  106. package/lib/test/memory/map.spec.js.map +0 -1
  107. package/lib/test/mocha/directory.order.spec.js +0 -422
  108. package/lib/test/mocha/directory.order.spec.js.map +0 -1
  109. package/lib/test/mocha/directory.snapshot.spec.js +0 -111
  110. package/lib/test/mocha/directory.snapshot.spec.js.map +0 -1
  111. package/lib/test/mocha/directory.spec.js +0 -1406
  112. package/lib/test/mocha/directory.spec.js.map +0 -1
  113. package/lib/test/mocha/directoryEquivalenceUtils.js +0 -36
  114. package/lib/test/mocha/directoryEquivalenceUtils.js.map +0 -1
  115. package/lib/test/mocha/directoryFuzzTests.spec.js +0 -337
  116. package/lib/test/mocha/directoryFuzzTests.spec.js.map +0 -1
  117. package/lib/test/mocha/dirname.cjs +0 -16
  118. package/lib/test/mocha/dirname.cjs.map +0 -1
  119. package/lib/test/mocha/map.fuzz.spec.js +0 -114
  120. package/lib/test/mocha/map.fuzz.spec.js.map +0 -1
  121. package/lib/test/mocha/map.spec.js +0 -685
  122. package/lib/test/mocha/map.spec.js.map +0 -1
  123. package/lib/test/mocha/rebasing.spec.js +0 -158
  124. package/lib/test/mocha/rebasing.spec.js.map +0 -1
  125. package/lib/test/mocha/reconnection.spec.js +0 -327
  126. package/lib/test/mocha/reconnection.spec.js.map +0 -1
  127. package/lib/test/types/validateMapPrevious.generated.js +0 -66
  128. package/lib/test/types/validateMapPrevious.generated.js.map +0 -1
  129. /package/{dist → lib}/tsdoc-metadata.json +0 -0
package/lib/map-beta.d.ts DELETED
@@ -1,195 +0,0 @@
1
- /**
2
- * The `map` library provides interfaces and implementing classes for map-like distributed data structures.
3
- *
4
- * @remarks The following distributed data structures are defined in this library:
5
- *
6
- * - {@link SharedMap}
7
- *
8
- * - {@link SharedDirectory}
9
- *
10
- * @packageDocumentation
11
- */
12
-
13
- import { IChannelAttributes } from '@fluidframework/datastore-definitions';
14
- import { IChannelFactory } from '@fluidframework/datastore-definitions';
15
- import { IChannelServices } from '@fluidframework/datastore-definitions';
16
- import { IChannelStorageService } from '@fluidframework/datastore-definitions';
17
- import { IDisposable } from '@fluidframework/core-interfaces';
18
- import { IEvent } from '@fluidframework/core-interfaces';
19
- import { IEventProvider } from '@fluidframework/core-interfaces';
20
- import { IEventThisPlaceHolder } from '@fluidframework/core-interfaces';
21
- import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
22
- import { IFluidHandle } from '@fluidframework/core-interfaces';
23
- import { IFluidSerializer } from '@fluidframework/shared-object-base';
24
- import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
25
- import { ISharedObject } from '@fluidframework/shared-object-base';
26
- import { ISharedObjectEvents } from '@fluidframework/shared-object-base';
27
- import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
28
- import { ITelemetryContext } from '@fluidframework/runtime-definitions';
29
- import { SharedObject } from '@fluidframework/shared-object-base';
30
-
31
- /* Excluded from this release type: DirectoryFactory */
32
-
33
- /* Excluded from this release type: ICreateInfo */
34
-
35
- /* Excluded from this release type: IDirectory */
36
-
37
- /* Excluded from this release type: IDirectoryClearOperation */
38
-
39
- /* Excluded from this release type: IDirectoryCreateSubDirectoryOperation */
40
-
41
- /* Excluded from this release type: IDirectoryDataObject */
42
-
43
- /* Excluded from this release type: IDirectoryDeleteOperation */
44
-
45
- /* Excluded from this release type: IDirectoryDeleteSubDirectoryOperation */
46
-
47
- /* Excluded from this release type: IDirectoryEvents */
48
-
49
- /* Excluded from this release type: IDirectoryKeyOperation */
50
-
51
- /* Excluded from this release type: IDirectoryNewStorageFormat */
52
-
53
- /* Excluded from this release type: IDirectoryOperation */
54
-
55
- /* Excluded from this release type: IDirectorySetOperation */
56
-
57
- /* Excluded from this release type: IDirectoryStorageOperation */
58
-
59
- /* Excluded from this release type: IDirectorySubDirectoryOperation */
60
-
61
- /* Excluded from this release type: IDirectoryValueChanged */
62
-
63
- /* Excluded from this release type: ILocalValue */
64
-
65
- /* Excluded from this release type: ISerializableValue */
66
-
67
- /* Excluded from this release type: ISerializedValue */
68
-
69
- /* Excluded from this release type: ISharedDirectory */
70
-
71
- /* Excluded from this release type: ISharedDirectoryEvents */
72
-
73
- /**
74
- * The SharedMap distributed data structure can be used to store key-value pairs. It provides the same API for setting
75
- * and retrieving values that JavaScript developers are accustomed to with the
76
- * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map | Map} built-in object.
77
- * However, the keys of a SharedMap must be strings, and the values must either be a JSON-serializable object or a
78
- * {@link @fluidframework/datastore#FluidObjectHandle}.
79
- *
80
- * For more information, including example usages, see {@link https://fluidframework.com/docs/data-structures/map/}.
81
- * @sealed
82
- * @public
83
- */
84
- export declare interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {
85
- /**
86
- * Retrieves the given key from the map if it exists.
87
- * @param key - Key to retrieve from
88
- * @returns The stored value, or undefined if the key is not set
89
- */
90
- get<T = any>(key: string): T | undefined;
91
- /**
92
- * Sets the value stored at key to the provided value.
93
- * @param key - Key to set
94
- * @param value - Value to set
95
- * @returns The {@link ISharedMap} itself
96
- */
97
- set<T = unknown>(key: string, value: T): this;
98
- }
99
-
100
- /**
101
- * Events emitted in response to changes to the {@link ISharedMap | map} data.
102
- * @sealed
103
- * @public
104
- */
105
- export declare interface ISharedMapEvents extends ISharedObjectEvents {
106
- /**
107
- * Emitted when a key is set or deleted.
108
- *
109
- * @remarks Listener parameters:
110
- *
111
- * - `changed` - Information on the key that changed and its value prior to the change.
112
- *
113
- * - `local` - Whether the change originated from this client.
114
- *
115
- * - `target` - The {@link ISharedMap} itself.
116
- */
117
- (event: "valueChanged", listener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): any;
118
- /**
119
- * Emitted when the map is cleared.
120
- *
121
- * @remarks Listener parameters:
122
- *
123
- * - `local` - Whether the clear originated from this client.
124
- *
125
- * - `target` - The {@link ISharedMap} itself.
126
- */
127
- (event: "clear", listener: (local: boolean, target: IEventThisPlaceHolder) => void): any;
128
- }
129
-
130
- /**
131
- * Type of "valueChanged" event parameter.
132
- * @sealed
133
- * @public
134
- */
135
- export declare interface IValueChanged {
136
- /**
137
- * The key storing the value that changed.
138
- */
139
- key: string;
140
- /**
141
- * The value that was stored at the key prior to the change.
142
- */
143
- previousValue: any;
144
- }
145
-
146
- /* Excluded from this release type: LocalValueMaker */
147
-
148
- /* Excluded from this release type: MapFactory */
149
-
150
- /* Excluded from this release type: SharedDirectory */
151
-
152
- /**
153
- * {@inheritDoc ISharedMap}
154
- * @public
155
- * @deprecated Please use SharedTree for new containers. SharedMap is supported for loading preexisting Fluid Framework 1.0 containers only.
156
- */
157
- export declare const SharedMap: {
158
- /**
159
- * Get a factory for SharedMap to register with the data store.
160
- * @returns A factory that creates SharedMaps and loads them from storage.
161
- */
162
- getFactory(): IChannelFactory<ISharedMap>;
163
- /**
164
- * Create a new shared map.
165
- * @param runtime - The data store runtime that the new shared map belongs to.
166
- * @param id - Optional name of the shared map.
167
- * @returns Newly created shared map.
168
- *
169
- * @example
170
- * To create a `SharedMap`, call the static create method:
171
- *
172
- * ```typescript
173
- * const myMap = SharedMap.create(this.runtime, id);
174
- * ```
175
- * @privateRemarks
176
- * TODO:
177
- * Clarify how this differs from `MapFactory.create`.
178
- * They are different since making this forward to MapFactory.create breaks some things,
179
- * but the difference is unclear from the documentation.
180
- */
181
- create(runtime: IFluidDataStoreRuntime, id?: string): ISharedMap;
182
- };
183
-
184
- /**
185
- * {@inheritDoc ISharedMap}
186
- * @public
187
- * @deprecated Use ISharedMap instead.
188
- * @privateRemarks
189
- * This alias is for legacy compat from when the SharedMap class was exported as public.
190
- */
191
- export declare type SharedMap = ISharedMap;
192
-
193
- /* Excluded from this release type: SharedObject */
194
-
195
- export { }
@@ -1,195 +0,0 @@
1
- /**
2
- * The `map` library provides interfaces and implementing classes for map-like distributed data structures.
3
- *
4
- * @remarks The following distributed data structures are defined in this library:
5
- *
6
- * - {@link SharedMap}
7
- *
8
- * - {@link SharedDirectory}
9
- *
10
- * @packageDocumentation
11
- */
12
-
13
- import { IChannelAttributes } from '@fluidframework/datastore-definitions';
14
- import { IChannelFactory } from '@fluidframework/datastore-definitions';
15
- import { IChannelServices } from '@fluidframework/datastore-definitions';
16
- import { IChannelStorageService } from '@fluidframework/datastore-definitions';
17
- import { IDisposable } from '@fluidframework/core-interfaces';
18
- import { IEvent } from '@fluidframework/core-interfaces';
19
- import { IEventProvider } from '@fluidframework/core-interfaces';
20
- import { IEventThisPlaceHolder } from '@fluidframework/core-interfaces';
21
- import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
22
- import { IFluidHandle } from '@fluidframework/core-interfaces';
23
- import { IFluidSerializer } from '@fluidframework/shared-object-base';
24
- import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
25
- import { ISharedObject } from '@fluidframework/shared-object-base';
26
- import { ISharedObjectEvents } from '@fluidframework/shared-object-base';
27
- import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
28
- import { ITelemetryContext } from '@fluidframework/runtime-definitions';
29
- import { SharedObject } from '@fluidframework/shared-object-base';
30
-
31
- /* Excluded from this release type: DirectoryFactory */
32
-
33
- /* Excluded from this release type: ICreateInfo */
34
-
35
- /* Excluded from this release type: IDirectory */
36
-
37
- /* Excluded from this release type: IDirectoryClearOperation */
38
-
39
- /* Excluded from this release type: IDirectoryCreateSubDirectoryOperation */
40
-
41
- /* Excluded from this release type: IDirectoryDataObject */
42
-
43
- /* Excluded from this release type: IDirectoryDeleteOperation */
44
-
45
- /* Excluded from this release type: IDirectoryDeleteSubDirectoryOperation */
46
-
47
- /* Excluded from this release type: IDirectoryEvents */
48
-
49
- /* Excluded from this release type: IDirectoryKeyOperation */
50
-
51
- /* Excluded from this release type: IDirectoryNewStorageFormat */
52
-
53
- /* Excluded from this release type: IDirectoryOperation */
54
-
55
- /* Excluded from this release type: IDirectorySetOperation */
56
-
57
- /* Excluded from this release type: IDirectoryStorageOperation */
58
-
59
- /* Excluded from this release type: IDirectorySubDirectoryOperation */
60
-
61
- /* Excluded from this release type: IDirectoryValueChanged */
62
-
63
- /* Excluded from this release type: ILocalValue */
64
-
65
- /* Excluded from this release type: ISerializableValue */
66
-
67
- /* Excluded from this release type: ISerializedValue */
68
-
69
- /* Excluded from this release type: ISharedDirectory */
70
-
71
- /* Excluded from this release type: ISharedDirectoryEvents */
72
-
73
- /**
74
- * The SharedMap distributed data structure can be used to store key-value pairs. It provides the same API for setting
75
- * and retrieving values that JavaScript developers are accustomed to with the
76
- * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map | Map} built-in object.
77
- * However, the keys of a SharedMap must be strings, and the values must either be a JSON-serializable object or a
78
- * {@link @fluidframework/datastore#FluidObjectHandle}.
79
- *
80
- * For more information, including example usages, see {@link https://fluidframework.com/docs/data-structures/map/}.
81
- * @sealed
82
- * @public
83
- */
84
- export declare interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {
85
- /**
86
- * Retrieves the given key from the map if it exists.
87
- * @param key - Key to retrieve from
88
- * @returns The stored value, or undefined if the key is not set
89
- */
90
- get<T = any>(key: string): T | undefined;
91
- /**
92
- * Sets the value stored at key to the provided value.
93
- * @param key - Key to set
94
- * @param value - Value to set
95
- * @returns The {@link ISharedMap} itself
96
- */
97
- set<T = unknown>(key: string, value: T): this;
98
- }
99
-
100
- /**
101
- * Events emitted in response to changes to the {@link ISharedMap | map} data.
102
- * @sealed
103
- * @public
104
- */
105
- export declare interface ISharedMapEvents extends ISharedObjectEvents {
106
- /**
107
- * Emitted when a key is set or deleted.
108
- *
109
- * @remarks Listener parameters:
110
- *
111
- * - `changed` - Information on the key that changed and its value prior to the change.
112
- *
113
- * - `local` - Whether the change originated from this client.
114
- *
115
- * - `target` - The {@link ISharedMap} itself.
116
- */
117
- (event: "valueChanged", listener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): any;
118
- /**
119
- * Emitted when the map is cleared.
120
- *
121
- * @remarks Listener parameters:
122
- *
123
- * - `local` - Whether the clear originated from this client.
124
- *
125
- * - `target` - The {@link ISharedMap} itself.
126
- */
127
- (event: "clear", listener: (local: boolean, target: IEventThisPlaceHolder) => void): any;
128
- }
129
-
130
- /**
131
- * Type of "valueChanged" event parameter.
132
- * @sealed
133
- * @public
134
- */
135
- export declare interface IValueChanged {
136
- /**
137
- * The key storing the value that changed.
138
- */
139
- key: string;
140
- /**
141
- * The value that was stored at the key prior to the change.
142
- */
143
- previousValue: any;
144
- }
145
-
146
- /* Excluded from this release type: LocalValueMaker */
147
-
148
- /* Excluded from this release type: MapFactory */
149
-
150
- /* Excluded from this release type: SharedDirectory */
151
-
152
- /**
153
- * {@inheritDoc ISharedMap}
154
- * @public
155
- * @deprecated Please use SharedTree for new containers. SharedMap is supported for loading preexisting Fluid Framework 1.0 containers only.
156
- */
157
- export declare const SharedMap: {
158
- /**
159
- * Get a factory for SharedMap to register with the data store.
160
- * @returns A factory that creates SharedMaps and loads them from storage.
161
- */
162
- getFactory(): IChannelFactory<ISharedMap>;
163
- /**
164
- * Create a new shared map.
165
- * @param runtime - The data store runtime that the new shared map belongs to.
166
- * @param id - Optional name of the shared map.
167
- * @returns Newly created shared map.
168
- *
169
- * @example
170
- * To create a `SharedMap`, call the static create method:
171
- *
172
- * ```typescript
173
- * const myMap = SharedMap.create(this.runtime, id);
174
- * ```
175
- * @privateRemarks
176
- * TODO:
177
- * Clarify how this differs from `MapFactory.create`.
178
- * They are different since making this forward to MapFactory.create breaks some things,
179
- * but the difference is unclear from the documentation.
180
- */
181
- create(runtime: IFluidDataStoreRuntime, id?: string): ISharedMap;
182
- };
183
-
184
- /**
185
- * {@inheritDoc ISharedMap}
186
- * @public
187
- * @deprecated Use ISharedMap instead.
188
- * @privateRemarks
189
- * This alias is for legacy compat from when the SharedMap class was exported as public.
190
- */
191
- export declare type SharedMap = ISharedMap;
192
-
193
- /* Excluded from this release type: SharedObject */
194
-
195
- export { }