@fluidframework/container-runtime-definitions 2.70.0 → 2.72.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.
- package/CHANGELOG.md +8 -15
- package/dist/containerExtension.d.ts +46 -30
- package/dist/containerExtension.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/lib/containerExtension.d.ts +46 -30
- package/lib/containerExtension.d.ts.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/package.json +13 -20
- package/src/containerExtension.ts +76 -38
- package/src/index.ts +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @fluidframework/container-runtime-definitions
|
|
2
2
|
|
|
3
|
+
## 2.72.0
|
|
4
|
+
|
|
5
|
+
Dependency updates only.
|
|
6
|
+
|
|
7
|
+
## 2.71.0
|
|
8
|
+
|
|
9
|
+
Dependency updates only.
|
|
10
|
+
|
|
3
11
|
## 2.70.0
|
|
4
12
|
|
|
5
13
|
Dependency updates only.
|
|
@@ -93,7 +101,6 @@ Dependency updates only.
|
|
|
93
101
|
parameter.
|
|
94
102
|
|
|
95
103
|
These changes were originally announced in version 0.25.0. See the following issues for more details:
|
|
96
|
-
|
|
97
104
|
- [#1537](https://github.com/microsoft/FluidFramework/issues/1537)
|
|
98
105
|
- [#2931](https://github.com/microsoft/FluidFramework/pull/2931)
|
|
99
106
|
|
|
@@ -122,7 +129,6 @@ Dependency updates only.
|
|
|
122
129
|
Similarly, `IDeltaManager.outbound` contained functionality that could break core runtime features such as generation of batches and chunking. Data loss or corruption could occur when `IDeltaManger.inbound.pause()` or `IDeltaManager.inbound.resume()` were called.
|
|
123
130
|
|
|
124
131
|
#### Alternatives
|
|
125
|
-
|
|
126
132
|
- Alternatives to `IDeltaManager.inbound.on("op", ...)` are `IDeltaManager.on("op", ...)`
|
|
127
133
|
- Alternatives to calling `IDeltaManager.inbound.pause`, `IDeltaManager.outbound.pause` for `IContainer` disconnect use `IContainer.disconnect`.
|
|
128
134
|
- Alternatives to calling `IDeltaManager.inbound.resume`, `IDeltaManager.outbound.resume` for `IContainer` reconnect use `IContainer.connect`.
|
|
@@ -163,7 +169,6 @@ Dependency updates only.
|
|
|
163
169
|
|
|
164
170
|
Make IFluidDataStoreRuntime.deltaManager have an opaque type.
|
|
165
171
|
Marks the following types which were reachable from it as alpha:
|
|
166
|
-
|
|
167
172
|
- IConnectionDetails
|
|
168
173
|
- IDeltaSender
|
|
169
174
|
- IDeltaManagerEvents
|
|
@@ -187,7 +192,6 @@ Dependency updates only.
|
|
|
187
192
|
TypeScript types and implementation code.
|
|
188
193
|
|
|
189
194
|
This means that using Fluid Framework packages require the following TypeScript settings in tsconfig.json:
|
|
190
|
-
|
|
191
195
|
- `"moduleResolution": "Node16"` with `"module": "Node16"`
|
|
192
196
|
- `"moduleResolution": "Bundler"` with `"module": "ESNext"`
|
|
193
197
|
|
|
@@ -206,26 +210,21 @@ Dependency updates only.
|
|
|
206
210
|
- container-runtime: New feature: ID compression for DataStores & DDSs ([#19859](https://github.com/microsoft/FluidFramework/issues/19859)) [51f0d3db73](https://github.com/microsoft/FluidFramework/commits/51f0d3db737800e1c30ea5e3952d38ff30ffc7da)
|
|
207
211
|
|
|
208
212
|
### Key changes
|
|
209
|
-
|
|
210
213
|
1. A new API IContainerRuntimeBase.generateDocumentUniqueId() is exposed. This API will opportunistically generate IDs in short format (non-negative numbers). If it can't achieve that, it will return UUID strings. UUIDs generated will have low entropy in groups and will compress well. It can be leveraged anywhere in container where container unique IDs are required. I.e. any place that uses uuid() and stores data in container is likely candidate to start leveraging this API.
|
|
211
214
|
2. Data store internal IDs (IDs that are auto generated by FF system) will opportunistically be generated in shorter form. Data stores created in detached container will always have short IDs, data stores created in attached container will opportunistically be short (by using newly added IContainerRuntimeBase.generateDocumentUniqueId() capability)
|
|
212
215
|
3. Similar DDS names will be opportunistically short (same considerations for detached DDS vs. attached DDS)
|
|
213
216
|
|
|
214
217
|
### Implementation details
|
|
215
|
-
|
|
216
218
|
1. Container level ID Compressor can now be enabled with delay. With such setting, only new IContainerRuntimeBase.generateDocumentUniqueId() is exposed (ID Compressor is not exposed in such case, as leveraging any of its other capabilities requires future container sessions to load ID Compressor on container load, for correctness reasons). Once Container establishes connection and any changes are made in container, newly added API will start generating more compact IDs (in most cases).
|
|
217
219
|
|
|
218
220
|
### Breaking changes
|
|
219
|
-
|
|
220
221
|
1. DDS names can no longer start with "\_" symbol - this is reserved for FF needs. I've validated that's not an issue for AzureClient (it only creates root object by name, everything else is referred by handle). Our main internal partners almost never use named DDSs (I can find only 4 instances in Loop).
|
|
221
222
|
|
|
222
223
|
### Backward compatibility considerations
|
|
223
|
-
|
|
224
224
|
1. Data store internal IDs could collide with earlier used names data stores. Earlier versions of FF framework (before DataStore aliasing feature was added) allowed customers to supply IDs for data stores. And thus, files created with earlier versions of framework could have data store IDs that will be similar to names FF will use for newly created data stores ("A", ... "Z", "a"..."z", "AA", etc.). While such collision is possible, it's very unlikely (almost impossible) if user-provided names were at least 4-5 characters long.
|
|
225
225
|
2. If application runs to these problems, or wants to reduce risks, consider disabling ID compressor via IContainerRuntimeOptions.enableRuntimeIdCompressor = "off".
|
|
226
226
|
|
|
227
227
|
### Minor changes
|
|
228
|
-
|
|
229
228
|
1. IContainerRuntime.createDetachedRootDataStore() is removed. Please use IContainerRuntime.createDetachedDataStore and IDataStore.trySetAlias() instead
|
|
230
229
|
2. IContainerRuntimeOptions.enableRuntimeIdCompressor has been changes from boolean to tri-state.
|
|
231
230
|
|
|
@@ -244,7 +243,6 @@ Dependency updates only.
|
|
|
244
243
|
- Updated server dependencies ([#19122](https://github.com/microsoft/FluidFramework/issues/19122)) [25366b4229](https://github.com/microsoft/FluidFramework/commits/25366b422918cb43685c5f328b50450749592902)
|
|
245
244
|
|
|
246
245
|
The following Fluid server dependencies have been updated to the latest version, 3.0.0. [See the full changelog.](https://github.com/microsoft/FluidFramework/releases/tag/server_v3.0.0)
|
|
247
|
-
|
|
248
246
|
- @fluidframework/gitresources
|
|
249
247
|
- @fluidframework/server-kafka-orderer
|
|
250
248
|
- @fluidframework/server-lambdas
|
|
@@ -313,7 +311,6 @@ Dependency updates only.
|
|
|
313
311
|
- Dependencies on @fluidframework/protocol-definitions package updated to 3.0.0 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
314
312
|
|
|
315
313
|
This included the following changes from the protocol-definitions release:
|
|
316
|
-
|
|
317
314
|
- Updating signal interfaces for some planned improvements. The intention is split the interface between signals
|
|
318
315
|
submitted by clients to the server and the resulting signals sent from the server to clients.
|
|
319
316
|
- A new optional type member is available on the ISignalMessage interface and a new ISentSignalMessage interface has
|
|
@@ -328,7 +325,6 @@ Dependency updates only.
|
|
|
328
325
|
- DEPRECATED: resolveHandle and IFluidHandleContext deprecated on IContainerRuntime [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
329
326
|
|
|
330
327
|
The `resolveHandle(...)` and `get IFluidHandleContext()` methods have been deprecated on the following interfaces:
|
|
331
|
-
|
|
332
328
|
- `IContainerRuntime`
|
|
333
329
|
- `IContainerRuntimeBase`
|
|
334
330
|
|
|
@@ -339,7 +335,6 @@ Dependency updates only.
|
|
|
339
335
|
- Server upgrade: dependencies on Fluid server packages updated to 2.0.1 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
340
336
|
|
|
341
337
|
Dependencies on the following Fluid server package have been updated to version 2.0.1:
|
|
342
|
-
|
|
343
338
|
- @fluidframework/gitresources: 2.0.1
|
|
344
339
|
- @fluidframework/server-kafka-orderer: 2.0.1
|
|
345
340
|
- @fluidframework/server-lambdas: 2.0.1
|
|
@@ -385,7 +380,6 @@ Dependency updates only.
|
|
|
385
380
|
|
|
386
381
|
The **@fluidframework/common-definitions** package is being deprecated, so the following interfaces and types are now
|
|
387
382
|
imported from the **@fluidframework/core-interfaces** package:
|
|
388
|
-
|
|
389
383
|
- interface IDisposable
|
|
390
384
|
- interface IErrorEvent
|
|
391
385
|
- interface IErrorEvent
|
|
@@ -450,7 +444,6 @@ Dependency updates only.
|
|
|
450
444
|
### Major Changes
|
|
451
445
|
|
|
452
446
|
- The following functions and classes were deprecated in previous releases and have been removed: [8b242fdc79](https://github.com/microsoft/FluidFramework/commits/8b242fdc796714cf1da9ad3f90d02efb122af0c2)
|
|
453
|
-
|
|
454
447
|
- `PureDataObject.getFluidObjectFromDirectory`
|
|
455
448
|
- `IProvideContainerRuntime` and its `IContainerRuntime` member.
|
|
456
449
|
- `ContainerRuntime`'s `IProvideContainerRuntime` has also been removed.
|
|
@@ -6,6 +6,7 @@ import type { ILayerCompatDetails } from "@fluid-internal/client-utils";
|
|
|
6
6
|
import type { IAudience } from "@fluidframework/container-definitions/internal";
|
|
7
7
|
import type { BrandedType, InternalUtilityTypes, ITelemetryBaseLogger, JsonDeserialized, JsonSerializable, Listenable, OpaqueJsonDeserialized, TypedMessage } from "@fluidframework/core-interfaces/internal";
|
|
8
8
|
import type { IQuorumClients } from "@fluidframework/driver-definitions/internal";
|
|
9
|
+
import type { ContainerExtensionId, ContainerExtensionExpectations, ExtensionCompatibilityDetails, UnknownExtensionInstantiation } from "@fluidframework/runtime-definitions/internal";
|
|
9
10
|
/**
|
|
10
11
|
* While connected, the id of a client within a session.
|
|
11
12
|
*
|
|
@@ -136,12 +137,37 @@ export type InboundExtensionMessage<TMessage extends TypedMessage = TypedMessage
|
|
|
136
137
|
export interface ExtensionRuntimeProperties {
|
|
137
138
|
SignalMessages: TypedMessage;
|
|
138
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* Collection of properties resulting from instantiating an extension via its
|
|
142
|
+
* factory.
|
|
143
|
+
*
|
|
144
|
+
* @remarks
|
|
145
|
+
* All of the members are mutable to allow for handling version or capability
|
|
146
|
+
* mismatches via replacement of interface or extension instances. That is the
|
|
147
|
+
* only time mutation is expected to occur.
|
|
148
|
+
*
|
|
149
|
+
* @internal
|
|
150
|
+
*/
|
|
151
|
+
export interface ExtensionInstantiationResult<TInterface, TRuntimeProperties extends ExtensionRuntimeProperties, TUseContext extends unknown[]> extends UnknownExtensionInstantiation {
|
|
152
|
+
interface: TInterface;
|
|
153
|
+
extension: ContainerExtension<TRuntimeProperties, TUseContext>;
|
|
154
|
+
}
|
|
139
155
|
/**
|
|
140
156
|
* Defines requirements for a component to register with container as an extension.
|
|
141
157
|
*
|
|
142
158
|
* @internal
|
|
143
159
|
*/
|
|
144
160
|
export interface ContainerExtension<TRuntimeProperties extends ExtensionRuntimeProperties, TUseContext extends unknown[] = []> {
|
|
161
|
+
/**
|
|
162
|
+
* Called when a new request is made for an extension with different version
|
|
163
|
+
* or capabilities than were registered for this extension instance.
|
|
164
|
+
*
|
|
165
|
+
* @typeParam TInterface - interface type of new request
|
|
166
|
+
*
|
|
167
|
+
* @param thisExistingInstantiation - registration of this extension in store
|
|
168
|
+
* @param newCompatibilityRequest - compatibility details of the new request
|
|
169
|
+
*/
|
|
170
|
+
handleVersionOrCapabilitiesMismatch<TRequestedInterface>(thisExistingInstantiation: Readonly<ExtensionInstantiationResult<unknown, TRuntimeProperties, TUseContext>>, newCompatibilityRequest: ExtensionCompatibilityDetails): Readonly<ExtensionInstantiationResult<TRequestedInterface, TRuntimeProperties, TUseContext>>;
|
|
145
171
|
/**
|
|
146
172
|
* Notifies the extension of a new use context.
|
|
147
173
|
*
|
|
@@ -259,43 +285,32 @@ export interface ExtensionHost<TRuntimeProperties extends ExtensionRuntimeProper
|
|
|
259
285
|
* Factory method to create an extension instance.
|
|
260
286
|
*
|
|
261
287
|
* Any such method provided to {@link ContainerExtensionStore.acquireExtension}
|
|
262
|
-
* must use the same value for a given {@link ContainerExtensionId} so that an
|
|
288
|
+
* must use the same value for a given {@link @fluidframework/runtime-definitions#ContainerExtensionId} so that an
|
|
263
289
|
* `instanceof` check may be performed at runtime.
|
|
264
290
|
*
|
|
265
291
|
* @typeParam T - Type of extension to create
|
|
266
292
|
* @typeParam TRuntimeProperties - Extension runtime properties
|
|
267
293
|
* @typeParam TUseContext - Array of custom use context passed to factory or onNewUse
|
|
268
294
|
*
|
|
269
|
-
* @param host - Host runtime for extension to work against
|
|
270
|
-
* @param useContext - Custom use context for extension.
|
|
271
|
-
* @returns Record providing:
|
|
272
|
-
* `interface` instance (type `T`) that is provided to caller of
|
|
273
|
-
* {@link ContainerExtensionStore.acquireExtension} and
|
|
274
|
-
* `extension` store/runtime uses to interact with extension.
|
|
275
|
-
*
|
|
276
|
-
* @internal
|
|
277
|
-
*/
|
|
278
|
-
export type ContainerExtensionFactory<T, TRuntimeProperties extends ExtensionRuntimeProperties, TUseContext extends unknown[] = []> = new (host: ExtensionHost<TRuntimeProperties>, ...useContext: TUseContext) => {
|
|
279
|
-
readonly interface: T;
|
|
280
|
-
readonly extension: ContainerExtension<TRuntimeProperties, TUseContext>;
|
|
281
|
-
};
|
|
282
|
-
/**
|
|
283
|
-
* Unique identifier for extension
|
|
284
|
-
*
|
|
285
|
-
* @remarks
|
|
286
|
-
* A string known to all clients working with a certain ContainerExtension and unique
|
|
287
|
-
* among ContainerExtensions. Not `/` may be used in the string. Recommend using
|
|
288
|
-
* concatenation of: type of unique identifier, `:` (required), and unique identifier.
|
|
289
|
-
*
|
|
290
|
-
* @example Examples
|
|
291
|
-
* ```typescript
|
|
292
|
-
* "guid:g0fl001d-1415-5000-c00l-g0fa54g0b1g1"
|
|
293
|
-
* "name:@foo-scope_bar:v1"
|
|
294
|
-
* ```
|
|
295
|
-
*
|
|
296
295
|
* @internal
|
|
297
296
|
*/
|
|
298
|
-
export
|
|
297
|
+
export interface ContainerExtensionFactory<TInterface, TRuntimeProperties extends ExtensionRuntimeProperties, TUseContext extends unknown[] = []> extends ContainerExtensionExpectations {
|
|
298
|
+
resolvePriorInstantiation(priorInstantiation: UnknownExtensionInstantiation): Readonly<ExtensionInstantiationResult<TInterface, TRuntimeProperties, TUseContext>>;
|
|
299
|
+
/**
|
|
300
|
+
* @param host - Host runtime for extension to work against
|
|
301
|
+
* @param useContext - Custom use context for extension.
|
|
302
|
+
* @returns Record providing:
|
|
303
|
+
* `interface` instance (type `T`) that is provided to caller of
|
|
304
|
+
* {@link ContainerExtensionStore.acquireExtension} and
|
|
305
|
+
* `extension` store/runtime uses to interact with extension.
|
|
306
|
+
*/
|
|
307
|
+
instantiateExtension(host: ExtensionHost<TRuntimeProperties>, ...useContext: TUseContext): ExtensionInstantiationResult<TInterface, TRuntimeProperties, TUseContext>;
|
|
308
|
+
/**
|
|
309
|
+
* Determines if an `ExtensionInstantiationResult` came from `instantiateExtension`.
|
|
310
|
+
* Called by the semantics of the instanceof operator.
|
|
311
|
+
*/
|
|
312
|
+
[Symbol.hasInstance]: (instance: unknown) => instance is ExtensionInstantiationResult<TInterface, TRuntimeProperties, TUseContext>;
|
|
313
|
+
}
|
|
299
314
|
/**
|
|
300
315
|
* @sealed
|
|
301
316
|
* @internal
|
|
@@ -306,8 +321,9 @@ export interface ContainerExtensionStore {
|
|
|
306
321
|
*
|
|
307
322
|
* @param id - Identifier for the requested extension
|
|
308
323
|
* @param factory - Factory to create the extension if not found
|
|
324
|
+
* @param context - Custom use context for extension
|
|
309
325
|
* @returns The extension
|
|
310
326
|
*/
|
|
311
|
-
acquireExtension<
|
|
327
|
+
acquireExtension<TInterface, TRuntimeProperties extends ExtensionRuntimeProperties, TUseContext extends unknown[] = []>(id: ContainerExtensionId, factory: ContainerExtensionFactory<TInterface, TRuntimeProperties, TUseContext>, ...context: TUseContext): TInterface;
|
|
312
328
|
}
|
|
313
329
|
//# sourceMappingURL=containerExtension.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerExtension.d.ts","sourceRoot":"","sources":["../src/containerExtension.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAA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EvF;;;;;;;OAOG;IACH,oBAAoB,CACnB,IAAI,EAAE,aAAa,CAAC,kBAAkB,CAAC,EACvC,GAAG,UAAU,EAAE,WAAW,GACxB,4BAA4B,CAAC,UAAU,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC;IAE7E;;;OAGG;IACH,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CACrB,QAAQ,EAAE,OAAO,KACb,QAAQ,IAAI,4BAA4B,CAAC,UAAU,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC;CAC3F;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACvC;;;;;;;OAOG;IACH,gBAAgB,CACf,UAAU,EACV,kBAAkB,SAAS,0BAA0B,EACrD,WAAW,SAAS,OAAO,EAAE,GAAG,EAAE,EAElC,EAAE,EAAE,oBAAoB,EACxB,OAAO,EAAE,yBAAyB,CAAC,UAAU,EAAE,kBAAkB,EAAE,WAAW,CAAC,EAC/E,GAAG,OAAO,EAAE,WAAW,GACrB,UAAU,CAAC;CACd"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export type {
|
|
5
|
+
export type { ContainerExtensionId, ExtensionCompatibilityDetails, } from "@fluidframework/runtime-definitions/internal";
|
|
6
|
+
export type { ClientConnectionId, ContainerExtensionFactory, ContainerExtensionStore, ContainerExtension, ExtensionHost, ExtensionHostEvents, ExtensionInstantiationResult, ExtensionMessage, ExtensionRuntimeProperties, InboundExtensionMessage, JoinedStatus, JoinedStatus_disconnected, JoinedStatus_joinedForReading, JoinedStatus_joinedForWriting, OutboundExtensionMessage, RawInboundExtensionMessage, UnverifiedBrand, VerifiedInboundExtensionMessage, } from "./containerExtension.js";
|
|
6
7
|
export type { IContainerRuntime, IContainerRuntimeBaseWithCombinedEvents, IContainerRuntimeEvents, IContainerRuntimeInternal, IContainerRuntimeWithResolveHandle_Deprecated, SummarizerStopReason, ISummarizeEventProps, ISummarizerObservabilityProps, ISummarizerEvents, } from "./containerRuntime.js";
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,YAAY,EACX,oBAAoB,EACpB,6BAA6B,GAC7B,MAAM,8CAA8C,CAAC;AACtD,YAAY,EACX,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,4BAA4B,EAC5B,gBAAgB,EAChB,0BAA0B,EAC1B,uBAAuB,EACvB,YAAY,EACZ,yBAAyB,EACzB,6BAA6B,EAC7B,6BAA6B,EAC7B,wBAAwB,EACxB,0BAA0B,EAC1B,eAAe,EACf,+BAA+B,GAC/B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACX,iBAAiB,EACjB,uCAAuC,EACvC,uBAAuB,EACvB,yBAAyB,EACzB,6CAA6C,EAC7C,oBAAoB,EACpB,oBAAoB,EACpB,6BAA6B,EAC7B,iBAAiB,GACjB,MAAM,uBAAuB,CAAC"}
|
|
@@ -6,6 +6,7 @@ import type { ILayerCompatDetails } from "@fluid-internal/client-utils";
|
|
|
6
6
|
import type { IAudience } from "@fluidframework/container-definitions/internal";
|
|
7
7
|
import type { BrandedType, InternalUtilityTypes, ITelemetryBaseLogger, JsonDeserialized, JsonSerializable, Listenable, OpaqueJsonDeserialized, TypedMessage } from "@fluidframework/core-interfaces/internal";
|
|
8
8
|
import type { IQuorumClients } from "@fluidframework/driver-definitions/internal";
|
|
9
|
+
import type { ContainerExtensionId, ContainerExtensionExpectations, ExtensionCompatibilityDetails, UnknownExtensionInstantiation } from "@fluidframework/runtime-definitions/internal";
|
|
9
10
|
/**
|
|
10
11
|
* While connected, the id of a client within a session.
|
|
11
12
|
*
|
|
@@ -136,12 +137,37 @@ export type InboundExtensionMessage<TMessage extends TypedMessage = TypedMessage
|
|
|
136
137
|
export interface ExtensionRuntimeProperties {
|
|
137
138
|
SignalMessages: TypedMessage;
|
|
138
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* Collection of properties resulting from instantiating an extension via its
|
|
142
|
+
* factory.
|
|
143
|
+
*
|
|
144
|
+
* @remarks
|
|
145
|
+
* All of the members are mutable to allow for handling version or capability
|
|
146
|
+
* mismatches via replacement of interface or extension instances. That is the
|
|
147
|
+
* only time mutation is expected to occur.
|
|
148
|
+
*
|
|
149
|
+
* @internal
|
|
150
|
+
*/
|
|
151
|
+
export interface ExtensionInstantiationResult<TInterface, TRuntimeProperties extends ExtensionRuntimeProperties, TUseContext extends unknown[]> extends UnknownExtensionInstantiation {
|
|
152
|
+
interface: TInterface;
|
|
153
|
+
extension: ContainerExtension<TRuntimeProperties, TUseContext>;
|
|
154
|
+
}
|
|
139
155
|
/**
|
|
140
156
|
* Defines requirements for a component to register with container as an extension.
|
|
141
157
|
*
|
|
142
158
|
* @internal
|
|
143
159
|
*/
|
|
144
160
|
export interface ContainerExtension<TRuntimeProperties extends ExtensionRuntimeProperties, TUseContext extends unknown[] = []> {
|
|
161
|
+
/**
|
|
162
|
+
* Called when a new request is made for an extension with different version
|
|
163
|
+
* or capabilities than were registered for this extension instance.
|
|
164
|
+
*
|
|
165
|
+
* @typeParam TInterface - interface type of new request
|
|
166
|
+
*
|
|
167
|
+
* @param thisExistingInstantiation - registration of this extension in store
|
|
168
|
+
* @param newCompatibilityRequest - compatibility details of the new request
|
|
169
|
+
*/
|
|
170
|
+
handleVersionOrCapabilitiesMismatch<TRequestedInterface>(thisExistingInstantiation: Readonly<ExtensionInstantiationResult<unknown, TRuntimeProperties, TUseContext>>, newCompatibilityRequest: ExtensionCompatibilityDetails): Readonly<ExtensionInstantiationResult<TRequestedInterface, TRuntimeProperties, TUseContext>>;
|
|
145
171
|
/**
|
|
146
172
|
* Notifies the extension of a new use context.
|
|
147
173
|
*
|
|
@@ -259,43 +285,32 @@ export interface ExtensionHost<TRuntimeProperties extends ExtensionRuntimeProper
|
|
|
259
285
|
* Factory method to create an extension instance.
|
|
260
286
|
*
|
|
261
287
|
* Any such method provided to {@link ContainerExtensionStore.acquireExtension}
|
|
262
|
-
* must use the same value for a given {@link ContainerExtensionId} so that an
|
|
288
|
+
* must use the same value for a given {@link @fluidframework/runtime-definitions#ContainerExtensionId} so that an
|
|
263
289
|
* `instanceof` check may be performed at runtime.
|
|
264
290
|
*
|
|
265
291
|
* @typeParam T - Type of extension to create
|
|
266
292
|
* @typeParam TRuntimeProperties - Extension runtime properties
|
|
267
293
|
* @typeParam TUseContext - Array of custom use context passed to factory or onNewUse
|
|
268
294
|
*
|
|
269
|
-
* @param host - Host runtime for extension to work against
|
|
270
|
-
* @param useContext - Custom use context for extension.
|
|
271
|
-
* @returns Record providing:
|
|
272
|
-
* `interface` instance (type `T`) that is provided to caller of
|
|
273
|
-
* {@link ContainerExtensionStore.acquireExtension} and
|
|
274
|
-
* `extension` store/runtime uses to interact with extension.
|
|
275
|
-
*
|
|
276
|
-
* @internal
|
|
277
|
-
*/
|
|
278
|
-
export type ContainerExtensionFactory<T, TRuntimeProperties extends ExtensionRuntimeProperties, TUseContext extends unknown[] = []> = new (host: ExtensionHost<TRuntimeProperties>, ...useContext: TUseContext) => {
|
|
279
|
-
readonly interface: T;
|
|
280
|
-
readonly extension: ContainerExtension<TRuntimeProperties, TUseContext>;
|
|
281
|
-
};
|
|
282
|
-
/**
|
|
283
|
-
* Unique identifier for extension
|
|
284
|
-
*
|
|
285
|
-
* @remarks
|
|
286
|
-
* A string known to all clients working with a certain ContainerExtension and unique
|
|
287
|
-
* among ContainerExtensions. Not `/` may be used in the string. Recommend using
|
|
288
|
-
* concatenation of: type of unique identifier, `:` (required), and unique identifier.
|
|
289
|
-
*
|
|
290
|
-
* @example Examples
|
|
291
|
-
* ```typescript
|
|
292
|
-
* "guid:g0fl001d-1415-5000-c00l-g0fa54g0b1g1"
|
|
293
|
-
* "name:@foo-scope_bar:v1"
|
|
294
|
-
* ```
|
|
295
|
-
*
|
|
296
295
|
* @internal
|
|
297
296
|
*/
|
|
298
|
-
export
|
|
297
|
+
export interface ContainerExtensionFactory<TInterface, TRuntimeProperties extends ExtensionRuntimeProperties, TUseContext extends unknown[] = []> extends ContainerExtensionExpectations {
|
|
298
|
+
resolvePriorInstantiation(priorInstantiation: UnknownExtensionInstantiation): Readonly<ExtensionInstantiationResult<TInterface, TRuntimeProperties, TUseContext>>;
|
|
299
|
+
/**
|
|
300
|
+
* @param host - Host runtime for extension to work against
|
|
301
|
+
* @param useContext - Custom use context for extension.
|
|
302
|
+
* @returns Record providing:
|
|
303
|
+
* `interface` instance (type `T`) that is provided to caller of
|
|
304
|
+
* {@link ContainerExtensionStore.acquireExtension} and
|
|
305
|
+
* `extension` store/runtime uses to interact with extension.
|
|
306
|
+
*/
|
|
307
|
+
instantiateExtension(host: ExtensionHost<TRuntimeProperties>, ...useContext: TUseContext): ExtensionInstantiationResult<TInterface, TRuntimeProperties, TUseContext>;
|
|
308
|
+
/**
|
|
309
|
+
* Determines if an `ExtensionInstantiationResult` came from `instantiateExtension`.
|
|
310
|
+
* Called by the semantics of the instanceof operator.
|
|
311
|
+
*/
|
|
312
|
+
[Symbol.hasInstance]: (instance: unknown) => instance is ExtensionInstantiationResult<TInterface, TRuntimeProperties, TUseContext>;
|
|
313
|
+
}
|
|
299
314
|
/**
|
|
300
315
|
* @sealed
|
|
301
316
|
* @internal
|
|
@@ -306,8 +321,9 @@ export interface ContainerExtensionStore {
|
|
|
306
321
|
*
|
|
307
322
|
* @param id - Identifier for the requested extension
|
|
308
323
|
* @param factory - Factory to create the extension if not found
|
|
324
|
+
* @param context - Custom use context for extension
|
|
309
325
|
* @returns The extension
|
|
310
326
|
*/
|
|
311
|
-
acquireExtension<
|
|
327
|
+
acquireExtension<TInterface, TRuntimeProperties extends ExtensionRuntimeProperties, TUseContext extends unknown[] = []>(id: ContainerExtensionId, factory: ContainerExtensionFactory<TInterface, TRuntimeProperties, TUseContext>, ...context: TUseContext): TInterface;
|
|
312
328
|
}
|
|
313
329
|
//# sourceMappingURL=containerExtension.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerExtension.d.ts","sourceRoot":"","sources":["../src/containerExtension.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"containerExtension.d.ts","sourceRoot":"","sources":["../src/containerExtension.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,KAAK,EACX,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,sBAAsB,EACtB,YAAY,EACZ,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,KAAK,EACX,oBAAoB,EACpB,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC7B,MAAM,8CAA8C,CAAC;AAEtD;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAExC;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,CAC3B,QAAQ,SAAS,YAAY,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,gBAAgB,CAAC,OAAO,CAAC,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E,IAAI,CAAC;IAEV;;;OAGG;IACH,SAAS,EAAE,MAAM,cAAc,CAAC;IAEhC;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,SAAS,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,yBAAyB,CACzC,UAAU,EACV,kBAAkB,SAAS,0BAA0B,EACrD,WAAW,SAAS,OAAO,EAAE,GAAG,EAAE,CACjC,SAAQ,8BAA8B;IACvC,yBAAyB,CACxB,kBAAkB,EAAE,6BAA6B,GAC/C,QAAQ,CAAC,4BAA4B,CAAC,UAAU,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC,CAAC;IAEvF;;;;;;;OAOG;IACH,oBAAoB,CACnB,IAAI,EAAE,aAAa,CAAC,kBAAkB,CAAC,EACvC,GAAG,UAAU,EAAE,WAAW,GACxB,4BAA4B,CAAC,UAAU,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC;IAE7E;;;OAGG;IACH,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CACrB,QAAQ,EAAE,OAAO,KACb,QAAQ,IAAI,4BAA4B,CAAC,UAAU,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC;CAC3F;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACvC;;;;;;;OAOG;IACH,gBAAgB,CACf,UAAU,EACV,kBAAkB,SAAS,0BAA0B,EACrD,WAAW,SAAS,OAAO,EAAE,GAAG,EAAE,EAElC,EAAE,EAAE,oBAAoB,EACxB,OAAO,EAAE,yBAAyB,CAAC,UAAU,EAAE,kBAAkB,EAAE,WAAW,CAAC,EAC/E,GAAG,OAAO,EAAE,WAAW,GACrB,UAAU,CAAC;CACd"}
|
package/lib/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export type {
|
|
5
|
+
export type { ContainerExtensionId, ExtensionCompatibilityDetails, } from "@fluidframework/runtime-definitions/internal";
|
|
6
|
+
export type { ClientConnectionId, ContainerExtensionFactory, ContainerExtensionStore, ContainerExtension, ExtensionHost, ExtensionHostEvents, ExtensionInstantiationResult, ExtensionMessage, ExtensionRuntimeProperties, InboundExtensionMessage, JoinedStatus, JoinedStatus_disconnected, JoinedStatus_joinedForReading, JoinedStatus_joinedForWriting, OutboundExtensionMessage, RawInboundExtensionMessage, UnverifiedBrand, VerifiedInboundExtensionMessage, } from "./containerExtension.js";
|
|
6
7
|
export type { IContainerRuntime, IContainerRuntimeBaseWithCombinedEvents, IContainerRuntimeEvents, IContainerRuntimeInternal, IContainerRuntimeWithResolveHandle_Deprecated, SummarizerStopReason, ISummarizeEventProps, ISummarizerObservabilityProps, ISummarizerEvents, } from "./containerRuntime.js";
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,YAAY,EACX,oBAAoB,EACpB,6BAA6B,GAC7B,MAAM,8CAA8C,CAAC;AACtD,YAAY,EACX,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,4BAA4B,EAC5B,gBAAgB,EAChB,0BAA0B,EAC1B,uBAAuB,EACvB,YAAY,EACZ,yBAAyB,EACzB,6BAA6B,EAC7B,6BAA6B,EAC7B,wBAAwB,EACxB,0BAA0B,EAC1B,eAAe,EACf,+BAA+B,GAC/B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACX,iBAAiB,EACjB,uCAAuC,EACvC,uBAAuB,EACvB,yBAAyB,EACzB,6CAA6C,EAC7C,oBAAoB,EACpB,oBAAoB,EACpB,6BAA6B,EAC7B,iBAAiB,GACjB,MAAM,uBAAuB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/container-runtime-definitions",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.72.0",
|
|
4
4
|
"description": "Fluid Runtime definitions",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -41,20 +41,20 @@
|
|
|
41
41
|
"main": "",
|
|
42
42
|
"types": "lib/public.d.ts",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@fluid-internal/client-utils": "~2.
|
|
45
|
-
"@fluidframework/container-definitions": "~2.
|
|
46
|
-
"@fluidframework/core-interfaces": "~2.
|
|
47
|
-
"@fluidframework/driver-definitions": "~2.
|
|
48
|
-
"@fluidframework/runtime-definitions": "~2.
|
|
44
|
+
"@fluid-internal/client-utils": "~2.72.0",
|
|
45
|
+
"@fluidframework/container-definitions": "~2.72.0",
|
|
46
|
+
"@fluidframework/core-interfaces": "~2.72.0",
|
|
47
|
+
"@fluidframework/driver-definitions": "~2.72.0",
|
|
48
|
+
"@fluidframework/runtime-definitions": "~2.72.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
52
52
|
"@biomejs/biome": "~1.9.3",
|
|
53
|
-
"@fluid-tools/build-cli": "^0.
|
|
53
|
+
"@fluid-tools/build-cli": "^0.60.0",
|
|
54
54
|
"@fluidframework/build-common": "^2.0.3",
|
|
55
|
-
"@fluidframework/build-tools": "^0.
|
|
56
|
-
"@fluidframework/container-runtime-definitions-previous": "npm:@fluidframework/container-runtime-definitions@2.
|
|
57
|
-
"@fluidframework/eslint-config-fluid": "
|
|
55
|
+
"@fluidframework/build-tools": "^0.60.0",
|
|
56
|
+
"@fluidframework/container-runtime-definitions-previous": "npm:@fluidframework/container-runtime-definitions@2.71.0",
|
|
57
|
+
"@fluidframework/eslint-config-fluid": "~2.72.0",
|
|
58
58
|
"@microsoft/api-extractor": "7.52.11",
|
|
59
59
|
"concurrently": "^8.2.1",
|
|
60
60
|
"copyfiles": "^2.4.1",
|
|
@@ -63,14 +63,7 @@
|
|
|
63
63
|
"typescript": "~5.4.5"
|
|
64
64
|
},
|
|
65
65
|
"typeValidation": {
|
|
66
|
-
"broken": {
|
|
67
|
-
"Interface_IContainerRuntime": {
|
|
68
|
-
"backCompat": false
|
|
69
|
-
},
|
|
70
|
-
"Interface_IContainerRuntimeWithResolveHandle_Deprecated": {
|
|
71
|
-
"backCompat": false
|
|
72
|
-
}
|
|
73
|
-
},
|
|
66
|
+
"broken": {},
|
|
74
67
|
"entrypoint": "legacy"
|
|
75
68
|
},
|
|
76
69
|
"scripts": {
|
|
@@ -101,8 +94,8 @@
|
|
|
101
94
|
"ci:build:api-reports:legacy": "api-extractor run --config api-extractor/api-extractor.legacy.json",
|
|
102
95
|
"ci:build:docs": "api-extractor run",
|
|
103
96
|
"clean": "rimraf --glob dist lib {alpha,beta,internal,legacy}.d.ts \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp",
|
|
104
|
-
"eslint": "eslint --format stylish src",
|
|
105
|
-
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
97
|
+
"eslint": "eslint --quiet --format stylish src",
|
|
98
|
+
"eslint:fix": "eslint --quiet --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
106
99
|
"format": "npm run format:biome",
|
|
107
100
|
"format:biome": "biome check . --write",
|
|
108
101
|
"lint": "fluid-build . --task lint",
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
import type { ILayerCompatDetails } from "@fluid-internal/client-utils";
|
|
7
7
|
import type { IAudience } from "@fluidframework/container-definitions/internal";
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-imports -- BrandedType is a class declaration only
|
|
9
8
|
import type {
|
|
10
9
|
BrandedType,
|
|
11
10
|
InternalUtilityTypes,
|
|
@@ -17,6 +16,12 @@ import type {
|
|
|
17
16
|
TypedMessage,
|
|
18
17
|
} from "@fluidframework/core-interfaces/internal";
|
|
19
18
|
import type { IQuorumClients } from "@fluidframework/driver-definitions/internal";
|
|
19
|
+
import type {
|
|
20
|
+
ContainerExtensionId,
|
|
21
|
+
ContainerExtensionExpectations,
|
|
22
|
+
ExtensionCompatibilityDetails,
|
|
23
|
+
UnknownExtensionInstantiation,
|
|
24
|
+
} from "@fluidframework/runtime-definitions/internal";
|
|
20
25
|
|
|
21
26
|
/**
|
|
22
27
|
* While connected, the id of a client within a session.
|
|
@@ -180,6 +185,26 @@ export interface ExtensionRuntimeProperties {
|
|
|
180
185
|
SignalMessages: TypedMessage;
|
|
181
186
|
}
|
|
182
187
|
|
|
188
|
+
/**
|
|
189
|
+
* Collection of properties resulting from instantiating an extension via its
|
|
190
|
+
* factory.
|
|
191
|
+
*
|
|
192
|
+
* @remarks
|
|
193
|
+
* All of the members are mutable to allow for handling version or capability
|
|
194
|
+
* mismatches via replacement of interface or extension instances. That is the
|
|
195
|
+
* only time mutation is expected to occur.
|
|
196
|
+
*
|
|
197
|
+
* @internal
|
|
198
|
+
*/
|
|
199
|
+
export interface ExtensionInstantiationResult<
|
|
200
|
+
TInterface,
|
|
201
|
+
TRuntimeProperties extends ExtensionRuntimeProperties,
|
|
202
|
+
TUseContext extends unknown[],
|
|
203
|
+
> extends UnknownExtensionInstantiation {
|
|
204
|
+
interface: TInterface;
|
|
205
|
+
extension: ContainerExtension<TRuntimeProperties, TUseContext>;
|
|
206
|
+
}
|
|
207
|
+
|
|
183
208
|
/**
|
|
184
209
|
* Defines requirements for a component to register with container as an extension.
|
|
185
210
|
*
|
|
@@ -189,6 +214,24 @@ export interface ContainerExtension<
|
|
|
189
214
|
TRuntimeProperties extends ExtensionRuntimeProperties,
|
|
190
215
|
TUseContext extends unknown[] = [],
|
|
191
216
|
> {
|
|
217
|
+
/**
|
|
218
|
+
* Called when a new request is made for an extension with different version
|
|
219
|
+
* or capabilities than were registered for this extension instance.
|
|
220
|
+
*
|
|
221
|
+
* @typeParam TInterface - interface type of new request
|
|
222
|
+
*
|
|
223
|
+
* @param thisExistingInstantiation - registration of this extension in store
|
|
224
|
+
* @param newCompatibilityRequest - compatibility details of the new request
|
|
225
|
+
*/
|
|
226
|
+
handleVersionOrCapabilitiesMismatch<TRequestedInterface>(
|
|
227
|
+
thisExistingInstantiation: Readonly<
|
|
228
|
+
ExtensionInstantiationResult<unknown, TRuntimeProperties, TUseContext>
|
|
229
|
+
>,
|
|
230
|
+
newCompatibilityRequest: ExtensionCompatibilityDetails,
|
|
231
|
+
): Readonly<
|
|
232
|
+
ExtensionInstantiationResult<TRequestedInterface, TRuntimeProperties, TUseContext>
|
|
233
|
+
>;
|
|
234
|
+
|
|
192
235
|
/**
|
|
193
236
|
* Notifies the extension of a new use context.
|
|
194
237
|
*
|
|
@@ -327,51 +370,45 @@ export interface ExtensionHost<TRuntimeProperties extends ExtensionRuntimeProper
|
|
|
327
370
|
* Factory method to create an extension instance.
|
|
328
371
|
*
|
|
329
372
|
* Any such method provided to {@link ContainerExtensionStore.acquireExtension}
|
|
330
|
-
* must use the same value for a given {@link ContainerExtensionId} so that an
|
|
373
|
+
* must use the same value for a given {@link @fluidframework/runtime-definitions#ContainerExtensionId} so that an
|
|
331
374
|
* `instanceof` check may be performed at runtime.
|
|
332
375
|
*
|
|
333
376
|
* @typeParam T - Type of extension to create
|
|
334
377
|
* @typeParam TRuntimeProperties - Extension runtime properties
|
|
335
378
|
* @typeParam TUseContext - Array of custom use context passed to factory or onNewUse
|
|
336
379
|
*
|
|
337
|
-
* @param host - Host runtime for extension to work against
|
|
338
|
-
* @param useContext - Custom use context for extension.
|
|
339
|
-
* @returns Record providing:
|
|
340
|
-
* `interface` instance (type `T`) that is provided to caller of
|
|
341
|
-
* {@link ContainerExtensionStore.acquireExtension} and
|
|
342
|
-
* `extension` store/runtime uses to interact with extension.
|
|
343
|
-
*
|
|
344
380
|
* @internal
|
|
345
381
|
*/
|
|
346
|
-
export
|
|
347
|
-
|
|
382
|
+
export interface ContainerExtensionFactory<
|
|
383
|
+
TInterface,
|
|
348
384
|
TRuntimeProperties extends ExtensionRuntimeProperties,
|
|
349
385
|
TUseContext extends unknown[] = [],
|
|
350
|
-
>
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
)
|
|
354
|
-
readonly interface: T;
|
|
355
|
-
readonly extension: ContainerExtension<TRuntimeProperties, TUseContext>;
|
|
356
|
-
};
|
|
386
|
+
> extends ContainerExtensionExpectations {
|
|
387
|
+
resolvePriorInstantiation(
|
|
388
|
+
priorInstantiation: UnknownExtensionInstantiation,
|
|
389
|
+
): Readonly<ExtensionInstantiationResult<TInterface, TRuntimeProperties, TUseContext>>;
|
|
357
390
|
|
|
358
|
-
/**
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
391
|
+
/**
|
|
392
|
+
* @param host - Host runtime for extension to work against
|
|
393
|
+
* @param useContext - Custom use context for extension.
|
|
394
|
+
* @returns Record providing:
|
|
395
|
+
* `interface` instance (type `T`) that is provided to caller of
|
|
396
|
+
* {@link ContainerExtensionStore.acquireExtension} and
|
|
397
|
+
* `extension` store/runtime uses to interact with extension.
|
|
398
|
+
*/
|
|
399
|
+
instantiateExtension(
|
|
400
|
+
host: ExtensionHost<TRuntimeProperties>,
|
|
401
|
+
...useContext: TUseContext
|
|
402
|
+
): ExtensionInstantiationResult<TInterface, TRuntimeProperties, TUseContext>;
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Determines if an `ExtensionInstantiationResult` came from `instantiateExtension`.
|
|
406
|
+
* Called by the semantics of the instanceof operator.
|
|
407
|
+
*/
|
|
408
|
+
[Symbol.hasInstance]: (
|
|
409
|
+
instance: unknown,
|
|
410
|
+
) => instance is ExtensionInstantiationResult<TInterface, TRuntimeProperties, TUseContext>;
|
|
411
|
+
}
|
|
375
412
|
|
|
376
413
|
/**
|
|
377
414
|
* @sealed
|
|
@@ -383,15 +420,16 @@ export interface ContainerExtensionStore {
|
|
|
383
420
|
*
|
|
384
421
|
* @param id - Identifier for the requested extension
|
|
385
422
|
* @param factory - Factory to create the extension if not found
|
|
423
|
+
* @param context - Custom use context for extension
|
|
386
424
|
* @returns The extension
|
|
387
425
|
*/
|
|
388
426
|
acquireExtension<
|
|
389
|
-
|
|
427
|
+
TInterface,
|
|
390
428
|
TRuntimeProperties extends ExtensionRuntimeProperties,
|
|
391
429
|
TUseContext extends unknown[] = [],
|
|
392
430
|
>(
|
|
393
431
|
id: ContainerExtensionId,
|
|
394
|
-
factory: ContainerExtensionFactory<
|
|
432
|
+
factory: ContainerExtensionFactory<TInterface, TRuntimeProperties, TUseContext>,
|
|
395
433
|
...context: TUseContext
|
|
396
|
-
):
|
|
434
|
+
): TInterface;
|
|
397
435
|
}
|
package/src/index.ts
CHANGED
|
@@ -3,14 +3,21 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
// Re-export selected types from runtime-definitions internal module
|
|
7
|
+
// that are core to more complete container runtime extensions types
|
|
8
|
+
// maintained here.
|
|
9
|
+
export type {
|
|
10
|
+
ContainerExtensionId,
|
|
11
|
+
ExtensionCompatibilityDetails,
|
|
12
|
+
} from "@fluidframework/runtime-definitions/internal";
|
|
6
13
|
export type {
|
|
7
14
|
ClientConnectionId,
|
|
8
15
|
ContainerExtensionFactory,
|
|
9
|
-
ContainerExtensionId,
|
|
10
16
|
ContainerExtensionStore,
|
|
11
17
|
ContainerExtension,
|
|
12
18
|
ExtensionHost,
|
|
13
19
|
ExtensionHostEvents,
|
|
20
|
+
ExtensionInstantiationResult,
|
|
14
21
|
ExtensionMessage,
|
|
15
22
|
ExtensionRuntimeProperties,
|
|
16
23
|
InboundExtensionMessage,
|