@fluidframework/datastore 2.0.0-internal.6.4.0 → 2.0.0-internal.7.1.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 (37) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/api-extractor.json +1 -1
  3. package/api-report/datastore.api.md +172 -0
  4. package/dist/channelDeltaConnection.js +6 -6
  5. package/dist/channelDeltaConnection.js.map +1 -1
  6. package/dist/channelStorageService.js +10 -10
  7. package/dist/channelStorageService.js.map +1 -1
  8. package/dist/dataStoreRuntime.d.ts +15 -11
  9. package/dist/dataStoreRuntime.d.ts.map +1 -1
  10. package/dist/dataStoreRuntime.js +86 -90
  11. package/dist/dataStoreRuntime.js.map +1 -1
  12. package/dist/datastore-alpha.d.ts +327 -0
  13. package/dist/datastore-beta.d.ts +327 -0
  14. package/dist/datastore-public.d.ts +327 -0
  15. package/dist/datastore.d.ts +326 -0
  16. package/dist/fluidHandle.d.ts +2 -0
  17. package/dist/fluidHandle.d.ts.map +1 -1
  18. package/dist/fluidHandle.js +21 -19
  19. package/dist/fluidHandle.js.map +1 -1
  20. package/dist/remoteChannelContext.js.map +1 -1
  21. package/dist/tsdoc-metadata.json +1 -1
  22. package/lib/channelDeltaConnection.js +6 -6
  23. package/lib/channelDeltaConnection.js.map +1 -1
  24. package/lib/channelStorageService.js +10 -10
  25. package/lib/channelStorageService.js.map +1 -1
  26. package/lib/dataStoreRuntime.d.ts +15 -11
  27. package/lib/dataStoreRuntime.d.ts.map +1 -1
  28. package/lib/dataStoreRuntime.js +86 -90
  29. package/lib/dataStoreRuntime.js.map +1 -1
  30. package/lib/fluidHandle.d.ts +2 -0
  31. package/lib/fluidHandle.d.ts.map +1 -1
  32. package/lib/fluidHandle.js +21 -19
  33. package/lib/fluidHandle.js.map +1 -1
  34. package/lib/remoteChannelContext.js.map +1 -1
  35. package/package.json +25 -26
  36. package/src/dataStoreRuntime.ts +21 -24
  37. package/src/fluidHandle.ts +2 -0
@@ -0,0 +1,327 @@
1
+ import { AttachState } from '@fluidframework/container-definitions';
2
+ import { FluidObject } from '@fluidframework/core-interfaces';
3
+ import { IAudience } from '@fluidframework/container-definitions';
4
+ import { IChannel } from '@fluidframework/datastore-definitions';
5
+ import { IChannelFactory } from '@fluidframework/datastore-definitions';
6
+ import { IClientDetails } from '@fluidframework/protocol-definitions';
7
+ import { IDeltaManager } from '@fluidframework/container-definitions';
8
+ import { IDocumentMessage } from '@fluidframework/protocol-definitions';
9
+ import { IFluidDataStoreChannel } from '@fluidframework/runtime-definitions';
10
+ import { IFluidDataStoreContext } from '@fluidframework/runtime-definitions';
11
+ import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
12
+ import { IFluidDataStoreRuntimeEvents } from '@fluidframework/datastore-definitions';
13
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
14
+ import { IFluidHandleContext } from '@fluidframework/core-interfaces';
15
+ import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
16
+ import { IIdCompressor } from '@fluidframework/runtime-definitions';
17
+ import { IInboundSignalMessage } from '@fluidframework/runtime-definitions';
18
+ import { ILoaderOptions } from '@fluidframework/container-definitions';
19
+ import { IQuorumClients } from '@fluidframework/protocol-definitions';
20
+ import { IRequest } from '@fluidframework/core-interfaces';
21
+ import { IResponse } from '@fluidframework/core-interfaces';
22
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
23
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
24
+ import { ITelemetryContext } from '@fluidframework/runtime-definitions';
25
+ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
26
+ import { VisibilityState } from '@fluidframework/runtime-definitions';
27
+
28
+ /**
29
+ * @public
30
+ */
31
+ export declare enum DataStoreMessageType {
32
+ Attach = "attach",
33
+ ChannelOp = "op"
34
+ }
35
+
36
+ /**
37
+ * Base data store class
38
+ *
39
+ * @public
40
+ */
41
+ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataStoreRuntimeEvents> implements IFluidDataStoreChannel, IFluidDataStoreRuntime, IFluidHandleContext {
42
+ private readonly dataStoreContext;
43
+ private readonly sharedObjectRegistry;
44
+ /**
45
+ * @deprecated - Instantiate the class using its constructor instead.
46
+ *
47
+ * Loads the data store runtime
48
+ * @param context - The data store context
49
+ * @param sharedObjectRegistry - The registry of shared objects used by this data store
50
+ * @param existing - If loading from an existing file.
51
+ */
52
+ static load(context: IFluidDataStoreContext, sharedObjectRegistry: ISharedObjectRegistry, existing: boolean): FluidDataStoreRuntime;
53
+ /**
54
+ * {@inheritDoc @fluidframework/datastore-definitions#IFluidDataStoreRuntime.entryPoint}
55
+ */
56
+ readonly entryPoint: IFluidHandle<FluidObject>;
57
+ /**
58
+ * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
59
+ */
60
+ get IFluidRouter(): this;
61
+ get connected(): boolean;
62
+ get clientId(): string | undefined;
63
+ get clientDetails(): IClientDetails;
64
+ get isAttached(): boolean;
65
+ get attachState(): AttachState;
66
+ get absolutePath(): string;
67
+ get routeContext(): IFluidHandleContext;
68
+ get idCompressor(): IIdCompressor | undefined;
69
+ get IFluidHandleContext(): this;
70
+ get rootRoutingContext(): this;
71
+ get channelsRoutingContext(): this;
72
+ get objectsRoutingContext(): this;
73
+ private _disposed;
74
+ get disposed(): boolean;
75
+ private readonly contexts;
76
+ private readonly pendingAttach;
77
+ private readonly deferredAttached;
78
+ private readonly localChannelContextQueue;
79
+ private readonly notBoundedChannelContextSet;
80
+ private _attachState;
81
+ visibilityState: VisibilityState;
82
+ private readonly pendingHandlesToMakeVisible;
83
+ readonly id: string;
84
+ readonly options: ILoaderOptions;
85
+ readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
86
+ private readonly quorum;
87
+ private readonly audience;
88
+ private readonly mc;
89
+ get logger(): ITelemetryLoggerExt;
90
+ /**
91
+ * If the summarizer makes local changes, a telemetry event is logged. This has the potential to be very noisy.
92
+ * So, adding a count of how many telemetry events are logged per data store context. This can be
93
+ * controlled via feature flags.
94
+ */
95
+ private localChangesTelemetryCount;
96
+ /**
97
+ * Invokes the given callback and expects that no ops are submitted
98
+ * until execution finishes. If an op is submitted, an error will be raised.
99
+ *
100
+ * Can be disabled by feature gate `Fluid.ContainerRuntime.DisableOpReentryCheck`
101
+ *
102
+ * @param callback - the callback to be invoked
103
+ */
104
+ ensureNoDataModelChanges<T>(callback: () => T): T;
105
+ /**
106
+ * Create an instance of a DataStore runtime.
107
+ *
108
+ * @param dataStoreContext - Context object for the runtime.
109
+ * @param sharedObjectRegistry - The registry of shared objects that this data store will be able to instantiate.
110
+ * @param existing - Pass 'true' if loading this datastore from an existing file; pass 'false' otherwise.
111
+ * @param provideEntryPoint - Function to initialize the entryPoint object for the data store runtime. The
112
+ * handle to this data store runtime will point to the object returned by this function. If this function is not
113
+ * provided, the handle will be left undefined. This is here so we can start making handles a first-class citizen
114
+ * and the primary way of interacting with some Fluid objects, and should be used if possible.
115
+ */
116
+ constructor(dataStoreContext: IFluidDataStoreContext, sharedObjectRegistry: ISharedObjectRegistry, existing: boolean, provideEntryPoint: (runtime: IFluidDataStoreRuntime) => Promise<FluidObject>);
117
+ dispose(): void;
118
+ resolveHandle(request: IRequest): Promise<IResponse>;
119
+ request(request: IRequest): Promise<IResponse>;
120
+ getChannel(id: string): Promise<IChannel>;
121
+ createChannel(id: string | undefined, type: string): IChannel;
122
+ /**
123
+ * Binds a channel with the runtime. If the runtime is attached we will attach the channel right away.
124
+ * If the runtime is not attached we will defer the attach until the runtime attaches.
125
+ * @param channel - channel to be registered.
126
+ */
127
+ bindChannel(channel: IChannel): void;
128
+ /**
129
+ * This function is called when a data store becomes root. It does the following:
130
+ *
131
+ * 1. Marks the data store locally visible in the container.
132
+ *
133
+ * 2. Attaches the graph of all the handles bound to it.
134
+ *
135
+ * 3. Calls into the data store context to mark it visible in the container too. If the container is globally
136
+ * visible, it will mark us globally visible. Otherwise, it will mark us globally visible when it becomes
137
+ * globally visible.
138
+ */
139
+ makeVisibleAndAttachGraph(): void;
140
+ /**
141
+ * This function is called when a handle to this data store is added to a visible DDS.
142
+ */
143
+ attachGraph(): void;
144
+ bind(handle: IFluidHandle): void;
145
+ setConnectionState(connected: boolean, clientId?: string): void;
146
+ getQuorum(): IQuorumClients;
147
+ getAudience(): IAudience;
148
+ uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;
149
+ private createRemoteChannelContext;
150
+ process(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
151
+ processSignal(message: IInboundSignalMessage, local: boolean): void;
152
+ private isChannelAttached;
153
+ /**
154
+ * Returns the outbound routes of this channel. Currently, all contexts in this channel are considered
155
+ * referenced and are hence outbound. This will change when we have root and non-root channel contexts.
156
+ * The only root contexts will be considered as referenced.
157
+ */
158
+ private getOutboundRoutes;
159
+ /**
160
+ * Updates the GC nodes of this channel. It does the following:
161
+ * - Adds a back route to self to all its child GC nodes.
162
+ * - Adds a node for this channel.
163
+ * @param builder - The builder that contains the GC nodes for this channel's children.
164
+ */
165
+ private updateGCNodes;
166
+ /**
167
+ * Generates data used for garbage collection. This includes a list of GC nodes that represent this channel
168
+ * including any of its child channel contexts. Each node has a set of outbound routes to other GC nodes in the
169
+ * document. It does the following:
170
+ *
171
+ * 1. Calls into each child context to get its GC data.
172
+ *
173
+ * 2. Prefixes the child context's id to the GC nodes in the child's GC data. This makes sure that the node can be
174
+ * identified as belonging to the child.
175
+ *
176
+ * 3. Adds a GC node for this channel to the nodes received from the children. All these nodes together represent
177
+ * the GC data of this channel.
178
+ *
179
+ * @param fullGC - true to bypass optimizations and force full generation of GC data.
180
+ */
181
+ getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;
182
+ /**
183
+ * After GC has run, called to notify this channel of routes that are used in it. It calls the child contexts to
184
+ * update their used routes.
185
+ * @param usedRoutes - The routes that are used in all contexts in this channel.
186
+ */
187
+ updateUsedRoutes(usedRoutes: string[]): void;
188
+ /**
189
+ * Called when a new outbound reference is added to another node. This is used by garbage collection to identify
190
+ * all references added in the system.
191
+ * @param srcHandle - The handle of the node that added the reference.
192
+ * @param outboundHandle - The handle of the outbound node that is referenced.
193
+ */
194
+ private addedGCOutboundReference;
195
+ /**
196
+ * Returns a summary at the current sequence number.
197
+ * @param fullTree - true to bypass optimizations and force a full summary tree
198
+ * @param trackState - This tells whether we should track state from this summary.
199
+ * @param telemetryContext - summary data passed through the layers for telemetry purposes
200
+ */
201
+ summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): Promise<ISummaryTreeWithStats>;
202
+ getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
203
+ submitMessage(type: DataStoreMessageType, content: any, localOpMetadata: unknown): void;
204
+ submitSignal(type: string, content: any): void;
205
+ /**
206
+ * Will return when the data store is attached.
207
+ */
208
+ waitAttached(): Promise<void>;
209
+ /**
210
+ * Attach channel should only be called after the data store has been attached
211
+ */
212
+ private attachChannel;
213
+ private submitChannelOp;
214
+ private submit;
215
+ /**
216
+ * For messages of type MessageType.Operation, finds the right channel and asks it to resubmit the message.
217
+ * For all other messages, just submit it again.
218
+ * This typically happens when we reconnect and there are unacked messages.
219
+ * @param content - The content of the original message.
220
+ * @param localOpMetadata - The local metadata associated with the original message.
221
+ */
222
+ reSubmit(type: DataStoreMessageType, content: any, localOpMetadata: unknown): void;
223
+ /**
224
+ * Revert a local op.
225
+ * @param content - The content of the original message.
226
+ * @param localOpMetadata - The local metadata associated with the original message.
227
+ */
228
+ rollback?(type: DataStoreMessageType, content: any, localOpMetadata: unknown): void;
229
+ applyStashedOp(content: any): Promise<unknown>;
230
+ private setChannelDirty;
231
+ private processChannelOp;
232
+ private attachListener;
233
+ private verifyNotClosed;
234
+ /**
235
+ * Summarizer client should not have local changes. These changes can become part of the summary and can break
236
+ * eventual consistency. For example, the next summary (say at ref seq# 100) may contain these changes whereas
237
+ * other clients that are up-to-date till seq# 100 may not have them yet.
238
+ */
239
+ private identifyLocalChangeInSummarizer;
240
+ }
241
+
242
+ /**
243
+ * Handle for a shared {@link @fluidframework/core-interfaces#FluidObject}.
244
+ *
245
+ * @public
246
+ */
247
+ export declare class FluidObjectHandle<T extends FluidObject = FluidObject> implements IFluidHandle {
248
+ protected readonly value: T | Promise<T>;
249
+ readonly path: string;
250
+ readonly routeContext: IFluidHandleContext;
251
+ private readonly pendingHandlesToMakeVisible;
252
+ /**
253
+ * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.absolutePath}
254
+ */
255
+ readonly absolutePath: string;
256
+ /**
257
+ * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}
258
+ */
259
+ get IFluidHandle(): IFluidHandle;
260
+ /**
261
+ * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.isAttached}
262
+ */
263
+ get isAttached(): boolean;
264
+ /**
265
+ * Tells whether the object of this handle is visible in the container locally or globally.
266
+ */
267
+ private get visible();
268
+ /**
269
+ * Tracks whether this handle is locally visible in the container.
270
+ */
271
+ private locallyVisible;
272
+ /**
273
+ * Creates a new `FluidObjectHandle`.
274
+ *
275
+ * @param value - The {@link @fluidframework/core-interfaces#FluidObject} object this handle is for.
276
+ * @param path - The path to this handle relative to the `routeContext`.
277
+ * @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route
278
+ * to this handle.
279
+ */
280
+ constructor(value: T | Promise<T>, path: string, routeContext: IFluidHandleContext);
281
+ /**
282
+ * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.get}
283
+ */
284
+ get(): Promise<any>;
285
+ /**
286
+ * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.attachGraph }
287
+ */
288
+ attachGraph(): void;
289
+ /**
290
+ * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.bind}
291
+ */
292
+ bind(handle: IFluidHandle): void;
293
+ }
294
+
295
+ /**
296
+ * @public
297
+ */
298
+ export declare interface ISharedObjectRegistry {
299
+ get(name: string): IChannelFactory | undefined;
300
+ }
301
+
302
+ /**
303
+ * Mixin class that adds request handler to FluidDataStoreRuntime
304
+ * Request handler is only called when data store can't resolve request, i.e. for custom requests.
305
+ * @param Base - base class, inherits from FluidDataStoreRuntime
306
+ * @param requestHandler - request handler to mix in
307
+ *
308
+ * @public
309
+ */
310
+ export declare const mixinRequestHandler: (requestHandler: (request: IRequest, runtime: FluidDataStoreRuntime) => Promise<IResponse>, Base?: typeof FluidDataStoreRuntime) => typeof FluidDataStoreRuntime;
311
+
312
+ /**
313
+ * Mixin class that adds await for DataObject to finish initialization before we proceed to summary.
314
+ * @param handler - handler that returns info about blob to be added to summary.
315
+ * Or undefined not to add anything to summary.
316
+ * @param Base - base class, inherits from FluidDataStoreRuntime
317
+ *
318
+ * @public
319
+ */
320
+ export declare const mixinSummaryHandler: (handler: (runtime: FluidDataStoreRuntime) => Promise<{
321
+ path: string[];
322
+ content: string;
323
+ } | undefined>, Base?: typeof FluidDataStoreRuntime) => typeof FluidDataStoreRuntime;
324
+
325
+ /* Excluded from this release type: TypedEventEmitter */
326
+
327
+ export { }
@@ -0,0 +1,326 @@
1
+ import { AttachState } from '@fluidframework/container-definitions';
2
+ import { FluidObject } from '@fluidframework/core-interfaces';
3
+ import { IAudience } from '@fluidframework/container-definitions';
4
+ import { IChannel } from '@fluidframework/datastore-definitions';
5
+ import { IChannelFactory } from '@fluidframework/datastore-definitions';
6
+ import { IClientDetails } from '@fluidframework/protocol-definitions';
7
+ import { IDeltaManager } from '@fluidframework/container-definitions';
8
+ import { IDocumentMessage } from '@fluidframework/protocol-definitions';
9
+ import { IFluidDataStoreChannel } from '@fluidframework/runtime-definitions';
10
+ import { IFluidDataStoreContext } from '@fluidframework/runtime-definitions';
11
+ import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
12
+ import { IFluidDataStoreRuntimeEvents } from '@fluidframework/datastore-definitions';
13
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
14
+ import { IFluidHandleContext } from '@fluidframework/core-interfaces';
15
+ import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
16
+ import { IIdCompressor } from '@fluidframework/runtime-definitions';
17
+ import { IInboundSignalMessage } from '@fluidframework/runtime-definitions';
18
+ import { ILoaderOptions } from '@fluidframework/container-definitions';
19
+ import { IQuorumClients } from '@fluidframework/protocol-definitions';
20
+ import { IRequest } from '@fluidframework/core-interfaces';
21
+ import { IResponse } from '@fluidframework/core-interfaces';
22
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
23
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
24
+ import { ITelemetryContext } from '@fluidframework/runtime-definitions';
25
+ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
26
+ import { TypedEventEmitter } from '@fluid-internal/client-utils';
27
+ import { VisibilityState } from '@fluidframework/runtime-definitions';
28
+
29
+ /**
30
+ * @public
31
+ */
32
+ export declare enum DataStoreMessageType {
33
+ Attach = "attach",
34
+ ChannelOp = "op"
35
+ }
36
+
37
+ /**
38
+ * Base data store class
39
+ *
40
+ * @public
41
+ */
42
+ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataStoreRuntimeEvents> implements IFluidDataStoreChannel, IFluidDataStoreRuntime, IFluidHandleContext {
43
+ private readonly dataStoreContext;
44
+ private readonly sharedObjectRegistry;
45
+ /**
46
+ * @deprecated - Instantiate the class using its constructor instead.
47
+ *
48
+ * Loads the data store runtime
49
+ * @param context - The data store context
50
+ * @param sharedObjectRegistry - The registry of shared objects used by this data store
51
+ * @param existing - If loading from an existing file.
52
+ */
53
+ static load(context: IFluidDataStoreContext, sharedObjectRegistry: ISharedObjectRegistry, existing: boolean): FluidDataStoreRuntime;
54
+ /**
55
+ * {@inheritDoc @fluidframework/datastore-definitions#IFluidDataStoreRuntime.entryPoint}
56
+ */
57
+ readonly entryPoint: IFluidHandle<FluidObject>;
58
+ /**
59
+ * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
60
+ */
61
+ get IFluidRouter(): this;
62
+ get connected(): boolean;
63
+ get clientId(): string | undefined;
64
+ get clientDetails(): IClientDetails;
65
+ get isAttached(): boolean;
66
+ get attachState(): AttachState;
67
+ get absolutePath(): string;
68
+ get routeContext(): IFluidHandleContext;
69
+ get idCompressor(): IIdCompressor | undefined;
70
+ get IFluidHandleContext(): this;
71
+ get rootRoutingContext(): this;
72
+ get channelsRoutingContext(): this;
73
+ get objectsRoutingContext(): this;
74
+ private _disposed;
75
+ get disposed(): boolean;
76
+ private readonly contexts;
77
+ private readonly pendingAttach;
78
+ private readonly deferredAttached;
79
+ private readonly localChannelContextQueue;
80
+ private readonly notBoundedChannelContextSet;
81
+ private _attachState;
82
+ visibilityState: VisibilityState;
83
+ private readonly pendingHandlesToMakeVisible;
84
+ readonly id: string;
85
+ readonly options: ILoaderOptions;
86
+ readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
87
+ private readonly quorum;
88
+ private readonly audience;
89
+ private readonly mc;
90
+ get logger(): ITelemetryLoggerExt;
91
+ /**
92
+ * If the summarizer makes local changes, a telemetry event is logged. This has the potential to be very noisy.
93
+ * So, adding a count of how many telemetry events are logged per data store context. This can be
94
+ * controlled via feature flags.
95
+ */
96
+ private localChangesTelemetryCount;
97
+ /**
98
+ * Invokes the given callback and expects that no ops are submitted
99
+ * until execution finishes. If an op is submitted, an error will be raised.
100
+ *
101
+ * Can be disabled by feature gate `Fluid.ContainerRuntime.DisableOpReentryCheck`
102
+ *
103
+ * @param callback - the callback to be invoked
104
+ */
105
+ ensureNoDataModelChanges<T>(callback: () => T): T;
106
+ /**
107
+ * Create an instance of a DataStore runtime.
108
+ *
109
+ * @param dataStoreContext - Context object for the runtime.
110
+ * @param sharedObjectRegistry - The registry of shared objects that this data store will be able to instantiate.
111
+ * @param existing - Pass 'true' if loading this datastore from an existing file; pass 'false' otherwise.
112
+ * @param provideEntryPoint - Function to initialize the entryPoint object for the data store runtime. The
113
+ * handle to this data store runtime will point to the object returned by this function. If this function is not
114
+ * provided, the handle will be left undefined. This is here so we can start making handles a first-class citizen
115
+ * and the primary way of interacting with some Fluid objects, and should be used if possible.
116
+ */
117
+ constructor(dataStoreContext: IFluidDataStoreContext, sharedObjectRegistry: ISharedObjectRegistry, existing: boolean, provideEntryPoint: (runtime: IFluidDataStoreRuntime) => Promise<FluidObject>);
118
+ dispose(): void;
119
+ resolveHandle(request: IRequest): Promise<IResponse>;
120
+ request(request: IRequest): Promise<IResponse>;
121
+ getChannel(id: string): Promise<IChannel>;
122
+ createChannel(id: string | undefined, type: string): IChannel;
123
+ /**
124
+ * Binds a channel with the runtime. If the runtime is attached we will attach the channel right away.
125
+ * If the runtime is not attached we will defer the attach until the runtime attaches.
126
+ * @param channel - channel to be registered.
127
+ */
128
+ bindChannel(channel: IChannel): void;
129
+ /**
130
+ * This function is called when a data store becomes root. It does the following:
131
+ *
132
+ * 1. Marks the data store locally visible in the container.
133
+ *
134
+ * 2. Attaches the graph of all the handles bound to it.
135
+ *
136
+ * 3. Calls into the data store context to mark it visible in the container too. If the container is globally
137
+ * visible, it will mark us globally visible. Otherwise, it will mark us globally visible when it becomes
138
+ * globally visible.
139
+ */
140
+ makeVisibleAndAttachGraph(): void;
141
+ /**
142
+ * This function is called when a handle to this data store is added to a visible DDS.
143
+ */
144
+ attachGraph(): void;
145
+ bind(handle: IFluidHandle): void;
146
+ setConnectionState(connected: boolean, clientId?: string): void;
147
+ getQuorum(): IQuorumClients;
148
+ getAudience(): IAudience;
149
+ uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;
150
+ private createRemoteChannelContext;
151
+ process(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
152
+ processSignal(message: IInboundSignalMessage, local: boolean): void;
153
+ private isChannelAttached;
154
+ /**
155
+ * Returns the outbound routes of this channel. Currently, all contexts in this channel are considered
156
+ * referenced and are hence outbound. This will change when we have root and non-root channel contexts.
157
+ * The only root contexts will be considered as referenced.
158
+ */
159
+ private getOutboundRoutes;
160
+ /**
161
+ * Updates the GC nodes of this channel. It does the following:
162
+ * - Adds a back route to self to all its child GC nodes.
163
+ * - Adds a node for this channel.
164
+ * @param builder - The builder that contains the GC nodes for this channel's children.
165
+ */
166
+ private updateGCNodes;
167
+ /**
168
+ * Generates data used for garbage collection. This includes a list of GC nodes that represent this channel
169
+ * including any of its child channel contexts. Each node has a set of outbound routes to other GC nodes in the
170
+ * document. It does the following:
171
+ *
172
+ * 1. Calls into each child context to get its GC data.
173
+ *
174
+ * 2. Prefixes the child context's id to the GC nodes in the child's GC data. This makes sure that the node can be
175
+ * identified as belonging to the child.
176
+ *
177
+ * 3. Adds a GC node for this channel to the nodes received from the children. All these nodes together represent
178
+ * the GC data of this channel.
179
+ *
180
+ * @param fullGC - true to bypass optimizations and force full generation of GC data.
181
+ */
182
+ getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;
183
+ /**
184
+ * After GC has run, called to notify this channel of routes that are used in it. It calls the child contexts to
185
+ * update their used routes.
186
+ * @param usedRoutes - The routes that are used in all contexts in this channel.
187
+ */
188
+ updateUsedRoutes(usedRoutes: string[]): void;
189
+ /**
190
+ * Called when a new outbound reference is added to another node. This is used by garbage collection to identify
191
+ * all references added in the system.
192
+ * @param srcHandle - The handle of the node that added the reference.
193
+ * @param outboundHandle - The handle of the outbound node that is referenced.
194
+ */
195
+ private addedGCOutboundReference;
196
+ /**
197
+ * Returns a summary at the current sequence number.
198
+ * @param fullTree - true to bypass optimizations and force a full summary tree
199
+ * @param trackState - This tells whether we should track state from this summary.
200
+ * @param telemetryContext - summary data passed through the layers for telemetry purposes
201
+ */
202
+ summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): Promise<ISummaryTreeWithStats>;
203
+ getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
204
+ submitMessage(type: DataStoreMessageType, content: any, localOpMetadata: unknown): void;
205
+ submitSignal(type: string, content: any): void;
206
+ /**
207
+ * Will return when the data store is attached.
208
+ */
209
+ waitAttached(): Promise<void>;
210
+ /**
211
+ * Attach channel should only be called after the data store has been attached
212
+ */
213
+ private attachChannel;
214
+ private submitChannelOp;
215
+ private submit;
216
+ /**
217
+ * For messages of type MessageType.Operation, finds the right channel and asks it to resubmit the message.
218
+ * For all other messages, just submit it again.
219
+ * This typically happens when we reconnect and there are unacked messages.
220
+ * @param content - The content of the original message.
221
+ * @param localOpMetadata - The local metadata associated with the original message.
222
+ */
223
+ reSubmit(type: DataStoreMessageType, content: any, localOpMetadata: unknown): void;
224
+ /**
225
+ * Revert a local op.
226
+ * @param content - The content of the original message.
227
+ * @param localOpMetadata - The local metadata associated with the original message.
228
+ */
229
+ rollback?(type: DataStoreMessageType, content: any, localOpMetadata: unknown): void;
230
+ applyStashedOp(content: any): Promise<unknown>;
231
+ private setChannelDirty;
232
+ private processChannelOp;
233
+ private attachListener;
234
+ private verifyNotClosed;
235
+ /**
236
+ * Summarizer client should not have local changes. These changes can become part of the summary and can break
237
+ * eventual consistency. For example, the next summary (say at ref seq# 100) may contain these changes whereas
238
+ * other clients that are up-to-date till seq# 100 may not have them yet.
239
+ */
240
+ private identifyLocalChangeInSummarizer;
241
+ }
242
+
243
+ /**
244
+ * Handle for a shared {@link @fluidframework/core-interfaces#FluidObject}.
245
+ *
246
+ * @public
247
+ */
248
+ export declare class FluidObjectHandle<T extends FluidObject = FluidObject> implements IFluidHandle {
249
+ protected readonly value: T | Promise<T>;
250
+ readonly path: string;
251
+ readonly routeContext: IFluidHandleContext;
252
+ private readonly pendingHandlesToMakeVisible;
253
+ /**
254
+ * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.absolutePath}
255
+ */
256
+ readonly absolutePath: string;
257
+ /**
258
+ * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}
259
+ */
260
+ get IFluidHandle(): IFluidHandle;
261
+ /**
262
+ * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.isAttached}
263
+ */
264
+ get isAttached(): boolean;
265
+ /**
266
+ * Tells whether the object of this handle is visible in the container locally or globally.
267
+ */
268
+ private get visible();
269
+ /**
270
+ * Tracks whether this handle is locally visible in the container.
271
+ */
272
+ private locallyVisible;
273
+ /**
274
+ * Creates a new `FluidObjectHandle`.
275
+ *
276
+ * @param value - The {@link @fluidframework/core-interfaces#FluidObject} object this handle is for.
277
+ * @param path - The path to this handle relative to the `routeContext`.
278
+ * @param routeContext - The parent {@link @fluidframework/core-interfaces#IFluidHandleContext} that has a route
279
+ * to this handle.
280
+ */
281
+ constructor(value: T | Promise<T>, path: string, routeContext: IFluidHandleContext);
282
+ /**
283
+ * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.get}
284
+ */
285
+ get(): Promise<any>;
286
+ /**
287
+ * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.attachGraph }
288
+ */
289
+ attachGraph(): void;
290
+ /**
291
+ * {@inheritDoc @fluidframework/core-interfaces#IFluidHandle.bind}
292
+ */
293
+ bind(handle: IFluidHandle): void;
294
+ }
295
+
296
+ /**
297
+ * @public
298
+ */
299
+ export declare interface ISharedObjectRegistry {
300
+ get(name: string): IChannelFactory | undefined;
301
+ }
302
+
303
+ /**
304
+ * Mixin class that adds request handler to FluidDataStoreRuntime
305
+ * Request handler is only called when data store can't resolve request, i.e. for custom requests.
306
+ * @param Base - base class, inherits from FluidDataStoreRuntime
307
+ * @param requestHandler - request handler to mix in
308
+ *
309
+ * @public
310
+ */
311
+ export declare const mixinRequestHandler: (requestHandler: (request: IRequest, runtime: FluidDataStoreRuntime) => Promise<IResponse>, Base?: typeof FluidDataStoreRuntime) => typeof FluidDataStoreRuntime;
312
+
313
+ /**
314
+ * Mixin class that adds await for DataObject to finish initialization before we proceed to summary.
315
+ * @param handler - handler that returns info about blob to be added to summary.
316
+ * Or undefined not to add anything to summary.
317
+ * @param Base - base class, inherits from FluidDataStoreRuntime
318
+ *
319
+ * @public
320
+ */
321
+ export declare const mixinSummaryHandler: (handler: (runtime: FluidDataStoreRuntime) => Promise<{
322
+ path: string[];
323
+ content: string;
324
+ } | undefined>, Base?: typeof FluidDataStoreRuntime) => typeof FluidDataStoreRuntime;
325
+
326
+ export { }
@@ -5,6 +5,8 @@
5
5
  import { IFluidHandle, IFluidHandleContext, FluidObject } from "@fluidframework/core-interfaces";
6
6
  /**
7
7
  * Handle for a shared {@link @fluidframework/core-interfaces#FluidObject}.
8
+ *
9
+ * @public
8
10
  */
9
11
  export declare class FluidObjectHandle<T extends FluidObject = FluidObject> implements IFluidHandle {
10
12
  protected readonly value: T | Promise<T>;
@@ -1 +1 @@
1
- {"version":3,"file":"fluidHandle.d.ts","sourceRoot":"","sources":["../src/fluidHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAGjG;;GAEG;AACH,qBAAa,iBAAiB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,CAAE,YAAW,YAAY;IAuDzF,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;aACxB,IAAI,EAAE,MAAM;aACZ,YAAY,EAAE,mBAAmB;IAxDlD,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAgC;IAE5E;;OAEG;IACH,SAAgB,YAAY,EAAE,MAAM,CAAC;IAErC;;OAEG;IACH,IAAW,YAAY,IAAI,YAAY,CAEtC;IAED;;OAEG;IACH,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED;;OAEG;IACH,OAAO,KAAK,OAAO,GAclB;IAED;;OAEG;IACH,OAAO,CAAC,cAAc,CAAkB;IAExC;;;;;;;OAOG;gBAEiB,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EACxB,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,mBAAmB;IAKlD;;OAEG;IACU,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IAKhC;;OAEG;IACI,WAAW,IAAI,IAAI;IAa1B;;OAEG;IACI,IAAI,CAAC,MAAM,EAAE,YAAY;CAQhC"}
1
+ {"version":3,"file":"fluidHandle.d.ts","sourceRoot":"","sources":["../src/fluidHandle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAGjG;;;;GAIG;AACH,qBAAa,iBAAiB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,CAAE,YAAW,YAAY;IAuDzF,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;aACxB,IAAI,EAAE,MAAM;aACZ,YAAY,EAAE,mBAAmB;IAxDlD,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAgC;IAE5E;;OAEG;IACH,SAAgB,YAAY,EAAE,MAAM,CAAC;IAErC;;OAEG;IACH,IAAW,YAAY,IAAI,YAAY,CAEtC;IAED;;OAEG;IACH,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED;;OAEG;IACH,OAAO,KAAK,OAAO,GAclB;IAED;;OAEG;IACH,OAAO,CAAC,cAAc,CAAkB;IAExC;;;;;;;OAOG;gBAEiB,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EACxB,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,mBAAmB;IAKlD;;OAEG;IACU,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IAKhC;;OAEG;IACI,WAAW,IAAI,IAAI;IAa1B;;OAEG;IACI,IAAI,CAAC,MAAM,EAAE,YAAY;CAQhC"}