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