@fluidframework/container-definitions 2.0.0-internal.2.1.2 → 2.0.0-internal.2.2.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.
package/.eslintrc.js CHANGED
@@ -5,7 +5,8 @@
5
5
 
6
6
  module.exports = {
7
7
  "extends": [
8
- require.resolve("@fluidframework/eslint-config-fluid")
8
+ require.resolve("@fluidframework/eslint-config-fluid"),
9
+ "prettier"
9
10
  ],
10
11
  "parserOptions": {
11
12
  "project": ["./tsconfig.json", "./src/test/types/tsconfig.json"]
package/dist/deltas.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  import { IDisposable, IEventProvider, IEvent, IErrorEvent } from "@fluidframework/common-definitions";
6
6
  import { ConnectionMode, IClientConfiguration, IClientDetails, IDocumentMessage, ISequencedDocumentMessage, ISignalClient, ISignalMessage, ITokenClaims } from "@fluidframework/protocol-definitions";
7
7
  /**
8
- * Contract representing the result of a newly established connection to the server for syncing deltas
8
+ * Contract representing the result of a newly established connection to the server for syncing deltas.
9
9
  */
10
10
  export interface IConnectionDetails {
11
11
  clientId: string;
@@ -16,8 +16,11 @@ export interface IConnectionDetails {
16
16
  initialClients: ISignalClient[];
17
17
  serviceConfiguration: IClientConfiguration;
18
18
  /**
19
- * Last known sequence number to ordering service at the time of connection
20
- * It may lap actual last sequence number (quite a bit, if container is very active).
19
+ * Last known sequence number to ordering service at the time of connection.
20
+ *
21
+ * @remarks
22
+ *
23
+ * It may lap actual last sequence number (quite a bit, if container is very active).
21
24
  * But it's the best information for client to figure out how far it is behind, at least
22
25
  * for "read" connections. "write" connections may use own "join" op to similar information,
23
26
  * that is likely to be more up-to-date.
@@ -46,19 +49,76 @@ export interface IDeltaSender {
46
49
  */
47
50
  flush(): void;
48
51
  }
49
- /** Events emitted by the Delta Manager */
52
+ /**
53
+ * Events emitted by {@link IDeltaManager}.
54
+ */
50
55
  export interface IDeltaManagerEvents extends IEvent {
56
+ /**
57
+ * @deprecated No replacement API recommended.
58
+ */
51
59
  (event: "prepareSend", listener: (messageBuffer: any[]) => void): any;
60
+ /**
61
+ * @deprecated No replacement API recommended.
62
+ */
52
63
  (event: "submitOp", listener: (message: IDocumentMessage) => void): any;
64
+ /**
65
+ * Emitted immediately after processing an incoming operation (op).
66
+ *
67
+ * @remarks
68
+ *
69
+ * Note: this event is not intended for general use.
70
+ * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the
71
+ * ops directly on the {@link IDeltaManager}.
72
+ *
73
+ * Listener parameters:
74
+ *
75
+ * - `message`: The op that was processed.
76
+ *
77
+ * - `processingTime`: The amount of time it took to process the inbound operation (op), expressed in milliseconds.
78
+ */
53
79
  (event: "op", listener: (message: ISequencedDocumentMessage, processingTime: number) => void): any;
80
+ /**
81
+ * @deprecated No replacement API recommended.
82
+ */
54
83
  (event: "allSentOpsAckd", listener: () => void): any;
55
- (event: "pong" | "processTime", listener: (latency: number) => void): any;
56
84
  /**
57
- * The connect event fires once we've received the connect_document_success message from the
58
- * server. This happens prior to the client's join message (if there is a join message).
85
+ * @deprecated No replacement API recommended.
86
+ */
87
+ (event: "pong", listener: (latency: number) => void): any;
88
+ /**
89
+ * @deprecated No replacement API recommended.
90
+ */
91
+ (event: "processTime", listener: (latency: number) => void): any;
92
+ /**
93
+ * Emitted when the {@link IDeltaManager} completes connecting to the Fluid service.
94
+ *
95
+ * @remarks
96
+ * This occurs once we've received the connect_document_success message from the server,
97
+ * and happens prior to the client's join message (if there is a join message).
98
+ *
99
+ * Listener parameters:
100
+ *
101
+ * - `details`: Connection metadata.
102
+ *
103
+ * - `opsBehind`: An estimate of far behind the client is relative to the service in terms of ops.
104
+ * Will not be specified if an estimate cannot be determined.
59
105
  */
60
106
  (event: "connect", listener: (details: IConnectionDetails, opsBehind?: number) => void): any;
107
+ /**
108
+ * Emitted when the {@link IDeltaManager} becomes disconnected from the Fluid service.
109
+ *
110
+ * @remarks Listener parameters:
111
+ *
112
+ * - `reason`: Describes the reason for which the delta manager was disconnected.
113
+ */
61
114
  (event: "disconnect", listener: (reason: string) => void): any;
115
+ /**
116
+ * Emitted when read/write permissions change.
117
+ *
118
+ * @remarks Listener parameters:
119
+ *
120
+ * - `readonly`: Whether or not the delta manager is now read-only.
121
+ */
62
122
  (event: "readonly", listener: (readonly: boolean) => void): any;
63
123
  }
64
124
  /**
@@ -100,12 +160,42 @@ export interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>
100
160
  /** Submit a signal to the service to be broadcast to other connected clients, but not persisted */
101
161
  submitSignal(content: any): void;
102
162
  }
103
- /** Events emitted by a Delta Queue */
163
+ /**
164
+ * Events emitted by {@link IDeltaQueue}.
165
+ */
104
166
  export interface IDeltaQueueEvents<T> extends IErrorEvent {
105
- (event: "push" | "op", listener: (task: T) => void): any;
106
167
  /**
107
- * @param count - number of events (T) processed before becoming idle
108
- * @param duration - amount of time it took to process elements (milliseconds).
168
+ * Emitted when a task is enqueued.
169
+ *
170
+ * @remarks Listener parameters:
171
+ *
172
+ * - `task`: The task being enqueued.
173
+ */
174
+ (event: "push", listener: (task: T) => void): any;
175
+ /**
176
+ * Emitted immediately after processing an enqueued task and removing it from the queue.
177
+ *
178
+ * @remarks
179
+ *
180
+ * Note: this event is not intended for general use.
181
+ * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the
182
+ * ops directly on the {@link IDeltaQueue}.
183
+ *
184
+ * Listener parameters:
185
+ *
186
+ * - `task`: The task that was processed.
187
+ */
188
+ (event: "op", listener: (task: T) => void): any;
189
+ /**
190
+ * Emitted when the queue of tasks to process is emptied.
191
+ *
192
+ * @remarks Listener parameters:
193
+ *
194
+ * - `count`: The number of events (`T`) processed before becoming idle.
195
+ *
196
+ * - `duration`: The amount of time it took to process elements (in milliseconds).
197
+ *
198
+ * @see {@link IDeltaQueue.idle}
109
199
  */
110
200
  (event: "idle", listener: (count: number, duration: number) => void): any;
111
201
  }
@@ -122,11 +212,13 @@ export interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, ID
122
212
  */
123
213
  length: number;
124
214
  /**
125
- * Flag indicating whether or not the queue is idle
215
+ * Flag indicating whether or not the queue is idle.
216
+ * I.e. there are no remaining messages to processes.
126
217
  */
127
218
  idle: boolean;
128
219
  /**
129
- * Pauses processing on the queue
220
+ * Pauses processing on the queue.
221
+ *
130
222
  * @returns A promise which resolves when processing has been paused.
131
223
  */
132
224
  pause(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"deltas.d.ts","sourceRoot":"","sources":["../src/deltas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtG,OAAO,EACH,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EACzB,aAAa,EACb,cAAc,EACd,YAAY,EACf,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C;;;;;;OAMG;IACH,wBAAwB,EAAE,MAAM,GAAG,SAAS,CAAC;CAChD;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,OAAO,EAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAEtD;;OAEG;IACH,aAAa,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;CACjB;AAED,0CAA0C;AAC1C,MAAM,WA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M,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;KAAE,CAAC,CAAC;CAC3E;AAED,oBAAY,YAAY,GAAG;IACvB,QAAQ,CAAC,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAC;CACxC,GAAG;IACA,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB,mDAAmD;IACnD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1C,gDAAgD;IAChD,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CACjC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"deltas.js","sourceRoot":"","sources":["../src/deltas.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable, IEventProvider, IEvent, IErrorEvent } from \"@fluidframework/common-definitions\";\nimport {\n ConnectionMode,\n IClientConfiguration,\n IClientDetails,\n IDocumentMessage,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ITokenClaims,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Contract representing the result of a newly established connection to the server for syncing deltas\n */\nexport interface IConnectionDetails {\n clientId: string;\n claims: ITokenClaims;\n existing: boolean;\n mode: ConnectionMode;\n version: string;\n initialClients: ISignalClient[];\n serviceConfiguration: IClientConfiguration;\n /**\n * Last known sequence number to ordering service at the time of connection\n * It may lap actual last sequence number (quite a bit, if container is very active).\n * But it's the best information for client to figure out how far it is behind, at least\n * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n * that is likely to be more up-to-date.\n */\n checkpointSequenceNumber: number | undefined;\n}\n\n/**\n * Interface used to define a strategy for handling incoming delta messages\n */\nexport interface IDeltaHandlerStrategy {\n /**\n * Processes the message.\n */\n process: (message: ISequencedDocumentMessage) => void;\n\n /**\n * Processes the signal.\n */\n processSignal: (message: ISignalMessage) => void;\n}\n\n/**\n * Contract supporting delivery of outbound messages to the server\n */\nexport interface IDeltaSender {\n /**\n * Flush all pending messages through the outbound queue\n */\n flush(): void;\n}\n\n/** Events emitted by the Delta Manager */\nexport interface IDeltaManagerEvents extends IEvent {\n (event: \"prepareSend\", listener: (messageBuffer: any[]) => void);\n (event: \"submitOp\", listener: (message: IDocumentMessage) => void);\n (event: \"op\", listener: (message: ISequencedDocumentMessage, processingTime: number) => void);\n (event: \"allSentOpsAckd\", listener: () => void);\n (event: \"pong\" | \"processTime\", listener: (latency: number) => void);\n /**\n * The connect event fires once we've received the connect_document_success message from the\n * server. This happens prior to the client's join message (if there is a join message).\n */\n (event: \"connect\", listener: (details: IConnectionDetails, opsBehind?: number) => void);\n (event: \"disconnect\", listener: (reason: string) => void);\n (event: \"readonly\", listener: (readonly: boolean) => void);\n}\n\n/**\n * Manages the transmission of ops between the runtime and storage.\n */\nexport interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>, IDeltaSender, IDisposable {\n /** The queue of inbound delta messages */\n readonly inbound: IDeltaQueue<T>;\n\n /** The queue of outbound delta messages */\n readonly outbound: IDeltaQueue<U[]>;\n\n /** The queue of inbound delta signals */\n readonly inboundSignal: IDeltaQueue<ISignalMessage>;\n\n /** The current minimum sequence number */\n readonly minimumSequenceNumber: number;\n\n /** The last sequence number processed by the delta manager */\n readonly lastSequenceNumber: number;\n\n /** The last message processed by the delta manager */\n readonly lastMessage: ISequencedDocumentMessage | undefined;\n\n /** The latest sequence number the delta manager is aware of */\n readonly lastKnownSeqNumber: number;\n\n /** The initial sequence number set when attaching the op handler */\n readonly initialSequenceNumber: number;\n\n /**\n * Tells if current connection has checkpoint information.\n * I.e. we know how far behind the client was at the time of establishing connection\n */\n readonly hasCheckpointSequenceNumber: boolean;\n\n /** Details of client */\n readonly clientDetails: IClientDetails;\n\n /** Protocol version being used to communicate with the service */\n readonly version: string;\n\n /** Max message size allowed to the delta manager */\n readonly maxMessageSize: number;\n\n /** Service configuration provided by the service. */\n readonly serviceConfiguration: IClientConfiguration | undefined;\n\n /** Flag to indicate whether the client can write or not. */\n readonly active: boolean;\n\n readonly readOnlyInfo: ReadOnlyInfo;\n\n /** Submit a signal to the service to be broadcast to other connected clients, but not persisted */\n submitSignal(content: any): void;\n}\n\n/** Events emitted by a Delta Queue */\nexport interface IDeltaQueueEvents<T> extends IErrorEvent {\n (event: \"push\" | \"op\", listener: (task: T) => void);\n /**\n * @param count - number of events (T) processed before becoming idle\n * @param duration - amount of time it took to process elements (milliseconds).\n */\n (event: \"idle\", listener: (count: number, duration: number) => void);\n}\n\n/**\n * Queue of ops to be sent to or processed from storage\n */\nexport interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, IDisposable {\n /**\n * Flag indicating whether or not the queue was paused\n */\n paused: boolean;\n\n /**\n * The number of messages remaining in the queue\n */\n length: number;\n\n /**\n * Flag indicating whether or not the queue is idle\n */\n idle: boolean;\n\n /**\n * Pauses processing on the queue\n * @returns A promise which resolves when processing has been paused.\n */\n pause(): Promise<void>;\n\n /**\n * Resumes processing on the queue\n */\n resume(): void;\n\n /**\n * Peeks at the next message in the queue\n */\n peek(): T | undefined;\n\n /**\n * Returns all the items in the queue as an array. Does not remove them from the queue.\n */\n toArray(): T[];\n\n /**\n * returns number of ops processed and time it took to process these ops.\n * Zeros if queue did not process anything (had no messages, was paused or had hit an error before)\n */\n waitTillProcessingDone(): Promise<{ count: number; duration: number; }>;\n}\n\nexport type ReadOnlyInfo = {\n readonly readonly: false | undefined;\n} | {\n readonly readonly: true;\n /** read-only because forceReadOnly() was called */\n readonly forced: boolean;\n /** read-only because client does not have write permissions for document */\n readonly permissions: boolean | undefined;\n /** read-only with no delta stream connection */\n readonly storageOnly: boolean;\n};\n"]}
1
+ {"version":3,"file":"deltas.js","sourceRoot":"","sources":["../src/deltas.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable, IEventProvider, IEvent, IErrorEvent } from \"@fluidframework/common-definitions\";\nimport {\n ConnectionMode,\n IClientConfiguration,\n IClientDetails,\n IDocumentMessage,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ITokenClaims,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Contract representing the result of a newly established connection to the server for syncing deltas.\n */\nexport interface IConnectionDetails {\n clientId: string;\n claims: ITokenClaims;\n existing: boolean;\n mode: ConnectionMode;\n version: string;\n initialClients: ISignalClient[];\n serviceConfiguration: IClientConfiguration;\n\n /**\n * Last known sequence number to ordering service at the time of connection.\n *\n * @remarks\n *\n * It may lap actual last sequence number (quite a bit, if container is very active).\n * But it's the best information for client to figure out how far it is behind, at least\n * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n * that is likely to be more up-to-date.\n */\n checkpointSequenceNumber: number | undefined;\n}\n\n/**\n * Interface used to define a strategy for handling incoming delta messages\n */\nexport interface IDeltaHandlerStrategy {\n /**\n * Processes the message.\n */\n process: (message: ISequencedDocumentMessage) => void;\n\n /**\n * Processes the signal.\n */\n processSignal: (message: ISignalMessage) => void;\n}\n\n/**\n * Contract supporting delivery of outbound messages to the server\n */\nexport interface IDeltaSender {\n /**\n * Flush all pending messages through the outbound queue\n */\n flush(): void;\n}\n\n/**\n * Events emitted by {@link IDeltaManager}.\n */\n/* eslint-disable @typescript-eslint/unified-signatures */\nexport interface IDeltaManagerEvents extends IEvent {\n /**\n * @deprecated No replacement API recommended.\n */\n (event: \"prepareSend\", listener: (messageBuffer: any[]) => void);\n\n /**\n * @deprecated No replacement API recommended.\n */\n (event: \"submitOp\", listener: (message: IDocumentMessage) => void);\n\n /**\n * Emitted immediately after processing an incoming operation (op).\n *\n * @remarks\n *\n * Note: this event is not intended for general use.\n * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the\n * ops directly on the {@link IDeltaManager}.\n *\n * Listener parameters:\n *\n * - `message`: The op that was processed.\n *\n * - `processingTime`: The amount of time it took to process the inbound operation (op), expressed in milliseconds.\n */\n (event: \"op\", listener: (message: ISequencedDocumentMessage, processingTime: number) => void);\n\n /**\n * @deprecated No replacement API recommended.\n */\n (event: \"allSentOpsAckd\", listener: () => void);\n\n /**\n * @deprecated No replacement API recommended.\n */\n (event: \"pong\", listener: (latency: number) => void);\n\n /**\n * @deprecated No replacement API recommended.\n */\n (event: \"processTime\", listener: (latency: number) => void);\n\n /**\n * Emitted when the {@link IDeltaManager} completes connecting to the Fluid service.\n *\n * @remarks\n * This occurs once we've received the connect_document_success message from the server,\n * and happens prior to the client's join message (if there is a join message).\n *\n * Listener parameters:\n *\n * - `details`: Connection metadata.\n *\n * - `opsBehind`: An estimate of far behind the client is relative to the service in terms of ops.\n * Will not be specified if an estimate cannot be determined.\n */\n (event: \"connect\", listener: (details: IConnectionDetails, opsBehind?: number) => void);\n\n /**\n * Emitted when the {@link IDeltaManager} becomes disconnected from the Fluid service.\n *\n * @remarks Listener parameters:\n *\n * - `reason`: Describes the reason for which the delta manager was disconnected.\n */\n (event: \"disconnect\", listener: (reason: string) => void);\n\n /**\n * Emitted when read/write permissions change.\n *\n * @remarks Listener parameters:\n *\n * - `readonly`: Whether or not the delta manager is now read-only.\n */\n (event: \"readonly\", listener: (readonly: boolean) => void);\n}\n/* eslint-enable @typescript-eslint/unified-signatures */\n\n/**\n * Manages the transmission of ops between the runtime and storage.\n */\nexport interface IDeltaManager<T, U> extends IEventProvider<IDeltaManagerEvents>, IDeltaSender, IDisposable {\n /** The queue of inbound delta messages */\n readonly inbound: IDeltaQueue<T>;\n\n /** The queue of outbound delta messages */\n readonly outbound: IDeltaQueue<U[]>;\n\n /** The queue of inbound delta signals */\n readonly inboundSignal: IDeltaQueue<ISignalMessage>;\n\n /** The current minimum sequence number */\n readonly minimumSequenceNumber: number;\n\n /** The last sequence number processed by the delta manager */\n readonly lastSequenceNumber: number;\n\n /** The last message processed by the delta manager */\n readonly lastMessage: ISequencedDocumentMessage | undefined;\n\n /** The latest sequence number the delta manager is aware of */\n readonly lastKnownSeqNumber: number;\n\n /** The initial sequence number set when attaching the op handler */\n readonly initialSequenceNumber: number;\n\n /**\n * Tells if current connection has checkpoint information.\n * I.e. we know how far behind the client was at the time of establishing connection\n */\n readonly hasCheckpointSequenceNumber: boolean;\n\n /** Details of client */\n readonly clientDetails: IClientDetails;\n\n /** Protocol version being used to communicate with the service */\n readonly version: string;\n\n /** Max message size allowed to the delta manager */\n readonly maxMessageSize: number;\n\n /** Service configuration provided by the service. */\n readonly serviceConfiguration: IClientConfiguration | undefined;\n\n /** Flag to indicate whether the client can write or not. */\n readonly active: boolean;\n\n readonly readOnlyInfo: ReadOnlyInfo;\n\n /** Submit a signal to the service to be broadcast to other connected clients, but not persisted */\n submitSignal(content: any): void;\n}\n\n/**\n * Events emitted by {@link IDeltaQueue}.\n */\n/* eslint-disable @typescript-eslint/unified-signatures */\nexport interface IDeltaQueueEvents<T> extends IErrorEvent {\n /**\n * Emitted when a task is enqueued.\n *\n * @remarks Listener parameters:\n *\n * - `task`: The task being enqueued.\n */\n (event: \"push\", listener: (task: T) => void);\n\n /**\n * Emitted immediately after processing an enqueued task and removing it from the queue.\n *\n * @remarks\n *\n * Note: this event is not intended for general use.\n * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the\n * ops directly on the {@link IDeltaQueue}.\n *\n * Listener parameters:\n *\n * - `task`: The task that was processed.\n */\n (event: \"op\", listener: (task: T) => void);\n\n /**\n * Emitted when the queue of tasks to process is emptied.\n *\n * @remarks Listener parameters:\n *\n * - `count`: The number of events (`T`) processed before becoming idle.\n *\n * - `duration`: The amount of time it took to process elements (in milliseconds).\n *\n * @see {@link IDeltaQueue.idle}\n */\n (event: \"idle\", listener: (count: number, duration: number) => void);\n}\n/* eslint-enable @typescript-eslint/unified-signatures */\n\n/**\n * Queue of ops to be sent to or processed from storage\n */\nexport interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, IDisposable {\n /**\n * Flag indicating whether or not the queue was paused\n */\n paused: boolean;\n\n /**\n * The number of messages remaining in the queue\n */\n length: number;\n\n /**\n * Flag indicating whether or not the queue is idle.\n * I.e. there are no remaining messages to processes.\n */\n idle: boolean;\n\n /**\n * Pauses processing on the queue.\n *\n * @returns A promise which resolves when processing has been paused.\n */\n pause(): Promise<void>;\n\n /**\n * Resumes processing on the queue\n */\n resume(): void;\n\n /**\n * Peeks at the next message in the queue\n */\n peek(): T | undefined;\n\n /**\n * Returns all the items in the queue as an array. Does not remove them from the queue.\n */\n toArray(): T[];\n\n /**\n * returns number of ops processed and time it took to process these ops.\n * Zeros if queue did not process anything (had no messages, was paused or had hit an error before)\n */\n waitTillProcessingDone(): Promise<{ count: number; duration: number; }>;\n}\n\nexport type ReadOnlyInfo = {\n readonly readonly: false | undefined;\n} | {\n readonly readonly: true;\n /** read-only because forceReadOnly() was called */\n readonly forced: boolean;\n /** read-only because client does not have write permissions for document */\n readonly permissions: boolean | undefined;\n /** read-only with no delta stream connection */\n readonly storageOnly: boolean;\n};\n"]}
package/dist/error.d.ts CHANGED
@@ -66,7 +66,8 @@ export interface IErrorBase extends Partial<Error> {
66
66
  export interface ContainerWarning extends IErrorBase {
67
67
  /**
68
68
  * Whether this error has already been logged. Used to avoid logging errors twice.
69
- * Default is false.
69
+ *
70
+ * @defaultValue `false`
70
71
  */
71
72
  logged?: boolean;
72
73
  }
@@ -1 +1 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E;;GAEG;AACH,oBAAY,kBAAkB;IAC1B;;OAEG;IACH,YAAY,iBAAiB;IAE7B;;OAEG;IACH,eAAe,oBAAoB;IAEnC;;OAEG;IACH,mBAAmB,wBAAwB;IAE3C;;OAEG;IACH,mBAAmB,wBAAwB;I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AAA;;;GAGG;;;AAIH;;GAEG;AACH,IAAY,kBA+BX;AA/BD,WAAY,kBAAkB;IAC1B;;OAEG;IACH,mDAA6B,CAAA;IAE7B;;OAEG;IACH,yDAAmC,CAAA;IAEnC;;OAEG;IACH,iEAA2C,CAAA;IAE3C;;OAEG;IACH,iEAA2C,CAAA;IAE3C;;OAEG;IACH,+CAAyB,CAAA;IAEzB;;;OAGG;IACH,6EAAuD,CAAA;AAC3D,CAAC,EA/BW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QA+B7B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryProperties } from \"@fluidframework/common-definitions\";\n\n/**\n * Different error types the Container may report out to the Host\n */\nexport enum ContainerErrorType {\n /**\n * Some error, most likely an exception caught by runtime and propagated to container as critical error\n */\n genericError = \"genericError\",\n\n /**\n * Throttling error from server. Server is busy and is asking not to reconnect for some time\n */\n throttlingError = \"throttlingError\",\n\n /**\n * Data loss error detected by Container / DeltaManager. Likely points to storage issue.\n */\n dataCorruptionError = \"dataCorruptionError\",\n\n /**\n * Error encountered when processing an operation. May correlate with data corruption.\n */\n dataProcessingError = \"dataProcessingError\",\n\n /**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n */\n usageError = \"usageError\",\n\n /**\n * Error indicating an client session has expired. Currently this only happens when GC is allowed on a document and\n * aids in safely deleting unused objects.\n */\n clientSessionExpiredError = \"clientSessionExpiredError\",\n}\n\n/**\n * Base interface for all errors and warnings at container level\n */\nexport interface IErrorBase extends Partial<Error> {\n /** errorType is a union of error types from\n * - container\n * - runtime\n * - drivers\n */\n readonly errorType: string;\n\n /**\n * See Error.message\n * Privacy Note - This is a freeform string that we may not control in all cases (e.g. a dependency throws an error)\n * If there are known cases where this contains privacy-sensitive data it will be tagged and included in the result\n * of getTelemetryProperties. When logging, consider fetching it that way rather than straight from this field.\n */\n readonly message: string;\n /** See Error.name */\n readonly name?: string;\n /** See Error.stack */\n readonly stack?: string;\n /**\n * Returns all properties of this error object that are either safe to log\n * or explicitly tagged as containing privacy-sensitive data.\n */\n getTelemetryProperties?(): ITelemetryProperties;\n}\n\n/**\n * Represents warnings raised on container.\n */\nexport interface ContainerWarning extends IErrorBase {\n /**\n * Whether this error has already been logged. Used to avoid logging errors twice.\n * Default is false.\n */\n logged?: boolean;\n}\n\n/**\n * Represents errors raised on container.\n */\nexport type ICriticalContainerError = IErrorBase;\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n */\nexport interface IGenericError extends IErrorBase {\n readonly errorType: ContainerErrorType.genericError;\n error?: any;\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n */\nexport interface IUsageError extends IErrorBase {\n readonly errorType: ContainerErrorType.usageError;\n}\n\n/**\n * Warning emitted when requests to storage are being throttled\n */\nexport interface IThrottlingWarning extends IErrorBase {\n readonly errorType: ContainerErrorType.throttlingError;\n readonly retryAfterSeconds: number;\n}\n"]}
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AACH,IAAY,kBA+BX;AA/BD,WAAY,kBAAkB;IAC1B;;OAEG;IACH,mDAA6B,CAAA;IAE7B;;OAEG;IACH,yDAAmC,CAAA;IAEnC;;OAEG;IACH,iEAA2C,CAAA;IAE3C;;OAEG;IACH,iEAA2C,CAAA;IAE3C;;OAEG;IACH,+CAAyB,CAAA;IAEzB;;;OAGG;IACH,6EAAuD,CAAA;AAC3D,CAAC,EA/BW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QA+B7B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryProperties } from \"@fluidframework/common-definitions\";\n\n/**\n * Different error types the Container may report out to the Host\n */\nexport enum ContainerErrorType {\n /**\n * Some error, most likely an exception caught by runtime and propagated to container as critical error\n */\n genericError = \"genericError\",\n\n /**\n * Throttling error from server. Server is busy and is asking not to reconnect for some time\n */\n throttlingError = \"throttlingError\",\n\n /**\n * Data loss error detected by Container / DeltaManager. Likely points to storage issue.\n */\n dataCorruptionError = \"dataCorruptionError\",\n\n /**\n * Error encountered when processing an operation. May correlate with data corruption.\n */\n dataProcessingError = \"dataProcessingError\",\n\n /**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n */\n usageError = \"usageError\",\n\n /**\n * Error indicating an client session has expired. Currently this only happens when GC is allowed on a document and\n * aids in safely deleting unused objects.\n */\n clientSessionExpiredError = \"clientSessionExpiredError\",\n}\n\n/**\n * Base interface for all errors and warnings at container level\n */\nexport interface IErrorBase extends Partial<Error> {\n /** errorType is a union of error types from\n * - container\n * - runtime\n * - drivers\n */\n readonly errorType: string;\n\n /**\n * See Error.message\n * Privacy Note - This is a freeform string that we may not control in all cases (e.g. a dependency throws an error)\n * If there are known cases where this contains privacy-sensitive data it will be tagged and included in the result\n * of getTelemetryProperties. When logging, consider fetching it that way rather than straight from this field.\n */\n readonly message: string;\n /** See Error.name */\n readonly name?: string;\n /** See Error.stack */\n readonly stack?: string;\n /**\n * Returns all properties of this error object that are either safe to log\n * or explicitly tagged as containing privacy-sensitive data.\n */\n getTelemetryProperties?(): ITelemetryProperties;\n}\n\n/**\n * Represents warnings raised on container.\n */\nexport interface ContainerWarning extends IErrorBase {\n /**\n * Whether this error has already been logged. Used to avoid logging errors twice.\n *\n * @defaultValue `false`\n */\n logged?: boolean;\n}\n\n/**\n * Represents errors raised on container.\n */\nexport type ICriticalContainerError = IErrorBase;\n\n/**\n * Generic wrapper for an unrecognized/uncategorized error object\n */\nexport interface IGenericError extends IErrorBase {\n readonly errorType: ContainerErrorType.genericError;\n error?: any;\n}\n\n/**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n */\nexport interface IUsageError extends IErrorBase {\n readonly errorType: ContainerErrorType.usageError;\n}\n\n/**\n * Warning emitted when requests to storage are being throttled\n */\nexport interface IThrottlingWarning extends IErrorBase {\n readonly errorType: ContainerErrorType.throttlingError;\n readonly retryAfterSeconds: number;\n}\n"]}
package/dist/loader.d.ts CHANGED
@@ -34,7 +34,7 @@ export interface IFluidModuleWithDetails {
34
34
  */
35
35
  export interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComparer> {
36
36
  /**
37
- * Load the code module (package) that is capable to interact with the document.
37
+ * Load the code module (package) that can interact with the document.
38
38
  *
39
39
  * @param source - Code proposal that articulates the current schema the document is written in.
40
40
  * @returns - Code module entry point along with the code details associated with it.
@@ -42,7 +42,7 @@ export interface ICodeDetailsLoader extends Partial<IProvideFluidCodeDetailsComp
42
42
  load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;
43
43
  }
44
44
  /**
45
- * The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails
45
+ * The interface returned from a IFluidCodeResolver which represents IFluidCodeDetails
46
46
  * that have been resolved and are ready to load
47
47
  */
48
48
  export interface IResolvedFluidCodeDetails extends IFluidCodeDetails {
@@ -78,22 +78,134 @@ export interface ICodeAllowList {
78
78
  testSource(source: IResolvedFluidCodeDetails): Promise<boolean>;
79
79
  }
80
80
  /**
81
- * Events emitted by the Container "upwards" to the Loader and Host
81
+ * Events emitted by the {@link IContainer} "upwards" to the Loader and Host.
82
82
  */
83
83
  export interface IContainerEvents extends IEvent {
84
+ /**
85
+ * Emitted when the readonly state of the container changes.
86
+ *
87
+ * @remarks Listener parameters:
88
+ *
89
+ * - `readonly`: Whether or not the container is now in a readonly state.
90
+ *
91
+ * @see {@link IContainer.readOnlyInfo}
92
+ */
84
93
  (event: "readonly", listener: (readonly: boolean) => void): void;
94
+ /**
95
+ * Emitted when the {@link IContainer} completes connecting to the Fluid service.
96
+ *
97
+ * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.
98
+ *
99
+ * @see
100
+ *
101
+ * - {@link IContainer.connectionState}
102
+ *
103
+ * - {@link IContainer.connect}
104
+ */
85
105
  (event: "connected", listener: (clientId: string) => void): any;
106
+ /**
107
+ * Fires when new container code details have been proposed, prior to acceptance.
108
+ *
109
+ * @remarks Listener parameters:
110
+ *
111
+ * - `codeDetails`: The code details being proposed.
112
+ *
113
+ * - `proposal`: NOT RECOMMENDED FOR USE.
114
+ *
115
+ * @see {@link IContainer.proposeCodeDetails}
116
+ */
86
117
  (event: "codeDetailsProposed", listener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void): any;
118
+ /**
119
+ * @deprecated No replacement API recommended.
120
+ */
87
121
  (event: "contextChanged", listener: (codeDetails: IFluidCodeDetails) => void): any;
88
- (event: "disconnected" | "attached", listener: () => void): any;
122
+ /**
123
+ * Emitted when the {@link IContainer} becomes disconnected from the Fluid service.
124
+ *
125
+ * @remarks Reflects connection state changes against the (delta) service acknowledging ops/edits.
126
+ *
127
+ * @see
128
+ *
129
+ * - {@link IContainer.connectionState}
130
+ *
131
+ * - {@link IContainer.disconnect}
132
+ */
133
+ (event: "disconnected", listener: () => void): any;
134
+ /**
135
+ * Emitted when a {@link AttachState.Detached | detached} container is
136
+ * {@link AttachState.Attached | attached} to the Fluid service.
137
+ *
138
+ * @see
139
+ *
140
+ * - {@link IContainer.attachState}
141
+ *
142
+ * - {@link IContainer.attach}
143
+ */
144
+ (event: "attached", listener: () => void): any;
145
+ /**
146
+ * Emitted when the {@link IContainer} is closed, which permanently disables it.
147
+ *
148
+ * @remarks Listener parameters:
149
+ *
150
+ * - `error`: If the container was closed due to error, this will contain details about the error that caused it.
151
+ *
152
+ * @see {@link IContainer.close}
153
+ */
89
154
  (event: "closed", listener: (error?: ICriticalContainerError) => void): any;
155
+ /**
156
+ * Emitted when the container encounters a state which may lead to errors, which may be actionable by the consumer.
157
+ *
158
+ * @remarks
159
+ *
160
+ * Note: this event is not intended for general use.
161
+ * The longer-term intention is to surface warnings more directly on the APIs that produce them.
162
+ * For now, use of this should be avoided when possible.
163
+ *
164
+ * Listener parameters:
165
+ *
166
+ * - `error`: The warning describing the encountered state.
167
+ */
90
168
  (event: "warning", listener: (error: ContainerWarning) => void): any;
169
+ /**
170
+ * Emitted immediately after processing an incoming operation (op).
171
+ *
172
+ * @remarks
173
+ *
174
+ * Note: this event is not intended for general use.
175
+ * Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the
176
+ * ops directly on the {@link IContainer}.
177
+ *
178
+ * Listener parameters:
179
+ *
180
+ * - `message`: The op that was processed.
181
+ */
91
182
  (event: "op", listener: (message: ISequencedDocumentMessage) => void): any;
92
- (event: "dirty" | "saved", listener: (dirty: boolean) => void): any;
183
+ /**
184
+ * Emitted upon the first local change while the Container is in the "saved" state.
185
+ * That is, when {@link IContainer.isDirty} transitions from `true` to `false`.
186
+ *
187
+ * @remarks Listener parameters:
188
+ *
189
+ * - `dirty`: DEPRECATED. This parameter will be removed in a future release.
190
+ *
191
+ * @see {@link IContainer.isDirty}
192
+ */
193
+ (event: "dirty", listener: (dirty: boolean) => void): any;
194
+ /**
195
+ * Emitted when all local changes/edits have been acknowledged by the service.
196
+ * I.e., when {@link IContainer.isDirty} transitions from `false` to `true`.
197
+ *
198
+ * @remarks Listener parameters:
199
+ *
200
+ * - `dirty`: DEPRECATED. This parameter will be removed in a future release.
201
+ *
202
+ * @see {@link IContainer.isDirty}
203
+ */
204
+ (event: "saved", listener: (dirty: boolean) => void): any;
93
205
  }
94
206
  /**
95
- * Namespace for the different connection states a container can be in
96
- * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression
207
+ * Namespace for the different connection states a container can be in.
208
+ * PLEASE NOTE: The sequence of the numerical values does no correspond to the typical connection state progression.
97
209
  */
98
210
  export declare namespace ConnectionState {
99
211
  /**
@@ -117,11 +229,11 @@ export declare namespace ConnectionState {
117
229
  type Connected = 2;
118
230
  }
119
231
  /**
120
- * Type defining the different states of connectivity a container can be in.
232
+ * Type defining the different states of connectivity a Container can be in.
121
233
  */
122
234
  export declare type ConnectionState = ConnectionState.Disconnected | ConnectionState.EstablishingConnection | ConnectionState.CatchingUp | ConnectionState.Connected;
123
235
  /**
124
- * The Host's view of the Container and its connection to storage
236
+ * The Host's view of a Container and its connection to storage
125
237
  */
126
238
  export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRouter {
127
239
  /**
@@ -134,7 +246,7 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
134
246
  */
135
247
  getQuorum(): IQuorumClients;
136
248
  /**
137
- * Represents the resolved url to the Container
249
+ * Represents the resolved url to the Container.
138
250
  * Will be undefined only when the container is in the {@link AttachState.Detached | detatched} state.
139
251
  */
140
252
  resolvedUrl: IResolvedUrl | undefined;
@@ -154,47 +266,50 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
154
266
  */
155
267
  getLoadedCodeDetails(): IFluidCodeDetails | undefined;
156
268
  /**
157
- * Returns true if the container has been closed, otherwise false
269
+ * Returns true if the container has been closed, otherwise false.
158
270
  */
159
271
  readonly closed: boolean;
160
272
  /**
161
- * Returns true if the container is dirty, i.e. there are user changes that has not been saved
162
- * Closing container in this state results in data loss for user.
163
- * Container usually gets into this situation due to loss of connectivity.
273
+ * Whether or not there are any local changes that have not been saved.
164
274
  */
165
275
  readonly isDirty: boolean;
166
276
  /**
167
- * Closes the container
277
+ * Closes the container.
278
+ *
279
+ * @param error - If the container is being closed due to error, this provides details about the error that
280
+ * resulted in closing it.
168
281
  */
169
282
  close(error?: ICriticalContainerError): void;
170
283
  /**
171
284
  * Closes the container and returns serialized local state intended to be
172
- * given to a newly loaded container
285
+ * given to a newly loaded container.
173
286
  */
174
287
  closeAndGetPendingLocalState(): string;
175
288
  /**
176
- * Propose new code details that define the code to be loaded
177
- * for this container's runtime. The returned promise will
178
- * be true when the proposal is accepted, and false if
179
- * the proposal is rejected.
289
+ * Propose new code details that define the code to be loaded for this container's runtime.
290
+ *
291
+ * The returned promise will be true when the proposal is accepted, and false if the proposal is rejected.
180
292
  */
181
293
  proposeCodeDetails(codeDetails: IFluidCodeDetails): Promise<boolean>;
182
294
  /**
183
295
  * Attaches the Container to the Container specified by the given Request.
184
296
  *
185
- * TODO - in the case of failure options should give a retry policy. Or some continuation function
186
- * that allows attachment to a secondary document.
297
+ * @privateRemarks
298
+ *
299
+ * TODO - in the case of failure options should give a retry policy.
300
+ * Or some continuation function that allows attachment to a secondary document.
187
301
  */
188
302
  attach(request: IRequest): Promise<void>;
189
303
  /**
190
- * Extract the snapshot from the detached container.
304
+ * Extract a snapshot of the container as long as it is in detached state. Calling this on an attached container
305
+ * is an error.
191
306
  */
192
307
  serialize(): string;
193
308
  /**
194
- * Get an absolute url for a provided container-relative request url.
309
+ * Get an absolute URL for a provided container-relative request URL.
195
310
  * If the container is not attached, this will return undefined.
196
311
  *
197
- * @param relativeUrl - A container-relative request URL
312
+ * @param relativeUrl - A container-relative request URL.
198
313
  */
199
314
  getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;
200
315
  /**
@@ -203,29 +318,45 @@ export interface IContainer extends IEventProvider<IContainerEvents>, IFluidRout
203
318
  */
204
319
  request(request: IRequest): Promise<IResponse>;
205
320
  /**
206
- * Provides the current state of the container's connection to the ordering service
321
+ * Provides the current state of the container's connection to the ordering service.
322
+ *
323
+ * @remarks Consumers can listen for state changes via the "connected" and "disconnected" events.
207
324
  */
208
325
  readonly connectionState: ConnectionState;
209
326
  /**
210
- * Attempts to connect the container to the delta stream and process ops
327
+ * Attempts to connect the container to the delta stream and process ops.
328
+ *
329
+ * @remarks
330
+ *
331
+ * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Connected}, and the
332
+ * "connected" event will be fired if/when connection succeeds.
211
333
  */
212
334
  connect(): void;
213
335
  /**
214
- * Disconnects the container from the delta stream and stops processing ops
336
+ * Disconnects the container from the delta stream and stops processing ops.
337
+ *
338
+ * @remarks
339
+ *
340
+ * {@link IContainer.connectionState} will be set to {@link (ConnectionState:namespace).Disconnected}, and the
341
+ * "disconnected" event will be fired when disconnection completes.
215
342
  */
216
343
  disconnect(): void;
217
344
  /**
218
- * The audience information for all clients currently associated with the document in the current session
345
+ * The audience information for all clients currently associated with the document in the current session.
219
346
  */
220
347
  readonly audience: IAudience;
221
348
  /**
222
349
  * The server provided ID of the client.
223
- * Set once this.connectionState === ConnectionState.Connected is true, otherwise undefined
224
- * @alpha
350
+ *
351
+ * Set once {@link IContainer.connectionState} is {@link (ConnectionState:namespace).Connected},
352
+ * otherwise will be `undefined`.
225
353
  */
226
354
  readonly clientId?: string | undefined;
227
355
  /**
228
356
  * Tells if container is in read-only mode.
357
+ *
358
+ * @remarks
359
+ *
229
360
  * Data stores should listen for "readonly" notifications and disallow user making changes to data stores.
230
361
  * Readonly state can be because of no storage write permission,
231
362
  * or due to host forcing readonly mode for container.
@@ -252,6 +383,8 @@ export interface ILoader extends IFluidRouter, Partial<IProvideLoader> {
252
383
  * Resolves the resource specified by the URL + headers contained in the request object
253
384
  * to the underlying container that will resolve the request.
254
385
  *
386
+ * @remarks
387
+ *
255
388
  * An analogy for this is resolve is a DNS resolve of a Fluid container. Request then executes
256
389
  * a request against the server found from the resolve step.
257
390
  */
@@ -276,25 +409,25 @@ export declare type ILoaderOptions = {
276
409
  [key in string | number]: any;
277
410
  } & {
278
411
  /**
279
- * Set caching behavior for the loader. If true, we will load a container from cache if one
412
+ * Set caching behavior for the loader. If true, we will load a container from cache if one
280
413
  * with the same id/version exists or create a new container and cache it if it does not. If
281
414
  * false, always load a new container and don't cache it. If the container has already been
282
- * closed, it will not be cached. A cache option in the LoaderHeader for an individual
415
+ * closed, it will not be cached. A cache option in the LoaderHeader for an individual
283
416
  * request will override the Loader's value.
284
417
  * Defaults to true.
285
418
  */
286
419
  cache?: boolean;
287
420
  /**
288
- * Provide the current Loader through the scope object when creating Containers. It is added
421
+ * Provide the current Loader through the scope object when creating Containers. It is added
289
422
  * as the `ILoader` property, and will overwrite an existing property of the same name on the
290
- * scope. Useful for when the host wants to provide the current Loader's functionality to
423
+ * scope. Useful for when the host wants to provide the current Loader's functionality to
291
424
  * individual Data Stores, which is typically expected when creating with a Loader.
292
425
  * Defaults to true.
293
426
  */
294
427
  provideScopeLoader?: boolean;
295
428
  /**
296
- * Max time(in ms) container will wait for a leave message of a disconnected client.
297
- */
429
+ * Max time (in ms) container will wait for a leave message of a disconnected client.
430
+ */
298
431
  maxClientLeaveWaitTime?: number;
299
432
  };
300
433
  /**
@@ -341,7 +474,7 @@ export interface IProvideLoader {
341
474
  /**
342
475
  * @deprecated 0.48, This API will be removed in 0.50
343
476
  * No replacement since it is not expected anyone will depend on this outside container-loader
344
- * See https://github.com/microsoft/FluidFramework/issues/9711 for context
477
+ * See {@link https://github.com/microsoft/FluidFramework/issues/9711} for context.
345
478
  */
346
479
  export interface IPendingLocalState {
347
480
  url: string;
@@ -349,8 +482,9 @@ export interface IPendingLocalState {
349
482
  }
350
483
  /**
351
484
  * This is used when we rehydrate a container from the snapshot. Here we put the blob contents
352
- * in separate property: blobContents. This is used as the ContainerContext's base snapshot
353
- * when attaching.
485
+ * in separate property: {@link ISnapshotTreeWithBlobContents.blobsContents}.
486
+ *
487
+ * @remarks This is used as the `ContainerContext`'s base snapshot when attaching.
354
488
  */
355
489
  export interface ISnapshotTreeWithBlobContents extends ISnapshotTree {
356
490
  blobsContents: {