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