@fluidframework/container-definitions 2.0.0-dev.7.2.0.203917 → 2.0.0-dev.7.2.0.205722

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.
@@ -1,1442 +0,0 @@
1
- /**
2
- * This library contains the interfaces and types concerning the `Loader` and loading the `Container`.
3
- *
4
- * @packageDocumentation
5
- */
6
-
7
- import { EventEmitter } from 'events';
8
- import { FluidObject } from '@fluidframework/core-interfaces';
9
- import { IAnyDriverError } from '@fluidframework/driver-definitions';
10
- import { IClient } from '@fluidframework/protocol-definitions';
11
- import { IClientConfiguration } from '@fluidframework/protocol-definitions';
12
- import { IClientDetails } from '@fluidframework/protocol-definitions';
13
- import { IDisposable } from '@fluidframework/core-interfaces';
14
- import { IDocumentMessage } from '@fluidframework/protocol-definitions';
15
- import { IDocumentStorageService } from '@fluidframework/driver-definitions';
16
- import { IErrorBase } from '@fluidframework/core-interfaces';
17
- import { IErrorEvent } from '@fluidframework/core-interfaces';
18
- import { IEvent } from '@fluidframework/core-interfaces';
19
- import { IEventProvider } from '@fluidframework/core-interfaces';
20
- import { IFluidRouter } from '@fluidframework/core-interfaces';
21
- import { IGenericError } from '@fluidframework/core-interfaces';
22
- import { IQuorumClients } from '@fluidframework/protocol-definitions';
23
- import { IRequest } from '@fluidframework/core-interfaces';
24
- import { IResolvedUrl } from '@fluidframework/driver-definitions';
25
- import { IResponse } from '@fluidframework/core-interfaces';
26
- import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
27
- import { ISequencedProposal } from '@fluidframework/protocol-definitions';
28
- import { ISignalMessage } from '@fluidframework/protocol-definitions';
29
- import { ISnapshotTree } from '@fluidframework/protocol-definitions';
30
- import { ISummaryContent } from '@fluidframework/protocol-definitions';
31
- import { ISummaryTree } from '@fluidframework/protocol-definitions';
32
- import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
33
- import { IThrottlingWarning } from '@fluidframework/core-interfaces';
34
- import { ITokenClaims } from '@fluidframework/protocol-definitions';
35
- import { IUsageError } from '@fluidframework/core-interfaces';
36
- import { IVersion } from '@fluidframework/protocol-definitions';
37
- import { MessageType } from '@fluidframework/protocol-definitions';
38
-
39
- /**
40
- * The attachment state of some Fluid data (e.g. a container or data store), denoting whether it is uploaded to the
41
- * service. The transition from detached to attached state is a one-way transition.
42
- * @public
43
- */
44
- export declare enum AttachState {
45
- /**
46
- * In detached state, the data is only present on the local client's machine. It has not yet been uploaded
47
- * to the service.
48
- */
49
- Detached = "Detached",
50
- /**
51
- * In attaching state, the data has started the upload to the service, but has not yet completed.
52
- */
53
- Attaching = "Attaching",
54
- /**
55
- * In attached state, the data has completed upload to the service. It can be accessed by other clients after
56
- * reaching attached state.
57
- */
58
- Attached = "Attached"
59
- }
60
-
61
- /**
62
- * Namespace for the different connection states a container can be in.
63
- * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression.
64
- * @public
65
- */
66
- export declare namespace ConnectionState {
67
- /**
68
- * The container is not connected to the delta server.
69
- * Note - When in this state the container may be about to reconnect,
70
- * or may remain disconnected until explicitly told to connect.
71
- */
72
- export type Disconnected = 0;
73
- /**
74
- * The container is disconnected but actively trying to establish a new connection.
75
- * PLEASE NOTE that this numerical value falls out of the order you may expect for this state.
76
- */
77
- export type EstablishingConnection = 3;
78
- /**
79
- * The container has an inbound connection only, and is catching up to the latest known state from the service.
80
- */
81
- export type CatchingUp = 1;
82
- /**
83
- * The container is fully connected and syncing.
84
- */
85
- export type Connected = 2;
86
- }
87
-
88
- /**
89
- * Type defining the different states of connectivity a Container can be in.
90
- * @public
91
- */
92
- export declare type ConnectionState = ConnectionState.Disconnected | ConnectionState.EstablishingConnection | ConnectionState.CatchingUp | ConnectionState.Connected;
93
-
94
- /**
95
- * Different error types the Container may report out to the Host.
96
- *
97
- * @deprecated ContainerErrorType is being deprecated as a public export. Please use {@link ContainerErrorTypes#clientSessionExpiredError} instead.
98
- * @public
99
- */
100
- export declare enum ContainerErrorType {
101
- /**
102
- * Some error, most likely an exception caught by runtime and propagated to container as critical error
103
- */
104
- genericError = "genericError",
105
- /**
106
- * Throttling error from server. Server is busy and is asking not to reconnect for some time
107
- */
108
- throttlingError = "throttlingError",
109
- /**
110
- * Data loss error detected by Container / DeltaManager. Likely points to storage issue.
111
- */
112
- dataCorruptionError = "dataCorruptionError",
113
- /**
114
- * Error encountered when processing an operation. May correlate with data corruption.
115
- */
116
- dataProcessingError = "dataProcessingError",
117
- /**
118
- * Error indicating an API is being used improperly resulting in an invalid operation.
119
- */
120
- usageError = "usageError",
121
- /**
122
- * Error indicating an client session has expired. Currently this only happens when GC is allowed on a document and
123
- * aids in safely deleting unused objects.
124
- */
125
- clientSessionExpiredError = "clientSessionExpiredError"
126
- }
127
-
128
- /**
129
- * Different error types the ClientSession may report out to the Host.
130
- * @public
131
- */
132
- export declare const ContainerErrorTypes: {
133
- /**
134
- * Error indicating an client session has expired. Currently this only happens when GC is allowed on a document and
135
- * aids in safely deleting unused objects.
136
- */
137
- readonly clientSessionExpiredError: "clientSessionExpiredError";
138
- readonly genericError: "genericError";
139
- readonly throttlingError: "throttlingError";
140
- readonly dataCorruptionError: "dataCorruptionError";
141
- readonly dataProcessingError: "dataProcessingError";
142
- readonly usageError: "usageError";
143
- };
144
-
145
- /**
146
- * @public
147
- */
148
- export declare type ContainerErrorTypes = (typeof ContainerErrorTypes)[keyof typeof ContainerErrorTypes];
149
-
150
- /**
151
- * Represents warnings raised on container.
152
- * @public
153
- */
154
- export declare interface ContainerWarning extends IErrorBase {
155
- /**
156
- * Whether this error has already been logged. Used to avoid logging errors twice.
157
- *
158
- * @defaultValue `false`
159
- */
160
- logged?: boolean;
161
- }
162
-
163
- /**
164
- * Audience represents all clients connected to the op stream, both read-only and read/write.
165
- *
166
- * See {@link https://nodejs.org/api/events.html#class-eventemitter | here} for an overview of the `EventEmitter`
167
- * class.
168
- * @public
169
- */
170
- export declare interface IAudience extends EventEmitter {
171
- /**
172
- * See {@link https://nodejs.dev/learn/the-nodejs-event-emitter | here} for an overview of `EventEmitter.on`.
173
- */
174
- on(event: "addMember" | "removeMember", listener: (clientId: string, client: IClient) => void): this;
175
- /**
176
- * List all clients connected to the op stream, keyed off their clientId
177
- */
178
- getMembers(): Map<string, IClient>;
179
- /**
180
- * Get details about the connected client with the specified clientId,
181
- * or undefined if the specified client isn't connected
182
- */
183
- getMember(clientId: string): IClient | undefined;
184
- }
185
-
186
- /**
187
- * Manages the state and the members for {@link IAudience}
188
- * @public
189
- */
190
- export declare interface IAudienceOwner extends IAudience {
191
- /**
192
- * Adds a new client to the audience
193
- */
194
- addMember(clientId: string, details: IClient): void;
195
- /**
196
- * Removes a client from the audience. Only emits an event if a client is actually removed
197
- * @returns if a client was removed from the audience
198
- */
199
- removeMember(clientId: string): boolean;
200
- }
201
-
202
- /**
203
- * Payload type for IContainerContext.submitBatchFn()
204
- * @public
205
- */
206
- export declare interface IBatchMessage {
207
- contents?: string;
208
- metadata: Record<string, unknown> | undefined;
209
- compression?: string;
210
- referenceSequenceNumber?: number;
211
- }
212
-
213
- /**
214
- * Fluid code loader resolves a code module matching the document schema, i.e. code details, such as
215
- * a package name and package version range.
216
- * @public
217
- */
218
- export declare interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer> {
219
- /**
220
- * Load the code module (package) that can interact with the document.
221
- *
222
- * @param source - Code proposal that articulates the current schema the document is written in.
223
- * @returns Code module entry point along with the code details associated with it.
224
- */
225
- load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;
226
- }
227
-
228
- /**
229
- * Contract representing the result of a newly established connection to the server for syncing deltas.
230
- * @public
231
- */
232
- export declare interface IConnectionDetails {
233
- clientId: string;
234
- claims: ITokenClaims;
235
- serviceConfiguration: IClientConfiguration;
236
- /**
237
- * Last known sequence number to ordering service at the time of connection.
238
- *
239
- * @remarks
240
- *
241
- * It may lap actual last sequence number (quite a bit, if container is very active).
242
- * But it's the best information for client to figure out how far it is behind, at least
243
- * for "read" connections. "write" connections may use own "join" op to similar information,
244
- * that is likely to be more up-to-date.
245
- */
246
- checkpointSequenceNumber: number | undefined;
247
- }
248
-
249
- /**
250
- * The Host's view of a Container and its connection to storage
251
- * @public
252
- */
253
- export declare interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {
254
- /**
255
- * The Delta Manager supporting the op stream for this Container
256
- */
257
- deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
258
- /**
259
- * The collection of write clients which were connected as of the current sequence number.
260
- * Also contains a map of key-value pairs that must be agreed upon by all clients before being accepted.
261
- */
262
- getQuorum(): IQuorumClients;
263
- /**
264
- * Represents the resolved url to the Container.
265
- * Will be undefined only when the container is in the {@link AttachState.Detached | detatched} state.
266
- */
267
- resolvedUrl: IResolvedUrl | undefined;
268
- /**
269
- * Indicates the attachment state of the container to a host service.
270
- */
271
- readonly attachState: AttachState;
272
- /**
273
- * Get the code details that are currently specified for the container.
274
- * @returns The current code details if any are specified, undefined if none are specified.
275
- */
276
- getSpecifiedCodeDetails(): IFluidCodeDetails | undefined;
277
- /**
278
- * Get the code details that were used to load the container.
279
- * @returns The code details that were used to load the container if it is loaded, undefined if it is not yet
280
- * loaded.
281
- */
282
- getLoadedCodeDetails(): IFluidCodeDetails | undefined;
283
- /**
284
- * Returns true if the container has been closed and/or disposed, otherwise false.
285
- */
286
- readonly closed: boolean;
287
- /**
288
- * Returns true if the container has been disposed, otherwise false.
289
- */
290
- readonly disposed?: boolean;
291
- /**
292
- * Whether or not there are any local changes that have not been saved.
293
- */
294
- readonly isDirty: boolean;
295
- /**
296
- * Disposes the container. If not already closed, this acts as a closure and then disposes runtime resources.
297
- * The container is not expected to be used anymore once it is disposed.
298
- *
299
- * @param error - If the container is being disposed due to error, this provides details about the error that
300
- * resulted in disposing it.
301
- */
302
- dispose(error?: ICriticalContainerError): void;
303
- /**
304
- * Closes the container.
305
- *
306
- * @param error - If the container is being closed due to error, this provides details about the error that
307
- * resulted in closing it.
308
- */
309
- close(error?: ICriticalContainerError): void;
310
- /**
311
- * Propose new code details that define the code to be loaded for this container's runtime.
312
- *
313
- * The returned promise will be true when the proposal is accepted, and false if the proposal is rejected.
314
- */
315
- proposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;
316
- /**
317
- * Attaches the Container to the Container specified by the given Request.
318
- *
319
- * @privateRemarks
320
- *
321
- * TODO - in the case of failure options should give a retry policy.
322
- * Or some continuation function that allows attachment to a secondary document.
323
- */
324
- attach(request: IRequest): Promise<void>;
325
- /**
326
- * Extract a snapshot of the container as long as it is in detached state. Calling this on an attached container
327
- * is an error.
328
- */
329
- serialize(): string;
330
- /**
331
- * Get an absolute URL for a provided container-relative request URL.
332
- * If the container is not attached, this will return undefined.
333
- *
334
- * @param relativeUrl - A container-relative request URL.
335
- */
336
- getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;
337
- /**
338
- * @deprecated Requesting will not be supported in a future major release.
339
- * Instead, access the objects in a Fluid Container using entryPoint, and then navigate from there using
340
- * app-specific logic (e.g. retrieving handles from the entryPoint's DDSes, or a container's entryPoint object
341
- * could implement a request paradigm itself)
342
- *
343
- * IMPORTANT: This overload is provided for back-compat where IContainer.request(\{ url: "/" \}) is already implemented and used.
344
- * The functionality it can provide (if the Container implementation is built for it) is redundant with @see {@link IContainer.getEntryPoint}.
345
- *
346
- * Refer to Removing-IFluidRouter.md for details on migrating from the request pattern to using entryPoint.
347
- *
348
- * @param request - Only requesting \{ url: "/" \} is supported, requesting arbitrary URLs is deprecated.
349
- */
350
- request(request: {
351
- url: "/";
352
- headers?: undefined;
353
- }): Promise<IResponse>;
354
- /**
355
- * Issue a request against the container for a resource.
356
- * @param request - The request to be issued against the container
357
- *
358
- * @deprecated Requesting an arbitrary URL with headers will not be supported in a future major release.
359
- * Instead, access the objects in a Fluid Container using entryPoint, and then navigate from there using
360
- * app-specific logic (e.g. retrieving handles from the entryPoint's DDSes, or a container's entryPoint object
361
- * could implement a request paradigm itself)
362
- *
363
- * Refer to Removing-IFluidRouter.md for details on migrating from the request pattern to using entryPoint.
364
- */
365
- request(request: IRequest): Promise<IResponse>;
366
- /**
367
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
368
- */
369
- readonly IFluidRouter: IFluidRouter;
370
- /**
371
- * Provides the current state of the container's connection to the ordering service.
372
- *
373
- * @remarks Consumers can listen for state changes via the "connected" and "disconnected" events.
374
- */
375
- readonly connectionState: ConnectionState;
376
- /**
377
- * Attempts to connect the container to the delta stream and process ops.
378
- *
379
- * @remarks
380
- *
381
- * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Connected}, and the
382
- * "connected" event will be fired if/when connection succeeds.
383
- */
384
- connect(): void;
385
- /**
386
- * Disconnects the container from the delta stream and stops processing ops.
387
- *
388
- * @remarks
389
- *
390
- * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Disconnected}, and the
391
- * "disconnected" event will be fired when disconnection completes.
392
- */
393
- disconnect(): void;
394
- /**
395
- * The audience information for all clients currently associated with the document in the current session.
396
- */
397
- readonly audience: IAudience;
398
- /**
399
- * The server provided ID of the client.
400
- *
401
- * Set once {@link IContainer.connectionState} is {@link (ConnectionState:namespace).Connected},
402
- * otherwise will be `undefined`.
403
- */
404
- readonly clientId?: string | undefined;
405
- /**
406
- * Tells if container is in read-only mode.
407
- *
408
- * @remarks
409
- *
410
- * Data stores should listen for "readonly" notifications and disallow user making changes to data stores.
411
- * Readonly state can be because of no storage write permission,
412
- * or due to host forcing readonly mode for container.
413
- *
414
- * We do not differentiate here between no write access to storage vs. host disallowing changes to container -
415
- * in all cases container runtime and data stores should respect readonly state and not allow local changes.
416
- *
417
- * It is undefined if we have not yet established websocket connection
418
- * and do not know if user has write access to a file.
419
- */
420
- readonly readOnlyInfo: ReadOnlyInfo;
421
- /* Excluded from this release type: forceReadonly */
422
- /**
423
- * Exposes the entryPoint for the container.
424
- * Use this as the primary way of getting access to the user-defined logic within the container.
425
- */
426
- getEntryPoint(): Promise<FluidObject | undefined>;
427
- }
428
-
429
- /**
430
- * IContainerContext is fundamentally just the set of things that an IRuntimeFactory (and IRuntime) will consume from the
431
- * loader layer. It gets passed into the IRuntimeFactory.instantiateRuntime call. Only include members on this interface
432
- * if you intend them to be consumed/called from the runtime layer.
433
- * @public
434
- */
435
- export declare interface IContainerContext {
436
- readonly options: ILoaderOptions;
437
- readonly clientId: string | undefined;
438
- readonly clientDetails: IClientDetails;
439
- readonly storage: IDocumentStorageService;
440
- readonly connected: boolean;
441
- readonly baseSnapshot: ISnapshotTree | undefined;
442
- /**
443
- * @deprecated Please use submitBatchFn & submitSummaryFn
444
- */
445
- readonly submitFn: (type: MessageType, contents: any, batch: boolean, appData?: any) => number;
446
- /**
447
- * @returns clientSequenceNumber of last message in a batch
448
- */
449
- readonly submitBatchFn: (batch: IBatchMessage[], referenceSequenceNumber?: number) => number;
450
- readonly submitSummaryFn: (summaryOp: ISummaryContent, referenceSequenceNumber?: number) => number;
451
- readonly submitSignalFn: (contents: any) => void;
452
- readonly disposeFn?: (error?: ICriticalContainerError) => void;
453
- readonly closeFn: (error?: ICriticalContainerError) => void;
454
- readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
455
- readonly quorum: IQuorumClients;
456
- /**
457
- * @deprecated This method is provided as a migration tool for customers currently reading the code details
458
- * from within the Container by directly accessing the Quorum proposals. The code details should not be accessed
459
- * from within the Container as this requires coupling between the container contents and the code loader.
460
- * Direct access to Quorum proposals will be removed in an upcoming release, and in a further future release this
461
- * migration tool will be removed.
462
- */
463
- getSpecifiedCodeDetails?(): IFluidCodeDetails | undefined;
464
- readonly audience: IAudience | undefined;
465
- readonly loader: ILoader;
466
- readonly taggedLogger: ITelemetryBaseLogger;
467
- pendingLocalState?: unknown;
468
- /**
469
- * Ambient services provided with the context
470
- */
471
- readonly scope: FluidObject;
472
- /**
473
- * Get an absolute url for a provided container-relative request.
474
- * @param relativeUrl - A relative request within the container
475
- *
476
- * TODO: Optional for backwards compatibility. Make non-optional in version 0.19
477
- */
478
- getAbsoluteUrl?(relativeUrl: string): Promise<string | undefined>;
479
- /**
480
- * Indicates the attachment state of the container to a host service.
481
- */
482
- readonly attachState: AttachState;
483
- getLoadedFromVersion(): IVersion | undefined;
484
- updateDirtyContainerState(dirty: boolean): void;
485
- readonly supportedFeatures?: ReadonlyMap<string, unknown>;
486
- /**
487
- * WARNING: this id is meant for telemetry usages ONLY, not recommended for other consumption
488
- * This id is not supposed to be exposed anywhere else. It is dependant on usage or drivers
489
- * and scenarios which can change in the future.
490
- * @deprecated 2.0.0-internal.5.2.0 - The docId is already logged by the {@link IContainerContext.taggedLogger} for
491
- * telemetry purposes, so this is generally unnecessary for telemetry.
492
- * If the id is needed for other purposes it should be passed to the consumer explicitly.
493
- *
494
- * @privateremarks Tracking in AB#5714
495
- */
496
- readonly id: string;
497
- }
498
-
499
- /**
500
- * Events emitted by the {@link IContainer} "upwards" to the Loader and Host.
501
- * @public
502
- */
503
- export declare interface IContainerEvents extends IEvent {
504
- /**
505
- * Emitted when the readonly state of the container changes.
506
- *
507
- * @remarks Listener parameters:
508
- *
509
- * - `readonly`: Whether or not the container is now in a readonly state.
510
- *
511
- * @see {@link IContainer.readOnlyInfo}
512
- */
513
- (event: "readonly", listener: (readonly: boolean) => void): void;
514
- /**
515
- * Emitted when the {@link IContainer} completes connecting to the Fluid service.
516
- *
517
- * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.
518
- *
519
- * @see
520
- *
521
- * - {@link IContainer.connectionState}
522
- *
523
- * - {@link IContainer.connect}
524
- */
525
- (event: "connected", listener: (clientId: string) => void): any;
526
- /**
527
- * Fires when new container code details have been proposed, prior to acceptance.
528
- *
529
- * @remarks Listener parameters:
530
- *
531
- * - `codeDetails`: The code details being proposed.
532
- *
533
- * - `proposal`: NOT RECOMMENDED FOR USE.
534
- *
535
- * @see {@link IContainer.proposeCodeDetails}
536
- */
537
- (event: "codeDetailsProposed", listener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void): any;
538
- /**
539
- * Emitted when the {@link IContainer} becomes disconnected from the Fluid service.
540
- *
541
- * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.
542
- *
543
- * @see
544
- *
545
- * - {@link IContainer.connectionState}
546
- *
547
- * - {@link IContainer.disconnect}
548
- */
549
- (event: "disconnected", listener: () => void): any;
550
- /**
551
- * Emitted when a {@link AttachState.Detached | detached} container begins the process of
552
- * {@link AttachState.Attaching | attached} to the Fluid service.
553
- *
554
- * @see
555
- *
556
- * - {@link IContainer.attachState}
557
- *
558
- * - {@link IContainer.attach}
559
- */
560
- (event: "attaching", listener: () => void): any;
561
- /**
562
- * Emitted when the {@link AttachState.Attaching | attaching} process is complete and the container is
563
- * {@link AttachState.Attached | attached} to the Fluid service.
564
- *
565
- * @see
566
- *
567
- * - {@link IContainer.attachState}
568
- *
569
- * - {@link IContainer.attach}
570
- */
571
- (event: "attached", listener: () => void): any;
572
- /**
573
- * Emitted when the {@link IContainer} is closed, which permanently disables it.
574
- *
575
- * @remarks Listener parameters:
576
- *
577
- * - `error`: If the container was closed due to error, this will contain details about the error that caused it.
578
- *
579
- * @see {@link IContainer.close}
580
- */
581
- (event: "closed", listener: (error?: ICriticalContainerError) => void): any;
582
- /**
583
- * Emitted when the {@link IContainer} is disposed, which permanently disables it.
584
- *
585
- * @remarks Listener parameters:
586
- *
587
- * - `error`: If the container was disposed due to error, this will contain details about the error that caused it.
588
- *
589
- * @see {@link IContainer.dispose}
590
- */
591
- (event: "disposed", listener: (error?: ICriticalContainerError) => void): any;
592
- /**
593
- * Emitted when the container encounters a state which may lead to errors, which may be actionable by the consumer.
594
- *
595
- * @remarks
596
- *
597
- * Note: this event is not intended for general use.
598
- * The longer-term intention is to surface warnings more directly on the APIs that produce them.
599
- * For now, use of this should be avoided when possible.
600
- *
601
- * Listener parameters:
602
- *
603
- * - `error`: The warning describing the encountered state.
604
- */
605
- (event: "warning", listener: (error: ContainerWarning) => void): any;
606
- /**
607
- * Emitted immediately after processing an incoming operation (op).
608
- *
609
- * @remarks
610
- *
611
- * Note: this event is not intended for general use.
612
- * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the
613
- * ops directly on the {@link IContainer}.
614
- *
615
- * Listener parameters:
616
- *
617
- * - `message`: The op that was processed.
618
- */
619
- (event: "op", listener: (message: ISequencedDocumentMessage) => void): any;
620
- /**
621
- * Emitted upon the first local change while the Container is in the "saved" state.
622
- * That is, when {@link IContainer.isDirty} transitions from `true` to `false`.
623
- *
624
- * @remarks Listener parameters:
625
- *
626
- * - `dirty`: DEPRECATED. This parameter will be removed in a future release.
627
- *
628
- * @see {@link IContainer.isDirty}
629
- */
630
- (event: "dirty", listener: (dirty: boolean) => void): any;
631
- /**
632
- * Emitted when all local changes/edits have been acknowledged by the service.
633
- * I.e., when {@link IContainer.isDirty} transitions from `false` to `true`.
634
- *
635
- * @remarks Listener parameters:
636
- *
637
- * - `dirty`: DEPRECATED. This parameter will be removed in a future release.
638
- *
639
- * @see {@link IContainer.isDirty}
640
- */
641
- (event: "saved", listener: (dirty: boolean) => void): any;
642
- }
643
-
644
- /**
645
- * @public
646
- */
647
- export declare interface IContainerLoadMode {
648
- opsBeforeReturn?: undefined | "sequenceNumber" | "cached" | "all";
649
- deltaConnection?: "none" | "delayed" | undefined;
650
- /**
651
- * If set to true, will indefinitely pause all incoming and outgoing after the container is loaded.
652
- */
653
- pauseAfterLoad?: boolean;
654
- }
655
-
656
- /**
657
- * Represents errors raised on container.
658
- *
659
- * @see
660
- *
661
- * The following are commonly thrown error types, but `errorType` could be any string.
662
- *
663
- * - {@link @fluidframework/core-interfaces#ContainerErrorType}
664
- *
665
- * - {@link @fluidframework/driver-definitions#DriverErrorType}
666
- *
667
- * - {@link @fluidframework/odsp-driver-definitions#OdspErrorType}
668
- *
669
- * - {@link @fluidframework/routerlicious-driver#RouterliciousErrorType}
670
- *
671
- * @public
672
- */
673
- export declare type ICriticalContainerError = IErrorBase;
674
-
675
- /**
676
- * Manages the transmission of ops between the runtime and storage.
677
- * @public
678
- */
679
- export declare interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>, IDeltaSender {
680
- /**
681
- * The queue of inbound delta messages
682
- */
683
- readonly inbound: IDeltaQueue<T>;
684
- /**
685
- * The queue of outbound delta messages
686
- */
687
- readonly outbound: IDeltaQueue<U[]>;
688
- /**
689
- * The queue of inbound delta signals
690
- */
691
- readonly inboundSignal: IDeltaQueue<ISignalMessage>;
692
- /**
693
- * The current minimum sequence number
694
- */
695
- readonly minimumSequenceNumber: number;
696
- /**
697
- * The last sequence number processed by the delta manager
698
- */
699
- readonly lastSequenceNumber: number;
700
- /**
701
- * The last message processed by the delta manager
702
- */
703
- readonly lastMessage: ISequencedDocumentMessage | undefined;
704
- /**
705
- * The latest sequence number the delta manager is aware of
706
- */
707
- readonly lastKnownSeqNumber: number;
708
- /**
709
- * The initial sequence number set when attaching the op handler
710
- */
711
- readonly initialSequenceNumber: number;
712
- /**
713
- * Tells if current connection has checkpoint information.
714
- * I.e. we know how far behind the client was at the time of establishing connection
715
- */
716
- readonly hasCheckpointSequenceNumber: boolean;
717
- /**
718
- * Details of client
719
- */
720
- readonly clientDetails: IClientDetails;
721
- /**
722
- * Protocol version being used to communicate with the service
723
- */
724
- readonly version: string;
725
- /**
726
- * Max message size allowed to the delta manager
727
- */
728
- readonly maxMessageSize: number;
729
- /**
730
- * Service configuration provided by the service.
731
- */
732
- readonly serviceConfiguration: IClientConfiguration | undefined;
733
- /**
734
- * Flag to indicate whether the client can write or not.
735
- */
736
- readonly active: boolean;
737
- readonly readOnlyInfo: ReadOnlyInfo;
738
- /**
739
- * Submit a signal to the service to be broadcast to other connected clients, but not persisted
740
- */
741
- submitSignal(content: any): void;
742
- }
743
-
744
- /**
745
- * Events emitted by {@link IDeltaManager}.
746
- * @public
747
- */
748
- export declare interface IDeltaManagerEvents extends IEvent {
749
- /**
750
- * @deprecated No replacement API recommended.
751
- */
752
- (event: "prepareSend", listener: (messageBuffer: any[]) => void): any;
753
- /**
754
- * @deprecated No replacement API recommended.
755
- */
756
- (event: "submitOp", listener: (message: IDocumentMessage) => void): any;
757
- /**
758
- * Emitted immediately after processing an incoming operation (op).
759
- *
760
- * @remarks
761
- *
762
- * Note: this event is not intended for general use.
763
- * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the
764
- * ops directly on the {@link IDeltaManager}.
765
- *
766
- * Listener parameters:
767
- *
768
- * - `message`: The op that was processed.
769
- *
770
- * - `processingTime`: The amount of time it took to process the inbound operation (op), expressed in milliseconds.
771
- */
772
- (event: "op", listener: (message: ISequencedDocumentMessage, processingTime: number) => void): any;
773
- /**
774
- * Emitted periodically with latest information on network roundtrip latency
775
- */
776
- (event: "pong", listener: (latency: number) => void): any;
777
- /**
778
- * Emitted when the {@link IDeltaManager} completes connecting to the Fluid service.
779
- *
780
- * @remarks
781
- * This occurs once we've received the connect_document_success message from the server,
782
- * and happens prior to the client's join message (if there is a join message).
783
- *
784
- * Listener parameters:
785
- *
786
- * - `details`: Connection metadata.
787
- *
788
- * - `opsBehind`: An estimate of far behind the client is relative to the service in terms of ops.
789
- * Will not be specified if an estimate cannot be determined.
790
- */
791
- (event: "connect", listener: (details: IConnectionDetails, opsBehind?: number) => void): any;
792
- /**
793
- * Emitted when the {@link IDeltaManager} becomes disconnected from the Fluid service.
794
- *
795
- * @remarks Listener parameters:
796
- *
797
- * - `reason`: Describes the reason for which the delta manager was disconnected.
798
- * - `error` : error if any for the disconnect.
799
- */
800
- (event: "disconnect", listener: (reason: string, error?: IAnyDriverError) => void): any;
801
- /**
802
- * Emitted when read/write permissions change.
803
- *
804
- * @remarks Listener parameters:
805
- *
806
- * - `readonly`: Whether or not the delta manager is now read-only.
807
- */
808
- (event: "readonly", listener: (readonly: boolean, readonlyConnectionReason?: {
809
- reason: string;
810
- error?: IErrorBase;
811
- }) => void): any;
812
- }
813
-
814
- /**
815
- * Queue of ops to be sent to or processed from storage
816
- * @public
817
- */
818
- export declare interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, IDisposable {
819
- /**
820
- * Flag indicating whether or not the queue was paused
821
- */
822
- paused: boolean;
823
- /**
824
- * The number of messages remaining in the queue
825
- */
826
- length: number;
827
- /**
828
- * Flag indicating whether or not the queue is idle.
829
- * I.e. there are no remaining messages to processes.
830
- */
831
- idle: boolean;
832
- /**
833
- * Pauses processing on the queue.
834
- *
835
- * @returns A promise which resolves when processing has been paused.
836
- */
837
- pause(): Promise<void>;
838
- /**
839
- * Resumes processing on the queue
840
- */
841
- resume(): void;
842
- /**
843
- * Peeks at the next message in the queue
844
- */
845
- peek(): T | undefined;
846
- /**
847
- * Returns all the items in the queue as an array. Does not remove them from the queue.
848
- */
849
- toArray(): T[];
850
- /**
851
- * returns number of ops processed and time it took to process these ops.
852
- * Zeros if queue did not process anything (had no messages, was paused or had hit an error before)
853
- */
854
- waitTillProcessingDone(): Promise<{
855
- count: number;
856
- duration: number;
857
- }>;
858
- }
859
-
860
- /**
861
- * Events emitted by {@link IDeltaQueue}.
862
- * @public
863
- */
864
- export declare interface IDeltaQueueEvents<T> extends IErrorEvent {
865
- /**
866
- * Emitted when a task is enqueued.
867
- *
868
- * @remarks Listener parameters:
869
- *
870
- * - `task`: The task being enqueued.
871
- */
872
- (event: "push", listener: (task: T) => void): any;
873
- /**
874
- * Emitted immediately after processing an enqueued task and removing it from the queue.
875
- *
876
- * @remarks
877
- *
878
- * Note: this event is not intended for general use.
879
- * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the
880
- * ops directly on the {@link IDeltaQueue}.
881
- *
882
- * Listener parameters:
883
- *
884
- * - `task`: The task that was processed.
885
- */
886
- (event: "op", listener: (task: T) => void): any;
887
- /**
888
- * Emitted when the queue of tasks to process is emptied.
889
- *
890
- * @remarks Listener parameters:
891
- *
892
- * - `count`: The number of events (`T`) processed before becoming idle.
893
- *
894
- * - `duration`: The amount of time it took to process elements (in milliseconds).
895
- *
896
- * @see {@link IDeltaQueue.idle}
897
- */
898
- (event: "idle", listener: (count: number, duration: number) => void): any;
899
- }
900
-
901
- /**
902
- * Contract supporting delivery of outbound messages to the server
903
- * @public
904
- */
905
- export declare interface IDeltaSender {
906
- /**
907
- * Flush all pending messages through the outbound queue
908
- */
909
- flush(): void;
910
- }
911
-
912
- export { IErrorBase }
913
-
914
- /**
915
- * A Fluid package for specification for browser environments
916
- * @public
917
- */
918
- export declare interface IFluidBrowserPackage extends IFluidPackage {
919
- /**
920
- * {@inheritDoc @fluidframework/core-interfaces#IFluidPackage.fluid}
921
- */
922
- fluid: {
923
- /**
924
- * The browser specific package information for this package
925
- */
926
- browser: IFluidBrowserPackageEnvironment;
927
- /**
928
- * {@inheritDoc @fluidframework/core-interfaces#IFluidPackage.fluid.environment}
929
- */
930
- [environment: string]: IFluidPackageEnvironment;
931
- };
932
- }
933
-
934
- /**
935
- * A specific Fluid package environment for browsers
936
- * @public
937
- */
938
- export declare interface IFluidBrowserPackageEnvironment extends IFluidPackageEnvironment {
939
- /**
940
- * The Universal Module Definition (umd) target specifics the scripts necessary for
941
- * loading a packages in a browser environment and finding its entry point.
942
- */
943
- umd: {
944
- /**
945
- * The bundled js files for loading this package.
946
- * These files will be loaded and executed in order.
947
- */
948
- files: string[];
949
- /**
950
- * The global name that the script entry points will be exposed.
951
- * This entry point should be an {@link @fluidframework/container-definitions#IFluidModule}.
952
- */
953
- library: string;
954
- };
955
- }
956
-
957
- /**
958
- * Data structure used to describe the code to load on the Fluid document
959
- * @public
960
- */
961
- export declare interface IFluidCodeDetails {
962
- /**
963
- * The code package to be used on the Fluid document. This is either the package name which will be loaded
964
- * from a package manager. Or the expanded Fluid package.
965
- */
966
- readonly package: string | Readonly<IFluidPackage>;
967
- /**
968
- * Configuration details. This includes links to the package manager and base CDNs.
969
- *
970
- * @remarks This is strictly consumer-defined data.
971
- * Its contents and semantics (including whether or not this data is present) are completely up to the consumer.
972
- */
973
- readonly config?: IFluidCodeDetailsConfig;
974
- }
975
-
976
- /**
977
- * @public
978
- */
979
- export declare const IFluidCodeDetailsComparer: keyof IProvideFluidCodeDetailsComparer;
980
-
981
- /**
982
- * Provides capability to compare Fluid code details.
983
- * @public
984
- */
985
- export declare interface IFluidCodeDetailsComparer extends IProvideFluidCodeDetailsComparer {
986
- /**
987
- * Determines if the `candidate` code details satisfy the constraints specified in `constraint` code details.
988
- *
989
- * Similar semantics to:
990
- * {@link https://github.com/npm/node-semver#usage}
991
- */
992
- satisfies(candidate: IFluidCodeDetails, constraint: IFluidCodeDetails): Promise<boolean>;
993
- /**
994
- * Return a number representing the ascending sort order of the `a` and `b` code details:
995
- *
996
- * - `< 0` if `a < b`.
997
- *
998
- * - `= 0` if `a === b`.
999
- *
1000
- * - `> 0` if `a > b`.
1001
- *
1002
- * - `undefined` if `a` is not comparable to `b`.
1003
- *
1004
- * Similar semantics to:
1005
- * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description | Array.sort}
1006
- */
1007
- compare(a: IFluidCodeDetails, b: IFluidCodeDetails): Promise<number | undefined>;
1008
- }
1009
-
1010
- /**
1011
- * Package manager configuration. Provides a key value mapping of config values
1012
- * @public
1013
- */
1014
- export declare interface IFluidCodeDetailsConfig {
1015
- readonly [key: string]: string;
1016
- }
1017
-
1018
- /**
1019
- * Fluid code resolvers take a Fluid code details, and resolve the
1020
- * full Fluid package including absolute urls for the browser file entries.
1021
- * The Fluid code resolver is coupled to a specific cdn and knows how to resolve
1022
- * the code detail for loading from that cdn. This include resolving to the most recent
1023
- * version of package that supports the provided code details.
1024
- * @public
1025
- */
1026
- export declare interface IFluidCodeResolver {
1027
- /**
1028
- * Resolves a Fluid code details into a form that can be loaded.
1029
- * @param details - The Fluid code details to resolve.
1030
- * @returns A IResolvedFluidCodeDetails where the resolvedPackage's Fluid file entries are absolute urls, and
1031
- * an optional resolvedPackageCacheId if the loaded package should be cached.
1032
- */
1033
- resolveCodeDetails(details: IFluidCodeDetails): Promise<IResolvedFluidCodeDetails>;
1034
- }
1035
-
1036
- /**
1037
- * @public
1038
- */
1039
- export declare interface IFluidModule {
1040
- fluidExport: FluidObject<IRuntimeFactory & IProvideFluidCodeDetailsComparer>;
1041
- }
1042
-
1043
- /**
1044
- * Encapsulates a module entry point with corresponding code details.
1045
- * @public
1046
- */
1047
- export declare interface IFluidModuleWithDetails {
1048
- /**
1049
- * Fluid code module that implements the runtime factory needed to instantiate the container runtime.
1050
- */
1051
- module: IFluidModule;
1052
- /**
1053
- * Code details associated with the module. Represents a document schema this module supports.
1054
- * If the code loader implements the {@link @fluidframework/core-interfaces#(IFluidCodeDetailsComparer:interface)}
1055
- * interface, it'll be called to determine whether the module code details satisfy the new code proposal in the
1056
- * quorum.
1057
- */
1058
- details: IFluidCodeDetails;
1059
- }
1060
-
1061
- /**
1062
- * Fluid-specific properties expected on a package to be loaded by the code loader.
1063
- * While compatible with the npm package format it is not necessary that that package is an
1064
- * npm package:
1065
- * {@link https://stackoverflow.com/questions/10065564/add-custom-metadata-or-config-to-package-json-is-it-valid}
1066
- * @public
1067
- */
1068
- export declare interface IFluidPackage {
1069
- /**
1070
- * The name of the package that this code represnets
1071
- */
1072
- name: string;
1073
- /**
1074
- * This object represents the Fluid specific properties of the package
1075
- */
1076
- fluid: {
1077
- /**
1078
- * The name of the of the environment. This should be something like browser, or node
1079
- * and contain the necessary targets for loading this code in that environment.
1080
- */
1081
- [environment: string]: undefined | IFluidPackageEnvironment;
1082
- };
1083
- /**
1084
- * General access for extended fields as specific usages will
1085
- * likely have additional infornamation like a definition of
1086
- * compatible versions, or deployment information like rings or rollouts.
1087
- */
1088
- [key: string]: unknown;
1089
- }
1090
-
1091
- /**
1092
- * Specifies an environment on Fluid property of a IFluidPackage.
1093
- * @public
1094
- */
1095
- export declare interface IFluidPackageEnvironment {
1096
- /**
1097
- * The name of the target. For a browser environment, this could be umd for scripts
1098
- * or css for styles.
1099
- */
1100
- [target: string]: undefined | {
1101
- /**
1102
- * List of files for the target. These can be relative or absolute.
1103
- * The code loader should resolve relative paths, and validate all
1104
- * full urls.
1105
- */
1106
- files: string[];
1107
- /**
1108
- * General access for extended fields as specific usages will
1109
- * likely have additional infornamation like a definition
1110
- * of Library, the entrypoint for umd packages.
1111
- */
1112
- [key: string]: unknown;
1113
- };
1114
- }
1115
-
1116
- export { IGenericError }
1117
-
1118
- /**
1119
- * The Host's view of the Loader, used for loading Containers
1120
- * @public
1121
- */
1122
- export declare interface IHostLoader extends ILoader {
1123
- /**
1124
- * Creates a new container using the specified chaincode but in an unattached state. While unattached all
1125
- * updates will only be local until the user explicitly attaches the container to a service provider.
1126
- */
1127
- createDetachedContainer(codeDetails: IFluidCodeDetails): Promise<IContainer>;
1128
- /**
1129
- * Creates a new container using the specified snapshot but in an unattached state. While unattached all
1130
- * updates will only be local until the user explicitly attaches the container to a service provider.
1131
- */
1132
- rehydrateDetachedContainerFromSnapshot(snapshot: string): Promise<IContainer>;
1133
- }
1134
-
1135
- /**
1136
- * The Runtime's view of the Loader, used for loading Containers
1137
- * @public
1138
- */
1139
- export declare interface ILoader extends Partial<IProvideLoader> {
1140
- /**
1141
- * Resolves the resource specified by the URL + headers contained in the request object
1142
- * to the underlying container that will resolve the request.
1143
- *
1144
- * @remarks
1145
- *
1146
- * An analogy for this is resolve is a DNS resolve of a Fluid container. Request then executes
1147
- * a request against the server found from the resolve step.
1148
- */
1149
- resolve(request: IRequest, pendingLocalState?: string): Promise<IContainer>;
1150
- /**
1151
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the Container's IFluidRouter/request.
1152
- */
1153
- request(request: IRequest): Promise<IResponse>;
1154
- /**
1155
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the Container's IFluidRouter/request.
1156
- */
1157
- readonly IFluidRouter: IFluidRouter;
1158
- }
1159
-
1160
- /**
1161
- * Set of Request Headers that the Loader understands and may inspect or modify
1162
- * @public
1163
- */
1164
- export declare interface ILoaderHeader {
1165
- /**
1166
- * @deprecated This header has been deprecated and will be removed in a future release
1167
- */
1168
- [LoaderHeader.cache]: boolean;
1169
- [LoaderHeader.clientDetails]: IClientDetails;
1170
- [LoaderHeader.loadMode]: IContainerLoadMode;
1171
- /**
1172
- * Loads the container to at least the specified sequence number.
1173
- * If not defined, behavior will fall back to `IContainerLoadMode.opsBeforeReturn`.
1174
- */
1175
- [LoaderHeader.sequenceNumber]: number;
1176
- [LoaderHeader.reconnect]: boolean;
1177
- [LoaderHeader.version]: string | undefined;
1178
- }
1179
-
1180
- /**
1181
- * @public
1182
- */
1183
- export declare type ILoaderOptions = {
1184
- [key in string | number]: any;
1185
- } & {
1186
- /**
1187
- * @deprecated This option has been deprecated and will be removed in a future release
1188
- * Set caching behavior for the loader. If true, we will load a container from cache if one
1189
- * with the same id/version exists or create a new container and cache it if it does not. If
1190
- * false, always load a new container and don't cache it. If the container has already been
1191
- * closed, it will not be cached. A cache option in the LoaderHeader for an individual
1192
- * request will override the Loader's value.
1193
- * Defaults to false.
1194
- */
1195
- cache?: boolean;
1196
- /**
1197
- * Provide the current Loader through the scope object when creating Containers. It is added
1198
- * as the `ILoader` property, and will overwrite an existing property of the same name on the
1199
- * scope. Useful for when the host wants to provide the current Loader's functionality to
1200
- * individual Data Stores, which is typically expected when creating with a Loader.
1201
- * Defaults to true.
1202
- */
1203
- provideScopeLoader?: boolean;
1204
- /**
1205
- * Max time (in ms) container will wait for a leave message of a disconnected client.
1206
- */
1207
- maxClientLeaveWaitTime?: number;
1208
- };
1209
-
1210
- /**
1211
- * @deprecated 0.48, This API will be removed in 0.50
1212
- * No replacement since it is not expected anyone will depend on this outside container-loader
1213
- * See {@link https://github.com/microsoft/FluidFramework/issues/9711} for context.
1214
- * @public
1215
- */
1216
- export declare interface IPendingLocalState {
1217
- url: string;
1218
- pendingRuntimeState: unknown;
1219
- }
1220
-
1221
- /**
1222
- * @public
1223
- */
1224
- export declare interface IProvideFluidCodeDetailsComparer {
1225
- readonly IFluidCodeDetailsComparer: IFluidCodeDetailsComparer;
1226
- }
1227
-
1228
- /**
1229
- * @public
1230
- */
1231
- export declare interface IProvideLoader {
1232
- readonly ILoader: ILoader;
1233
- }
1234
-
1235
- /**
1236
- * @public
1237
- */
1238
- export declare interface IProvideRuntimeFactory {
1239
- readonly IRuntimeFactory: IRuntimeFactory;
1240
- }
1241
-
1242
- /**
1243
- * The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails
1244
- * that have been resolved and are ready to load
1245
- * @public
1246
- */
1247
- export declare interface IResolvedFluidCodeDetails extends IFluidCodeDetails {
1248
- /**
1249
- * A resolved version of the Fluid package. All Fluid browser file entries should be absolute urls.
1250
- */
1251
- readonly resolvedPackage: Readonly<IFluidPackage>;
1252
- /**
1253
- * If not undefined, this id will be used to cache the entry point for the code package
1254
- */
1255
- readonly resolvedPackageCacheId: string | undefined;
1256
- }
1257
-
1258
- /**
1259
- * The IRuntime represents an instantiation of a code package within a Container.
1260
- * Primarily held by the ContainerContext to be able to interact with the running instance of the Container.
1261
- * @public
1262
- */
1263
- export declare interface IRuntime extends IDisposable {
1264
- /**
1265
- * Executes a request against the runtime
1266
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
1267
- */
1268
- request(request: IRequest): Promise<IResponse>;
1269
- /**
1270
- * Notifies the runtime of a change in the connection state
1271
- */
1272
- setConnectionState(connected: boolean, clientId?: string): any;
1273
- /**
1274
- * Processes the given op (message)
1275
- */
1276
- process(message: ISequencedDocumentMessage, local: boolean): any;
1277
- /**
1278
- * Processes the given signal
1279
- */
1280
- processSignal(message: any, local: boolean): any;
1281
- /**
1282
- * Create a summary. Used when attaching or serializing a detached container.
1283
- *
1284
- * @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported
1285
- * using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the
1286
- * new storage IDs so requests can be redirected.
1287
- */
1288
- createSummary(blobRedirectTable?: Map<string, string>): ISummaryTree;
1289
- /**
1290
- * Propagate the container state when container is attaching or attached.
1291
- * @param attachState - State of the container.
1292
- */
1293
- setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;
1294
- /**
1295
- * Get pending local state in a serializable format to be given back to a newly loaded container
1296
- * @experimental
1297
- * {@link https://github.com/microsoft/FluidFramework/packages/tree/main/loader/container-loader/closeAndGetPendingLocalState.md}
1298
- */
1299
- getPendingLocalState(props?: {
1300
- notifyImminentClosure?: boolean;
1301
- }): unknown;
1302
- /**
1303
- * Notify runtime that container is moving to "Attaching" state
1304
- * @param snapshot - snapshot created at attach time
1305
- * @deprecated not necessary after op replay moved to Container
1306
- */
1307
- notifyAttaching(snapshot: ISnapshotTreeWithBlobContents): void;
1308
- /**
1309
- * Notify runtime that we have processed a saved message, so that it can do async work (applying
1310
- * stashed ops) after having processed it.
1311
- */
1312
- notifyOpReplay?(message: ISequencedDocumentMessage): Promise<void>;
1313
- /**
1314
- * Exposes the entryPoint for the container runtime.
1315
- * Use this as the primary way of getting access to the user-defined logic within the container runtime.
1316
- *
1317
- * @see {@link IContainer.getEntryPoint}
1318
- */
1319
- getEntryPoint(): Promise<FluidObject | undefined>;
1320
- }
1321
-
1322
- /**
1323
- * @public
1324
- */
1325
- export declare const IRuntimeFactory: keyof IProvideRuntimeFactory;
1326
-
1327
- /**
1328
- * Exported module definition
1329
- *
1330
- * Provides the entry point for the ContainerContext to load the proper IRuntime
1331
- * to start up the running instance of the Container.
1332
- * @public
1333
- */
1334
- export declare interface IRuntimeFactory extends IProvideRuntimeFactory {
1335
- /**
1336
- * Instantiates a new IRuntime for the given IContainerContext to proxy to
1337
- * This is the main entry point to the Container's business logic
1338
- *
1339
- * @param context - container context to be supplied to the runtime
1340
- * @param existing - whether to instantiate for the first time or from an existing context
1341
- */
1342
- instantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;
1343
- }
1344
-
1345
- /**
1346
- * Determines if any object is an IFluidBrowserPackage
1347
- * @param maybePkg - The object to check for compatibility with IFluidBrowserPackage
1348
- * @public
1349
- */
1350
- export declare const isFluidBrowserPackage: (maybePkg: unknown) => maybePkg is Readonly<IFluidBrowserPackage>;
1351
-
1352
- /**
1353
- * Determines if any object is an IFluidCodeDetails
1354
- * @public
1355
- */
1356
- export declare const isFluidCodeDetails: (details: unknown) => details is Readonly<IFluidCodeDetails>;
1357
-
1358
- /**
1359
- * Check if the package.json defines a Fluid package
1360
- * @param pkg - the package json data to check if it is a Fluid package.
1361
- * @public
1362
- */
1363
- export declare const isFluidPackage: (pkg: unknown) => pkg is Readonly<IFluidPackage>;
1364
-
1365
- /**
1366
- * This is used when we rehydrate a container from the snapshot. Here we put the blob contents
1367
- * in separate property: {@link ISnapshotTreeWithBlobContents.blobsContents}.
1368
- *
1369
- * @remarks This is used as the `ContainerContext`'s base snapshot when attaching.
1370
- * @public
1371
- */
1372
- export declare interface ISnapshotTreeWithBlobContents extends ISnapshotTree {
1373
- blobsContents: {
1374
- [path: string]: ArrayBufferLike;
1375
- };
1376
- trees: {
1377
- [path: string]: ISnapshotTreeWithBlobContents;
1378
- };
1379
- }
1380
-
1381
- export { IThrottlingWarning }
1382
-
1383
- export { IUsageError }
1384
-
1385
- /**
1386
- * Accepted header keys for requests coming to the Loader
1387
- * @public
1388
- */
1389
- export declare enum LoaderHeader {
1390
- /**
1391
- * @deprecated This header has been deprecated and will be removed in a future release
1392
- * Override the Loader's default caching behavior for this container.
1393
- */
1394
- cache = "fluid-cache",
1395
- clientDetails = "fluid-client-details",
1396
- /**
1397
- * Start the container in a paused, unconnected state. Defaults to false
1398
- */
1399
- loadMode = "loadMode",
1400
- reconnect = "fluid-reconnect",
1401
- /**
1402
- * Loads the container to at least the specified sequence number.
1403
- * If not defined, behavior will fall back to `IContainerLoadMode.opsBeforeReturn`.
1404
- */
1405
- sequenceNumber = "fluid-sequence-number",
1406
- /**
1407
- * One of the following:
1408
- * null or "null": use ops, no snapshots
1409
- * undefined: fetch latest snapshot
1410
- * otherwise, version sha to load snapshot
1411
- */
1412
- version = "version"
1413
- }
1414
-
1415
- /**
1416
- * @public
1417
- */
1418
- export declare type ReadOnlyInfo = {
1419
- readonly readonly: false | undefined;
1420
- } | {
1421
- readonly readonly: true;
1422
- /**
1423
- * Read-only because `forceReadOnly()` was called.
1424
- */
1425
- readonly forced: boolean;
1426
- /**
1427
- * Read-only because client does not have write permissions for document.
1428
- */
1429
- readonly permissions: boolean | undefined;
1430
- /**
1431
- * Read-only with no delta stream connection.
1432
- */
1433
- readonly storageOnly: boolean;
1434
- /**
1435
- * Extra info on why connection to delta stream is not possible.
1436
- *
1437
- * @remarks This info might be provided if {@link ReadOnlyInfo.storageOnly} is set to `true`.
1438
- */
1439
- readonly storageOnlyReason?: string;
1440
- };
1441
-
1442
- export { }