@fluidframework/shared-object-base 2.0.0-rc.2.0.1 → 2.0.0-rc.3.0.0

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