@fluidframework/runtime-definitions 2.0.0-internal.7.3.0 → 2.0.0-internal.8.0.0

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