@fluidframework/datastore-definitions 2.0.0-internal.7.0.0 → 2.0.0-internal.7.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluidframework/datastore-definitions
2
2
 
3
+ ## 2.0.0-internal.7.1.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.0.0-internal.7.0.0
4
8
 
5
9
  ### Major Changes
@@ -1,4 +1,12 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "@fluidframework/build-common/api-extractor-common-report.json"
3
+ "extends": "@fluidframework/build-common/api-extractor-base.json",
4
+ "messages": {
5
+ "extractorMessageReporting": {
6
+ "ae-missing-release-tag": {
7
+ // TODO: Fix violations and remove this rule override
8
+ "logLevel": "none"
9
+ }
10
+ }
11
+ }
4
12
  }
@@ -0,0 +1,155 @@
1
+ ## API Report File for "@fluidframework/datastore-definitions"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { AttachState } from '@fluidframework/container-definitions';
8
+ import { FluidObject } from '@fluidframework/core-interfaces';
9
+ import { IAudience } from '@fluidframework/container-definitions';
10
+ import { IDeltaManager } from '@fluidframework/container-definitions';
11
+ import { IDisposable } from '@fluidframework/core-interfaces';
12
+ import { IDocumentMessage } from '@fluidframework/protocol-definitions';
13
+ import { IEvent } from '@fluidframework/core-interfaces';
14
+ import { IEventProvider } from '@fluidframework/core-interfaces';
15
+ import { IExperimentalIncrementalSummaryContext } from '@fluidframework/runtime-definitions';
16
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
17
+ import { IFluidHandleContext } from '@fluidframework/core-interfaces';
18
+ import { IFluidLoadable } from '@fluidframework/core-interfaces';
19
+ import { IFluidRouter } from '@fluidframework/core-interfaces';
20
+ import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
21
+ import { IIdCompressor } from '@fluidframework/runtime-definitions';
22
+ import { IInboundSignalMessage } from '@fluidframework/runtime-definitions';
23
+ import { ILoaderOptions } from '@fluidframework/container-definitions';
24
+ import { IProvideFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
25
+ import { IQuorumClients } from '@fluidframework/protocol-definitions';
26
+ import { IRequest } from '@fluidframework/core-interfaces';
27
+ import { IResponse } from '@fluidframework/core-interfaces';
28
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
29
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
30
+ import { ITelemetryContext } from '@fluidframework/runtime-definitions';
31
+ import { ITelemetryLogger } from '@fluidframework/core-interfaces';
32
+
33
+ // @public (undocumented)
34
+ export interface IChannel extends IFluidLoadable {
35
+ // (undocumented)
36
+ readonly attributes: IChannelAttributes;
37
+ connect(services: IChannelServices): void;
38
+ getAttachSummary(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
39
+ getGCData(fullGC?: boolean): IGarbageCollectionData;
40
+ readonly id: string;
41
+ isAttached(): boolean;
42
+ summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext): Promise<ISummaryTreeWithStats>;
43
+ }
44
+
45
+ // @public
46
+ export interface IChannelAttributes {
47
+ readonly packageVersion?: string;
48
+ readonly snapshotFormatVersion: string;
49
+ readonly type: string;
50
+ }
51
+
52
+ // @public
53
+ export interface IChannelFactory {
54
+ readonly attributes: IChannelAttributes;
55
+ create(runtime: IFluidDataStoreRuntime, id: string): IChannel;
56
+ load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, channelAttributes: Readonly<IChannelAttributes>): Promise<IChannel>;
57
+ readonly type: string;
58
+ }
59
+
60
+ // @public
61
+ export interface IChannelServices {
62
+ // (undocumented)
63
+ deltaConnection: IDeltaConnection;
64
+ // (undocumented)
65
+ objectStorage: IChannelStorageService;
66
+ }
67
+
68
+ // @public
69
+ export interface IChannelStorageService {
70
+ contains(path: string): Promise<boolean>;
71
+ list(path: string): Promise<string[]>;
72
+ readBlob(path: string): Promise<ArrayBufferLike>;
73
+ }
74
+
75
+ // @public
76
+ export interface IDeltaConnection {
77
+ addedGCOutboundReference?(srcHandle: IFluidHandle, outboundHandle: IFluidHandle): void;
78
+ attach(handler: IDeltaHandler): void;
79
+ // (undocumented)
80
+ connected: boolean;
81
+ dirty(): void;
82
+ submit(messageContent: any, localOpMetadata: unknown): void;
83
+ }
84
+
85
+ // @public
86
+ export interface IDeltaHandler {
87
+ applyStashedOp(message: any): unknown;
88
+ process: (message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) => void;
89
+ reSubmit(message: any, localOpMetadata: unknown): void;
90
+ rollback?(message: any, localOpMetadata: unknown): void;
91
+ setConnectionState(connected: boolean): void;
92
+ }
93
+
94
+ // @public
95
+ export interface IFluidDataStoreRuntime extends IEventProvider<IFluidDataStoreRuntimeEvents>, IDisposable, Partial<IProvideFluidDataStoreRegistry> {
96
+ readonly attachState: AttachState;
97
+ bindChannel(channel: IChannel): void;
98
+ // (undocumented)
99
+ readonly channelsRoutingContext: IFluidHandleContext;
100
+ // (undocumented)
101
+ readonly clientId: string | undefined;
102
+ // (undocumented)
103
+ readonly connected: boolean;
104
+ createChannel(id: string | undefined, type: string): IChannel;
105
+ // (undocumented)
106
+ readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
107
+ ensureNoDataModelChanges<T>(callback: () => T): T;
108
+ readonly entryPoint: IFluidHandle<FluidObject>;
109
+ getAudience(): IAudience;
110
+ getChannel(id: string): Promise<IChannel>;
111
+ getQuorum(): IQuorumClients;
112
+ // (undocumented)
113
+ readonly id: string;
114
+ // (undocumented)
115
+ readonly idCompressor?: IIdCompressor;
116
+ // (undocumented)
117
+ readonly IFluidHandleContext: IFluidHandleContext;
118
+ // @deprecated (undocumented)
119
+ readonly IFluidRouter: IFluidRouter;
120
+ // (undocumented)
121
+ readonly logger: ITelemetryLogger;
122
+ // (undocumented)
123
+ readonly objectsRoutingContext: IFluidHandleContext;
124
+ // (undocumented)
125
+ readonly options: ILoaderOptions;
126
+ // @deprecated (undocumented)
127
+ request(request: IRequest): Promise<IResponse>;
128
+ // (undocumented)
129
+ readonly rootRoutingContext: IFluidHandleContext;
130
+ submitSignal(type: string, content: any): void;
131
+ uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;
132
+ waitAttached(): Promise<void>;
133
+ }
134
+
135
+ // @public (undocumented)
136
+ export interface IFluidDataStoreRuntimeEvents extends IEvent {
137
+ // (undocumented)
138
+ (event: "disconnected" | "dispose" | "attaching" | "attached", listener: () => void): any;
139
+ // (undocumented)
140
+ (event: "op", listener: (message: ISequencedDocumentMessage) => void): any;
141
+ // (undocumented)
142
+ (event: "signal", listener: (message: IInboundSignalMessage, local: boolean) => void): any;
143
+ // (undocumented)
144
+ (event: "connected", listener: (clientId: string) => void): any;
145
+ }
146
+
147
+ // @public
148
+ export type Jsonable<T = any, TReplaced = void> = T extends undefined | null | boolean | number | string | TReplaced ? T : Extract<T, Function> extends never ? {
149
+ [K in keyof T]: Extract<K, symbol> extends never ? Jsonable<T[K], TReplaced> : never;
150
+ } : never;
151
+
152
+ // @public
153
+ export type Serializable<T = any> = Jsonable<T, IFluidHandle>;
154
+
155
+ ```
@@ -0,0 +1,445 @@
1
+ /**
2
+ * This library defines the interfaces required to implement and/or communicate
3
+ * with a data store.
4
+ *
5
+ * @packageDocumentation
6
+ */
7
+
8
+ import { AttachState } from '@fluidframework/container-definitions';
9
+ import { FluidObject } from '@fluidframework/core-interfaces';
10
+ import { IAudience } from '@fluidframework/container-definitions';
11
+ import { IDeltaManager } from '@fluidframework/container-definitions';
12
+ import { IDisposable } from '@fluidframework/core-interfaces';
13
+ import { IDocumentMessage } from '@fluidframework/protocol-definitions';
14
+ import { IEvent } from '@fluidframework/core-interfaces';
15
+ import { IEventProvider } from '@fluidframework/core-interfaces';
16
+ import { IExperimentalIncrementalSummaryContext } from '@fluidframework/runtime-definitions';
17
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
18
+ import { IFluidHandleContext } from '@fluidframework/core-interfaces';
19
+ import { IFluidLoadable } from '@fluidframework/core-interfaces';
20
+ import { IFluidRouter } from '@fluidframework/core-interfaces';
21
+ import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
22
+ import { IIdCompressor } from '@fluidframework/runtime-definitions';
23
+ import { IInboundSignalMessage } from '@fluidframework/runtime-definitions';
24
+ import { ILoaderOptions } from '@fluidframework/container-definitions';
25
+ import { IProvideFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
26
+ import { IQuorumClients } from '@fluidframework/protocol-definitions';
27
+ import { IRequest } from '@fluidframework/core-interfaces';
28
+ import { IResponse } from '@fluidframework/core-interfaces';
29
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
30
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
31
+ import { ITelemetryContext } from '@fluidframework/runtime-definitions';
32
+ import { ITelemetryLogger } from '@fluidframework/core-interfaces';
33
+
34
+ export declare interface IChannel extends IFluidLoadable {
35
+ /**
36
+ * A readonly identifier for the channel
37
+ */
38
+ readonly id: string;
39
+ readonly attributes: IChannelAttributes;
40
+ /**
41
+ * Generates summary of the channel synchronously. It is called when an `attach message`
42
+ * for a local channel is generated. In other words, when the channel is being attached
43
+ * to make it visible to other clients.
44
+ *
45
+ * @remarks
46
+ *
47
+ * Note: Since the Attach Summary is generated for local channels when making them visible to
48
+ * remote clients, they don't have any previous summaries to compare against. For this reason,
49
+ * the attach summary cannot contain summary handles (paths to sub-trees or blobs).
50
+ * It can, however, contain {@link @fluidframework/protocol-definitions#ISummaryAttachment}
51
+ * (handles to blobs uploaded async via the blob manager).
52
+ *
53
+ * @param fullTree - A flag indicating whether the attempt should generate a full
54
+ * summary tree without any handles for unchanged subtrees.
55
+ *
56
+ * Default: `false`
57
+ *
58
+ * @param trackState - An optimization for tracking state of objects across summaries. If the state
59
+ * of an object did not change since last successful summary, an
60
+ * {@link @fluidframework/protocol-definitions#ISummaryHandle} can be used
61
+ * instead of re-summarizing it. If this is `false`, the expectation is that you should never
62
+ * send an `ISummaryHandle`, since you are not expected to track state.
63
+ *
64
+ * Note: The goal is to remove the trackState and automatically decided whether the
65
+ * handles will be used or not: {@link https://github.com/microsoft/FluidFramework/issues/10455}
66
+ *
67
+ * Default: `false`
68
+ *
69
+ * @param telemetryContext - See {@link @fluidframework/runtime-definitions#ITelemetryContext}.
70
+ *
71
+ * @returns A summary capturing the current state of the channel.
72
+ */
73
+ getAttachSummary(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
74
+ /**
75
+ * Generates summary of the channel asynchronously.
76
+ * This should not be called where the channel can be modified while summarization is in progress.
77
+ *
78
+ * @param fullTree - flag indicating whether the attempt should generate a full
79
+ * summary tree without any handles for unchanged subtrees. It should only be set to true when generating
80
+ * a summary from the entire container.
81
+ *
82
+ * Default: `false`
83
+ *
84
+ * @param trackState - An optimization for tracking state of objects across summaries. If the state
85
+ * of an object did not change since last successful summary, an
86
+ * {@link @fluidframework/protocol-definitions#ISummaryHandle} can be used
87
+ * instead of re-summarizing it. If this is `false`, the expectation is that you should never
88
+ * send an `ISummaryHandle`, since you are not expected to track state.
89
+ *
90
+ * Default: `false`
91
+ *
92
+ * Note: The goal is to remove the trackState and automatically decided whether the
93
+ * handles will be used or not: {@link https://github.com/microsoft/FluidFramework/issues/10455}
94
+ *
95
+ * @param telemetryContext - See {@link @fluidframework/runtime-definitions#ITelemetryContext}.
96
+ *
97
+ * @returns A summary capturing the current state of the channel.
98
+ */
99
+ summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext): Promise<ISummaryTreeWithStats>;
100
+ /**
101
+ * Checks if the channel is attached to storage.
102
+ * @returns True iff the channel is attached.
103
+ */
104
+ isAttached(): boolean;
105
+ /**
106
+ * Enables the channel to send and receive ops.
107
+ * @param services - The services to connect to.
108
+ */
109
+ connect(services: IChannelServices): void;
110
+ /**
111
+ * Returns the GC data for this channel. It contains a list of GC nodes that contains references to
112
+ * other GC nodes.
113
+ * @param fullGC - true to bypass optimizations and force full generation of GC data.
114
+ */
115
+ getGCData(fullGC?: boolean): IGarbageCollectionData;
116
+ }
117
+
118
+ /**
119
+ * Represents the attributes of a channel/DDS.
120
+ */
121
+ export declare interface IChannelAttributes {
122
+ /**
123
+ * Type name of the DDS for factory look up with ISharedObjectRegistry
124
+ */
125
+ readonly type: string;
126
+ /**
127
+ * Format version of the snapshot
128
+ * Currently, only use to display a debug message if the version is incompatible
129
+ */
130
+ readonly snapshotFormatVersion: string;
131
+ /**
132
+ * The package version of the code of the DDS, for debug only
133
+ */
134
+ readonly packageVersion?: string;
135
+ }
136
+
137
+ /**
138
+ * Definitions of a channel factory.
139
+ *
140
+ * @remarks
141
+ *
142
+ * The runtime must be able to produce "channels" of the correct in-memory object type for the collaborative session.
143
+ * Here "channels" are typically distributed data structures (DDSs).
144
+ *
145
+ * The runtime will consult with a registry of such factories during
146
+ * {@link https://fluidframework.com/docs/build/containers/ | Container} load and when receiving "attach" operations
147
+ * (ops), which indicate a new instance of a channel being introduced to the collaboration session, to produce the
148
+ * appropriate in-memory object.
149
+ *
150
+ * Factories follow a common model but enable custom behavior.
151
+ *
152
+ * @example
153
+ *
154
+ * If a collaboration includes a {@link https://fluidframework.com/docs/data-structures/map/ | SharedMap},
155
+ * the collaborating clients will need to have access to a factory that can produce the `SharedMap` object.
156
+ */
157
+ export declare interface IChannelFactory {
158
+ /**
159
+ * String representing the type of the factory.
160
+ */
161
+ readonly type: string;
162
+ /**
163
+ * Attributes of the channel.
164
+ */
165
+ readonly attributes: IChannelAttributes;
166
+ /**
167
+ * Loads the given channel. This call is only ever invoked internally as the only thing
168
+ * that is ever directly loaded is the document itself. Load will then only be called on documents that
169
+ * were created and added to a channel.
170
+ * @param runtime - Data store runtime containing state/info/helper methods about the data store.
171
+ * @param id - ID of the channel.
172
+ * @param services - Services to read objects at a given path using the delta connection.
173
+ * @param channelAttributes - The attributes for the the channel to be loaded.
174
+ * @returns The loaded object
175
+ *
176
+ * @privateRemarks
177
+ * Thought: should the storage object include the version information and limit access to just files
178
+ * for the given object? The latter seems good in general. But both are probably good things. We then just
179
+ * need a way to allow the document to provide later storage for the object.
180
+ */
181
+ load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, channelAttributes: Readonly<IChannelAttributes>): Promise<IChannel>;
182
+ /**
183
+ * Creates a local version of the channel.
184
+ * Calling attach on the object later will insert it into the object stream.
185
+ * @param runtime - The runtime the new object will be associated with
186
+ * @param id - The unique ID of the new object
187
+ * @returns The newly created object.
188
+ *
189
+ * @privateRemarks
190
+ * NOTE here - When we attach we need to submit all the pending ops prior to actually doing the attach
191
+ * for consistency.
192
+ */
193
+ create(runtime: IFluidDataStoreRuntime, id: string): IChannel;
194
+ }
195
+
196
+ /**
197
+ * Storage services to read the objects at a given path using the given delta connection.
198
+ */
199
+ export declare interface IChannelServices {
200
+ deltaConnection: IDeltaConnection;
201
+ objectStorage: IChannelStorageService;
202
+ }
203
+
204
+ /**
205
+ * Storage services to read the objects at a given path.
206
+ */
207
+ export declare interface IChannelStorageService {
208
+ /**
209
+ * Reads the object contained at the given path. Returns a buffer representation for the object.
210
+ */
211
+ readBlob(path: string): Promise<ArrayBufferLike>;
212
+ /**
213
+ * Determines if there is an object contained at the given path.
214
+ */
215
+ contains(path: string): Promise<boolean>;
216
+ /**
217
+ * Lists the blobs that exist at a specific path.
218
+ */
219
+ list(path: string): Promise<string[]>;
220
+ }
221
+
222
+ /**
223
+ * Interface to represent a connection to a delta notification stream.
224
+ */
225
+ export declare interface IDeltaConnection {
226
+ connected: boolean;
227
+ /**
228
+ * Send new messages to the server.
229
+ * @param messageContent - The content of the message to be sent.
230
+ * @param localOpMetadata - The local metadata associated with the message. This is kept locally by the runtime
231
+ * and not sent to the server. It will be provided back when this message is acknowledged by the server. It will
232
+ * also be provided back when asked to resubmit the message.
233
+ */
234
+ submit(messageContent: any, localOpMetadata: unknown): void;
235
+ /**
236
+ * Attaches a message handler to the delta connection
237
+ */
238
+ attach(handler: IDeltaHandler): void;
239
+ /**
240
+ * Indicates that the channel is dirty and needs to be part of the summary. It is called by a SharedSummaryBlock
241
+ * that needs to be part of the summary but does not generate ops.
242
+ */
243
+ dirty(): void;
244
+ /**
245
+ * Called when a new outbound reference is added to another node. This is used by garbage collection to identify
246
+ * all references added in the system.
247
+ * @param srcHandle - The handle of the node that added the reference.
248
+ * @param outboundHandle - The handle of the outbound node that is referenced.
249
+ */
250
+ addedGCOutboundReference?(srcHandle: IFluidHandle, outboundHandle: IFluidHandle): void;
251
+ }
252
+
253
+ /**
254
+ * Handler provided by shared data structure to process requests from the runtime.
255
+ */
256
+ export declare interface IDeltaHandler {
257
+ /**
258
+ * Processes the op.
259
+ * @param message - The message to process
260
+ * @param local - Whether the message originated from the local client
261
+ * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
262
+ * For messages from a remote client, this will be undefined.
263
+ */
264
+ process: (message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) => void;
265
+ /**
266
+ * State change events to indicate changes to the delta connection
267
+ * @param connected - true if connected, false otherwise
268
+ */
269
+ setConnectionState(connected: boolean): void;
270
+ /**
271
+ * Called when the runtime asks the client to resubmit an op. This may be because the Container reconnected and
272
+ * this op was not acked.
273
+ * The client can choose to resubmit the same message, submit different / multiple messages or not submit anything
274
+ * at all.
275
+ * @param message - The original message that was submitted.
276
+ * @param localOpMetadata - The local metadata associated with the original message.
277
+ */
278
+ reSubmit(message: any, localOpMetadata: unknown): void;
279
+ /**
280
+ * Apply changes from an op. Used when rehydrating an attached container
281
+ * with pending changes. This prepares the SharedObject for seeing an ACK
282
+ * for the op or resubmitting the op upon reconnection.
283
+ * @param message - Contents of a stashed op.
284
+ * @returns localMetadata of the op, to be passed to process() or resubmit()
285
+ * when the op is ACKed or resubmitted, respectively
286
+ */
287
+ applyStashedOp(message: any): unknown;
288
+ /**
289
+ * Revert a local op.
290
+ * @param message - The original message that was submitted.
291
+ * @param localOpMetadata - The local metadata associated with the original message.
292
+ */
293
+ rollback?(message: any, localOpMetadata: unknown): void;
294
+ }
295
+
296
+ /**
297
+ * Represents the runtime for the data store. Contains helper functions/state of the data store.
298
+ */
299
+ export declare interface IFluidDataStoreRuntime extends IEventProvider<IFluidDataStoreRuntimeEvents>, IDisposable, Partial<IProvideFluidDataStoreRegistry> {
300
+ readonly id: string;
301
+ readonly IFluidHandleContext: IFluidHandleContext;
302
+ readonly rootRoutingContext: IFluidHandleContext;
303
+ readonly channelsRoutingContext: IFluidHandleContext;
304
+ readonly objectsRoutingContext: IFluidHandleContext;
305
+ readonly options: ILoaderOptions;
306
+ readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
307
+ readonly clientId: string | undefined;
308
+ readonly connected: boolean;
309
+ readonly logger: ITelemetryLogger;
310
+ /**
311
+ * Indicates the attachment state of the data store to a host service.
312
+ */
313
+ readonly attachState: AttachState;
314
+ readonly idCompressor?: IIdCompressor;
315
+ /**
316
+ * Returns the channel with the given id
317
+ */
318
+ getChannel(id: string): Promise<IChannel>;
319
+ /**
320
+ * Invokes the given callback and expects that no ops are submitted
321
+ * until execution finishes. If an op is submitted, an error will be raised.
322
+ *
323
+ * Can be disabled by feature gate `Fluid.ContainerRuntime.DisableOpReentryCheck`
324
+ *
325
+ * @param callback - the callback to be invoked
326
+ */
327
+ ensureNoDataModelChanges<T>(callback: () => T): T;
328
+ /**
329
+ * Creates a new channel of the given type.
330
+ * @param id - ID of the channel to be created. A unique ID will be generated if left undefined.
331
+ * @param type - Type of the channel.
332
+ */
333
+ createChannel(id: string | undefined, type: string): IChannel;
334
+ /**
335
+ * Bind the channel with the data store runtime. If the runtime
336
+ * is attached then we attach the channel to make it live.
337
+ */
338
+ bindChannel(channel: IChannel): void;
339
+ /**
340
+ * Api to upload a blob of data.
341
+ * @param blob - blob to be uploaded.
342
+ */
343
+ uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;
344
+ /**
345
+ * Submits the signal to be sent to other clients.
346
+ * @param type - Type of the signal.
347
+ * @param content - Content of the signal.
348
+ */
349
+ submitSignal(type: string, content: any): void;
350
+ /**
351
+ * Returns the current quorum.
352
+ */
353
+ getQuorum(): IQuorumClients;
354
+ /**
355
+ * Returns the current audience.
356
+ */
357
+ getAudience(): IAudience;
358
+ /**
359
+ * Resolves when a local data store is attached.
360
+ */
361
+ waitAttached(): Promise<void>;
362
+ /**
363
+ * Exposes a handle to the root object / entryPoint of the data store. Use this as the primary way of interacting
364
+ * with it.
365
+ */
366
+ readonly entryPoint: IFluidHandle<FluidObject>;
367
+ /**
368
+ * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
369
+ */
370
+ request(request: IRequest): Promise<IResponse>;
371
+ /**
372
+ * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
373
+ */
374
+ readonly IFluidRouter: IFluidRouter;
375
+ }
376
+
377
+ export declare interface IFluidDataStoreRuntimeEvents extends IEvent {
378
+ (event: "disconnected" | "dispose" | "attaching" | "attached", listener: () => void): any;
379
+ (event: "op", listener: (message: ISequencedDocumentMessage) => void): any;
380
+ (event: "signal", listener: (message: IInboundSignalMessage, local: boolean) => void): any;
381
+ (event: "connected", listener: (clientId: string) => void): any;
382
+ }
383
+
384
+ /**
385
+ * Used to constrain a type `T` to types that are serializable as JSON.
386
+ * Produces a compile-time error if `T` contains non-Jsonable members.
387
+ *
388
+ * @remarks
389
+ * Note that this does NOT prevent using of values with non-json compatible data,
390
+ * it only prevents using values with types that include non-json compatible data.
391
+ * This means that one can, for example, pass an a value typed with json compatible
392
+ * interface into this function,
393
+ * that could actually be a class with lots on non-json compatible fields and methods.
394
+ *
395
+ * Important: `T extends Jsonable<T>` is incorrect (does not even compile).
396
+ * `T extends Jsonable` is also incorrect since `Jsonable` is just `any` and thus applies no constraint at all.
397
+ *
398
+ * The optional 'TReplaced' parameter may be used to permit additional leaf types to support
399
+ * situations where a `replacer` is used to handle special values (e.g., `Jsonable<{ x: IFluidHandle }, IFluidHandle>`).
400
+ *
401
+ * Note that `Jsonable<T>` does not protect against the following pitfalls when serializing with JSON.stringify():
402
+ *
403
+ * - `undefined` properties on objects are omitted (i.e., properties become undefined instead of equal to undefined).
404
+ *
405
+ * - When `undefined` appears as the root object or as an array element it is coerced to `null`.
406
+ *
407
+ * - Non-finite numbers (`NaN`, `+/-Infinity`) are also coerced to `null`.
408
+ *
409
+ * - prototypes and non-enumerable properties are lost.
410
+ *
411
+ * Also, `Jsonable<T>` does not prevent the construction of circular references.
412
+ *
413
+ * Using `Jsonable` (with no type parameters) or `Jsonable<any>` is just a type alias for `any`
414
+ * and should not be used if type safety is desired.
415
+ *
416
+ * @example Typical usage
417
+ *
418
+ * ```typescript
419
+ * function foo<T>(value: Jsonable<T>) { ... }
420
+ * ```
421
+ */
422
+ export declare type Jsonable<T = any, TReplaced = void> = T extends undefined | null | boolean | number | string | TReplaced ? T : Extract<T, Function> extends never ? {
423
+ [K in keyof T]: Extract<K, symbol> extends never ? Jsonable<T[K], TReplaced> : never;
424
+ } : never;
425
+
426
+ /**
427
+ * Used to constrain a type 'T' to types that Fluid can intrinsically serialize. Produces a
428
+ * compile-time error if `T` contains non-serializable members.
429
+ *
430
+ * @remarks
431
+ * See Jsonable for caveats regarding serialization of `undefined`, non-finite numbers,
432
+ * and circular references.
433
+ *
434
+ * Important: `T extends Serializable<T>` is generally incorrect.
435
+ * (Any value of `T` extends the serializable subset of itself.)
436
+ *
437
+ * @example Typical usage
438
+ *
439
+ * ```typescript
440
+ * function serialize<T>(value: Serializable<T>) { ... }
441
+ * ```
442
+ */
443
+ export declare type Serializable<T = any> = Jsonable<T, IFluidHandle>;
444
+
445
+ export { }