@fluidframework/shared-object-base 2.0.0-dev-rc.3.0.0.254513 → 2.0.0-dev-rc.3.0.0.254866

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,167 +0,0 @@
1
- import { EventEmitterEventType } from '@fluid-internal/client-utils';
2
- import { EventEmitterWithErrorHandling } from '@fluidframework/telemetry-utils/internal';
3
- import { IChannel } from '@fluidframework/datastore-definitions';
4
- import { IChannelAttributes } from '@fluidframework/datastore-definitions';
5
- import { IChannelFactory } from '@fluidframework/datastore-definitions';
6
- import { IChannelServices } from '@fluidframework/datastore-definitions';
7
- import { IChannelStorageService } from '@fluidframework/datastore-definitions';
8
- import { IErrorEvent } from '@fluidframework/core-interfaces';
9
- import { IEventProvider } from '@fluidframework/core-interfaces';
10
- import { IEventThisPlaceHolder } from '@fluidframework/core-interfaces';
11
- import { IExperimentalIncrementalSummaryContext } from '@fluidframework/runtime-definitions';
12
- import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
13
- import { IFluidHandle } from '@fluidframework/core-interfaces';
14
- import { IFluidHandleContext } from '@fluidframework/core-interfaces';
15
- import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
16
- import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
17
- import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
18
- import { ITelemetryContext } from '@fluidframework/runtime-definitions';
19
- import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
20
-
21
- /* Excluded from this release type: bindHandles */
22
-
23
- /* Excluded from this release type: createSingleBlobSummary */
24
-
25
- /* Excluded from this release type: EventEmitterWithErrorHandling */
26
-
27
- /* Excluded from this release type: FluidSerializer */
28
-
29
- /**
30
- * @public
31
- */
32
- export declare interface IFluidSerializer {
33
- /**
34
- * Given a mostly-plain object that may have handle objects embedded within, will return a fully-plain object
35
- * where any embedded IFluidHandles have been replaced with a serializable form.
36
- *
37
- * The original `input` object is not mutated. This method will shallowly clones all objects in the path from
38
- * the root to any replaced handles. (If no handles are found, returns the original object.)
39
- */
40
- encode(value: any, bind: IFluidHandle): any;
41
- /**
42
- * Given a fully-jsonable object tree that may have encoded handle objects embedded within, will return an
43
- * equivalent object tree where any encoded IFluidHandles have been replaced with their decoded form.
44
- *
45
- * The original `input` object is not mutated. This method will shallowly clone all objects in the path from
46
- * the root to any replaced handles. (If no handles are found, returns the original object.)
47
- *
48
- * The decoded handles are implicitly bound to the handle context of this serializer.
49
- */
50
- decode(input: any): any;
51
- /**
52
- * Stringifies a given value. Converts any IFluidHandle to its stringified equivalent.
53
- */
54
- stringify(value: any, bind: IFluidHandle): string;
55
- /**
56
- * Parses the given JSON input string and returns the JavaScript object defined by it. Any Fluid
57
- * handles will be realized as part of the parse
58
- */
59
- parse(value: string): any;
60
- }
61
-
62
- /**
63
- * Base interface for shared objects from which other interfaces derive. Implemented by SharedObject
64
- * @public
65
- */
66
- export declare interface ISharedObject<TEvent extends ISharedObjectEvents = ISharedObjectEvents> extends IChannel, IEventProvider<TEvent> {
67
- /**
68
- * Binds the given shared object to its containing data store runtime, causing it to attach once
69
- * the runtime attaches.
70
- */
71
- bindToContext(): void;
72
- /**
73
- * Returns the GC data for this shared object. It contains a list of GC nodes that contains references to
74
- * other GC nodes.
75
- * @param fullGC - true to bypass optimizations and force full generation of GC data.
76
- */
77
- getGCData(fullGC?: boolean): IGarbageCollectionData;
78
- }
79
-
80
- /**
81
- * Events emitted by {@link ISharedObject}.
82
- * @public
83
- */
84
- export declare interface ISharedObjectEvents extends IErrorEvent {
85
- /**
86
- * Fires before an incoming operation (op) is applied to the shared object.
87
- *
88
- * @remarks Note: this should be considered an internal implementation detail. It is not recommended for external
89
- * use.
90
- *
91
- * @eventProperty
92
- */
93
- (event: "pre-op", listener: (op: ISequencedDocumentMessage, local: boolean, target: IEventThisPlaceHolder) => void): any;
94
- /**
95
- * Fires after an incoming op is applied to the shared object.
96
- *
97
- * @remarks Note: this should be considered an internal implementation detail. It is not recommended for external
98
- * use.
99
- *
100
- * @eventProperty
101
- */
102
- (event: "op", listener: (op: ISequencedDocumentMessage, local: boolean, target: IEventThisPlaceHolder) => void): any;
103
- }
104
-
105
- /**
106
- * Defines a kind of shared object.
107
- * Used in containers to register a shared object implementation, and to create new instances of a given type of shared object.
108
- * @public
109
- */
110
- export declare interface ISharedObjectKind<TSharedObject> {
111
- /**
112
- * Get a factory which can be used by the Fluid Framework to programmatically instantiate shared objects within containers.
113
- * @remarks
114
- * The produced factory is intended for use with the FluidDataStoreRegistry and is used by the Fluid Framework to instantiate already existing Channels.
115
- * To create new shared objects use:
116
- *
117
- * - {@link @fluidframework/fluid-static#IFluidContainer.create} if using `@fluidframework/fluid-static`, for example via `@fluidframework/azure-client`.
118
- *
119
- * - {@link ISharedObjectKind.create} if using a custom container definitions (and thus not using {@link @fluidframework/fluid-static#IFluidContainer}).
120
- *
121
- * @privateRemarks
122
- * TODO:
123
- * Many tests use this and can't use {@link ISharedObjectKind.create}.
124
- * The docs should make it clear why that's ok, and why {@link ISharedObjectKind.create} isn't in such a way that when reading non app code (like tests in this package)
125
- * someone can tell if the wrong one is being used without running it and seeing if it works.
126
- */
127
- getFactory(): IChannelFactory<TSharedObject>;
128
- /**
129
- * Create a shared object.
130
- * @param runtime - The data store runtime that the new shared object belongs to.
131
- * @param id - Optional name of the shared object.
132
- * @returns Newly created shared object.
133
- *
134
- * @example
135
- * To create a `SharedTree`, call the static create method:
136
- *
137
- * ```typescript
138
- * const myTree = SharedTree.create(this.runtime, id);
139
- * ```
140
- * @remarks
141
- * If using `@fluidframework/fluid-static` (for example via `@fluidframework/azure-client`), use {@link @fluidframework/fluid-static#IFluidContainer.create} instead of calling this directly.
142
- *
143
- * @privateRemarks
144
- * TODO:
145
- * This returns null when used with MockFluidDataStoreRuntime, so its unclear how tests should create DDS instances unless using `RootDataObject.create` (which most tests shouldn't to minimize dependencies).
146
- * In practice tests either avoid mock runtimes, use getFactory(), or call the DDS constructor directly. It is unclear (from docs) how getFactory().create differs but it does not rely on runtime.createChannel so it works with mock runtimes.
147
- * TODO:
148
- * See note on ISharedObjectKind.getFactory.
149
- */
150
- create(runtime: IFluidDataStoreRuntime, id?: string): TSharedObject;
151
- }
152
-
153
- /* Excluded from this release type: makeHandlesSerializable */
154
-
155
- /* Excluded from this release type: parseHandles */
156
-
157
- /* Excluded from this release type: serializeHandles */
158
-
159
- /* Excluded from this release type: SharedObject */
160
-
161
- /* Excluded from this release type: SharedObjectCore */
162
-
163
- /* Excluded from this release type: SummarySerializer */
164
-
165
- /* Excluded from this release type: ValueType */
166
-
167
- export { }