@fluidframework/runtime-definitions 1.4.0-115997 → 2.0.0-dev-rc.1.0.0.224419

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 (55) hide show
  1. package/.eslintrc.cjs +12 -0
  2. package/CHANGELOG.md +330 -0
  3. package/README.md +43 -7
  4. package/api-extractor-lint.json +4 -0
  5. package/api-extractor.json +2 -2
  6. package/api-report/runtime-definitions.api.md +474 -0
  7. package/dist/attribution.d.ts +71 -0
  8. package/dist/attribution.d.ts.map +1 -0
  9. package/dist/attribution.js +7 -0
  10. package/dist/attribution.js.map +1 -0
  11. package/dist/dataStoreContext.d.ts +114 -61
  12. package/dist/dataStoreContext.d.ts.map +1 -1
  13. package/dist/dataStoreContext.js +27 -5
  14. package/dist/dataStoreContext.js.map +1 -1
  15. package/dist/dataStoreFactory.d.ts +7 -0
  16. package/dist/dataStoreFactory.d.ts.map +1 -1
  17. package/dist/dataStoreFactory.js +3 -0
  18. package/dist/dataStoreFactory.js.map +1 -1
  19. package/dist/dataStoreRegistry.d.ts +14 -4
  20. package/dist/dataStoreRegistry.d.ts.map +1 -1
  21. package/dist/dataStoreRegistry.js +3 -0
  22. package/dist/dataStoreRegistry.js.map +1 -1
  23. package/dist/garbageCollection.d.ts +35 -10
  24. package/dist/garbageCollection.d.ts.map +1 -1
  25. package/dist/garbageCollection.js +25 -3
  26. package/dist/garbageCollection.js.map +1 -1
  27. package/dist/index.d.ts +52 -6
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +26 -16
  30. package/dist/index.js.map +1 -1
  31. package/dist/protocol.d.ts +10 -3
  32. package/dist/protocol.d.ts.map +1 -1
  33. package/dist/protocol.js.map +1 -1
  34. package/dist/runtime-definitions-alpha.d.ts +993 -0
  35. package/dist/runtime-definitions-beta.d.ts +264 -0
  36. package/dist/runtime-definitions-public.d.ts +264 -0
  37. package/dist/runtime-definitions-untrimmed.d.ts +1068 -0
  38. package/dist/summary.d.ts +138 -70
  39. package/dist/summary.d.ts.map +1 -1
  40. package/dist/summary.js +13 -1
  41. package/dist/summary.js.map +1 -1
  42. package/dist/tsdoc-metadata.json +11 -0
  43. package/package.json +96 -42
  44. package/prettier.config.cjs +8 -0
  45. package/src/aliasing.md +42 -0
  46. package/src/attribution.ts +78 -0
  47. package/src/dataStoreContext.ts +432 -388
  48. package/src/dataStoreFactory.ts +21 -11
  49. package/src/dataStoreRegistry.ts +18 -6
  50. package/src/garbageCollection.ts +38 -15
  51. package/src/index.ts +111 -6
  52. package/src/protocol.ts +46 -38
  53. package/src/summary.ts +298 -225
  54. package/tsconfig.json +10 -12
  55. package/.eslintrc.js +0 -13
@@ -0,0 +1,993 @@
1
+ import { AttachState } from '@fluidframework/container-definitions';
2
+ import { FluidObject } from '@fluidframework/core-interfaces';
3
+ import { IAudience } from '@fluidframework/container-definitions';
4
+ import { IClientDetails } from '@fluidframework/protocol-definitions';
5
+ import { IdCompressor } from '@fluidframework/id-compressor';
6
+ import { IdCreationRange } from '@fluidframework/id-compressor';
7
+ import { IDeltaManager } from '@fluidframework/container-definitions';
8
+ import { IDisposable } from '@fluidframework/core-interfaces';
9
+ import { IDocumentMessage } from '@fluidframework/protocol-definitions';
10
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
11
+ import { IEvent } from '@fluidframework/core-interfaces';
12
+ import { IEventProvider } from '@fluidframework/core-interfaces';
13
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
14
+ import { IIdCompressor } from '@fluidframework/id-compressor';
15
+ import { IIdCompressorCore } from '@fluidframework/id-compressor';
16
+ import { ILoaderOptions } from '@fluidframework/container-definitions';
17
+ import { IProvideFluidHandleContext } from '@fluidframework/core-interfaces';
18
+ import { IQuorumClients } from '@fluidframework/protocol-definitions';
19
+ import { IRequest } from '@fluidframework/core-interfaces';
20
+ import { IResponse } from '@fluidframework/core-interfaces';
21
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
22
+ import { ISignalMessage } from '@fluidframework/protocol-definitions';
23
+ import { ISnapshotTree } from '@fluidframework/protocol-definitions';
24
+ import { ISummaryTree } from '@fluidframework/protocol-definitions';
25
+ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
26
+ import { ITree } from '@fluidframework/protocol-definitions';
27
+ import type { IUser } from '@fluidframework/protocol-definitions';
28
+ import { OpSpaceCompressedId } from '@fluidframework/id-compressor';
29
+ import { SerializedIdCompressor } from '@fluidframework/id-compressor';
30
+ import { SerializedIdCompressorWithNoSession } from '@fluidframework/id-compressor';
31
+ import { SerializedIdCompressorWithOngoingSession } from '@fluidframework/id-compressor';
32
+ import { SessionId } from '@fluidframework/id-compressor';
33
+ import { SessionSpaceCompressedId } from '@fluidframework/id-compressor';
34
+ import { StableId } from '@fluidframework/id-compressor';
35
+ import { SummaryTree } from '@fluidframework/protocol-definitions';
36
+ import { TelemetryEventPropertyType } from '@fluidframework/core-interfaces';
37
+
38
+ /**
39
+ * Encapsulates the return codes of the aliasing API.
40
+ *
41
+ * 'Success' - the datastore has been successfully aliased. It can now be used.
42
+ * 'Conflict' - there is already a datastore bound to the provided alias. To acquire it's entry point, use
43
+ * the `IContainerRuntime.getAliasedDataStoreEntryPoint` function. The current datastore should be discarded
44
+ * and will be garbage collected. The current datastore cannot be aliased to a different value.
45
+ * 'AlreadyAliased' - the datastore has already been previously bound to another alias name.
46
+ * @alpha
47
+ */
48
+ export declare type AliasResult = "Success" | "Conflict" | "AlreadyAliased";
49
+
50
+ /* Excluded from this release type: AttributionInfo */
51
+
52
+ /**
53
+ * Can be indexed into the ContainerRuntime in order to retrieve {@link AttributionInfo}.
54
+ * @alpha
55
+ */
56
+ export declare type AttributionKey = OpAttributionKey | DetachedAttributionKey | LocalAttributionKey;
57
+
58
+ /* Excluded from this release type: blobCountPropertyName */
59
+
60
+ /* Excluded from this release type: channelsTreeName */
61
+
62
+ /**
63
+ * @alpha
64
+ */
65
+ export declare type CreateChildSummarizerNodeFn = (summarizeInternal: SummarizeInternalFn, getGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,
66
+ /**
67
+ * @deprecated The functionality to get base GC details has been moved to summarizer node.
68
+ */
69
+ getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>) => ISummarizerNodeWithGC;
70
+
71
+ /**
72
+ * @alpha
73
+ */
74
+ export declare type CreateChildSummarizerNodeParam = {
75
+ type: CreateSummarizerNodeSource.FromSummary;
76
+ } | {
77
+ type: CreateSummarizerNodeSource.FromAttach;
78
+ sequenceNumber: number;
79
+ snapshot: ITree;
80
+ } | {
81
+ type: CreateSummarizerNodeSource.Local;
82
+ };
83
+
84
+ /**
85
+ * @alpha
86
+ */
87
+ export declare enum CreateSummarizerNodeSource {
88
+ FromSummary = 0,
89
+ FromAttach = 1,
90
+ Local = 2
91
+ }
92
+
93
+ /**
94
+ * AttributionKey associated with content that was inserted while the container was in a detached state.
95
+ *
96
+ * @remarks Retrieving an {@link AttributionInfo} from content associated with detached attribution keys
97
+ * is currently unsupported, as applications can effectively modify content anonymously while detached.
98
+ * The runtime has no mechanism for reliably obtaining the user. It would be reasonable to start supporting
99
+ * this functionality if the host provided additional context to their attributor or attach calls.
100
+ * @alpha
101
+ */
102
+ export declare interface DetachedAttributionKey {
103
+ type: "detached";
104
+ /**
105
+ * Arbitrary discriminator associated with content inserted while detached.
106
+ *
107
+ * @remarks For now, the runtime assumes all content created while detached is associated
108
+ * with the same user/timestamp.
109
+ * We could weaken this assumption in the future with further API support and
110
+ * allow arbitrary strings or numbers as part of this key.
111
+ */
112
+ id: 0;
113
+ }
114
+
115
+ /**
116
+ * A single registry entry that may be used to create data stores
117
+ * It has to have either factory or registry, or both.
118
+ * @alpha
119
+ */
120
+ export declare type FluidDataStoreRegistryEntry = Readonly<Partial<IProvideFluidDataStoreRegistry & IProvideFluidDataStoreFactory>>;
121
+
122
+ /**
123
+ * Runtime flush mode handling
124
+ * @alpha
125
+ */
126
+ export declare enum FlushMode {
127
+ /**
128
+ * In Immediate flush mode the runtime will immediately send all operations to the driver layer.
129
+ */
130
+ Immediate = 0,
131
+ /**
132
+ * When in TurnBased flush mode the runtime will buffer operations in the current turn and send them as a single
133
+ * batch at the end of the turn. The flush call on the runtime can be used to force send the current batch.
134
+ */
135
+ TurnBased = 1
136
+ }
137
+
138
+ /* Excluded from this release type: FlushModeExperimental */
139
+
140
+ /* Excluded from this release type: gcBlobPrefix */
141
+
142
+ /* Excluded from this release type: gcDeletedBlobKey */
143
+
144
+ /* Excluded from this release type: gcTombstoneBlobKey */
145
+
146
+ /* Excluded from this release type: gcTreeKey */
147
+
148
+ /**
149
+ * Message send by client attaching local data structure.
150
+ * Contains snapshot of data structure which is the current state of this data structure.
151
+ * @alpha
152
+ */
153
+ export declare interface IAttachMessage {
154
+ /**
155
+ * The identifier for the object
156
+ */
157
+ id: string;
158
+ /**
159
+ * The type of object
160
+ */
161
+ type: string;
162
+ /**
163
+ * Initial snapshot of the document (contains ownership)
164
+ */
165
+ snapshot: ITree;
166
+ }
167
+
168
+ /**
169
+ * A reduced set of functionality of IContainerRuntime that a data store context/data store runtime will need
170
+ * TODO: this should be merged into IFluidDataStoreContext
171
+ * @alpha
172
+ */
173
+ export declare interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeBaseEvents> {
174
+ readonly logger: ITelemetryBaseLogger;
175
+ readonly clientDetails: IClientDetails;
176
+ /**
177
+ * Invokes the given callback and guarantees that all operations generated within the callback will be ordered
178
+ * sequentially. Total size of all messages must be less than maxOpSize.
179
+ */
180
+ orderSequentially(callback: () => void): void;
181
+ /**
182
+ * Submits a container runtime level signal to be sent to other clients.
183
+ * @param type - Type of the signal.
184
+ * @param content - Content of the signal.
185
+ */
186
+ submitSignal(type: string, content: any): void;
187
+ /**
188
+ * @deprecated 0.16 Issue #1537, #3631
189
+ */
190
+ _createDataStoreWithProps(pkg: string | string[], props?: any, id?: string): Promise<IDataStore>;
191
+ /**
192
+ * Creates a data store and returns an object that exposes a handle to the data store's entryPoint, and also serves
193
+ * as the data store's router. The data store is not bound to a container, and in such state is not persisted to
194
+ * storage (file). Storing the entryPoint handle (or any other handle inside the data store, e.g. for DDS) into an
195
+ * already attached DDS (or non-attached DDS that will eventually get attached to storage) will result in this
196
+ * store being attached to storage.
197
+ * @param pkg - Package name of the data store factory
198
+ */
199
+ createDataStore(pkg: string | string[]): Promise<IDataStore>;
200
+ /**
201
+ * Creates detached data store context. Only after context.attachRuntime() is called,
202
+ * data store initialization is considered complete.
203
+ */
204
+ createDetachedDataStore(pkg: Readonly<string[]>): IFluidDataStoreContextDetached;
205
+ /**
206
+ * Get an absolute url for a provided container-relative request.
207
+ * Returns undefined if the container or data store isn't attached to storage.
208
+ * @param relativeUrl - A relative request within the container
209
+ */
210
+ getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;
211
+ uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;
212
+ /**
213
+ * Returns the current quorum.
214
+ */
215
+ getQuorum(): IQuorumClients;
216
+ /**
217
+ * Returns the current audience.
218
+ */
219
+ getAudience(): IAudience;
220
+ }
221
+
222
+ /**
223
+ * @alpha
224
+ */
225
+ export declare interface IContainerRuntimeBaseEvents extends IEvent {
226
+ (event: "batchBegin", listener: (op: ISequencedDocumentMessage) => void): any;
227
+ /**
228
+ * @param runtimeMessage - tells if op is runtime op. If it is, it was unpacked, i.e. it's type and content
229
+ * represent internal container runtime type / content.
230
+ */
231
+ (event: "op", listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void): any;
232
+ (event: "batchEnd", listener: (error: any, op: ISequencedDocumentMessage) => void): any;
233
+ (event: "signal", listener: (message: IInboundSignalMessage, local: boolean) => void): any;
234
+ }
235
+
236
+ /**
237
+ * Exposes some functionality/features of a data store:
238
+ * - Handle to the data store's entryPoint
239
+ * - Fluid router for the data store
240
+ * - Can be assigned an alias
241
+ * @alpha
242
+ */
243
+ export declare interface IDataStore {
244
+ /**
245
+ * Attempt to assign an alias to the datastore.
246
+ * If the operation succeeds, the datastore can be referenced
247
+ * by the supplied alias and will not be garbage collected.
248
+ *
249
+ * @param alias - Given alias for this datastore.
250
+ * @returns A promise with the {@link AliasResult}
251
+ */
252
+ trySetAlias(alias: string): Promise<AliasResult>;
253
+ /**
254
+ * Exposes a handle to the root object / entryPoint of the data store. Use this as the primary way of interacting
255
+ * with it.
256
+ */
257
+ readonly entryPoint: IFluidHandle<FluidObject>;
258
+ }
259
+
260
+ export { IdCompressor }
261
+
262
+ export { IdCreationRange }
263
+
264
+ /**
265
+ * An envelope wraps the contents with the intended target
266
+ * @alpha
267
+ */
268
+ export declare interface IEnvelope {
269
+ /**
270
+ * The target for the envelope
271
+ */
272
+ address: string;
273
+ /**
274
+ * The contents of the envelope
275
+ */
276
+ contents: any;
277
+ }
278
+
279
+ /**
280
+ * @experimental - Can be deleted/changed at any time
281
+ * Contains the necessary information to allow DDSes to do incremental summaries
282
+ * @public
283
+ */
284
+ export declare interface IExperimentalIncrementalSummaryContext {
285
+ /**
286
+ * The sequence number of the summary generated that will be sent to the server.
287
+ */
288
+ summarySequenceNumber: number;
289
+ /**
290
+ * The sequence number of the most recent summary that was acknowledged by the server.
291
+ */
292
+ latestSummarySequenceNumber: number;
293
+ /**
294
+ * The path to the runtime/datastore/dds that is used to generate summary handles
295
+ * Note: Summary handles are nodes of the summary tree that point to previous parts of the last successful summary
296
+ * instead of being a blob or tree node
297
+ *
298
+ * This path contains the id of the data store and dds which should not be leaked to layers below them. Ideally,
299
+ * a layer should not know its own id. This is important for channel unification work and there has been a lot of
300
+ * work to remove these kinds of leakages. Some still exist, which have to be fixed but we should not be adding
301
+ * more dependencies.
302
+ */
303
+ summaryPath: string;
304
+ }
305
+
306
+ /**
307
+ * Minimal interface a data store runtime needs to provide for IFluidDataStoreContext to bind to control.
308
+ *
309
+ * Functionality include attach, snapshot, op/signal processing, request routes, expose an entryPoint,
310
+ * and connection state notifications
311
+ * @alpha
312
+ */
313
+ export declare interface IFluidDataStoreChannel extends IDisposable {
314
+ readonly id: string;
315
+ /**
316
+ * Indicates the attachment state of the channel to a host service.
317
+ */
318
+ readonly attachState: AttachState;
319
+ readonly visibilityState: VisibilityState;
320
+ /**
321
+ * Runs through the graph and attaches the bound handles. Then binds this runtime to the container.
322
+ * @deprecated This will be removed in favor of {@link IFluidDataStoreChannel.makeVisibleAndAttachGraph}.
323
+ */
324
+ attachGraph(): void;
325
+ /**
326
+ * Makes the data store channel visible in the container. Also, runs through its graph and attaches all
327
+ * bound handles that represent its dependencies in the container's graph.
328
+ */
329
+ makeVisibleAndAttachGraph(): void;
330
+ /**
331
+ * Retrieves the summary used as part of the initial summary message
332
+ */
333
+ getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
334
+ /**
335
+ * Processes the op.
336
+ */
337
+ process(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
338
+ /**
339
+ * Processes the signal.
340
+ */
341
+ processSignal(message: any, local: boolean): void;
342
+ /**
343
+ * Generates a summary for the channel.
344
+ * Introduced with summarizerNode - will be required in a future release.
345
+ * @param fullTree - true to bypass optimizations and force a full summary tree.
346
+ * @param trackState - This tells whether we should track state from this summary.
347
+ * @param telemetryContext - summary data passed through the layers for telemetry purposes
348
+ */
349
+ summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): Promise<ISummaryTreeWithStats>;
350
+ /**
351
+ * Returns the data used for garbage collection. This includes a list of GC nodes that represent this context
352
+ * including any of its children. Each node has a list of outbound routes to other GC nodes in the document.
353
+ * @param fullGC - true to bypass optimizations and force full generation of GC data.
354
+ */
355
+ getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;
356
+ /**
357
+ * After GC has run, called to notify this channel of routes that are used in it.
358
+ * @param usedRoutes - The routes that are used in this channel.
359
+ */
360
+ updateUsedRoutes(usedRoutes: string[]): void;
361
+ /**
362
+ * Notifies this object about changes in the connection state.
363
+ * @param value - New connection state.
364
+ * @param clientId - ID of the client. It's old ID when in disconnected state and
365
+ * it's new client ID when we are connecting or connected.
366
+ */
367
+ setConnectionState(connected: boolean, clientId?: string): any;
368
+ /**
369
+ * Ask the DDS to resubmit a message. This could be because we reconnected and this message was not acked.
370
+ * @param type - The type of the original message.
371
+ * @param content - The content of the original message.
372
+ * @param localOpMetadata - The local metadata associated with the original message.
373
+ */
374
+ reSubmit(type: string, content: any, localOpMetadata: unknown): any;
375
+ applyStashedOp(content: any): Promise<unknown>;
376
+ /**
377
+ * Revert a local message.
378
+ * @param type - The type of the original message.
379
+ * @param content - The content of the original message.
380
+ * @param localOpMetadata - The local metadata associated with the original message.
381
+ */
382
+ rollback?(type: string, content: any, localOpMetadata: unknown): void;
383
+ /**
384
+ * Exposes a handle to the root object / entryPoint of the component. Use this as the primary way of interacting
385
+ * with the component.
386
+ */
387
+ readonly entryPoint: IFluidHandle<FluidObject>;
388
+ request(request: IRequest): Promise<IResponse>;
389
+ }
390
+
391
+ /**
392
+ * Represents the context for the data store. It is used by the data store runtime to
393
+ * get information and call functionality to the container.
394
+ * @alpha
395
+ */
396
+ export declare interface IFluidDataStoreContext extends IEventProvider<IFluidDataStoreContextEvents>, Partial<IProvideFluidDataStoreRegistry>, IProvideFluidHandleContext {
397
+ readonly id: string;
398
+ /**
399
+ * A data store created by a client, is a local data store for that client. Also, when a detached container loads
400
+ * from a snapshot, all the data stores are treated as local data stores because at that stage the container
401
+ * still doesn't exists in storage and so the data store couldn't have been created by any other client.
402
+ * Value of this never changes even after the data store is attached.
403
+ * As implementer of data store runtime, you can use this property to check that this data store belongs to this
404
+ * client and hence implement any scenario based on that.
405
+ */
406
+ readonly isLocalDataStore: boolean;
407
+ /**
408
+ * The package path of the data store as per the package factory.
409
+ */
410
+ readonly packagePath: readonly string[];
411
+ readonly options: ILoaderOptions;
412
+ readonly clientId: string | undefined;
413
+ readonly connected: boolean;
414
+ readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
415
+ readonly storage: IDocumentStorageService;
416
+ readonly baseSnapshot: ISnapshotTree | undefined;
417
+ readonly logger: ITelemetryBaseLogger;
418
+ readonly clientDetails: IClientDetails;
419
+ readonly idCompressor?: IIdCompressor;
420
+ /**
421
+ * Indicates the attachment state of the data store to a host service.
422
+ */
423
+ readonly attachState: AttachState;
424
+ readonly containerRuntime: IContainerRuntimeBase;
425
+ /**
426
+ * @deprecated 0.16 Issue #1635, #3631
427
+ */
428
+ readonly createProps?: any;
429
+ /**
430
+ * Ambient services provided with the context
431
+ */
432
+ readonly scope: FluidObject;
433
+ /**
434
+ * Returns the current quorum.
435
+ */
436
+ getQuorum(): IQuorumClients;
437
+ /**
438
+ * Returns the current audience.
439
+ */
440
+ getAudience(): IAudience;
441
+ /**
442
+ * Invokes the given callback and expects that no ops are submitted
443
+ * until execution finishes. If an op is submitted, an error will be raised.
444
+ *
445
+ * Can be disabled by feature gate `Fluid.ContainerRuntime.DisableOpReentryCheck`
446
+ *
447
+ * @param callback - the callback to be invoked
448
+ */
449
+ ensureNoDataModelChanges<T>(callback: () => T): T;
450
+ /**
451
+ * Submits the message to be sent to other clients.
452
+ * @param type - Type of the message.
453
+ * @param content - Content of the message.
454
+ * @param localOpMetadata - The local metadata associated with the message. This is kept locally and not sent to
455
+ * the server. This will be sent back when this message is received back from the server. This is also sent if
456
+ * we are asked to resubmit the message.
457
+ */
458
+ submitMessage(type: string, content: any, localOpMetadata: unknown): void;
459
+ /**
460
+ * Submits the signal to be sent to other clients.
461
+ * @param type - Type of the signal.
462
+ * @param content - Content of the signal.
463
+ * @param targetClientId - When specified, the signal is only sent to the provided client id.
464
+ */
465
+ submitSignal(type: string, content: any, targetClientId?: string): void;
466
+ /**
467
+ * Called to make the data store locally visible in the container. This happens automatically for root data stores
468
+ * when they are marked as root. For non-root data stores, this happens when their handle is added to a visible DDS.
469
+ */
470
+ makeLocallyVisible(): void;
471
+ /**
472
+ * Call by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.
473
+ * @param address - The address of the channel that is dirty.
474
+ */
475
+ setChannelDirty(address: string): void;
476
+ /**
477
+ * Get an absolute url to the container based on the provided relativeUrl.
478
+ * Returns undefined if the container or data store isn't attached to storage.
479
+ * @param relativeUrl - A relative request within the container
480
+ */
481
+ getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;
482
+ getCreateChildSummarizerNodeFn(
483
+ /**
484
+ * Initial id or path part of this node
485
+ */
486
+ id: string,
487
+ /**
488
+ * Information needed to create the node.
489
+ * If it is from a base summary, it will assert that a summary has been seen.
490
+ * Attach information if it is created from an attach op.
491
+ * If it is local, it will throw unsupported errors on calls to summarize.
492
+ */
493
+ createParam: CreateChildSummarizerNodeParam): CreateChildSummarizerNodeFn;
494
+ uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;
495
+ /**
496
+ * @deprecated The functionality to get base GC details has been moved to summarizer node.
497
+ *
498
+ * Returns the GC details in the initial summary of this data store. This is used to initialize the data store
499
+ * and its children with the GC details from the previous summary.
500
+ */
501
+ getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
502
+ /**
503
+ * Called when a new outbound reference is added to another node. This is used by garbage collection to identify
504
+ * all references added in the system.
505
+ * @param srcHandle - The handle of the node that added the reference.
506
+ * @param outboundHandle - The handle of the outbound node that is referenced.
507
+ */
508
+ addedGCOutboundReference?(srcHandle: IFluidHandle, outboundHandle: IFluidHandle): void;
509
+ }
510
+
511
+ /**
512
+ * @alpha
513
+ */
514
+ export declare interface IFluidDataStoreContextDetached extends IFluidDataStoreContext {
515
+ /**
516
+ * Binds a runtime to the context.
517
+ */
518
+ attachRuntime(factory: IProvideFluidDataStoreFactory, dataStoreRuntime: IFluidDataStoreChannel): Promise<void>;
519
+ }
520
+
521
+ /**
522
+ * @alpha
523
+ */
524
+ export declare interface IFluidDataStoreContextEvents extends IEvent {
525
+ (event: "attaching" | "attached", listener: () => void): any;
526
+ }
527
+
528
+ /**
529
+ * @alpha
530
+ */
531
+ export declare const IFluidDataStoreFactory: keyof IProvideFluidDataStoreFactory;
532
+
533
+ /**
534
+ * IFluidDataStoreFactory create data stores. It is associated with an identifier (its `type` member)
535
+ * and usually provided to consumers using this mapping through a data store registry.
536
+ * @alpha
537
+ */
538
+ export declare interface IFluidDataStoreFactory extends IProvideFluidDataStoreFactory {
539
+ /**
540
+ * String that uniquely identifies the type of data store created by this factory.
541
+ */
542
+ type: string;
543
+ /**
544
+ * Generates runtime for the data store from the data store context. Once created should be bound to the context.
545
+ * @param context - Context for the data store.
546
+ * @param existing - If instantiating from an existing file.
547
+ */
548
+ instantiateDataStore(context: IFluidDataStoreContext, existing: boolean): Promise<IFluidDataStoreChannel>;
549
+ }
550
+
551
+ /**
552
+ * @alpha
553
+ */
554
+ export declare const IFluidDataStoreRegistry: keyof IProvideFluidDataStoreRegistry;
555
+
556
+ /**
557
+ * An association of identifiers to data store registry entries, where the
558
+ * entries can be used to create data stores.
559
+ * @alpha
560
+ */
561
+ export declare interface IFluidDataStoreRegistry extends IProvideFluidDataStoreRegistry {
562
+ get(name: string): Promise<FluidDataStoreRegistryEntry | undefined>;
563
+ }
564
+
565
+ /**
566
+ * Garbage collection data returned by nodes in a Container.
567
+ * Used for running GC in the Container.
568
+ * @public
569
+ */
570
+ export declare interface IGarbageCollectionData {
571
+ /**
572
+ * The GC nodes of a Fluid object in the Container. Each node has an id and a set of routes to other GC nodes.
573
+ */
574
+ gcNodes: {
575
+ [id: string]: string[];
576
+ };
577
+ }
578
+
579
+ /**
580
+ * GC details provided to each node during creation.
581
+ * @alpha
582
+ */
583
+ export declare interface IGarbageCollectionDetailsBase {
584
+ /**
585
+ * A list of routes to Fluid objects that are used in this node.
586
+ */
587
+ usedRoutes?: string[];
588
+ /**
589
+ * The GC data of this node.
590
+ */
591
+ gcData?: IGarbageCollectionData;
592
+ }
593
+
594
+ export { IIdCompressor }
595
+
596
+ export { IIdCompressorCore }
597
+
598
+ /**
599
+ * Represents ISignalMessage with its type.
600
+ * @public
601
+ */
602
+ export declare interface IInboundSignalMessage extends ISignalMessage {
603
+ type: string;
604
+ }
605
+
606
+ /**
607
+ * This type should be used when reading an incoming attach op,
608
+ * but it should not be used when creating a new attach op.
609
+ * Older versions of attach messages could have null snapshots,
610
+ * so this gives correct typings for writing backward compatible code.
611
+ * @alpha
612
+ */
613
+ export declare type InboundAttachMessage = Omit<IAttachMessage, "snapshot"> & {
614
+ snapshot: IAttachMessage["snapshot"] | null;
615
+ };
616
+
617
+ /**
618
+ * @alpha
619
+ */
620
+ export declare interface IProvideFluidDataStoreFactory {
621
+ readonly IFluidDataStoreFactory: IFluidDataStoreFactory;
622
+ }
623
+
624
+ /**
625
+ * @alpha
626
+ */
627
+ export declare interface IProvideFluidDataStoreRegistry {
628
+ readonly IFluidDataStoreRegistry: IFluidDataStoreRegistry;
629
+ }
630
+
631
+ /* Excluded from this release type: ISignalEnvelope */
632
+
633
+ /**
634
+ * Contains the same data as ISummaryResult but in order to avoid naming collisions,
635
+ * the data store summaries are wrapped around an array of labels identified by pathPartsForChildren.
636
+ *
637
+ * @example
638
+ *
639
+ * ```typescript
640
+ * id:""
641
+ * pathPartsForChildren: ["path1"]
642
+ * stats: ...
643
+ * summary:
644
+ * ...
645
+ * "path1":
646
+ * ```
647
+ * @alpha
648
+ */
649
+ export declare interface ISummarizeInternalResult extends ISummarizeResult {
650
+ id: string;
651
+ /**
652
+ * Additional path parts between this node's ID and its children's IDs.
653
+ */
654
+ pathPartsForChildren?: string[];
655
+ }
656
+
657
+ /**
658
+ * Represents a summary at a current sequence number.
659
+ * @alpha
660
+ */
661
+ export declare interface ISummarizeResult {
662
+ stats: ISummaryStats;
663
+ summary: SummaryTree;
664
+ }
665
+
666
+ /**
667
+ * @alpha
668
+ */
669
+ export declare interface ISummarizerNode {
670
+ /**
671
+ * Latest successfully acked summary reference sequence number
672
+ */
673
+ readonly referenceSequenceNumber: number;
674
+ /**
675
+ * Marks the node as having a change with the given sequence number.
676
+ * @param sequenceNumber - sequence number of change
677
+ */
678
+ invalidate(sequenceNumber: number): void;
679
+ /**
680
+ * Calls the internal summarize function and handles internal state tracking.
681
+ * If unchanged and fullTree is false, it will reuse previous summary subtree.
682
+ * If an error is encountered and throwOnFailure is false, it will try to make
683
+ * a summary with a pointer to the previous summary + a blob of outstanding ops.
684
+ * @param fullTree - true to skip optimizations and always generate the full tree
685
+ * @param trackState - indicates whether the summarizer node should track the state of the summary or not
686
+ * @param telemetryContext - summary data passed through the layers for telemetry purposes
687
+ */
688
+ summarize(fullTree: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): Promise<ISummarizeResult>;
689
+ /**
690
+ * Checks if there are any additional path parts for children that need to
691
+ * be loaded from the base summary. Additional path parts represent parts
692
+ * of the path between this SummarizerNode and any child SummarizerNodes
693
+ * that it might have. For example: if datastore "a" contains dds "b", but the
694
+ * path is "/a/.channels/b", then the additional path part is ".channels".
695
+ * @param snapshot - the base summary to parse
696
+ */
697
+ updateBaseSummaryState(snapshot: ISnapshotTree): void;
698
+ /**
699
+ * Records an op representing a change to this node/subtree.
700
+ * @param op - op of change to record
701
+ */
702
+ recordChange(op: ISequencedDocumentMessage): void;
703
+ createChild(
704
+ /**
705
+ * Summarize function
706
+ */
707
+ summarizeInternalFn: SummarizeInternalFn,
708
+ /**
709
+ * Initial id or path part of this node
710
+ */
711
+ id: string,
712
+ /**
713
+ * Information needed to create the node.
714
+ * If it is from a base summary, it will assert that a summary has been seen.
715
+ * Attach information if it is created from an attach op.
716
+ * If it is local, it will throw unsupported errors on calls to summarize.
717
+ */
718
+ createParam: CreateChildSummarizerNodeParam,
719
+ /**
720
+ * Optional configuration affecting summarize behavior
721
+ */
722
+ config?: ISummarizerNodeConfig): ISummarizerNode;
723
+ getChild(id: string): ISummarizerNode | undefined;
724
+ /** True if a summary is currently in progress */
725
+ isSummaryInProgress?(): boolean;
726
+ }
727
+
728
+ /**
729
+ * @alpha
730
+ */
731
+ export declare interface ISummarizerNodeConfig {
732
+ /**
733
+ * True to reuse previous handle when unchanged since last acked summary.
734
+ * Defaults to true.
735
+ */
736
+ readonly canReuseHandle?: boolean;
737
+ /**
738
+ * True to always stop execution on error during summarize, or false to
739
+ * attempt creating a summary that is a pointer ot the last acked summary
740
+ * plus outstanding ops in case of internal summarize failure.
741
+ * Defaults to false.
742
+ *
743
+ * BUG BUG: Default to true while we investigate problem
744
+ * with differential summaries
745
+ */
746
+ readonly throwOnFailure?: true;
747
+ }
748
+
749
+ /**
750
+ * @alpha
751
+ */
752
+ export declare interface ISummarizerNodeConfigWithGC extends ISummarizerNodeConfig {
753
+ /**
754
+ * True if GC is disabled. If so, don't track GC related state for a summary.
755
+ * This is propagated to all child nodes.
756
+ */
757
+ readonly gcDisabled?: boolean;
758
+ }
759
+
760
+ /**
761
+ * Extends the functionality of ISummarizerNode to support garbage collection. It adds / updates the following APIs:
762
+ *
763
+ * `usedRoutes`: The routes in this node that are currently in use.
764
+ *
765
+ * `getGCData`: A new API that can be used to get the garbage collection data for this node.
766
+ *
767
+ * `summarize`: Added a trackState flag which indicates whether the summarizer node should track the state of the
768
+ * summary or not.
769
+ *
770
+ * `createChild`: Added the following params:
771
+ *
772
+ * - `getGCDataFn`: This gets the GC data from the caller. This must be provided in order for getGCData to work.
773
+ *
774
+ * - `getInitialGCDetailsFn`: This gets the initial GC details from the caller.
775
+ *
776
+ * `deleteChild`: Deletes a child node.
777
+ *
778
+ * `isReferenced`: This tells whether this node is referenced in the document or not.
779
+ *
780
+ * `updateUsedRoutes`: Used to notify this node of routes that are currently in use in it.
781
+ * @alpha
782
+ */
783
+ export declare interface ISummarizerNodeWithGC extends ISummarizerNode {
784
+ createChild(
785
+ /**
786
+ * Summarize function
787
+ */
788
+ summarizeInternalFn: SummarizeInternalFn,
789
+ /**
790
+ * Initial id or path part of this node
791
+ */
792
+ id: string,
793
+ /**
794
+ * Information needed to create the node.
795
+ * If it is from a base summary, it will assert that a summary has been seen.
796
+ * Attach information if it is created from an attach op.
797
+ * If it is local, it will throw unsupported errors on calls to summarize.
798
+ */
799
+ createParam: CreateChildSummarizerNodeParam,
800
+ /**
801
+ * Optional configuration affecting summarize behavior
802
+ */
803
+ config?: ISummarizerNodeConfigWithGC, getGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,
804
+ /**
805
+ * @deprecated The functionality to update child's base GC details is incorporated in the summarizer node.
806
+ */
807
+ getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>): ISummarizerNodeWithGC;
808
+ /**
809
+ * Delete the child with the given id..
810
+ */
811
+ deleteChild(id: string): void;
812
+ getChild(id: string): ISummarizerNodeWithGC | undefined;
813
+ /**
814
+ * Returns this node's data that is used for garbage collection. This includes a list of GC nodes that represent
815
+ * this node. Each node has a set of outbound routes to other GC nodes in the document.
816
+ * @param fullGC - true to bypass optimizations and force full generation of GC data.
817
+ */
818
+ getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;
819
+ /**
820
+ * Tells whether this node is being referenced in this document or not. Unreferenced node will get GC'd
821
+ */
822
+ isReferenced(): boolean;
823
+ /**
824
+ * After GC has run, called to notify this node of routes that are used in it. These are used for the following:
825
+ * 1. To identify if this node is being referenced in the document or not.
826
+ * 2. To identify if this node or any of its children's used routes changed since last summary.
827
+ *
828
+ * @param usedRoutes - The routes that are used in this node.
829
+ */
830
+ updateUsedRoutes(usedRoutes: string[]): void;
831
+ }
832
+
833
+ /**
834
+ * Contains the aggregation data from a Tree/Subtree.
835
+ * @public
836
+ */
837
+ export declare interface ISummaryStats {
838
+ treeNodeCount: number;
839
+ blobNodeCount: number;
840
+ handleNodeCount: number;
841
+ totalBlobSize: number;
842
+ unreferencedBlobSize: number;
843
+ }
844
+
845
+ /**
846
+ * Represents the summary tree for a node along with the statistics for that tree.
847
+ * For example, for a given data store, it contains the data for data store along with a subtree for
848
+ * each of its DDS.
849
+ * Any component that implements IChannelContext, IFluidDataStoreChannel or extends SharedObject
850
+ * will be taking part of the summarization process.
851
+ * @public
852
+ */
853
+ export declare interface ISummaryTreeWithStats {
854
+ /**
855
+ * Represents an aggregation of node counts and blob sizes associated to the current summary information
856
+ */
857
+ stats: ISummaryStats;
858
+ /**
859
+ * A recursive data structure that will be converted to a snapshot tree and uploaded
860
+ * to the backend.
861
+ */
862
+ summary: ISummaryTree;
863
+ }
864
+
865
+ /**
866
+ * Contains telemetry data relevant to summarization workflows.
867
+ * This object is expected to be modified directly by various summarize methods.
868
+ * @public
869
+ */
870
+ export declare interface ITelemetryContext {
871
+ /**
872
+ * Sets value for telemetry data being tracked.
873
+ * @param prefix - unique prefix to tag this data with (ex: "fluid:map:")
874
+ * @param property - property name of the telemetry data being tracked (ex: "DirectoryCount")
875
+ * @param value - value to attribute to this summary telemetry data
876
+ */
877
+ set(prefix: string, property: string, value: TelemetryEventPropertyType): void;
878
+ /**
879
+ * Sets multiple values for telemetry data being tracked.
880
+ * @param prefix - unique prefix to tag this data with (ex: "fluid:summarize:")
881
+ * @param property - property name of the telemetry data being tracked (ex: "Options")
882
+ * @param values - A set of values to attribute to this summary telemetry data.
883
+ */
884
+ setMultiple(prefix: string, property: string, values: Record<string, TelemetryEventPropertyType>): void;
885
+ /**
886
+ * Get the telemetry data being tracked
887
+ * @param prefix - unique prefix for this data (ex: "fluid:map:")
888
+ * @param property - property name of the telemetry data being tracked (ex: "DirectoryCount")
889
+ * @returns undefined if item not found
890
+ */
891
+ get(prefix: string, property: string): TelemetryEventPropertyType;
892
+ /**
893
+ * Returns a serialized version of all the telemetry data.
894
+ * Should be used when logging in telemetry events.
895
+ */
896
+ serialize(): string;
897
+ }
898
+
899
+ /**
900
+ * AttributionKey associated with content that has been made locally but not yet acked by the server.
901
+ * @alpha
902
+ */
903
+ export declare interface LocalAttributionKey {
904
+ type: "local";
905
+ }
906
+
907
+ /**
908
+ * An iterable identifier/registry entry pair list
909
+ * @alpha
910
+ */
911
+ export declare type NamedFluidDataStoreRegistryEntries = Iterable<NamedFluidDataStoreRegistryEntry>;
912
+
913
+ /**
914
+ * An associated pair of an identifier and registry entry. Registry entries
915
+ * may be dynamically loaded.
916
+ * @alpha
917
+ */
918
+ export declare type NamedFluidDataStoreRegistryEntry = [string, Promise<FluidDataStoreRegistryEntry>];
919
+
920
+ /**
921
+ * AttributionKey representing a reference to some op in the op stream.
922
+ * Content associated with this key aligns with content modified by that op.
923
+ * @alpha
924
+ */
925
+ export declare interface OpAttributionKey {
926
+ /**
927
+ * The type of attribution this key corresponds to.
928
+ *
929
+ * Keys currently all represent op-based attribution, so have the form `{ type: "op", key: sequenceNumber }`.
930
+ * Thus, they can be used with an `OpStreamAttributor` to recover timestamp/user information.
931
+ */
932
+ type: "op";
933
+ /**
934
+ * The sequenceNumber of the op this attribution key is for.
935
+ */
936
+ seq: number;
937
+ }
938
+
939
+ export { OpSpaceCompressedId }
940
+
941
+ export { SerializedIdCompressor }
942
+
943
+ export { SerializedIdCompressorWithNoSession }
944
+
945
+ export { SerializedIdCompressorWithOngoingSession }
946
+
947
+ export { SessionId }
948
+
949
+ export { SessionSpaceCompressedId }
950
+
951
+ export { StableId }
952
+
953
+ /**
954
+ * @alpha
955
+ */
956
+ export declare type SummarizeInternalFn = (fullTree: boolean, trackState: boolean, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext) => Promise<ISummarizeInternalResult>;
957
+
958
+ /* Excluded from this release type: totalBlobSizePropertyName */
959
+
960
+ /**
961
+ * This tells the visibility state of a Fluid object. It basically tracks whether the object is not visible, visible
962
+ * locally within the container only or visible globally to all clients.
963
+ * @alpha
964
+ */
965
+ export declare const VisibilityState: {
966
+ /**
967
+ * Indicates that the object is not visible. This is the state when an object is first created.
968
+ */
969
+ NotVisible: string;
970
+ /**
971
+ * Indicates that the object is visible locally within the container. This is the state when an object is attached
972
+ * to the container's graph but the container itself isn't globally visible. The object's state goes from not
973
+ * visible to locally visible.
974
+ */
975
+ LocallyVisible: string;
976
+ /**
977
+ * Indicates that the object is visible globally to all clients. This is the state of an object in 2 scenarios:
978
+ *
979
+ * 1. It is attached to the container's graph when the container is globally visible. The object's state goes from
980
+ * not visible to globally visible.
981
+ *
982
+ * 2. When a container becomes globally visible, all locally visible objects go from locally visible to globally
983
+ * visible.
984
+ */
985
+ GloballyVisible: string;
986
+ };
987
+
988
+ /**
989
+ * @alpha
990
+ */
991
+ export declare type VisibilityState = (typeof VisibilityState)[keyof typeof VisibilityState];
992
+
993
+ export { }