@fluidframework/container-runtime-definitions 2.41.0-338401 → 2.42.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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @fluidframework/container-runtime-definitions
2
2
 
3
+ ## 2.42.0
4
+
5
+ Dependency updates only.
6
+
7
+ ## 2.41.0
8
+
9
+ Dependency updates only.
10
+
3
11
  ## 2.40.0
4
12
 
5
13
  Dependency updates only.
@@ -0,0 +1,246 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import type { ILayerCompatDetails } from "@fluid-internal/client-utils";
6
+ import type { IAudience } from "@fluidframework/container-definitions/internal";
7
+ import type { BrandedType, InternalUtilityTypes, ITelemetryBaseLogger, JsonDeserialized, JsonSerializable, Listenable, TypedMessage } from "@fluidframework/core-interfaces/internal";
8
+ import type { IQuorumClients } from "@fluidframework/driver-definitions/internal";
9
+ /**
10
+ * While connected, the id of a client within a session.
11
+ *
12
+ * @internal
13
+ */
14
+ export type ClientConnectionId = string;
15
+ /**
16
+ * Common structure between incoming and outgoing extension signals.
17
+ *
18
+ * @remarks
19
+ * Do not use directly, use {@link OutboundExtensionMessage} or {@link InboundExtensionMessage} instead.
20
+ *
21
+ * @sealed
22
+ * @internal
23
+ */
24
+ export type ExtensionMessage<TMessage extends TypedMessage = {
25
+ type: string;
26
+ content: JsonSerializable<unknown> | JsonDeserialized<unknown>;
27
+ }> = TMessage extends TypedMessage ? InternalUtilityTypes.FlattenIntersection<TMessage & {
28
+ /**
29
+ * Client ID of the singular client the message is being (or has been) sent to.
30
+ * May only be specified when IConnect.supportedFeatures['submit_signals_v2'] is true, will throw otherwise.
31
+ */
32
+ targetClientId?: ClientConnectionId;
33
+ }> : never;
34
+ /**
35
+ * Outgoing extension signals.
36
+ *
37
+ * @sealed
38
+ * @internal
39
+ */
40
+ export type OutboundExtensionMessage<TMessage extends TypedMessage = TypedMessage> = ExtensionMessage<{
41
+ type: TMessage["type"];
42
+ content: JsonSerializable<TMessage["content"]>;
43
+ }>;
44
+ /**
45
+ * Brand for value that has not been verified.
46
+ *
47
+ * @remarks
48
+ * Usage:
49
+ *
50
+ * - Cast any value to `UnverifiedBrand` using `as unknown as UnverifiedBrand<T>`
51
+ * when it is not yet confirmed that value is of type `T`.
52
+ *
53
+ * - When `T` value is needed, use narrowing type guards to check (preferred)
54
+ * or cast from `UnverifiedBrand` using `as unknown` when "instance" must
55
+ * be parsed to `T`.
56
+ *
57
+ * @example Example narrowing type guard:
58
+ * ```typescript
59
+ * function validateFoo(
60
+ * unverified: Foo | (Record<string, unknown> & UnverifiedBrand<Foo>)
61
+ * ): unverified is Foo {
62
+ * return unverified.IFooProvider === unverified;
63
+ * }
64
+ * ```
65
+ *
66
+ * @sealed
67
+ * @internal
68
+ */
69
+ export declare class UnverifiedBrand<T> extends BrandedType<T> {
70
+ private readonly UnverifiedValue;
71
+ private constructor();
72
+ }
73
+ /**
74
+ * Unverified incoming extension signals.
75
+ *
76
+ * @sealed
77
+ * @internal
78
+ */
79
+ export type RawInboundExtensionMessage<TMessage extends TypedMessage = TypedMessage> = TMessage extends TypedMessage ? InternalUtilityTypes.FlattenIntersection<ExtensionMessage<{
80
+ type: string;
81
+ content: JsonDeserialized<unknown>;
82
+ }> & {
83
+ /**
84
+ * The client ID that submitted the message.
85
+ * For server generated messages the clientId will be null.
86
+ */
87
+ clientId: ClientConnectionId | null;
88
+ }> & UnverifiedBrand<TMessage> : never;
89
+ /**
90
+ * Verified incoming extension signals.
91
+ *
92
+ * @sealed
93
+ * @internal
94
+ */
95
+ export type VerifiedInboundExtensionMessage<TMessage extends TypedMessage = TypedMessage> = TMessage extends TypedMessage ? InternalUtilityTypes.FlattenIntersection<ExtensionMessage<{
96
+ type: TMessage["type"];
97
+ content: JsonDeserialized<TMessage["content"]>;
98
+ }> & {
99
+ /**
100
+ * The client ID that submitted the message.
101
+ * For server generated messages the clientId will be null.
102
+ */
103
+ clientId: ClientConnectionId | null;
104
+ }> : never;
105
+ /**
106
+ * Incoming extension signal that may be of the known type or has not yet been validated.
107
+ *
108
+ * @sealed
109
+ * @internal
110
+ */
111
+ export type InboundExtensionMessage<TMessage extends TypedMessage = TypedMessage> = RawInboundExtensionMessage<TMessage> | VerifiedInboundExtensionMessage<TMessage>;
112
+ /**
113
+ * Runtime properties of an extension.
114
+ *
115
+ * @remarks
116
+ * This is used to coordinate select types that are known only to the extension, but
117
+ * that host will respect where it calls back or provides extension specific data.
118
+ *
119
+ * @internal
120
+ */
121
+ export interface ExtensionRuntimeProperties {
122
+ SignalMessages: TypedMessage;
123
+ }
124
+ /**
125
+ * Defines requirements for a component to register with container as an extension.
126
+ *
127
+ * @internal
128
+ */
129
+ export interface ContainerExtension<TRuntimeProperties extends ExtensionRuntimeProperties, TUseContext extends unknown[] = []> {
130
+ /**
131
+ * Notifies the extension of a new use context.
132
+ *
133
+ * @param useContext - Context new reference to extension is acquired within.
134
+ *
135
+ * @remarks
136
+ * This is called when a secondary reference to the extension is acquired.
137
+ * useContext is the array of arguments that would otherwise be passed to
138
+ * the factory during first acquisition request.
139
+ */
140
+ onNewUse(...useContext: TUseContext): void;
141
+ /**
142
+ * Callback for signal sent by this extension.
143
+ *
144
+ * @param addressChain - Address chain of the signal
145
+ * @param signalMessage - Signal unverified content and metadata
146
+ * @param local - True if signal was sent by this client
147
+ *
148
+ */
149
+ processSignal?: (addressChain: string[], signalMessage: InboundExtensionMessage<TRuntimeProperties["SignalMessages"]>, local: boolean) => void;
150
+ }
151
+ /**
152
+ * Events emitted by the {@link ExtensionHost}.
153
+ *
154
+ * @internal
155
+ */
156
+ export interface ExtensionHostEvents {
157
+ "disconnected": () => void;
158
+ "connected": (clientId: ClientConnectionId) => void;
159
+ }
160
+ /**
161
+ * Defines the runtime aspects an extension may access.
162
+ *
163
+ * @remarks
164
+ * In most cases this is a logical subset of {@link @fluidframework/container-runtime-definitions#IContainerRuntime}.
165
+ *
166
+ * @sealed
167
+ * @internal
168
+ */
169
+ export interface ExtensionHost<TRuntimeProperties extends ExtensionRuntimeProperties> {
170
+ readonly isConnected: () => boolean;
171
+ readonly getClientId: () => ClientConnectionId | undefined;
172
+ readonly events: Listenable<ExtensionHostEvents>;
173
+ readonly logger: ITelemetryBaseLogger;
174
+ readonly supportedFeatures: ILayerCompatDetails["supportedFeatures"];
175
+ /**
176
+ * Submits a signal to be sent to other clients.
177
+ * @param addressChain - Custom address sequence for the signal.
178
+ * @param message - Custom message content of the signal.
179
+ *
180
+ * Upon receipt of signal, {@link ContainerExtension.processSignal} will be called with the same
181
+ * address and message (less any non-{@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify|JSON.stringify}-able data).
182
+ */
183
+ submitAddressedSignal: (addressChain: string[], message: OutboundExtensionMessage<TRuntimeProperties["SignalMessages"]>) => void;
184
+ /**
185
+ * The collection of write clients which were connected as of the current sequence number.
186
+ * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.
187
+ */
188
+ getQuorum: () => IQuorumClients;
189
+ getAudience: () => IAudience;
190
+ }
191
+ /**
192
+ * Factory method to create an extension instance.
193
+ *
194
+ * Any such method provided to {@link ContainerExtensionStore.acquireExtension}
195
+ * must use the same value for a given {@link ContainerExtensionId} so that an
196
+ * `instanceof` check may be performed at runtime.
197
+ *
198
+ * @typeParam T - Type of extension to create
199
+ * @typeParam TRuntimeProperties - Extension runtime properties
200
+ * @typeParam TUseContext - Array of custom use context passed to factory or onNewUse
201
+ *
202
+ * @param host - Host runtime for extension to work against
203
+ * @param useContext - Custom use context for extension.
204
+ * @returns Record providing:
205
+ * `interface` instance (type `T`) that is provided to caller of
206
+ * {@link ContainerExtensionStore.acquireExtension} and
207
+ * `extension` store/runtime uses to interact with extension.
208
+ *
209
+ * @internal
210
+ */
211
+ export type ContainerExtensionFactory<T, TRuntimeProperties extends ExtensionRuntimeProperties, TUseContext extends unknown[] = []> = new (host: ExtensionHost<TRuntimeProperties>, ...useContext: TUseContext) => {
212
+ readonly interface: T;
213
+ readonly extension: ContainerExtension<TRuntimeProperties, TUseContext>;
214
+ };
215
+ /**
216
+ * Unique identifier for extension
217
+ *
218
+ * @remarks
219
+ * A string known to all clients working with a certain ContainerExtension and unique
220
+ * among ContainerExtensions. Not `/` may be used in the string. Recommend using
221
+ * concatenation of: type of unique identifier, `:` (required), and unique identifier.
222
+ *
223
+ * @example Examples
224
+ * ```typescript
225
+ * "guid:g0fl001d-1415-5000-c00l-g0fa54g0b1g1"
226
+ * "name:@foo-scope_bar:v1"
227
+ * ```
228
+ *
229
+ * @internal
230
+ */
231
+ export type ContainerExtensionId = `${string}:${string}`;
232
+ /**
233
+ * @sealed
234
+ * @internal
235
+ */
236
+ export interface ContainerExtensionStore {
237
+ /**
238
+ * Acquires an extension from store or adds new one.
239
+ *
240
+ * @param id - Identifier for the requested extension
241
+ * @param factory - Factory to create the extension if not found
242
+ * @returns The extension
243
+ */
244
+ acquireExtension<T, TRuntimeProperties extends ExtensionRuntimeProperties, TUseContext extends unknown[] = []>(id: ContainerExtensionId, factory: ContainerExtensionFactory<T, TRuntimeProperties, TUseContext>, ...context: TUseContext): T;
245
+ }
246
+ //# sourceMappingURL=containerExtension.d.ts.map
@@ -0,0 +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;AAEhF,OAAO,KAAK,EACX,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAElF;;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ACrB,CAAC,CAAC;CACL"}
@@ -9,6 +9,7 @@ import type { IFluidHandleContext } from "@fluidframework/core-interfaces/intern
9
9
  import type { IClientDetails } from "@fluidframework/driver-definitions";
10
10
  import type { IDocumentStorageService, IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
11
11
  import type { FlushMode, IContainerRuntimeBase, IContainerRuntimeBaseEvents, IProvideFluidDataStoreRegistry } from "@fluidframework/runtime-definitions/internal";
12
+ import type { ContainerExtensionStore } from "./containerExtension.js";
12
13
  /**
13
14
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
14
15
  * @legacy
@@ -150,4 +151,11 @@ export interface IContainerRuntime extends IProvideFluidDataStoreRegistry, ICont
150
151
  */
151
152
  getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;
152
153
  }
154
+ /**
155
+ * Represents the internal version of the runtime of the container.
156
+ *
157
+ * @internal
158
+ */
159
+ export interface IContainerRuntimeInternal extends IContainerRuntime, ContainerExtensionStore {
160
+ }
153
161
  //# sourceMappingURL=containerRuntime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"containerRuntime.d.ts","sourceRoot":"","sources":["../src/containerRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,KAAK,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,QAAQ,EACR,SAAS,EACT,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EACX,uBAAuB,EACvB,gBAAgB,EAChB,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AACrD,OAA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SAAQ,iBAAiB,EACxB,uBAAuB;CAAG"}
package/dist/index.d.ts CHANGED
@@ -2,5 +2,6 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export type { IContainerRuntime, IContainerRuntimeBaseWithCombinedEvents, IContainerRuntimeEvents, IContainerRuntimeWithResolveHandle_Deprecated, SummarizerStopReason, ISummarizeEventProps, ISummarizerObservabilityProps, ISummarizerEvents, } from "./containerRuntime.js";
5
+ export type { ClientConnectionId, ContainerExtensionFactory, ContainerExtensionId, ContainerExtensionStore, ContainerExtension, ExtensionHost, ExtensionHostEvents, ExtensionMessage, ExtensionRuntimeProperties, InboundExtensionMessage, OutboundExtensionMessage, RawInboundExtensionMessage, UnverifiedBrand, VerifiedInboundExtensionMessage, } from "./containerExtension.js";
6
+ export type { IContainerRuntime, IContainerRuntimeBaseWithCombinedEvents, IContainerRuntimeEvents, IContainerRuntimeInternal, IContainerRuntimeWithResolveHandle_Deprecated, SummarizerStopReason, ISummarizeEventProps, ISummarizerObservabilityProps, ISummarizerEvents, } from "./containerRuntime.js";
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,iBAAiB,EACjB,uCAAuC,EACvC,uBAAuB,EACvB,6CAA6C,EAC7C,oBAAoB,EACpB,oBAAoB,EACpB,6BAA6B,EAC7B,iBAAiB,GACjB,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,kBAAkB,EAClB,yBAAyB,EACzB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,0BAA0B,EAC1B,uBAAuB,EACvB,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"}
@@ -0,0 +1,246 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import type { ILayerCompatDetails } from "@fluid-internal/client-utils";
6
+ import type { IAudience } from "@fluidframework/container-definitions/internal";
7
+ import type { BrandedType, InternalUtilityTypes, ITelemetryBaseLogger, JsonDeserialized, JsonSerializable, Listenable, TypedMessage } from "@fluidframework/core-interfaces/internal";
8
+ import type { IQuorumClients } from "@fluidframework/driver-definitions/internal";
9
+ /**
10
+ * While connected, the id of a client within a session.
11
+ *
12
+ * @internal
13
+ */
14
+ export type ClientConnectionId = string;
15
+ /**
16
+ * Common structure between incoming and outgoing extension signals.
17
+ *
18
+ * @remarks
19
+ * Do not use directly, use {@link OutboundExtensionMessage} or {@link InboundExtensionMessage} instead.
20
+ *
21
+ * @sealed
22
+ * @internal
23
+ */
24
+ export type ExtensionMessage<TMessage extends TypedMessage = {
25
+ type: string;
26
+ content: JsonSerializable<unknown> | JsonDeserialized<unknown>;
27
+ }> = TMessage extends TypedMessage ? InternalUtilityTypes.FlattenIntersection<TMessage & {
28
+ /**
29
+ * Client ID of the singular client the message is being (or has been) sent to.
30
+ * May only be specified when IConnect.supportedFeatures['submit_signals_v2'] is true, will throw otherwise.
31
+ */
32
+ targetClientId?: ClientConnectionId;
33
+ }> : never;
34
+ /**
35
+ * Outgoing extension signals.
36
+ *
37
+ * @sealed
38
+ * @internal
39
+ */
40
+ export type OutboundExtensionMessage<TMessage extends TypedMessage = TypedMessage> = ExtensionMessage<{
41
+ type: TMessage["type"];
42
+ content: JsonSerializable<TMessage["content"]>;
43
+ }>;
44
+ /**
45
+ * Brand for value that has not been verified.
46
+ *
47
+ * @remarks
48
+ * Usage:
49
+ *
50
+ * - Cast any value to `UnverifiedBrand` using `as unknown as UnverifiedBrand<T>`
51
+ * when it is not yet confirmed that value is of type `T`.
52
+ *
53
+ * - When `T` value is needed, use narrowing type guards to check (preferred)
54
+ * or cast from `UnverifiedBrand` using `as unknown` when "instance" must
55
+ * be parsed to `T`.
56
+ *
57
+ * @example Example narrowing type guard:
58
+ * ```typescript
59
+ * function validateFoo(
60
+ * unverified: Foo | (Record<string, unknown> & UnverifiedBrand<Foo>)
61
+ * ): unverified is Foo {
62
+ * return unverified.IFooProvider === unverified;
63
+ * }
64
+ * ```
65
+ *
66
+ * @sealed
67
+ * @internal
68
+ */
69
+ export declare class UnverifiedBrand<T> extends BrandedType<T> {
70
+ private readonly UnverifiedValue;
71
+ private constructor();
72
+ }
73
+ /**
74
+ * Unverified incoming extension signals.
75
+ *
76
+ * @sealed
77
+ * @internal
78
+ */
79
+ export type RawInboundExtensionMessage<TMessage extends TypedMessage = TypedMessage> = TMessage extends TypedMessage ? InternalUtilityTypes.FlattenIntersection<ExtensionMessage<{
80
+ type: string;
81
+ content: JsonDeserialized<unknown>;
82
+ }> & {
83
+ /**
84
+ * The client ID that submitted the message.
85
+ * For server generated messages the clientId will be null.
86
+ */
87
+ clientId: ClientConnectionId | null;
88
+ }> & UnverifiedBrand<TMessage> : never;
89
+ /**
90
+ * Verified incoming extension signals.
91
+ *
92
+ * @sealed
93
+ * @internal
94
+ */
95
+ export type VerifiedInboundExtensionMessage<TMessage extends TypedMessage = TypedMessage> = TMessage extends TypedMessage ? InternalUtilityTypes.FlattenIntersection<ExtensionMessage<{
96
+ type: TMessage["type"];
97
+ content: JsonDeserialized<TMessage["content"]>;
98
+ }> & {
99
+ /**
100
+ * The client ID that submitted the message.
101
+ * For server generated messages the clientId will be null.
102
+ */
103
+ clientId: ClientConnectionId | null;
104
+ }> : never;
105
+ /**
106
+ * Incoming extension signal that may be of the known type or has not yet been validated.
107
+ *
108
+ * @sealed
109
+ * @internal
110
+ */
111
+ export type InboundExtensionMessage<TMessage extends TypedMessage = TypedMessage> = RawInboundExtensionMessage<TMessage> | VerifiedInboundExtensionMessage<TMessage>;
112
+ /**
113
+ * Runtime properties of an extension.
114
+ *
115
+ * @remarks
116
+ * This is used to coordinate select types that are known only to the extension, but
117
+ * that host will respect where it calls back or provides extension specific data.
118
+ *
119
+ * @internal
120
+ */
121
+ export interface ExtensionRuntimeProperties {
122
+ SignalMessages: TypedMessage;
123
+ }
124
+ /**
125
+ * Defines requirements for a component to register with container as an extension.
126
+ *
127
+ * @internal
128
+ */
129
+ export interface ContainerExtension<TRuntimeProperties extends ExtensionRuntimeProperties, TUseContext extends unknown[] = []> {
130
+ /**
131
+ * Notifies the extension of a new use context.
132
+ *
133
+ * @param useContext - Context new reference to extension is acquired within.
134
+ *
135
+ * @remarks
136
+ * This is called when a secondary reference to the extension is acquired.
137
+ * useContext is the array of arguments that would otherwise be passed to
138
+ * the factory during first acquisition request.
139
+ */
140
+ onNewUse(...useContext: TUseContext): void;
141
+ /**
142
+ * Callback for signal sent by this extension.
143
+ *
144
+ * @param addressChain - Address chain of the signal
145
+ * @param signalMessage - Signal unverified content and metadata
146
+ * @param local - True if signal was sent by this client
147
+ *
148
+ */
149
+ processSignal?: (addressChain: string[], signalMessage: InboundExtensionMessage<TRuntimeProperties["SignalMessages"]>, local: boolean) => void;
150
+ }
151
+ /**
152
+ * Events emitted by the {@link ExtensionHost}.
153
+ *
154
+ * @internal
155
+ */
156
+ export interface ExtensionHostEvents {
157
+ "disconnected": () => void;
158
+ "connected": (clientId: ClientConnectionId) => void;
159
+ }
160
+ /**
161
+ * Defines the runtime aspects an extension may access.
162
+ *
163
+ * @remarks
164
+ * In most cases this is a logical subset of {@link @fluidframework/container-runtime-definitions#IContainerRuntime}.
165
+ *
166
+ * @sealed
167
+ * @internal
168
+ */
169
+ export interface ExtensionHost<TRuntimeProperties extends ExtensionRuntimeProperties> {
170
+ readonly isConnected: () => boolean;
171
+ readonly getClientId: () => ClientConnectionId | undefined;
172
+ readonly events: Listenable<ExtensionHostEvents>;
173
+ readonly logger: ITelemetryBaseLogger;
174
+ readonly supportedFeatures: ILayerCompatDetails["supportedFeatures"];
175
+ /**
176
+ * Submits a signal to be sent to other clients.
177
+ * @param addressChain - Custom address sequence for the signal.
178
+ * @param message - Custom message content of the signal.
179
+ *
180
+ * Upon receipt of signal, {@link ContainerExtension.processSignal} will be called with the same
181
+ * address and message (less any non-{@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify|JSON.stringify}-able data).
182
+ */
183
+ submitAddressedSignal: (addressChain: string[], message: OutboundExtensionMessage<TRuntimeProperties["SignalMessages"]>) => void;
184
+ /**
185
+ * The collection of write clients which were connected as of the current sequence number.
186
+ * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.
187
+ */
188
+ getQuorum: () => IQuorumClients;
189
+ getAudience: () => IAudience;
190
+ }
191
+ /**
192
+ * Factory method to create an extension instance.
193
+ *
194
+ * Any such method provided to {@link ContainerExtensionStore.acquireExtension}
195
+ * must use the same value for a given {@link ContainerExtensionId} so that an
196
+ * `instanceof` check may be performed at runtime.
197
+ *
198
+ * @typeParam T - Type of extension to create
199
+ * @typeParam TRuntimeProperties - Extension runtime properties
200
+ * @typeParam TUseContext - Array of custom use context passed to factory or onNewUse
201
+ *
202
+ * @param host - Host runtime for extension to work against
203
+ * @param useContext - Custom use context for extension.
204
+ * @returns Record providing:
205
+ * `interface` instance (type `T`) that is provided to caller of
206
+ * {@link ContainerExtensionStore.acquireExtension} and
207
+ * `extension` store/runtime uses to interact with extension.
208
+ *
209
+ * @internal
210
+ */
211
+ export type ContainerExtensionFactory<T, TRuntimeProperties extends ExtensionRuntimeProperties, TUseContext extends unknown[] = []> = new (host: ExtensionHost<TRuntimeProperties>, ...useContext: TUseContext) => {
212
+ readonly interface: T;
213
+ readonly extension: ContainerExtension<TRuntimeProperties, TUseContext>;
214
+ };
215
+ /**
216
+ * Unique identifier for extension
217
+ *
218
+ * @remarks
219
+ * A string known to all clients working with a certain ContainerExtension and unique
220
+ * among ContainerExtensions. Not `/` may be used in the string. Recommend using
221
+ * concatenation of: type of unique identifier, `:` (required), and unique identifier.
222
+ *
223
+ * @example Examples
224
+ * ```typescript
225
+ * "guid:g0fl001d-1415-5000-c00l-g0fa54g0b1g1"
226
+ * "name:@foo-scope_bar:v1"
227
+ * ```
228
+ *
229
+ * @internal
230
+ */
231
+ export type ContainerExtensionId = `${string}:${string}`;
232
+ /**
233
+ * @sealed
234
+ * @internal
235
+ */
236
+ export interface ContainerExtensionStore {
237
+ /**
238
+ * Acquires an extension from store or adds new one.
239
+ *
240
+ * @param id - Identifier for the requested extension
241
+ * @param factory - Factory to create the extension if not found
242
+ * @returns The extension
243
+ */
244
+ acquireExtension<T, TRuntimeProperties extends ExtensionRuntimeProperties, TUseContext extends unknown[] = []>(id: ContainerExtensionId, factory: ContainerExtensionFactory<T, TRuntimeProperties, TUseContext>, ...context: TUseContext): T;
245
+ }
246
+ //# sourceMappingURL=containerExtension.d.ts.map
@@ -0,0 +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;AAEhF,OAAO,KAAK,EACX,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAElF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAExC;;;;;;;;GAQG;AACH,MAAM,MAAM,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type { IClientDetails } from "@fluidframework/driver-definitions";
10
10
  import type { IDocumentStorageService, IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
11
11
  import type { FlushMode, IContainerRuntimeBase, IContainerRuntimeBaseEvents, IProvideFluidDataStoreRegistry } from "@fluidframework/runtime-definitions/internal";
12
+ import type { ContainerExtensionStore } from "./containerExtension.js";
12
13
  /**
13
14
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
14
15
  * @legacy
@@ -150,4 +151,11 @@ export interface IContainerRuntime extends IProvideFluidDataStoreRegistry, ICont
150
151
  */
151
152
  getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;
152
153
  }
154
+ /**
155
+ * Represents the internal version of the runtime of the container.
156
+ *
157
+ * @internal
158
+ */
159
+ export interface IContainerRuntimeInternal extends IContainerRuntime, ContainerExtensionStore {
160
+ }
153
161
  //# sourceMappingURL=containerRuntime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"containerRuntime.d.ts","sourceRoot":"","sources":["../src/containerRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,KAAK,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,QAAQ,EACR,SAAS,EACT,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EACX,uBAAuB,EACvB,gBAAgB,EAChB,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EACX,SAAS,EACT,qBAAqB,EACrB,2BAA2B,EAC3B,8BAA8B,EAC9B,MAAM,8CAA8C,CAAC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right (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export type { IContainerRuntime, IContainerRuntimeBaseWithCombinedEvents, IContainerRuntimeEvents, IContainerRuntimeWithResolveHandle_Deprecated, SummarizerStopReason, ISummarizeEventProps, ISummarizerObservabilityProps, ISummarizerEvents, } from "./containerRuntime.js";
5
+ export type { ClientConnectionId, ContainerExtensionFactory, ContainerExtensionId, ContainerExtensionStore, ContainerExtension, ExtensionHost, ExtensionHostEvents, ExtensionMessage, ExtensionRuntimeProperties, InboundExtensionMessage, OutboundExtensionMessage, RawInboundExtensionMessage, UnverifiedBrand, VerifiedInboundExtensionMessage, } from "./containerExtension.js";
6
+ export type { IContainerRuntime, IContainerRuntimeBaseWithCombinedEvents, IContainerRuntimeEvents, IContainerRuntimeInternal, IContainerRuntimeWithResolveHandle_Deprecated, SummarizerStopReason, ISummarizeEventProps, ISummarizerObservabilityProps, ISummarizerEvents, } from "./containerRuntime.js";
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,iBAAiB,EACjB,uCAAuC,EACvC,uBAAuB,EACvB,6CAA6C,EAC7C,oBAAoB,EACpB,oBAAoB,EACpB,6BAA6B,EAC7B,iBAAiB,GACjB,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,kBAAkB,EAClB,yBAAyB,EACzB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,0BAA0B,EAC1B,uBAAuB,EACvB,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.41.0-338401",
3
+ "version": "2.42.0",
4
4
  "description": "Fluid Runtime definitions",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -41,10 +41,11 @@
41
41
  "main": "",
42
42
  "types": "lib/public.d.ts",
43
43
  "dependencies": {
44
- "@fluidframework/container-definitions": "2.41.0-338401",
45
- "@fluidframework/core-interfaces": "2.41.0-338401",
46
- "@fluidframework/driver-definitions": "2.41.0-338401",
47
- "@fluidframework/runtime-definitions": "2.41.0-338401"
44
+ "@fluid-internal/client-utils": "~2.42.0",
45
+ "@fluidframework/container-definitions": "~2.42.0",
46
+ "@fluidframework/core-interfaces": "~2.42.0",
47
+ "@fluidframework/driver-definitions": "~2.42.0",
48
+ "@fluidframework/runtime-definitions": "~2.42.0"
48
49
  },
49
50
  "devDependencies": {
50
51
  "@arethetypeswrong/cli": "^0.17.1",
@@ -52,8 +53,8 @@
52
53
  "@fluid-tools/build-cli": "^0.55.0",
53
54
  "@fluidframework/build-common": "^2.0.3",
54
55
  "@fluidframework/build-tools": "^0.55.0",
55
- "@fluidframework/container-runtime-definitions-previous": "npm:@fluidframework/container-runtime-definitions@2.40.0",
56
- "@fluidframework/eslint-config-fluid": "^5.7.3",
56
+ "@fluidframework/container-runtime-definitions-previous": "npm:@fluidframework/container-runtime-definitions@2.41.0",
57
+ "@fluidframework/eslint-config-fluid": "^5.7.4",
57
58
  "@microsoft/api-extractor": "7.52.8",
58
59
  "concurrently": "^8.2.1",
59
60
  "copyfiles": "^2.4.1",
@@ -0,0 +1,323 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import type { ILayerCompatDetails } from "@fluid-internal/client-utils";
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
+ import type {
10
+ BrandedType,
11
+ InternalUtilityTypes,
12
+ ITelemetryBaseLogger,
13
+ JsonDeserialized,
14
+ JsonSerializable,
15
+ Listenable,
16
+ TypedMessage,
17
+ } from "@fluidframework/core-interfaces/internal";
18
+ import type { IQuorumClients } from "@fluidframework/driver-definitions/internal";
19
+
20
+ /**
21
+ * While connected, the id of a client within a session.
22
+ *
23
+ * @internal
24
+ */
25
+ export type ClientConnectionId = string;
26
+
27
+ /**
28
+ * Common structure between incoming and outgoing extension signals.
29
+ *
30
+ * @remarks
31
+ * Do not use directly, use {@link OutboundExtensionMessage} or {@link InboundExtensionMessage} instead.
32
+ *
33
+ * @sealed
34
+ * @internal
35
+ */
36
+ export type ExtensionMessage<
37
+ TMessage extends TypedMessage = {
38
+ type: string;
39
+ content: JsonSerializable<unknown> | JsonDeserialized<unknown>;
40
+ },
41
+ > = // `TMessage extends TypedMessage` encourages processing union elements individually
42
+ TMessage extends TypedMessage
43
+ ? InternalUtilityTypes.FlattenIntersection<
44
+ TMessage & {
45
+ /**
46
+ * Client ID of the singular client the message is being (or has been) sent to.
47
+ * May only be specified when IConnect.supportedFeatures['submit_signals_v2'] is true, will throw otherwise.
48
+ */
49
+ targetClientId?: ClientConnectionId;
50
+ }
51
+ >
52
+ : never;
53
+
54
+ /**
55
+ * Outgoing extension signals.
56
+ *
57
+ * @sealed
58
+ * @internal
59
+ */
60
+ export type OutboundExtensionMessage<TMessage extends TypedMessage = TypedMessage> =
61
+ ExtensionMessage<{ type: TMessage["type"]; content: JsonSerializable<TMessage["content"]> }>;
62
+
63
+ /**
64
+ * Brand for value that has not been verified.
65
+ *
66
+ * @remarks
67
+ * Usage:
68
+ *
69
+ * - Cast any value to `UnverifiedBrand` using `as unknown as UnverifiedBrand<T>`
70
+ * when it is not yet confirmed that value is of type `T`.
71
+ *
72
+ * - When `T` value is needed, use narrowing type guards to check (preferred)
73
+ * or cast from `UnverifiedBrand` using `as unknown` when "instance" must
74
+ * be parsed to `T`.
75
+ *
76
+ * @example Example narrowing type guard:
77
+ * ```typescript
78
+ * function validateFoo(
79
+ * unverified: Foo | (Record<string, unknown> & UnverifiedBrand<Foo>)
80
+ * ): unverified is Foo {
81
+ * return unverified.IFooProvider === unverified;
82
+ * }
83
+ * ```
84
+ *
85
+ * @sealed
86
+ * @internal
87
+ */
88
+ export declare class UnverifiedBrand<T> extends BrandedType<T> {
89
+ private readonly UnverifiedValue: T;
90
+ private constructor();
91
+ }
92
+
93
+ /**
94
+ * Unverified incoming extension signals.
95
+ *
96
+ * @sealed
97
+ * @internal
98
+ */
99
+ export type RawInboundExtensionMessage<TMessage extends TypedMessage = TypedMessage> =
100
+ // `TMessage extends TypedMessage` encourages processing union elements individually
101
+ TMessage extends TypedMessage
102
+ ? InternalUtilityTypes.FlattenIntersection<
103
+ ExtensionMessage<{
104
+ type: string;
105
+ content: JsonDeserialized<unknown>;
106
+ }> & {
107
+ /**
108
+ * The client ID that submitted the message.
109
+ * For server generated messages the clientId will be null.
110
+ */
111
+ // eslint-disable-next-line @rushstack/no-new-null
112
+ clientId: ClientConnectionId | null;
113
+ }
114
+ > &
115
+ UnverifiedBrand<TMessage>
116
+ : never;
117
+
118
+ /**
119
+ * Verified incoming extension signals.
120
+ *
121
+ * @sealed
122
+ * @internal
123
+ */
124
+ export type VerifiedInboundExtensionMessage<TMessage extends TypedMessage = TypedMessage> =
125
+ // `TMessage extends TypedMessage` encourages processing union elements individually
126
+ TMessage extends TypedMessage
127
+ ? InternalUtilityTypes.FlattenIntersection<
128
+ ExtensionMessage<{
129
+ type: TMessage["type"];
130
+ content: JsonDeserialized<TMessage["content"]>;
131
+ }> & {
132
+ /**
133
+ * The client ID that submitted the message.
134
+ * For server generated messages the clientId will be null.
135
+ */
136
+ // eslint-disable-next-line @rushstack/no-new-null
137
+ clientId: ClientConnectionId | null;
138
+ }
139
+ >
140
+ : never;
141
+
142
+ /**
143
+ * Incoming extension signal that may be of the known type or has not yet been validated.
144
+ *
145
+ * @sealed
146
+ * @internal
147
+ */
148
+ export type InboundExtensionMessage<TMessage extends TypedMessage = TypedMessage> =
149
+ | RawInboundExtensionMessage<TMessage>
150
+ | VerifiedInboundExtensionMessage<TMessage>;
151
+
152
+ /**
153
+ * Runtime properties of an extension.
154
+ *
155
+ * @remarks
156
+ * This is used to coordinate select types that are known only to the extension, but
157
+ * that host will respect where it calls back or provides extension specific data.
158
+ *
159
+ * @internal
160
+ */
161
+ export interface ExtensionRuntimeProperties {
162
+ SignalMessages: TypedMessage;
163
+ }
164
+
165
+ /**
166
+ * Defines requirements for a component to register with container as an extension.
167
+ *
168
+ * @internal
169
+ */
170
+ export interface ContainerExtension<
171
+ TRuntimeProperties extends ExtensionRuntimeProperties,
172
+ TUseContext extends unknown[] = [],
173
+ > {
174
+ /**
175
+ * Notifies the extension of a new use context.
176
+ *
177
+ * @param useContext - Context new reference to extension is acquired within.
178
+ *
179
+ * @remarks
180
+ * This is called when a secondary reference to the extension is acquired.
181
+ * useContext is the array of arguments that would otherwise be passed to
182
+ * the factory during first acquisition request.
183
+ */
184
+ onNewUse(...useContext: TUseContext): void;
185
+
186
+ /**
187
+ * Callback for signal sent by this extension.
188
+ *
189
+ * @param addressChain - Address chain of the signal
190
+ * @param signalMessage - Signal unverified content and metadata
191
+ * @param local - True if signal was sent by this client
192
+ *
193
+ */
194
+ processSignal?: (
195
+ addressChain: string[],
196
+ signalMessage: InboundExtensionMessage<TRuntimeProperties["SignalMessages"]>,
197
+ local: boolean,
198
+ ) => void;
199
+ }
200
+
201
+ /**
202
+ * Events emitted by the {@link ExtensionHost}.
203
+ *
204
+ * @internal
205
+ */
206
+ export interface ExtensionHostEvents {
207
+ "disconnected": () => void;
208
+ "connected": (clientId: ClientConnectionId) => void;
209
+ }
210
+
211
+ /**
212
+ * Defines the runtime aspects an extension may access.
213
+ *
214
+ * @remarks
215
+ * In most cases this is a logical subset of {@link @fluidframework/container-runtime-definitions#IContainerRuntime}.
216
+ *
217
+ * @sealed
218
+ * @internal
219
+ */
220
+ export interface ExtensionHost<TRuntimeProperties extends ExtensionRuntimeProperties> {
221
+ readonly isConnected: () => boolean;
222
+ readonly getClientId: () => ClientConnectionId | undefined;
223
+
224
+ readonly events: Listenable<ExtensionHostEvents>;
225
+
226
+ readonly logger: ITelemetryBaseLogger;
227
+
228
+ readonly supportedFeatures: ILayerCompatDetails["supportedFeatures"];
229
+
230
+ /**
231
+ * Submits a signal to be sent to other clients.
232
+ * @param addressChain - Custom address sequence for the signal.
233
+ * @param message - Custom message content of the signal.
234
+ *
235
+ * Upon receipt of signal, {@link ContainerExtension.processSignal} will be called with the same
236
+ * address and message (less any non-{@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify|JSON.stringify}-able data).
237
+ */
238
+ submitAddressedSignal: (
239
+ addressChain: string[],
240
+ message: OutboundExtensionMessage<TRuntimeProperties["SignalMessages"]>,
241
+ ) => void;
242
+
243
+ /**
244
+ * The collection of write clients which were connected as of the current sequence number.
245
+ * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.
246
+ */
247
+ getQuorum: () => IQuorumClients;
248
+
249
+ getAudience: () => IAudience;
250
+ }
251
+
252
+ /**
253
+ * Factory method to create an extension instance.
254
+ *
255
+ * Any such method provided to {@link ContainerExtensionStore.acquireExtension}
256
+ * must use the same value for a given {@link ContainerExtensionId} so that an
257
+ * `instanceof` check may be performed at runtime.
258
+ *
259
+ * @typeParam T - Type of extension to create
260
+ * @typeParam TRuntimeProperties - Extension runtime properties
261
+ * @typeParam TUseContext - Array of custom use context passed to factory or onNewUse
262
+ *
263
+ * @param host - Host runtime for extension to work against
264
+ * @param useContext - Custom use context for extension.
265
+ * @returns Record providing:
266
+ * `interface` instance (type `T`) that is provided to caller of
267
+ * {@link ContainerExtensionStore.acquireExtension} and
268
+ * `extension` store/runtime uses to interact with extension.
269
+ *
270
+ * @internal
271
+ */
272
+ export type ContainerExtensionFactory<
273
+ T,
274
+ TRuntimeProperties extends ExtensionRuntimeProperties,
275
+ TUseContext extends unknown[] = [],
276
+ > = new (
277
+ host: ExtensionHost<TRuntimeProperties>,
278
+ ...useContext: TUseContext
279
+ ) => {
280
+ readonly interface: T;
281
+ readonly extension: ContainerExtension<TRuntimeProperties, TUseContext>;
282
+ };
283
+
284
+ /**
285
+ * Unique identifier for extension
286
+ *
287
+ * @remarks
288
+ * A string known to all clients working with a certain ContainerExtension and unique
289
+ * among ContainerExtensions. Not `/` may be used in the string. Recommend using
290
+ * concatenation of: type of unique identifier, `:` (required), and unique identifier.
291
+ *
292
+ * @example Examples
293
+ * ```typescript
294
+ * "guid:g0fl001d-1415-5000-c00l-g0fa54g0b1g1"
295
+ * "name:@foo-scope_bar:v1"
296
+ * ```
297
+ *
298
+ * @internal
299
+ */
300
+ export type ContainerExtensionId = `${string}:${string}`;
301
+
302
+ /**
303
+ * @sealed
304
+ * @internal
305
+ */
306
+ export interface ContainerExtensionStore {
307
+ /**
308
+ * Acquires an extension from store or adds new one.
309
+ *
310
+ * @param id - Identifier for the requested extension
311
+ * @param factory - Factory to create the extension if not found
312
+ * @returns The extension
313
+ */
314
+ acquireExtension<
315
+ T,
316
+ TRuntimeProperties extends ExtensionRuntimeProperties,
317
+ TUseContext extends unknown[] = [],
318
+ >(
319
+ id: ContainerExtensionId,
320
+ factory: ContainerExtensionFactory<T, TRuntimeProperties, TUseContext>,
321
+ ...context: TUseContext
322
+ ): T;
323
+ }
@@ -26,6 +26,8 @@ import type {
26
26
  IProvideFluidDataStoreRegistry,
27
27
  } from "@fluidframework/runtime-definitions/internal";
28
28
 
29
+ import type { ContainerExtensionStore } from "./containerExtension.js";
30
+
29
31
  /**
30
32
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
31
33
  * @legacy
@@ -198,3 +200,12 @@ export interface IContainerRuntime
198
200
  */
199
201
  getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;
200
202
  }
203
+
204
+ /**
205
+ * Represents the internal version of the runtime of the container.
206
+ *
207
+ * @internal
208
+ */
209
+ export interface IContainerRuntimeInternal
210
+ extends IContainerRuntime,
211
+ ContainerExtensionStore {}
package/src/index.ts CHANGED
@@ -3,10 +3,27 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ export type {
7
+ ClientConnectionId,
8
+ ContainerExtensionFactory,
9
+ ContainerExtensionId,
10
+ ContainerExtensionStore,
11
+ ContainerExtension,
12
+ ExtensionHost,
13
+ ExtensionHostEvents,
14
+ ExtensionMessage,
15
+ ExtensionRuntimeProperties,
16
+ InboundExtensionMessage,
17
+ OutboundExtensionMessage,
18
+ RawInboundExtensionMessage,
19
+ UnverifiedBrand,
20
+ VerifiedInboundExtensionMessage,
21
+ } from "./containerExtension.js";
6
22
  export type {
7
23
  IContainerRuntime,
8
24
  IContainerRuntimeBaseWithCombinedEvents,
9
25
  IContainerRuntimeEvents,
26
+ IContainerRuntimeInternal,
10
27
  IContainerRuntimeWithResolveHandle_Deprecated,
11
28
  SummarizerStopReason,
12
29
  ISummarizeEventProps,