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