@fluidframework/cell 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.
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../common/build/build-common/api-extractor-lint.json",
4
+ "messages": {
5
+ "extractorMessageReporting": {
6
+ // TODO: remove once base config has this enabled as an error
7
+ "ae-incompatible-release-tags": {
8
+ "logLevel": "error",
9
+ "addToApiReportFile": false
10
+ }
11
+ }
12
+ }
13
+ }
@@ -3,10 +3,6 @@
3
3
  "extends": "../../../common/build/build-common/api-extractor-base.json",
4
4
  "messages": {
5
5
  "extractorMessageReporting": {
6
- // TODO: Fix violations and remove these rule overrides
7
- "ae-forgotten-export": {
8
- "logLevel": "none"
9
- },
10
6
  // TODO: Add missing documentation and remove this rule override
11
7
  "ae-undocumented": {
12
8
  "logLevel": "none"
@@ -17,44 +17,44 @@ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
17
17
  import { Serializable } from '@fluidframework/datastore-definitions';
18
18
  import { SharedObject } from '@fluidframework/shared-object-base';
19
19
 
20
- // @alpha
20
+ // @internal
21
21
  export interface ICellAttributionOptions {
22
22
  // (undocumented)
23
23
  track?: boolean;
24
24
  }
25
25
 
26
- // @alpha
26
+ // @internal
27
27
  export interface ICellOptions {
28
28
  // (undocumented)
29
29
  attribution?: ICellAttributionOptions;
30
30
  }
31
31
 
32
- // @public
32
+ // @internal
33
33
  export interface ISharedCell<T = any> extends ISharedObject<ISharedCellEvents<T>> {
34
34
  delete(): void;
35
35
  empty(): boolean;
36
36
  get(): Serializable<T> | undefined;
37
- // @alpha (undocumented)
37
+ // (undocumented)
38
38
  getAttribution(): AttributionKey | undefined;
39
39
  set(value: Serializable<T>): void;
40
40
  }
41
41
 
42
- // @public
42
+ // @internal
43
43
  export interface ISharedCellEvents<T> extends ISharedObjectEvents {
44
44
  (event: "valueChanged", listener: (value: Serializable<T>) => void): any;
45
45
  (event: "delete", listener: () => void): any;
46
46
  }
47
47
 
48
- // @public
48
+ // @internal
49
49
  export class SharedCell<T = any> extends SharedObject<ISharedCellEvents<T>> implements ISharedCell<T> {
50
50
  constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
51
- // @internal (undocumented)
51
+ // (undocumented)
52
52
  protected applyStashedOp(content: unknown): unknown;
53
53
  static create(runtime: IFluidDataStoreRuntime, id?: string): SharedCell;
54
54
  delete(): void;
55
55
  empty(): boolean;
56
56
  get(): Serializable<T> | undefined;
57
- // @alpha (undocumented)
57
+ // (undocumented)
58
58
  getAttribution(): AttributionKey | undefined;
59
59
  static getFactory(): IChannelFactory;
60
60
  protected initializeLocalCore(): void;
@@ -4,264 +4,38 @@
4
4
  * @packageDocumentation
5
5
  */
6
6
 
7
- import { AttributionKey } from '@fluidframework/runtime-definitions';
8
- import { IChannelAttributes } from '@fluidframework/datastore-definitions';
9
- import { IChannelFactory } from '@fluidframework/datastore-definitions';
10
- import { IChannelStorageService } from '@fluidframework/datastore-definitions';
11
- import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
12
- import { IFluidSerializer } from '@fluidframework/shared-object-base';
13
7
  import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
14
- import { ISharedObject } from '@fluidframework/shared-object-base';
15
- import { ISharedObjectEvents } from '@fluidframework/shared-object-base';
16
- import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
17
- import { Serializable } from '@fluidframework/datastore-definitions';
18
- import { SharedObject } from '@fluidframework/shared-object-base';
19
8
 
20
- /**
21
- * This enables the cell to store the attribution information which can be accessed with the runtime
22
- * (i.e. who creeated the content and when it was created)
23
- *
24
- * default: false
25
- *
26
- * @alpha
27
- */
28
- export declare interface ICellAttributionOptions {
29
- track?: boolean;
30
- }
9
+ /* Excluded from this release type: AttributionKey */
31
10
 
32
- /**
33
- * Options related to attribution
34
- *
35
- * @alpha
36
- */
37
- export declare interface ICellOptions {
38
- attribution?: ICellAttributionOptions;
39
- }
11
+ /* Excluded from this release type: ICellAttributionOptions */
40
12
 
41
- /**
42
- * A Distributed Data Structure (DDS), which stores a single shared value that can be edited or deleted.
43
- *
44
- * @typeParam T - The type of cell data. Must be serializable.
45
- *
46
- * @example Creation
47
- *
48
- * To create a `SharedCell`, call the static create method:
49
- *
50
- * ```typescript
51
- * const myCell = SharedCell.create(this.runtime, id);
52
- * ```
53
- *
54
- * @example Usage
55
- *
56
- * The value stored in the cell can be set with the `.set()` method and retrieved with the `.get()` method:
57
- *
58
- * ```typescript
59
- * myCell.set(3);
60
- * console.log(myCell.get()); // 3
61
- * ```
62
- *
63
- * The value must only be plain JS objects or `SharedObject` handles (e.g. to another DDS or Fluid object).
64
- * In collaborative scenarios, the value is settled with a policy of _last write wins_.
65
- *
66
- * The `.delete()` method will delete the stored value from the cell:
67
- *
68
- * ```typescript
69
- * myCell.delete();
70
- * console.log(myCell.get()); // undefined
71
- * ```
72
- *
73
- * The `.empty()` method will check if the value is undefined.
74
- *
75
- * ```typescript
76
- * if (myCell.empty()) {
77
- * // myCell.get() will return undefined
78
- * } else {
79
- * // myCell.get() will return a non-undefined value
80
- * }
81
- * ```
82
- *
83
- * @example Eventing
84
- *
85
- * `SharedCell` is an `EventEmitter`, and will emit events when other clients make modifications. You should
86
- * register for these events and respond appropriately as the data is modified. `valueChanged` will be emitted
87
- * in response to a `set`, and `delete` will be emitted in response to a `delete`.
88
- *
89
- * @public
90
- */
91
- export declare interface ISharedCell<T = any> extends ISharedObject<ISharedCellEvents<T>> {
92
- /**
93
- * Retrieves the cell value.
94
- *
95
- * @returns The value of the cell
96
- */
97
- get(): Serializable<T> | undefined;
98
- /**
99
- * Sets the cell value.
100
- *
101
- * @param value - a JSON-able or SharedObject value to set the cell to
102
- */
103
- set(value: Serializable<T>): void;
104
- /**
105
- * Checks whether cell is empty or not.
106
- *
107
- * @returns `true` if the value of cell is `undefined`, `false` otherwise
108
- */
109
- empty(): boolean;
110
- /**
111
- * Delete the value from the cell.
112
- */
113
- delete(): void;
114
- /**
115
- * @alpha
116
- * @returns the AttributionKey associated with the cell's most recent change.
117
- */
118
- getAttribution(): AttributionKey | undefined;
119
- }
13
+ /* Excluded from this release type: ICellOptions */
120
14
 
121
- /**
122
- * Events emitted by {@link ISharedCell}.
123
- *
124
- * @public
125
- */
126
- export declare interface ISharedCellEvents<T> extends ISharedObjectEvents {
127
- /**
128
- * Emitted when the value has changed.
129
- *
130
- * @remarks Event paramters:
131
- *
132
- * - `value`: The new value of the cell.
133
- */
134
- (event: "valueChanged", listener: (value: Serializable<T>) => void): any;
135
- /**
136
- * Emitted when the value has been deleted.
137
- */
138
- (event: "delete", listener: () => void): any;
139
- }
15
+ /* Excluded from this release type: IChannelAttributes */
140
16
 
141
- /**
142
- * {@inheritDoc ISharedCell}
143
- *
144
- * @public
145
- */
146
- export declare class SharedCell<T = any> extends SharedObject<ISharedCellEvents<T>> implements ISharedCell<T> {
147
- /**
148
- * Create a new `SharedCell`.
149
- *
150
- * @param runtime - The data store runtime to which the `SharedCell` belongs.
151
- * @param id - Unique identifier for the `SharedCell`.
152
- *
153
- * @returns The newly create `SharedCell`. Note that it will not yet be attached.
154
- */
155
- static create(runtime: IFluidDataStoreRuntime, id?: string): SharedCell;
156
- /**
157
- * Gets the factory for the `SharedCell` to register with the data store.
158
- *
159
- * @returns A factory that creates and loads `SharedCell`s.
160
- */
161
- static getFactory(): IChannelFactory;
162
- /**
163
- * The data held by this cell.
164
- */
165
- private data;
166
- /**
167
- * This is used to assign a unique id to outgoing messages. It is used to track messages until
168
- * they are ack'd.
169
- */
170
- private messageId;
171
- /**
172
- * This keeps track of the messageId of messages that have been ack'd. It is updated every time
173
- * we a message is ack'd with it's messageId.
174
- */
175
- private messageIdObserved;
176
- private readonly pendingMessageIds;
177
- private attribution;
178
- private readonly options;
179
- /**
180
- * Constructs a new `SharedCell`.
181
- * If the object is non-local an id and service interfaces will be provided.
182
- *
183
- * @param runtime - The data store runtime to which the `SharedCell` belongs.
184
- * @param id - Unique identifier for the `SharedCell`.
185
- */
186
- constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
187
- /**
188
- * {@inheritDoc ISharedCell.get}
189
- */
190
- get(): Serializable<T> | undefined;
191
- /**
192
- * {@inheritDoc ISharedCell.set}
193
- */
194
- set(value: Serializable<T>): void;
195
- /**
196
- * {@inheritDoc ISharedCell.delete}
197
- */
198
- delete(): void;
199
- /**
200
- * {@inheritDoc ISharedCell.empty}
201
- */
202
- empty(): boolean;
203
- /**
204
- * {@inheritDoc ISharedCell.getAttribution}
205
- * @alpha
206
- */
207
- getAttribution(): AttributionKey | undefined;
208
- /**
209
- * Set the Op-based attribution through the SequencedDocumentMessage,
210
- * or set the local/detached attribution.
211
- */
212
- private setAttribution;
213
- /**
214
- * Creates a summary for the Cell.
215
- *
216
- * @returns The summary of the current state of the Cell.
217
- */
218
- protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
219
- /**
220
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
221
- */
222
- protected loadCore(storage: IChannelStorageService): Promise<void>;
223
- /**
224
- * Initialize a local instance of cell.
225
- */
226
- protected initializeLocalCore(): void;
227
- /**
228
- * Call back on disconnect.
229
- */
230
- protected onDisconnect(): void;
231
- /**
232
- * Apply inner op.
233
- *
234
- * @param content - ICellOperation content
235
- */
236
- private applyInnerOp;
237
- /**
238
- * Process a cell operation (op).
239
- *
240
- * @param message - The message to prepare.
241
- * @param local - Whether or not the message was sent by the local client.
242
- * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
243
- * For messages from a remote client, this will be `undefined`.
244
- */
245
- protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
246
- private setCore;
247
- private deleteCore;
248
- private decode;
249
- private createLocalOpMetadata;
250
- /* Excluded from this release type: applyStashedOp */
251
- /**
252
- * Rollback a local op.
253
- *
254
- * @param content - The operation to rollback.
255
- * @param localOpMetadata - The local metadata associated with the op.
256
- */
257
- protected rollback(content: any, localOpMetadata: unknown): void;
258
- /**
259
- * Submit a cell message to remote clients.
260
- *
261
- * @param op - The cell message.
262
- * @param previousValue - The value of the cell before this op.
263
- */
264
- private submitCellMessage;
265
- }
17
+ /* Excluded from this release type: IChannelFactory */
18
+
19
+ /* Excluded from this release type: IChannelStorageService */
20
+
21
+ /* Excluded from this release type: IFluidDataStoreRuntime */
22
+
23
+ /* Excluded from this release type: IFluidSerializer */
24
+
25
+ /* Excluded from this release type: ISharedCell */
26
+
27
+ /* Excluded from this release type: ISharedCellEvents */
28
+
29
+ /* Excluded from this release type: ISharedObject */
30
+
31
+ /* Excluded from this release type: ISharedObjectEvents */
32
+
33
+ /* Excluded from this release type: ISummaryTreeWithStats */
34
+
35
+ /* Excluded from this release type: Serializable */
36
+
37
+ /* Excluded from this release type: SharedCell */
38
+
39
+ /* Excluded from this release type: SharedObject */
266
40
 
267
41
  export { }
@@ -4,17 +4,7 @@
4
4
  * @packageDocumentation
5
5
  */
6
6
 
7
- import { IChannelAttributes } from '@fluidframework/datastore-definitions';
8
- import { IChannelFactory } from '@fluidframework/datastore-definitions';
9
- import { IChannelStorageService } from '@fluidframework/datastore-definitions';
10
- import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
11
- import { IFluidSerializer } from '@fluidframework/shared-object-base';
12
7
  import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
13
- import { ISharedObject } from '@fluidframework/shared-object-base';
14
- import { ISharedObjectEvents } from '@fluidframework/shared-object-base';
15
- import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
16
- import { Serializable } from '@fluidframework/datastore-definitions';
17
- import { SharedObject } from '@fluidframework/shared-object-base';
18
8
 
19
9
  /* Excluded from this release type: AttributionKey */
20
10
 
@@ -22,222 +12,30 @@ import { SharedObject } from '@fluidframework/shared-object-base';
22
12
 
23
13
  /* Excluded from this release type: ICellOptions */
24
14
 
25
- /**
26
- * A Distributed Data Structure (DDS), which stores a single shared value that can be edited or deleted.
27
- *
28
- * @typeParam T - The type of cell data. Must be serializable.
29
- *
30
- * @example Creation
31
- *
32
- * To create a `SharedCell`, call the static create method:
33
- *
34
- * ```typescript
35
- * const myCell = SharedCell.create(this.runtime, id);
36
- * ```
37
- *
38
- * @example Usage
39
- *
40
- * The value stored in the cell can be set with the `.set()` method and retrieved with the `.get()` method:
41
- *
42
- * ```typescript
43
- * myCell.set(3);
44
- * console.log(myCell.get()); // 3
45
- * ```
46
- *
47
- * The value must only be plain JS objects or `SharedObject` handles (e.g. to another DDS or Fluid object).
48
- * In collaborative scenarios, the value is settled with a policy of _last write wins_.
49
- *
50
- * The `.delete()` method will delete the stored value from the cell:
51
- *
52
- * ```typescript
53
- * myCell.delete();
54
- * console.log(myCell.get()); // undefined
55
- * ```
56
- *
57
- * The `.empty()` method will check if the value is undefined.
58
- *
59
- * ```typescript
60
- * if (myCell.empty()) {
61
- * // myCell.get() will return undefined
62
- * } else {
63
- * // myCell.get() will return a non-undefined value
64
- * }
65
- * ```
66
- *
67
- * @example Eventing
68
- *
69
- * `SharedCell` is an `EventEmitter`, and will emit events when other clients make modifications. You should
70
- * register for these events and respond appropriately as the data is modified. `valueChanged` will be emitted
71
- * in response to a `set`, and `delete` will be emitted in response to a `delete`.
72
- *
73
- * @public
74
- */
75
- export declare interface ISharedCell<T = any> extends ISharedObject<ISharedCellEvents<T>> {
76
- /**
77
- * Retrieves the cell value.
78
- *
79
- * @returns The value of the cell
80
- */
81
- get(): Serializable<T> | undefined;
82
- /**
83
- * Sets the cell value.
84
- *
85
- * @param value - a JSON-able or SharedObject value to set the cell to
86
- */
87
- set(value: Serializable<T>): void;
88
- /**
89
- * Checks whether cell is empty or not.
90
- *
91
- * @returns `true` if the value of cell is `undefined`, `false` otherwise
92
- */
93
- empty(): boolean;
94
- /**
95
- * Delete the value from the cell.
96
- */
97
- delete(): void;
98
- /* Excluded from this release type: getAttribution */
99
- }
15
+ /* Excluded from this release type: IChannelAttributes */
100
16
 
101
- /**
102
- * Events emitted by {@link ISharedCell}.
103
- *
104
- * @public
105
- */
106
- export declare interface ISharedCellEvents<T> extends ISharedObjectEvents {
107
- /**
108
- * Emitted when the value has changed.
109
- *
110
- * @remarks Event paramters:
111
- *
112
- * - `value`: The new value of the cell.
113
- */
114
- (event: "valueChanged", listener: (value: Serializable<T>) => void): any;
115
- /**
116
- * Emitted when the value has been deleted.
117
- */
118
- (event: "delete", listener: () => void): any;
119
- }
17
+ /* Excluded from this release type: IChannelFactory */
120
18
 
121
- /**
122
- * {@inheritDoc ISharedCell}
123
- *
124
- * @public
125
- */
126
- export declare class SharedCell<T = any> extends SharedObject<ISharedCellEvents<T>> implements ISharedCell<T> {
127
- /**
128
- * Create a new `SharedCell`.
129
- *
130
- * @param runtime - The data store runtime to which the `SharedCell` belongs.
131
- * @param id - Unique identifier for the `SharedCell`.
132
- *
133
- * @returns The newly create `SharedCell`. Note that it will not yet be attached.
134
- */
135
- static create(runtime: IFluidDataStoreRuntime, id?: string): SharedCell;
136
- /**
137
- * Gets the factory for the `SharedCell` to register with the data store.
138
- *
139
- * @returns A factory that creates and loads `SharedCell`s.
140
- */
141
- static getFactory(): IChannelFactory;
142
- /**
143
- * The data held by this cell.
144
- */
145
- private data;
146
- /**
147
- * This is used to assign a unique id to outgoing messages. It is used to track messages until
148
- * they are ack'd.
149
- */
150
- private messageId;
151
- /**
152
- * This keeps track of the messageId of messages that have been ack'd. It is updated every time
153
- * we a message is ack'd with it's messageId.
154
- */
155
- private messageIdObserved;
156
- private readonly pendingMessageIds;
157
- private attribution;
158
- private readonly options;
159
- /**
160
- * Constructs a new `SharedCell`.
161
- * If the object is non-local an id and service interfaces will be provided.
162
- *
163
- * @param runtime - The data store runtime to which the `SharedCell` belongs.
164
- * @param id - Unique identifier for the `SharedCell`.
165
- */
166
- constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
167
- /**
168
- * {@inheritDoc ISharedCell.get}
169
- */
170
- get(): Serializable<T> | undefined;
171
- /**
172
- * {@inheritDoc ISharedCell.set}
173
- */
174
- set(value: Serializable<T>): void;
175
- /**
176
- * {@inheritDoc ISharedCell.delete}
177
- */
178
- delete(): void;
179
- /**
180
- * {@inheritDoc ISharedCell.empty}
181
- */
182
- empty(): boolean;
183
- /* Excluded from this release type: getAttribution */
184
- /**
185
- * Set the Op-based attribution through the SequencedDocumentMessage,
186
- * or set the local/detached attribution.
187
- */
188
- private setAttribution;
189
- /**
190
- * Creates a summary for the Cell.
191
- *
192
- * @returns The summary of the current state of the Cell.
193
- */
194
- protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
195
- /**
196
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
197
- */
198
- protected loadCore(storage: IChannelStorageService): Promise<void>;
199
- /**
200
- * Initialize a local instance of cell.
201
- */
202
- protected initializeLocalCore(): void;
203
- /**
204
- * Call back on disconnect.
205
- */
206
- protected onDisconnect(): void;
207
- /**
208
- * Apply inner op.
209
- *
210
- * @param content - ICellOperation content
211
- */
212
- private applyInnerOp;
213
- /**
214
- * Process a cell operation (op).
215
- *
216
- * @param message - The message to prepare.
217
- * @param local - Whether or not the message was sent by the local client.
218
- * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
219
- * For messages from a remote client, this will be `undefined`.
220
- */
221
- protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
222
- private setCore;
223
- private deleteCore;
224
- private decode;
225
- private createLocalOpMetadata;
226
- /* Excluded from this release type: applyStashedOp */
227
- /**
228
- * Rollback a local op.
229
- *
230
- * @param content - The operation to rollback.
231
- * @param localOpMetadata - The local metadata associated with the op.
232
- */
233
- protected rollback(content: any, localOpMetadata: unknown): void;
234
- /**
235
- * Submit a cell message to remote clients.
236
- *
237
- * @param op - The cell message.
238
- * @param previousValue - The value of the cell before this op.
239
- */
240
- private submitCellMessage;
241
- }
19
+ /* Excluded from this release type: IChannelStorageService */
20
+
21
+ /* Excluded from this release type: IFluidDataStoreRuntime */
22
+
23
+ /* Excluded from this release type: IFluidSerializer */
24
+
25
+ /* Excluded from this release type: ISharedCell */
26
+
27
+ /* Excluded from this release type: ISharedCellEvents */
28
+
29
+ /* Excluded from this release type: ISharedObject */
30
+
31
+ /* Excluded from this release type: ISharedObjectEvents */
32
+
33
+ /* Excluded from this release type: ISummaryTreeWithStats */
34
+
35
+ /* Excluded from this release type: Serializable */
36
+
37
+ /* Excluded from this release type: SharedCell */
38
+
39
+ /* Excluded from this release type: SharedObject */
242
40
 
243
41
  export { }