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

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