@fluidframework/shared-object-base 2.0.0-dev.7.4.0.215930 → 2.0.0-dev.7.4.0.217212
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/api-extractor-lint.json +13 -0
- package/api-extractor.json +0 -4
- package/api-report/shared-object-base.api.md +14 -15
- package/dist/packageVersion.cjs +1 -1
- package/dist/packageVersion.cjs.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/serializer.cjs +4 -0
- package/dist/serializer.cjs.map +1 -1
- package/dist/serializer.d.ts +8 -0
- package/dist/serializer.d.ts.map +1 -1
- package/dist/shared-object-base-alpha.d.ts +40 -457
- package/dist/shared-object-base-beta.d.ts +59 -473
- package/dist/shared-object-base-public.d.ts +59 -473
- package/dist/shared-object-base-untrimmed.d.ts +18 -3
- package/dist/sharedObject.cjs +2 -3
- package/dist/sharedObject.cjs.map +1 -1
- package/dist/sharedObject.d.ts +2 -3
- package/dist/sharedObject.d.ts.map +1 -1
- package/dist/summarySerializer.cjs +1 -0
- package/dist/summarySerializer.cjs.map +1 -1
- package/dist/summarySerializer.d.ts +1 -0
- package/dist/summarySerializer.d.ts.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.cjs +4 -0
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts +4 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/valueType.cjs +1 -0
- package/dist/valueType.cjs.map +1 -1
- package/dist/valueType.d.ts +1 -0
- package/dist/valueType.d.ts.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.mjs +1 -1
- package/lib/packageVersion.mjs.map +1 -1
- package/lib/serializer.d.ts +8 -0
- package/lib/serializer.d.ts.map +1 -1
- package/lib/serializer.mjs +4 -0
- package/lib/serializer.mjs.map +1 -1
- package/lib/shared-object-base-alpha.d.ts +40 -457
- package/lib/shared-object-base-beta.d.ts +59 -473
- package/lib/shared-object-base-public.d.ts +59 -473
- package/lib/shared-object-base-untrimmed.d.ts +18 -3
- package/lib/sharedObject.d.ts +2 -3
- package/lib/sharedObject.d.ts.map +1 -1
- package/lib/sharedObject.mjs +2 -3
- package/lib/sharedObject.mjs.map +1 -1
- package/lib/summarySerializer.d.ts +1 -0
- package/lib/summarySerializer.d.ts.map +1 -1
- package/lib/summarySerializer.mjs +1 -0
- package/lib/summarySerializer.mjs.map +1 -1
- package/lib/types.d.ts +2 -0
- package/lib/types.d.ts.map +1 -1
- package/lib/types.mjs.map +1 -1
- package/lib/utils.d.ts +4 -0
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.mjs +4 -0
- package/lib/utils.mjs.map +1 -1
- package/lib/valueType.d.ts +1 -0
- package/lib/valueType.d.ts.map +1 -1
- package/lib/valueType.mjs +1 -0
- package/lib/valueType.mjs.map +1 -1
- package/package.json +15 -14
- package/src/packageVersion.ts +1 -1
- package/src/serializer.ts +8 -0
- package/src/sharedObject.ts +2 -3
- package/src/summarySerializer.ts +1 -0
- package/src/types.ts +2 -0
- package/src/utils.ts +4 -0
- package/src/valueType.ts +1 -0
|
@@ -1,479 +1,65 @@
|
|
|
1
|
-
import { EventEmitterWithErrorHandling } from '@fluidframework/telemetry-utils';
|
|
2
|
-
import { IChannel } from '@fluidframework/datastore-definitions';
|
|
3
|
-
import { IChannelAttributes } from '@fluidframework/datastore-definitions';
|
|
4
|
-
import { IChannelServices } from '@fluidframework/datastore-definitions';
|
|
5
|
-
import { IChannelStorageService } from '@fluidframework/datastore-definitions';
|
|
6
|
-
import { IErrorEvent } from '@fluidframework/core-interfaces';
|
|
7
|
-
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
8
|
-
import { IEventThisPlaceHolder } from '@fluidframework/core-interfaces';
|
|
9
|
-
import { IExperimentalIncrementalSummaryContext } from '@fluidframework/runtime-definitions';
|
|
10
|
-
import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
|
|
11
|
-
import { IFluidHandle } from '@fluidframework/core-interfaces';
|
|
12
|
-
import { IFluidHandleContext } from '@fluidframework/core-interfaces';
|
|
13
|
-
import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
|
|
14
1
|
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Create a new summary containing one blob
|
|
21
|
-
* @param key - the key for the blob in the summary
|
|
22
|
-
* @param content - blob content
|
|
23
|
-
* @returns The summary containing the blob
|
|
24
|
-
*/
|
|
25
|
-
export declare function createSingleBlobSummary(key: string, content: string | Uint8Array): ISummaryTreeWithStats;
|
|
2
|
+
|
|
3
|
+
/* Excluded from this release type: createSingleBlobSummary */
|
|
26
4
|
|
|
27
5
|
/* Excluded from this release type: EventEmitterEventType */
|
|
28
6
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
*/
|
|
87
|
-
decode(input: any): any;
|
|
88
|
-
/**
|
|
89
|
-
* Stringifies a given value. Converts any IFluidHandle to its stringified equivalent.
|
|
90
|
-
*/
|
|
91
|
-
stringify(value: any, bind: IFluidHandle): string;
|
|
92
|
-
/**
|
|
93
|
-
* Parses the given JSON input string and returns the JavaScript object defined by it. Any Fluid
|
|
94
|
-
* handles will be realized as part of the parse
|
|
95
|
-
*/
|
|
96
|
-
parse(value: string): any;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* JSON serialized form of an IFluidHandle
|
|
101
|
-
*/
|
|
102
|
-
export declare interface ISerializedHandle {
|
|
103
|
-
type: "__fluid_handle__";
|
|
104
|
-
url: string;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Base interface for shared objects from which other interfaces derive. Implemented by SharedObject
|
|
109
|
-
*/
|
|
110
|
-
export declare interface ISharedObject<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends IChannel, IEventProvider<TEvent> {
|
|
111
|
-
/**
|
|
112
|
-
* Binds the given shared object to its containing data store runtime, causing it to attach once
|
|
113
|
-
* the runtime attaches.
|
|
114
|
-
*/
|
|
115
|
-
bindToContext(): void;
|
|
116
|
-
/**
|
|
117
|
-
* Returns the GC data for this shared object. It contains a list of GC nodes that contains references to
|
|
118
|
-
* other GC nodes.
|
|
119
|
-
* @param fullGC - true to bypass optimizations and force full generation of GC data.
|
|
120
|
-
*/
|
|
121
|
-
getGCData(fullGC?: boolean): IGarbageCollectionData;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Events emitted by {@link ISharedObject}.
|
|
126
|
-
*/
|
|
127
|
-
export declare interface ISharedObjectEvents extends IErrorEvent {
|
|
128
|
-
/**
|
|
129
|
-
* Fires before an incoming operation (op) is applied to the shared object.
|
|
130
|
-
*
|
|
131
|
-
* @remarks Note: this should be considered an internal implementation detail. It is not recommended for external
|
|
132
|
-
* use.
|
|
133
|
-
*
|
|
134
|
-
* @eventProperty
|
|
135
|
-
*/
|
|
136
|
-
(event: "pre-op", listener: (op: ISequencedDocumentMessage, local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
137
|
-
/**
|
|
138
|
-
* Fires after an incoming op is applied to the shared object.
|
|
139
|
-
*
|
|
140
|
-
* @remarks Note: this should be considered an internal implementation detail. It is not recommended for external
|
|
141
|
-
* use.
|
|
142
|
-
*
|
|
143
|
-
* @eventProperty
|
|
144
|
-
*/
|
|
145
|
-
(event: "op", listener: (op: ISequencedDocumentMessage, local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export declare const isSerializedHandle: (value: any) => value is ISerializedHandle;
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object
|
|
152
|
-
* where any embedded IFluidHandles have been replaced with a serializable form.
|
|
153
|
-
*
|
|
154
|
-
* The original `input` object is not mutated. This method will shallowly clones all objects in the path from
|
|
155
|
-
* the root to any replaced handles. (If no handles are found, returns the original object.)
|
|
156
|
-
*
|
|
157
|
-
* @param input - The mostly-plain object
|
|
158
|
-
* @param context - The handle context for the container
|
|
159
|
-
* @param bind - Bind any other handles we find in the object against this given handle.
|
|
160
|
-
* @returns The fully-plain object
|
|
161
|
-
*/
|
|
162
|
-
export declare function makeHandlesSerializable(value: any, serializer: IFluidSerializer, bind: IFluidHandle): any;
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Given a fully-plain object that may have serializable-form handles within, will return the mostly-plain object
|
|
166
|
-
* with handle objects created instead.
|
|
167
|
-
* @param value - The fully-plain object
|
|
168
|
-
* @param serializer - The serializer that knows how to convert serializable-form handles into handle objects
|
|
169
|
-
* @param context - The handle context for the container
|
|
170
|
-
* @returns The mostly-plain object with handle objects within
|
|
171
|
-
*/
|
|
172
|
-
export declare function parseHandles(value: any, serializer: IFluidSerializer): any;
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Given a mostly-plain object that may have handle objects embedded within, return a string representation of an object
|
|
176
|
-
* where the handle objects have been replaced with a serializable form.
|
|
177
|
-
* @param value - The mostly-plain object
|
|
178
|
-
* @param serializer - The serializer that knows how to convert handles into serializable format
|
|
179
|
-
* @param context - The handle context for the container
|
|
180
|
-
* @param bind - Bind any other handles we find in the object against this given handle.
|
|
181
|
-
* @returns Result of strigifying an object
|
|
182
|
-
*/
|
|
183
|
-
export declare function serializeHandles(value: any, serializer: IFluidSerializer, bind: IFluidHandle): string | undefined;
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* SharedObject with simplified, synchronous summarization and GC.
|
|
187
|
-
* DDS implementations with async and incremental summarization should extend SharedObjectCore directly instead.
|
|
188
|
-
*/
|
|
189
|
-
export declare abstract class SharedObject<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends SharedObjectCore<TEvent> {
|
|
190
|
-
private readonly telemetryContextPrefix;
|
|
191
|
-
/**
|
|
192
|
-
* True while we are garbage collecting this object's data.
|
|
193
|
-
*/
|
|
194
|
-
private _isGCing;
|
|
195
|
-
/**
|
|
196
|
-
* The serializer to use to serialize / parse handles, if any.
|
|
197
|
-
*/
|
|
198
|
-
private readonly _serializer;
|
|
199
|
-
protected get serializer(): IFluidSerializer;
|
|
200
|
-
/**
|
|
201
|
-
* @param id - The id of the shared object
|
|
202
|
-
* @param runtime - The IFluidDataStoreRuntime which contains the shared object
|
|
203
|
-
* @param attributes - Attributes of the shared object
|
|
204
|
-
*/
|
|
205
|
-
constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes, telemetryContextPrefix: string);
|
|
206
|
-
/**
|
|
207
|
-
* {@inheritDoc @fluidframework/datastore-definitions#(IChannel:interface).getAttachSummary}
|
|
208
|
-
*/
|
|
209
|
-
getAttachSummary(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
210
|
-
/**
|
|
211
|
-
* {@inheritDoc @fluidframework/datastore-definitions#(IChannel:interface).summarize}
|
|
212
|
-
*/
|
|
213
|
-
summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext): Promise<ISummaryTreeWithStats>;
|
|
214
|
-
/**
|
|
215
|
-
* {@inheritDoc (ISharedObject:interface).getGCData}
|
|
216
|
-
*/
|
|
217
|
-
getGCData(fullGC?: boolean): IGarbageCollectionData;
|
|
218
|
-
/**
|
|
219
|
-
* Calls the serializer over all data in this object that reference other GC nodes.
|
|
220
|
-
* Derived classes must override this to provide custom list of references to other GC nodes.
|
|
221
|
-
*/
|
|
222
|
-
protected processGCDataCore(serializer: SummarySerializer): void;
|
|
223
|
-
/**
|
|
224
|
-
* Gets a form of the object that can be serialized.
|
|
225
|
-
* @returns A tree representing the snapshot of the shared object.
|
|
226
|
-
*/
|
|
227
|
-
protected abstract summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext): ISummaryTreeWithStats;
|
|
228
|
-
private incrementTelemetryMetric;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Base class from which all shared objects derive.
|
|
233
|
-
*/
|
|
234
|
-
export declare abstract class SharedObjectCore<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends EventEmitterWithErrorHandling<TEvent> implements ISharedObject<TEvent> {
|
|
235
|
-
id: string;
|
|
236
|
-
protected runtime: IFluidDataStoreRuntime;
|
|
237
|
-
readonly attributes: IChannelAttributes;
|
|
238
|
-
get IFluidLoadable(): this;
|
|
239
|
-
private readonly opProcessingHelper;
|
|
240
|
-
private readonly callbacksHelper;
|
|
241
|
-
/**
|
|
242
|
-
* The handle referring to this SharedObject
|
|
243
|
-
*/
|
|
244
|
-
readonly handle: IFluidHandle;
|
|
245
|
-
/**
|
|
246
|
-
* Telemetry logger for the shared object
|
|
247
|
-
*/
|
|
248
|
-
protected readonly logger: ITelemetryLoggerExt;
|
|
249
|
-
private readonly mc;
|
|
250
|
-
/**
|
|
251
|
-
* Connection state
|
|
252
|
-
*/
|
|
253
|
-
private _connected;
|
|
254
|
-
/**
|
|
255
|
-
* Services used by the shared object
|
|
256
|
-
*/
|
|
257
|
-
private services;
|
|
258
|
-
/**
|
|
259
|
-
* True if the dds is bound to its parent.
|
|
260
|
-
*/
|
|
261
|
-
private _isBoundToContext;
|
|
262
|
-
/**
|
|
263
|
-
* Tracks error that closed this object.
|
|
264
|
-
*/
|
|
265
|
-
private closeError?;
|
|
266
|
-
/**
|
|
267
|
-
* Gets the connection state
|
|
268
|
-
* @returns The state of the connection
|
|
269
|
-
*/
|
|
270
|
-
get connected(): boolean;
|
|
271
|
-
/**
|
|
272
|
-
* @param id - The id of the shared object
|
|
273
|
-
* @param runtime - The IFluidDataStoreRuntime which contains the shared object
|
|
274
|
-
* @param attributes - Attributes of the shared object
|
|
275
|
-
*/
|
|
276
|
-
constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
|
|
277
|
-
/**
|
|
278
|
-
* This function is only supposed to be called from SharedObjectCore's constructor and
|
|
279
|
-
* depends on a few things being set already. assert() calls make sure of it.
|
|
280
|
-
* @returns The telemetry sampling helpers, so the constructor can be the one to assign them
|
|
281
|
-
* to variables to avoid complaints from TypeScript.
|
|
282
|
-
*/
|
|
283
|
-
private setUpSampledTelemetryHelpers;
|
|
284
|
-
/**
|
|
285
|
-
* Marks this objects as closed. Any attempt to change it (local changes or processing remote ops)
|
|
286
|
-
* would result in same error thrown. If called multiple times, only first error is remembered.
|
|
287
|
-
* @param error - error object that is thrown whenever an attempt is made to modify this object
|
|
288
|
-
*/
|
|
289
|
-
private closeWithError;
|
|
290
|
-
/**
|
|
291
|
-
* Verifies that this object is not closed via closeWithError(). If it is, throws an error used to close it.
|
|
292
|
-
*/
|
|
293
|
-
private verifyNotClosed;
|
|
294
|
-
/**
|
|
295
|
-
* Event listener handler helper that can be used to react to exceptions thrown from event listeners
|
|
296
|
-
* It wraps error with DataProcessingError, closes this object and throws resulting error.
|
|
297
|
-
* See closeWithError() for more details
|
|
298
|
-
* Ideally such situation never happens, as consumers of DDS should never throw exceptions
|
|
299
|
-
* in event listeners (i.e. catch any of the issues and make determination on how to handle it).
|
|
300
|
-
* When such exceptions propagate through, most likely data model is no longer consistent, i.e.
|
|
301
|
-
* DDS state does not match what user sees. Because of it DDS moves to "corrupted state" and does not
|
|
302
|
-
* allow processing of ops or local changes, which very quickly results in container closure.
|
|
303
|
-
*/
|
|
304
|
-
private eventListenerErrorHandler;
|
|
305
|
-
private attachListeners;
|
|
306
|
-
/**
|
|
307
|
-
* A shared object, after construction, can either be loaded in the case that it is already part of
|
|
308
|
-
* a shared document. Or later attached if it is being newly added.
|
|
309
|
-
* @param services - Services used by the shared object
|
|
310
|
-
*/
|
|
311
|
-
load(services: IChannelServices): Promise<void>;
|
|
312
|
-
/**
|
|
313
|
-
* Initializes the object as a local, non-shared object. This object can become shared after
|
|
314
|
-
* it is attached to the document.
|
|
315
|
-
*/
|
|
316
|
-
initializeLocal(): void;
|
|
317
|
-
/**
|
|
318
|
-
* {@inheritDoc (ISharedObject:interface).bindToContext}
|
|
319
|
-
*/
|
|
320
|
-
bindToContext(): void;
|
|
321
|
-
/**
|
|
322
|
-
* {@inheritDoc @fluidframework/datastore-definitions#(IChannel:interface).connect}
|
|
323
|
-
*/
|
|
324
|
-
connect(services: IChannelServices): void;
|
|
325
|
-
/**
|
|
326
|
-
* {@inheritDoc @fluidframework/datastore-definitions#(IChannel:interface).isAttached}
|
|
327
|
-
*/
|
|
328
|
-
isAttached(): boolean;
|
|
329
|
-
/**
|
|
330
|
-
* {@inheritDoc @fluidframework/datastore-definitions#(IChannel:interface).getAttachSummary}
|
|
331
|
-
*/
|
|
332
|
-
abstract getAttachSummary(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
333
|
-
/**
|
|
334
|
-
* {@inheritDoc @fluidframework/datastore-definitions#(IChannel:interface).summarize}
|
|
335
|
-
*/
|
|
336
|
-
abstract summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): Promise<ISummaryTreeWithStats>;
|
|
337
|
-
/**
|
|
338
|
-
* {@inheritDoc (ISharedObject:interface).getGCData}
|
|
339
|
-
*/
|
|
340
|
-
abstract getGCData(fullGC?: boolean): IGarbageCollectionData;
|
|
341
|
-
/**
|
|
342
|
-
* Called when a handle is decoded by this object. A handle in the object's data represents an outbound reference
|
|
343
|
-
* to another object in the container.
|
|
344
|
-
* @param decodedHandle - The handle of the Fluid object that is decoded.
|
|
345
|
-
*/
|
|
346
|
-
protected handleDecoded(decodedHandle: IFluidHandle): void;
|
|
347
|
-
/**
|
|
348
|
-
* Allows the distributed data type to perform custom loading
|
|
349
|
-
* @param services - Storage used by the shared object
|
|
350
|
-
*/
|
|
351
|
-
protected abstract loadCore(services: IChannelStorageService): Promise<void>;
|
|
352
|
-
/**
|
|
353
|
-
* Allows the distributed data type to perform custom local loading.
|
|
354
|
-
*/
|
|
355
|
-
protected initializeLocalCore(): void;
|
|
356
|
-
/**
|
|
357
|
-
* Allows the distributive data type the ability to perform custom processing once an attach has happened.
|
|
358
|
-
* Also called after non-local data type get loaded.
|
|
359
|
-
*/
|
|
360
|
-
protected didAttach(): void;
|
|
361
|
-
/**
|
|
362
|
-
* Derived classes must override this to do custom processing on a remote message.
|
|
363
|
-
* @param message - The message to process
|
|
364
|
-
* @param local - True if the shared object is local
|
|
365
|
-
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
366
|
-
* For messages from a remote client, this will be undefined.
|
|
367
|
-
*/
|
|
368
|
-
protected abstract processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): any;
|
|
369
|
-
/**
|
|
370
|
-
* Called when the object has disconnected from the delta stream.
|
|
371
|
-
*/
|
|
372
|
-
protected abstract onDisconnect(): any;
|
|
373
|
-
/**
|
|
374
|
-
* Submits a message by the local client to the runtime.
|
|
375
|
-
* @param content - Content of the message
|
|
376
|
-
* @param localOpMetadata - The local metadata associated with the message. This is kept locally by the runtime
|
|
377
|
-
* and not sent to the server. This will be sent back when this message is received back from the server. This is
|
|
378
|
-
* also sent if we are asked to resubmit the message.
|
|
379
|
-
*/
|
|
380
|
-
protected submitLocalMessage(content: any, localOpMetadata?: unknown): void;
|
|
381
|
-
/**
|
|
382
|
-
* Marks this object as dirty so that it is part of the next summary. It is called by a SharedSummaryBlock
|
|
383
|
-
* that want to be part of summary but does not generate ops.
|
|
384
|
-
*/
|
|
385
|
-
protected dirty(): void;
|
|
386
|
-
/**
|
|
387
|
-
* Called when the object has fully connected to the delta stream
|
|
388
|
-
* Default implementation for DDS, override if different behavior is required.
|
|
389
|
-
*/
|
|
390
|
-
protected onConnect(): void;
|
|
391
|
-
/**
|
|
392
|
-
* Called when a message has to be resubmitted. This typically happens after a reconnection for unacked messages.
|
|
393
|
-
* The default implementation here is to resubmit the same message. The client can override if different behavior
|
|
394
|
-
* is required. It can choose to resubmit the same message, submit different / multiple messages or not submit
|
|
395
|
-
* anything at all.
|
|
396
|
-
* @param content - The content of the original message.
|
|
397
|
-
* @param localOpMetadata - The local metadata associated with the original message.
|
|
398
|
-
*/
|
|
399
|
-
protected reSubmitCore(content: any, localOpMetadata: unknown): void;
|
|
400
|
-
/**
|
|
401
|
-
* Promises that are waiting for an ack from the server before resolving should use this instead of new Promise.
|
|
402
|
-
* It ensures that if something changes that will interrupt that ack (e.g. the FluidDataStoreRuntime disposes),
|
|
403
|
-
* the Promise will reject.
|
|
404
|
-
* If runtime is disposed when this call is made, executor is not run and promise is rejected right away.
|
|
405
|
-
*/
|
|
406
|
-
protected newAckBasedPromise<T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
|
|
407
|
-
private attachDeltaHandler;
|
|
408
|
-
/**
|
|
409
|
-
* Set the state of connection to services.
|
|
410
|
-
* @param connected - true if connected, false otherwise.
|
|
411
|
-
*/
|
|
412
|
-
private setConnectionState;
|
|
413
|
-
/**
|
|
414
|
-
* Handles a message being received from the remote delta server.
|
|
415
|
-
* @param message - The message to process
|
|
416
|
-
* @param local - Whether the message originated from the local client
|
|
417
|
-
* @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
|
|
418
|
-
* For messages from a remote client, this will be undefined.
|
|
419
|
-
*/
|
|
420
|
-
private process;
|
|
421
|
-
/**
|
|
422
|
-
* Called when a message has to be resubmitted. This typically happens for unacked messages after a
|
|
423
|
-
* reconnection.
|
|
424
|
-
* @param content - The content of the original message.
|
|
425
|
-
* @param localOpMetadata - The local metadata associated with the original message.
|
|
426
|
-
*/
|
|
427
|
-
private reSubmit;
|
|
428
|
-
/**
|
|
429
|
-
* Revert an op
|
|
430
|
-
*/
|
|
431
|
-
protected rollback(content: any, localOpMetadata: unknown): void;
|
|
432
|
-
/**
|
|
433
|
-
* Apply changes from an op. Used when rehydrating an attached container
|
|
434
|
-
* with pending changes. This prepares the SharedObject for seeing an ACK
|
|
435
|
-
* for the op or resubmitting the op upon reconnection.
|
|
436
|
-
* @param content - Contents of a stashed op.
|
|
437
|
-
* @returns localMetadata of the op, to be passed to process() or resubmit()
|
|
438
|
-
* when the op is ACKed or resubmitted, respectively
|
|
439
|
-
*/
|
|
440
|
-
protected abstract applyStashedOp(content: any): unknown;
|
|
441
|
-
/* Excluded from this release type: emit */
|
|
442
|
-
/**
|
|
443
|
-
* Use to emit events inside {@link SharedObjectCore}, with no telemetry measurement
|
|
444
|
-
* done on the duration of the callbacks. Simply calls `super.emit()`.
|
|
445
|
-
* @param event - Event to emit
|
|
446
|
-
* @param args - Arguments for the event
|
|
447
|
-
* @returns Whatever `super.emit()` returns.
|
|
448
|
-
*/
|
|
449
|
-
private emitInternal;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
/**
|
|
453
|
-
* Serializer implementation for serializing handles during summary.
|
|
454
|
-
*/
|
|
455
|
-
export declare class SummarySerializer extends FluidSerializer {
|
|
456
|
-
private readonly serializedRoutes;
|
|
457
|
-
getSerializedRoutes(): string[];
|
|
458
|
-
protected serializeHandle(handle: IFluidHandle, bind: IFluidHandle): {
|
|
459
|
-
type: string;
|
|
460
|
-
url: string;
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
/**
|
|
465
|
-
* enum representing the possible types of a shared object
|
|
466
|
-
*/
|
|
467
|
-
export declare enum ValueType {
|
|
468
|
-
/**
|
|
469
|
-
* The value is a shared object
|
|
470
|
-
* @deprecated Instead store the handle of the shared object, rather than the shared object itself.
|
|
471
|
-
*/
|
|
472
|
-
Shared = 0,
|
|
473
|
-
/**
|
|
474
|
-
* The value is a plain JavaScript object or handle. If a plain object, it may contain handles deeper within.
|
|
475
|
-
*/
|
|
476
|
-
Plain = 1
|
|
477
|
-
}
|
|
7
|
+
/* Excluded from this release type: EventEmitterWithErrorHandling */
|
|
8
|
+
|
|
9
|
+
/* Excluded from this release type: FluidSerializer */
|
|
10
|
+
|
|
11
|
+
/* Excluded from this release type: IChannel */
|
|
12
|
+
|
|
13
|
+
/* Excluded from this release type: IChannelAttributes */
|
|
14
|
+
|
|
15
|
+
/* Excluded from this release type: IChannelServices */
|
|
16
|
+
|
|
17
|
+
/* Excluded from this release type: IChannelStorageService */
|
|
18
|
+
|
|
19
|
+
/* Excluded from this release type: IErrorEvent */
|
|
20
|
+
|
|
21
|
+
/* Excluded from this release type: IEventProvider */
|
|
22
|
+
|
|
23
|
+
/* Excluded from this release type: IEventThisPlaceHolder */
|
|
24
|
+
|
|
25
|
+
/* Excluded from this release type: IExperimentalIncrementalSummaryContext */
|
|
26
|
+
|
|
27
|
+
/* Excluded from this release type: IFluidDataStoreRuntime */
|
|
28
|
+
|
|
29
|
+
/* Excluded from this release type: IFluidHandle */
|
|
30
|
+
|
|
31
|
+
/* Excluded from this release type: IFluidHandleContext */
|
|
32
|
+
|
|
33
|
+
/* Excluded from this release type: IFluidSerializer */
|
|
34
|
+
|
|
35
|
+
/* Excluded from this release type: IGarbageCollectionData */
|
|
36
|
+
|
|
37
|
+
/* Excluded from this release type: ISerializedHandle */
|
|
38
|
+
|
|
39
|
+
/* Excluded from this release type: ISharedObject */
|
|
40
|
+
|
|
41
|
+
/* Excluded from this release type: ISharedObjectEvents */
|
|
42
|
+
|
|
43
|
+
/* Excluded from this release type: isSerializedHandle */
|
|
44
|
+
|
|
45
|
+
/* Excluded from this release type: ISummaryTreeWithStats */
|
|
46
|
+
|
|
47
|
+
/* Excluded from this release type: ITelemetryContext */
|
|
48
|
+
|
|
49
|
+
/* Excluded from this release type: ITelemetryLoggerExt */
|
|
50
|
+
|
|
51
|
+
/* Excluded from this release type: makeHandlesSerializable */
|
|
52
|
+
|
|
53
|
+
/* Excluded from this release type: parseHandles */
|
|
54
|
+
|
|
55
|
+
/* Excluded from this release type: serializeHandles */
|
|
56
|
+
|
|
57
|
+
/* Excluded from this release type: SharedObject */
|
|
58
|
+
|
|
59
|
+
/* Excluded from this release type: SharedObjectCore */
|
|
60
|
+
|
|
61
|
+
/* Excluded from this release type: SummarySerializer */
|
|
62
|
+
|
|
63
|
+
/* Excluded from this release type: ValueType */
|
|
478
64
|
|
|
479
65
|
export { }
|
|
@@ -22,11 +22,13 @@ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
|
22
22
|
* @param key - the key for the blob in the summary
|
|
23
23
|
* @param content - blob content
|
|
24
24
|
* @returns The summary containing the blob
|
|
25
|
+
* @internal
|
|
25
26
|
*/
|
|
26
27
|
export declare function createSingleBlobSummary(key: string, content: string | Uint8Array): ISummaryTreeWithStats;
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Data Store serializer implementation
|
|
31
|
+
* @internal
|
|
30
32
|
*/
|
|
31
33
|
export declare class FluidSerializer implements IFluidSerializer {
|
|
32
34
|
private readonly context;
|
|
@@ -65,6 +67,9 @@ export declare class FluidSerializer implements IFluidSerializer {
|
|
|
65
67
|
};
|
|
66
68
|
}
|
|
67
69
|
|
|
70
|
+
/**
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
68
73
|
export declare interface IFluidSerializer {
|
|
69
74
|
/**
|
|
70
75
|
* Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object
|
|
@@ -97,6 +102,7 @@ export declare interface IFluidSerializer {
|
|
|
97
102
|
|
|
98
103
|
/**
|
|
99
104
|
* JSON serialized form of an IFluidHandle
|
|
105
|
+
* @internal
|
|
100
106
|
*/
|
|
101
107
|
export declare interface ISerializedHandle {
|
|
102
108
|
type: "__fluid_handle__";
|
|
@@ -105,6 +111,7 @@ export declare interface ISerializedHandle {
|
|
|
105
111
|
|
|
106
112
|
/**
|
|
107
113
|
* Base interface for shared objects from which other interfaces derive. Implemented by SharedObject
|
|
114
|
+
* @internal
|
|
108
115
|
*/
|
|
109
116
|
export declare interface ISharedObject<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends IChannel, IEventProvider<TEvent> {
|
|
110
117
|
/**
|
|
@@ -122,6 +129,7 @@ export declare interface ISharedObject<TEvent extends ISharedObjectEvents = ISha
|
|
|
122
129
|
|
|
123
130
|
/**
|
|
124
131
|
* Events emitted by {@link ISharedObject}.
|
|
132
|
+
* @internal
|
|
125
133
|
*/
|
|
126
134
|
export declare interface ISharedObjectEvents extends IErrorEvent {
|
|
127
135
|
/**
|
|
@@ -144,6 +152,9 @@ export declare interface ISharedObjectEvents extends IErrorEvent {
|
|
|
144
152
|
(event: "op", listener: (op: ISequencedDocumentMessage, local: boolean, target: IEventThisPlaceHolder) => void): any;
|
|
145
153
|
}
|
|
146
154
|
|
|
155
|
+
/**
|
|
156
|
+
* @internal
|
|
157
|
+
*/
|
|
147
158
|
export declare const isSerializedHandle: (value: any) => value is ISerializedHandle;
|
|
148
159
|
|
|
149
160
|
/**
|
|
@@ -157,6 +168,7 @@ export declare const isSerializedHandle: (value: any) => value is ISerializedHan
|
|
|
157
168
|
* @param context - The handle context for the container
|
|
158
169
|
* @param bind - Bind any other handles we find in the object against this given handle.
|
|
159
170
|
* @returns The fully-plain object
|
|
171
|
+
* @internal
|
|
160
172
|
*/
|
|
161
173
|
export declare function makeHandlesSerializable(value: any, serializer: IFluidSerializer, bind: IFluidHandle): any;
|
|
162
174
|
|
|
@@ -167,6 +179,7 @@ export declare function makeHandlesSerializable(value: any, serializer: IFluidSe
|
|
|
167
179
|
* @param serializer - The serializer that knows how to convert serializable-form handles into handle objects
|
|
168
180
|
* @param context - The handle context for the container
|
|
169
181
|
* @returns The mostly-plain object with handle objects within
|
|
182
|
+
* @internal
|
|
170
183
|
*/
|
|
171
184
|
export declare function parseHandles(value: any, serializer: IFluidSerializer): any;
|
|
172
185
|
|
|
@@ -178,12 +191,14 @@ export declare function parseHandles(value: any, serializer: IFluidSerializer):
|
|
|
178
191
|
* @param context - The handle context for the container
|
|
179
192
|
* @param bind - Bind any other handles we find in the object against this given handle.
|
|
180
193
|
* @returns Result of strigifying an object
|
|
194
|
+
* @internal
|
|
181
195
|
*/
|
|
182
196
|
export declare function serializeHandles(value: any, serializer: IFluidSerializer, bind: IFluidHandle): string | undefined;
|
|
183
197
|
|
|
184
198
|
/**
|
|
185
199
|
* SharedObject with simplified, synchronous summarization and GC.
|
|
186
200
|
* DDS implementations with async and incremental summarization should extend SharedObjectCore directly instead.
|
|
201
|
+
* @internal
|
|
187
202
|
*/
|
|
188
203
|
export declare abstract class SharedObject<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends SharedObjectCore<TEvent> {
|
|
189
204
|
private readonly telemetryContextPrefix;
|
|
@@ -229,6 +244,7 @@ export declare abstract class SharedObject<TEvent extends ISharedObjectEvents =
|
|
|
229
244
|
|
|
230
245
|
/**
|
|
231
246
|
* Base class from which all shared objects derive.
|
|
247
|
+
* @internal
|
|
232
248
|
*/
|
|
233
249
|
export declare abstract class SharedObjectCore<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends EventEmitterWithErrorHandling<TEvent> implements ISharedObject<TEvent> {
|
|
234
250
|
id: string;
|
|
@@ -443,9 +459,6 @@ export declare abstract class SharedObjectCore<TEvent extends ISharedObjectEvent
|
|
|
443
459
|
* attached to them by the consumers of the DDS). It should not be called from outside the class or to emit events
|
|
444
460
|
* which are only internal to the DDS. Support for calling it from outside the DDS instance might be removed in the
|
|
445
461
|
* future.
|
|
446
|
-
*
|
|
447
|
-
* @internal
|
|
448
|
-
*
|
|
449
462
|
* @param event - The event to emit.
|
|
450
463
|
* @param args - Arguments to pass to the event listeners.
|
|
451
464
|
* @returns `true` if the event had listeners, `false` otherwise.
|
|
@@ -463,6 +476,7 @@ export declare abstract class SharedObjectCore<TEvent extends ISharedObjectEvent
|
|
|
463
476
|
|
|
464
477
|
/**
|
|
465
478
|
* Serializer implementation for serializing handles during summary.
|
|
479
|
+
* @internal
|
|
466
480
|
*/
|
|
467
481
|
export declare class SummarySerializer extends FluidSerializer {
|
|
468
482
|
private readonly serializedRoutes;
|
|
@@ -475,6 +489,7 @@ export declare class SummarySerializer extends FluidSerializer {
|
|
|
475
489
|
|
|
476
490
|
/**
|
|
477
491
|
* enum representing the possible types of a shared object
|
|
492
|
+
* @internal
|
|
478
493
|
*/
|
|
479
494
|
export declare enum ValueType {
|
|
480
495
|
/**
|