@fluidframework/cell 2.0.0-dev.2.3.0.115467 → 2.0.0-dev.3.1.0.125672

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 (49) hide show
  1. package/.eslintrc.js +9 -7
  2. package/.mocharc.js +2 -2
  3. package/README.md +95 -1
  4. package/api-extractor.json +2 -2
  5. package/dist/cell.d.ts +47 -73
  6. package/dist/cell.d.ts.map +1 -1
  7. package/dist/cell.js +71 -74
  8. package/dist/cell.js.map +1 -1
  9. package/dist/cellFactory.d.ts +18 -1
  10. package/dist/cellFactory.d.ts.map +1 -1
  11. package/dist/cellFactory.js +18 -1
  12. package/dist/cellFactory.js.map +1 -1
  13. package/dist/index.d.ts +6 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +5 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/interfaces.d.ts +116 -3
  18. package/dist/interfaces.d.ts.map +1 -1
  19. package/dist/interfaces.js.map +1 -1
  20. package/dist/packageVersion.d.ts +1 -1
  21. package/dist/packageVersion.js +1 -1
  22. package/dist/packageVersion.js.map +1 -1
  23. package/lib/cell.d.ts +47 -73
  24. package/lib/cell.d.ts.map +1 -1
  25. package/lib/cell.js +72 -75
  26. package/lib/cell.js.map +1 -1
  27. package/lib/cellFactory.d.ts +18 -1
  28. package/lib/cellFactory.d.ts.map +1 -1
  29. package/lib/cellFactory.js +18 -1
  30. package/lib/cellFactory.js.map +1 -1
  31. package/lib/index.d.ts +6 -1
  32. package/lib/index.d.ts.map +1 -1
  33. package/lib/index.js +5 -0
  34. package/lib/index.js.map +1 -1
  35. package/lib/interfaces.d.ts +116 -3
  36. package/lib/interfaces.d.ts.map +1 -1
  37. package/lib/interfaces.js.map +1 -1
  38. package/lib/packageVersion.d.ts +1 -1
  39. package/lib/packageVersion.js +1 -1
  40. package/lib/packageVersion.js.map +1 -1
  41. package/package.json +29 -20
  42. package/prettier.config.cjs +1 -1
  43. package/src/cell.ts +357 -317
  44. package/src/cellFactory.ts +52 -34
  45. package/src/index.ts +13 -1
  46. package/src/interfaces.ts +156 -32
  47. package/src/packageVersion.ts +1 -1
  48. package/tsconfig.esnext.json +6 -6
  49. package/tsconfig.json +9 -13
package/dist/cell.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cell.js","sourceRoot":"","sources":["../src/cell.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAsD;AACtD,+EAA8F;AAS9F,+DAA4D;AAC5D,2EAA6G;AAC7G,+CAA4C;AA0B5C,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAa,UAAoB,SAAQ,iCAAkC;IAwCvE;;;;;;OAMG;IACH,YAAY,EAAU,EAAE,OAA+B,EAAE,UAA8B;QACnF,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;QAtBlD;;;WAGG;QACK,cAAS,GAAW,CAAC,CAAC,CAAC;QAE/B;;;WAGG;QACK,sBAAiB,GAAW,CAAC,CAAC,CAAC;QAEtB,sBAAiB,GAAa,EAAE,CAAC;IAWlD,CAAC;IA/CD;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,OAA+B,EAAE,EAAW;QAC7D,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,yBAAW,CAAC,IAAI,CAAe,CAAC;IACrE,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,UAAU;QACpB,OAAO,IAAI,yBAAW,EAAE,CAAC;IAC7B,CAAC;IA+BD;;OAEG;IACI,GAAG;QACN,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED;;OAEG;IACI,GAAG,CAAC,KAAsB;QAC7B,mCAAmC;QACnC,MAAM,cAAc,GAAe;YAC/B,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,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,MAAM,cAAc,GAAG,eAAuC,CAAC;QAC/D,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,EAAE;YAC7D,IAAI,cAAc,CAAC,aAAa,KAAK,SAAS,EAAE;gBAC5C,IAAI,CAAC,UAAU,EAAE,CAAC;aACrB;iBAAM;gBACH,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;aAC9C;YAED,MAAM,oBAAoB,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,CAAC;YAC1D,IAAI,oBAAoB,KAAK,cAAc,CAAC,gBAAgB,EAAE;gBAC1D,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;aAC9D;SACJ;aAAM;YACH,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;SAClD;IACL,CAAC;IAEA;;;;MAIE;IACK,iBAAiB,CAAC,EAAkB,EAAE,aAAmB;QAC7D,MAAM,aAAa,GAAG,IAAI,CAAC,qBAAqB,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;QACpE,IAAI,CAAC,kBAAkB,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;IAC/C,CAAC;CACJ;AAlQD,gCAkQC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport { ISequencedDocumentMessage, MessageType } from \"@fluidframework/protocol-definitions\";\nimport {\n IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelStorageService,\n IChannelFactory,\n Serializable,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport { createSingleBlobSummary, IFluidSerializer, SharedObject } from \"@fluidframework/shared-object-base\";\nimport { CellFactory } from \"./cellFactory\";\nimport {\n ISharedCell,\n ISharedCellEvents,\n ICellLocalOpMetadata,\n} from \"./interfaces\";\n\n/**\n * Description of a cell delta operation\n */\ntype ICellOperation = ISetCellOperation | IDeleteCellOperation;\n\ninterface ISetCellOperation {\n type: \"setCell\";\n value: ICellValue;\n}\n\ninterface IDeleteCellOperation {\n type: \"deleteCell\";\n}\n\ninterface ICellValue {\n // The actual value contained in the cell which needs to be wrapped to handle undefined\n value: any;\n}\n\nconst snapshotFileName = \"header\";\n\n/**\n * The SharedCell distributed data structure can be used to store a single serializable value.\n *\n * @remarks\n * ### Creation\n *\n * To create a `SharedCell`, call the static create method:\n *\n * ```typescript\n * const myCell = SharedCell.create(this.runtime, id);\n * ```\n *\n * ### Usage\n *\n * The value stored in the cell can be set with the `.set()` method and retrieved with the `.get()` method:\n *\n * ```typescript\n * myCell.set(3);\n * console.log(myCell.get()); // 3\n * ```\n *\n * The value must only be plain JS objects or `SharedObject` handles (e.g. to another DDS or Fluid object).\n * In collaborative scenarios, the value is settled with a policy of _last write wins_.\n *\n * The `.delete()` method will delete the stored value from the cell:\n *\n * ```typescript\n * myCell.delete();\n * console.log(myCell.get()); // undefined\n * ```\n *\n * The `.empty()` method will check if the value is undefined.\n *\n * ```typescript\n * if (myCell.empty()) {\n * // myCell.get() will return undefined\n * } else {\n * // myCell.get() will return a non-undefined value\n * }\n * ```\n *\n * ### Eventing\n *\n * `SharedCell` is an `EventEmitter`, and will emit events when other clients make modifications. You should\n * register for these events and respond appropriately as the data is modified. `valueChanged` will be emitted\n * in response to a `set`, and `delete` will be emitted in response to a `delete`.\n */\nexport class SharedCell<T = any> extends SharedObject<ISharedCellEvents<T>>\n implements ISharedCell<T> {\n /**\n * Create a new shared cell\n *\n * @param runtime - data store runtime the new shared map belongs to\n * @param id - optional name of the shared map\n * @returns newly create shared map (but not attached yet)\n */\n public static create(runtime: IFluidDataStoreRuntime, id?: string) {\n return runtime.createChannel(id, CellFactory.Type) as SharedCell;\n }\n\n /**\n * Get a factory for SharedCell to register with the data store.\n *\n * @returns a factory that creates and load SharedCell\n */\n public static getFactory(): IChannelFactory {\n return new CellFactory();\n }\n /**\n * The data held by this cell.\n */\n private data: Serializable<T> | undefined;\n\n /**\n * This is used to assign a unique id to outgoing messages. It is used to track messages until\n * they are ack'd.\n */\n private messageId: number = -1;\n\n /**\n * This keeps track of the messageId of messages that have been ack'd. It is updated every time\n * we a message is ack'd with it's messageId.\n */\n private messageIdObserved: number = -1;\n\n private readonly pendingMessageIds: number[] = [];\n\n /**\n * Constructs a new shared cell. If the object is non-local an id and service interfaces will\n * be provided\n *\n * @param runtime - data store runtime the shared map belongs to\n * @param id - optional name of the shared map\n */\n constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {\n super(id, runtime, attributes, \"fluid_cell_\");\n }\n\n /**\n * {@inheritDoc ISharedCell.get}\n */\n public get(): Serializable<T> | undefined {\n return this.data;\n }\n\n /**\n * {@inheritDoc ISharedCell.set}\n */\n public set(value: Serializable<T>) {\n // Serialize the value if required.\n const operationValue: ICellValue = {\n value: this.serializer.encode(value, this.handle),\n };\n\n // Set the value locally.\n const previousValue = this.setCore(value);\n\n // If we are not attached, don't submit the op.\n if (!this.isAttached()) {\n return;\n }\n\n const op: ISetCellOperation = {\n type: \"setCell\",\n value: operationValue,\n };\n this.submitCellMessage(op, previousValue);\n }\n\n /**\n * {@inheritDoc ISharedCell.delete}\n */\n public delete() {\n // Delete the value locally.\n const previousValue = this.deleteCore();\n\n // If we are not attached, don't submit the op.\n if (!this.isAttached()) {\n return;\n }\n\n const op: IDeleteCellOperation = {\n type: \"deleteCell\",\n };\n this.submitCellMessage(op, previousValue);\n }\n\n /**\n * {@inheritDoc ISharedCell.empty}\n */\n public empty() {\n return this.data === undefined;\n }\n\n /**\n * Create a summary for the cell\n *\n * @returns the summary of the current state of the cell\n */\n protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n const content: ICellValue = { value: this.data };\n return createSingleBlobSummary(snapshotFileName, serializer.stringify(content, this.handle));\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n */\n protected async loadCore(storage: IChannelStorageService): Promise<void> {\n const content = await readAndParse<ICellValue>(storage, snapshotFileName);\n\n this.data = this.decode(content);\n }\n\n /**\n * Initialize a local instance of cell\n */\n protected initializeLocalCore() {\n this.data = undefined;\n }\n\n /**\n * Call back on disconnect\n */\n protected onDisconnect() { }\n\n /**\n * Apply inner op\n * @param content - ICellOperation content\n */\n private applyInnerOp(content: ICellOperation) {\n switch (content.type) {\n case \"setCell\":\n return this.setCore(this.decode(content.value));\n\n case \"deleteCell\":\n return this.deleteCore();\n\n default:\n throw new Error(\"Unknown operation\");\n }\n }\n\n /**\n * Process a cell operation\n *\n * @param message - the message to prepare\n * @param local - whether the message was sent by the local client\n * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n * For messages from a remote client, this will be undefined.\n */\n protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) {\n const cellOpMetadata = localOpMetadata as ICellLocalOpMetadata;\n if (this.messageId !== this.messageIdObserved) {\n // We are waiting for an ACK on our change to this cell - we will ignore all messages until we get it.\n if (local) {\n const messageIdReceived = cellOpMetadata.pendingMessageId;\n assert(messageIdReceived !== undefined && messageIdReceived <= this.messageId,\n 0x00c /* \"messageId is incorrect from from the local client's ACK\" */);\n assert(this.pendingMessageIds !== undefined &&\n this.pendingMessageIds[0] === cellOpMetadata.pendingMessageId,\n 0x471 /* Unexpected pending message received */);\n this.pendingMessageIds.shift();\n // We got an ACK. Update messageIdObserved.\n this.messageIdObserved = cellOpMetadata.pendingMessageId;\n }\n return;\n }\n\n if (message.type === MessageType.Operation && !local) {\n const op = message.contents as ICellOperation;\n this.applyInnerOp(op);\n }\n }\n\n private setCore(value: Serializable<T>): Serializable<T> | undefined {\n const previousLocalValue = this.get();\n this.data = value;\n this.emit(\"valueChanged\", value);\n return previousLocalValue;\n }\n\n private deleteCore(): Serializable<T> | undefined {\n const previousLocalValue = this.get();\n this.data = undefined;\n this.emit(\"delete\");\n return previousLocalValue;\n }\n\n private decode(cellValue: ICellValue) {\n const value = cellValue.value;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return this.serializer.decode(value);\n }\n\n private createLocalOpMetadata(op: ICellOperation, previousValue?: Serializable<T>): ICellLocalOpMetadata {\n const pendingMessageId = ++this.messageId;\n this.pendingMessageIds.push(pendingMessageId);\n const localMetadata: ICellLocalOpMetadata = {\n pendingMessageId, previousValue,\n };\n return localMetadata;\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}\n * @internal\n */\n protected applyStashedOp(content: unknown): unknown {\n const cellContent = content as ICellOperation;\n const previousValue = this.applyInnerOp(cellContent);\n return this.createLocalOpMetadata(cellContent, previousValue);\n }\n\n /**\n * Rollback a local op\n * @param content - The operation to rollback\n * @param localOpMetadata - The local metadata associated with the op.\n */\n protected rollback(content: any, localOpMetadata: unknown) {\n const cellOpMetadata = localOpMetadata as ICellLocalOpMetadata;\n if (content.type === \"setCell\" || content.type === \"deleteCell\") {\n if (cellOpMetadata.previousValue === undefined) {\n this.deleteCore();\n } else {\n this.setCore(cellOpMetadata.previousValue);\n }\n\n const lastPendingMessageId = this.pendingMessageIds.pop();\n if (lastPendingMessageId !== cellOpMetadata.pendingMessageId) {\n throw new Error(\"Rollback op does not match last pending\");\n }\n } else {\n throw new Error(\"Unsupported op for rollback\");\n }\n }\n\n /**\n * Submit a cell message to remote clients.\n * @param op - The cell message\n * @param previousValue - The value of the cell before this op\n */\n private submitCellMessage(op: ICellOperation, previousValue?: any): void {\n const localMetadata = this.createLocalOpMetadata(op, previousValue);\n this.submitLocalMessage(op, localMetadata);\n }\n}\n"]}
1
+ {"version":3,"file":"cell.js","sourceRoot":"","sources":["../src/cell.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAsD;AACtD,+EAA8F;AAC9F,qEAA4E;AAS5E,+DAA4D;AAC5D,2EAI4C;AAC5C,+CAA4C;AA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,MAAM,aAAa,GAAG,IAAI,CAAC,qBAAqB,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;QACpE,IAAI,CAAC,kBAAkB,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;IAC5C,CAAC;CACD;AAtUD,gCAsUC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport { ISequencedDocumentMessage, MessageType } from \"@fluidframework/protocol-definitions\";\nimport { loggerToMonitoringContext } from \"@fluidframework/telemetry-utils\";\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n\tIChannelFactory,\n\tSerializable,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport {\n\tcreateSingleBlobSummary,\n\tIFluidSerializer,\n\tSharedObject,\n} from \"@fluidframework/shared-object-base\";\nimport { CellFactory } from \"./cellFactory\";\nimport {\n\tISharedCell,\n\tISharedCellEvents,\n\tICellLocalOpMetadata,\n\tAttributionKey,\n\tICellOptions,\n} from \"./interfaces\";\n\n/**\n * Description of a cell delta operation\n */\ntype ICellOperation = ISetCellOperation | IDeleteCellOperation;\n\ninterface ISetCellOperation {\n\ttype: \"setCell\";\n\tvalue: ICellValue;\n}\n\ninterface IDeleteCellOperation {\n\ttype: \"deleteCell\";\n}\n\ninterface ICellValue {\n\t/**\n\t * The actual value contained in the `Cell`, which needs to be wrapped to handle `undefined`.\n\t */\n\tvalue: unknown;\n\t/**\n\t * The attribution key contained in the `Cell`.\n\t * @alpha\n\t */\n\tattribution?: AttributionKey;\n}\n\nconst snapshotFileName = \"header\";\n\n/**\n * {@inheritDoc ISharedCell}\n */\n// TODO: use `unknown` instead (breaking change).\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class SharedCell<T = any>\n\textends SharedObject<ISharedCellEvents<T>>\n\timplements ISharedCell<T>\n{\n\t/**\n\t * Create a new `SharedCell`.\n\t *\n\t * @param runtime - The data store runtime to which the `SharedCell` belongs.\n\t * @param id - Unique identifier for the `SharedCell`.\n\t *\n\t * @returns The newly create `SharedCell`. Note that it will not yet be attached.\n\t */\n\tpublic static create(runtime: IFluidDataStoreRuntime, id?: string): SharedCell {\n\t\treturn runtime.createChannel(id, CellFactory.Type) as SharedCell;\n\t}\n\n\t/**\n\t * Gets the factory for the `SharedCell` to register with the data store.\n\t *\n\t * @returns A factory that creates and loads `SharedCell`s.\n\t */\n\tpublic static getFactory(): IChannelFactory {\n\t\treturn new CellFactory();\n\t}\n\n\t/**\n\t * The data held by this cell.\n\t */\n\tprivate data: Serializable<T> | undefined;\n\n\t/**\n\t * This is used to assign a unique id to outgoing messages. It is used to track messages until\n\t * they are ack'd.\n\t */\n\tprivate messageId: number = -1;\n\n\t/**\n\t * This keeps track of the messageId of messages that have been ack'd. It is updated every time\n\t * we a message is ack'd with it's messageId.\n\t */\n\tprivate messageIdObserved: number = -1;\n\n\tprivate readonly pendingMessageIds: number[] = [];\n\n\tprivate attribution: AttributionKey | undefined;\n\n\tprivate readonly options: ICellOptions | undefined;\n\n\t/**\n\t * Constructs a new `SharedCell`.\n\t * If the object is non-local an id and service interfaces will be provided.\n\t *\n\t * @alpha\n\t *\n\t * @param runtime - The data store runtime to which the `SharedCell` belongs.\n\t * @param id - Unique identifier for the `SharedCell`.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility\n\tconstructor(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t\toptions?: ICellOptions,\n\t) {\n\t\tsuper(id, runtime, attributes, \"fluid_cell_\");\n\n\t\tthis.options ??= options;\n\n\t\tconst configSetAttribution = loggerToMonitoringContext(this.logger).config.getBoolean(\n\t\t\t\"Fluid.Attribution.EnableOnNewFile\",\n\t\t);\n\t\tif (configSetAttribution !== undefined) {\n\t\t\t(this.options ?? (this.options = {})).attribution = { track: configSetAttribution };\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedCell.get}\n\t */\n\tpublic get(): Serializable<T> | undefined {\n\t\treturn this.data;\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedCell.set}\n\t */\n\tpublic set(value: Serializable<T>): void {\n\t\t// Serialize the value if required.\n\t\tconst operationValue: ICellValue = {\n\t\t\tvalue: this.serializer.encode(value, this.handle),\n\t\t};\n\n\t\t// Set the value locally.\n\t\tconst previousValue = this.setCore(value);\n\n\t\t// If we are not attached, don't submit the op.\n\t\tif (!this.isAttached()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst op: ISetCellOperation = {\n\t\t\ttype: \"setCell\",\n\t\t\tvalue: operationValue,\n\t\t};\n\t\tthis.submitCellMessage(op, previousValue);\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedCell.delete}\n\t */\n\tpublic delete(): void {\n\t\t// Delete the value locally.\n\t\tconst previousValue = this.deleteCore();\n\n\t\t// If we are not attached, don't submit the op.\n\t\tif (!this.isAttached()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst op: IDeleteCellOperation = {\n\t\t\ttype: \"deleteCell\",\n\t\t};\n\t\tthis.submitCellMessage(op, previousValue);\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedCell.empty}\n\t */\n\tpublic empty(): boolean {\n\t\treturn this.data === undefined;\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedCell.getAttribution}\n\t * @alpha\n\t */\n\tpublic getAttribution(): AttributionKey | undefined {\n\t\treturn this.attribution;\n\t}\n\n\t/**\n\t * Set the attribution through the SequencedDocumentMessage\n\t */\n\tprivate setAttribution(message: ISequencedDocumentMessage): void {\n\t\tif (this.options?.attribution?.track ?? false) {\n\t\t\tthis.attribution = { type: \"op\", seq: message.sequenceNumber };\n\t\t}\n\t}\n\n\t/**\n\t * Creates a summary for the Cell.\n\t *\n\t * @returns The summary of the current state of the Cell.\n\t */\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\tconst content: ICellValue = { value: this.data, attribution: this.attribution };\n\t\treturn createSingleBlobSummary(\n\t\t\tsnapshotFileName,\n\t\t\tserializer.stringify(content, this.handle),\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst content = await readAndParse<ICellValue>(storage, snapshotFileName);\n\n\t\tthis.data = this.decode(content);\n\t\tthis.attribution = content.attribution;\n\t}\n\n\t/**\n\t * Initialize a local instance of cell.\n\t */\n\tprotected initializeLocalCore(): void {\n\t\tthis.data = undefined;\n\t}\n\n\t/**\n\t * Call back on disconnect.\n\t */\n\tprotected onDisconnect(): void {}\n\n\t/**\n\t * Apply inner op.\n\t *\n\t * @param content - ICellOperation content\n\t */\n\tprivate applyInnerOp(content: ICellOperation): Serializable<T> | undefined {\n\t\tswitch (content.type) {\n\t\t\tcase \"setCell\":\n\t\t\t\treturn this.setCore(this.decode(content.value));\n\n\t\t\tcase \"deleteCell\":\n\t\t\t\treturn this.deleteCore();\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error(\"Unknown operation\");\n\t\t}\n\t}\n\n\t/**\n\t * Process a cell operation (op).\n\t *\n\t * @param message - The message to prepare.\n\t * @param local - Whether or not the message was sent by the local client.\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be `undefined`.\n\t */\n\tprotected processCore(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\tconst cellOpMetadata = localOpMetadata as ICellLocalOpMetadata;\n\t\tif (this.messageId !== this.messageIdObserved) {\n\t\t\t// We are waiting for an ACK on our change to this cell - we will ignore all messages until we get it.\n\t\t\tif (local) {\n\t\t\t\tconst messageIdReceived = cellOpMetadata.pendingMessageId;\n\t\t\t\tassert(\n\t\t\t\t\tmessageIdReceived !== undefined && messageIdReceived <= this.messageId,\n\t\t\t\t\t0x00c /* \"messageId is incorrect from from the local client's ACK\" */,\n\t\t\t\t);\n\t\t\t\tassert(\n\t\t\t\t\tthis.pendingMessageIds !== undefined &&\n\t\t\t\t\t\tthis.pendingMessageIds[0] === cellOpMetadata.pendingMessageId,\n\t\t\t\t\t0x471 /* Unexpected pending message received */,\n\t\t\t\t);\n\t\t\t\tthis.pendingMessageIds.shift();\n\t\t\t\t// We got an ACK. Update messageIdObserved.\n\t\t\t\tthis.messageIdObserved = cellOpMetadata.pendingMessageId;\n\t\t\t\t// update the attributor\n\t\t\t\tthis.setAttribution(message);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (message.type === MessageType.Operation && !local) {\n\t\t\tconst op = message.contents as ICellOperation;\n\t\t\t// update the attributor\n\t\t\tthis.setAttribution(message);\n\t\t\tthis.applyInnerOp(op);\n\t\t}\n\t}\n\n\tprivate setCore(value: Serializable<T>): Serializable<T> | undefined {\n\t\tconst previousLocalValue = this.get();\n\t\tthis.data = value;\n\t\tthis.emit(\"valueChanged\", value);\n\t\treturn previousLocalValue;\n\t}\n\n\tprivate deleteCore(): Serializable<T> | undefined {\n\t\tconst previousLocalValue = this.get();\n\t\tthis.data = undefined;\n\t\tthis.emit(\"delete\");\n\t\treturn previousLocalValue;\n\t}\n\n\tprivate decode(cellValue: ICellValue): Serializable<T> {\n\t\tconst value = cellValue.value;\n\t\treturn this.serializer.decode(value) as Serializable<T>;\n\t}\n\n\tprivate createLocalOpMetadata(\n\t\top: ICellOperation,\n\t\tpreviousValue?: Serializable<T>,\n\t): ICellLocalOpMetadata {\n\t\tconst pendingMessageId = ++this.messageId;\n\t\tthis.pendingMessageIds.push(pendingMessageId);\n\t\tconst localMetadata: ICellLocalOpMetadata = {\n\t\t\tpendingMessageId,\n\t\t\tpreviousValue,\n\t\t};\n\t\treturn localMetadata;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}\n\t *\n\t * @internal\n\t */\n\tprotected applyStashedOp(content: unknown): unknown {\n\t\tconst cellContent = content as ICellOperation;\n\t\tconst previousValue = this.applyInnerOp(cellContent);\n\t\treturn this.createLocalOpMetadata(cellContent, previousValue);\n\t}\n\n\t/**\n\t * Rollback a local op.\n\t *\n\t * @param content - The operation to rollback.\n\t * @param localOpMetadata - The local metadata associated with the op.\n\t */\n\t// TODO: use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n\tprotected rollback(content: any, localOpMetadata: unknown): void {\n\t\tconst cellOpMetadata = localOpMetadata as ICellLocalOpMetadata;\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\tif (content.type === \"setCell\" || content.type === \"deleteCell\") {\n\t\t\tif (cellOpMetadata.previousValue === undefined) {\n\t\t\t\tthis.deleteCore();\n\t\t\t} else {\n\t\t\t\tthis.setCore(cellOpMetadata.previousValue as Serializable<T>);\n\t\t\t}\n\n\t\t\tconst lastPendingMessageId = this.pendingMessageIds.pop();\n\t\t\tif (lastPendingMessageId !== cellOpMetadata.pendingMessageId) {\n\t\t\t\tthrow new Error(\"Rollback op does not match last pending\");\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Error(\"Unsupported op for rollback\");\n\t\t}\n\t}\n\n\t/**\n\t * Submit a cell message to remote clients.\n\t *\n\t * @param op - The cell message.\n\t * @param previousValue - The value of the cell before this op.\n\t */\n\tprivate submitCellMessage(op: ICellOperation, previousValue?: Serializable<T>): void {\n\t\tconst localMetadata = this.createLocalOpMetadata(op, previousValue);\n\t\tthis.submitLocalMessage(op, localMetadata);\n\t}\n}\n"]}
@@ -5,17 +5,34 @@
5
5
  import { IChannelAttributes, IFluidDataStoreRuntime, IChannelServices, IChannelFactory } from "@fluidframework/datastore-definitions";
6
6
  import { ISharedCell } from "./interfaces";
7
7
  /**
8
- * The factory that defines the map
8
+ * {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link ISharedCell}.
9
+ *
10
+ * @sealed
9
11
  */
10
12
  export declare class CellFactory implements IChannelFactory {
13
+ /**
14
+ * {@inheritDoc CellFactory."type"}
15
+ */
11
16
  static readonly Type = "https://graph.microsoft.com/types/cell";
17
+ /**
18
+ * {@inheritDoc CellFactory.attributes}
19
+ */
12
20
  static readonly Attributes: IChannelAttributes;
21
+ /**
22
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
23
+ */
13
24
  get type(): string;
25
+ /**
26
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
27
+ */
14
28
  get attributes(): IChannelAttributes;
15
29
  /**
16
30
  * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
17
31
  */
18
32
  load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<ISharedCell>;
33
+ /**
34
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
35
+ */
19
36
  create(document: IFluidDataStoreRuntime, id: string): ISharedCell;
20
37
  }
21
38
  //# sourceMappingURL=cellFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cellFactory.d.ts","sourceRoot":"","sources":["../src/cellFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EAClB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C;;GAEG;AACH,qBAAa,WAAY,YAAW,eAAe;IAC/C,gBAAuB,IAAI,4CAA4C;IAEvE,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF,IAAW,IAAI,WAEd;IAED,IAAW,UAAU,uBAEpB;IAED;;OAEG;IACU,IAAI,CACb,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC;IAMlD,MAAM,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,WAAW;CAK3E"}
1
+ {"version":3,"file":"cellFactory.d.ts","sourceRoot":"","sources":["../src/cellFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C;;;;GAIG;AACH,qBAAa,WAAY,YAAW,eAAe;IAClD;;OAEG;IACH,gBAAuB,IAAI,4CAA4C;IAEvE;;OAEG;IACH,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF;;OAEG;IACH,IAAW,IAAI,IAAI,MAAM,CAExB;IAED;;OAEG;IACH,IAAW,UAAU,IAAI,kBAAkB,CAE1C;IAED;;OAEG;IACU,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC5B,OAAO,CAAC,WAAW,CAAC;IAMvB;;OAEG;IACI,MAAM,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,WAAW;CAKxE"}
@@ -8,12 +8,20 @@ exports.CellFactory = void 0;
8
8
  const cell_1 = require("./cell");
9
9
  const packageVersion_1 = require("./packageVersion");
10
10
  /**
11
- * The factory that defines the map
11
+ * {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link ISharedCell}.
12
+ *
13
+ * @sealed
12
14
  */
13
15
  class CellFactory {
16
+ /**
17
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
18
+ */
14
19
  get type() {
15
20
  return CellFactory.Type;
16
21
  }
22
+ /**
23
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
24
+ */
17
25
  get attributes() {
18
26
  return CellFactory.Attributes;
19
27
  }
@@ -25,6 +33,9 @@ class CellFactory {
25
33
  await cell.load(services);
26
34
  return cell;
27
35
  }
36
+ /**
37
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
38
+ */
28
39
  create(document, id) {
29
40
  const cell = new cell_1.SharedCell(id, document, this.attributes);
30
41
  cell.initializeLocal();
@@ -32,7 +43,13 @@ class CellFactory {
32
43
  }
33
44
  }
34
45
  exports.CellFactory = CellFactory;
46
+ /**
47
+ * {@inheritDoc CellFactory."type"}
48
+ */
35
49
  CellFactory.Type = "https://graph.microsoft.com/types/cell";
50
+ /**
51
+ * {@inheritDoc CellFactory.attributes}
52
+ */
36
53
  CellFactory.Attributes = {
37
54
  type: CellFactory.Type,
38
55
  snapshotFormatVersion: "0.1",
@@ -1 +1 @@
1
- {"version":3,"file":"cellFactory.js","sourceRoot":"","sources":["../src/cellFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,iCAAoC;AAEpC,qDAA8C;AAE9C;;GAEG;AACH,MAAa,WAAW;IASpB,IAAW,IAAI;QACX,OAAO,WAAW,CAAC,IAAI,CAAC;IAC5B,CAAC;IAED,IAAW,UAAU;QACjB,OAAO,WAAW,CAAC,UAAU,CAAC;IAClC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CACb,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAC9B,MAAM,IAAI,GAAG,IAAI,iBAAU,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACrD,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,MAAM,CAAC,QAAgC,EAAE,EAAU;QACtD,MAAM,IAAI,GAAG,IAAI,iBAAU,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3D,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IAChB,CAAC;;AAlCL,kCAmCC;AAlC0B,gBAAI,GAAG,wCAAwC,CAAC;AAEhD,sBAAU,GAAuB;IACpD,IAAI,EAAE,WAAW,CAAC,IAAI;IACtB,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,2BAAU;CAC7B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelServices,\n IChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { SharedCell } from \"./cell\";\nimport { ISharedCell } from \"./interfaces\";\nimport { pkgVersion } from \"./packageVersion\";\n\n/**\n * The factory that defines the map\n */\nexport class CellFactory implements IChannelFactory {\n public static readonly Type = \"https://graph.microsoft.com/types/cell\";\n\n public static readonly Attributes: IChannelAttributes = {\n type: CellFactory.Type,\n snapshotFormatVersion: \"0.1\",\n packageVersion: pkgVersion,\n };\n\n public get type() {\n return CellFactory.Type;\n }\n\n public get attributes() {\n return CellFactory.Attributes;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n */\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes): Promise<ISharedCell> {\n const cell = new SharedCell(id, runtime, attributes);\n await cell.load(services);\n return cell;\n }\n\n public create(document: IFluidDataStoreRuntime, id: string): ISharedCell {\n const cell = new SharedCell(id, document, this.attributes);\n cell.initializeLocal();\n return cell;\n }\n}\n"]}
1
+ {"version":3,"file":"cellFactory.js","sourceRoot":"","sources":["../src/cellFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,iCAAoC;AAEpC,qDAA8C;AAE9C;;;;GAIG;AACH,MAAa,WAAW;IAevB;;OAEG;IACH,IAAW,IAAI;QACd,OAAO,WAAW,CAAC,IAAI,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,WAAW,CAAC,UAAU,CAAC;IAC/B,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,IAAI,GAAG,IAAI,iBAAU,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACrD,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,QAAgC,EAAE,EAAU;QACzD,MAAM,IAAI,GAAG,IAAI,iBAAU,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3D,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACb,CAAC;;AAlDF,kCAmDC;AAlDA;;GAEG;AACoB,gBAAI,GAAG,wCAAwC,CAAC;AAEvE;;GAEG;AACoB,sBAAU,GAAuB;IACvD,IAAI,EAAE,WAAW,CAAC,IAAI;IACtB,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,2BAAU;CAC1B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { SharedCell } from \"./cell\";\nimport { ISharedCell } from \"./interfaces\";\nimport { pkgVersion } from \"./packageVersion\";\n\n/**\n * {@link @fluidframework/datastore-definitions#IChannelFactory} for {@link ISharedCell}.\n *\n * @sealed\n */\nexport class CellFactory implements IChannelFactory {\n\t/**\n\t * {@inheritDoc CellFactory.\"type\"}\n\t */\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/cell\";\n\n\t/**\n\t * {@inheritDoc CellFactory.attributes}\n\t */\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: CellFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic get type(): string {\n\t\treturn CellFactory.Type;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic get attributes(): IChannelAttributes {\n\t\treturn CellFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<ISharedCell> {\n\t\tconst cell = new SharedCell(id, runtime, attributes);\n\t\tawait cell.load(services);\n\t\treturn cell;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}\n\t */\n\tpublic create(document: IFluidDataStoreRuntime, id: string): ISharedCell {\n\t\tconst cell = new SharedCell(id, document, this.attributes);\n\t\tcell.initializeLocal();\n\t\treturn cell;\n\t}\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -2,6 +2,11 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
+ /**
6
+ * The `SharedCell` Distributed Data Structure (DDS) stores a single, shared value that can be edited or deleted.
7
+ *
8
+ * @packageDocumentation
9
+ */
5
10
  export { SharedCell } from "./cell";
6
- export { ISharedCell, ISharedCellEvents } from "./interfaces";
11
+ export { ISharedCell, ISharedCellEvents, AttributionKey, ICellOptions, ICellAttributionOptions, } from "./interfaces";
7
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EACN,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,uBAAuB,GACvB,MAAM,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -5,6 +5,11 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.SharedCell = void 0;
8
+ /**
9
+ * The `SharedCell` Distributed Data Structure (DDS) stores a single, shared value that can be edited or deleted.
10
+ *
11
+ * @packageDocumentation
12
+ */
8
13
  var cell_1 = require("./cell");
9
14
  Object.defineProperty(exports, "SharedCell", { enumerable: true, get: function () { return cell_1.SharedCell; } });
10
15
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAAoC;AAA3B,kGAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { SharedCell } from \"./cell\";\nexport { ISharedCell, ISharedCellEvents } from \"./interfaces\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AAEH,+BAAoC;AAA3B,kGAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * The `SharedCell` Distributed Data Structure (DDS) stores a single, shared value that can be edited or deleted.\n *\n * @packageDocumentation\n */\n\nexport { SharedCell } from \"./cell\";\nexport {\n\tISharedCell,\n\tISharedCellEvents,\n\tAttributionKey,\n\tICellOptions,\n\tICellAttributionOptions,\n} from \"./interfaces\";\n"]}
@@ -4,12 +4,70 @@
4
4
  */
5
5
  import { ISharedObject, ISharedObjectEvents } from "@fluidframework/shared-object-base";
6
6
  import { Serializable } from "@fluidframework/datastore-definitions";
7
+ /**
8
+ * Events emitted by {@link ISharedCell}.
9
+ */
7
10
  export interface ISharedCellEvents<T> extends ISharedObjectEvents {
11
+ /**
12
+ * Emitted when the value has changed.
13
+ *
14
+ * @remarks Event paramters:
15
+ *
16
+ * - `value`: The new value of the cell.
17
+ */
8
18
  (event: "valueChanged", listener: (value: Serializable<T>) => void): any;
19
+ /**
20
+ * Emitted when the value has been deleted.
21
+ */
9
22
  (event: "delete", listener: () => void): any;
10
23
  }
11
24
  /**
12
- * Shared cell interface
25
+ * A Distributed Data Structure (DDS), which stores a single shared value that can be edited or deleted.
26
+ *
27
+ * @typeParam T - The type of cell data. Must be serializable.
28
+ *
29
+ * @example Creation:
30
+ *
31
+ * To create a `SharedCell`, call the static create method:
32
+ *
33
+ * ```typescript
34
+ * const myCell = SharedCell.create(this.runtime, id);
35
+ * ```
36
+ *
37
+ * @example Usage:
38
+ *
39
+ * The value stored in the cell can be set with the `.set()` method and retrieved with the `.get()` method:
40
+ *
41
+ * ```typescript
42
+ * myCell.set(3);
43
+ * console.log(myCell.get()); // 3
44
+ * ```
45
+ *
46
+ * The value must only be plain JS objects or `SharedObject` handles (e.g. to another DDS or Fluid object).
47
+ * In collaborative scenarios, the value is settled with a policy of _last write wins_.
48
+ *
49
+ * The `.delete()` method will delete the stored value from the cell:
50
+ *
51
+ * ```typescript
52
+ * myCell.delete();
53
+ * console.log(myCell.get()); // undefined
54
+ * ```
55
+ *
56
+ * The `.empty()` method will check if the value is undefined.
57
+ *
58
+ * ```typescript
59
+ * if (myCell.empty()) {
60
+ * // myCell.get() will return undefined
61
+ * } else {
62
+ * // myCell.get() will return a non-undefined value
63
+ * }
64
+ * ```
65
+ *
66
+ * @example Eventing:
67
+ *
68
+ * `SharedCell` is an `EventEmitter`, and will emit events when other clients make modifications. You should
69
+ * register for these events and respond appropriately as the data is modified. `valueChanged` will be emitted
70
+ * in response to a `set`, and `delete` will be emitted in response to a `delete`.
13
71
  */
14
72
  export interface ISharedCell<T = any> extends ISharedObject<ISharedCellEvents<T>> {
15
73
  /**
@@ -34,9 +92,64 @@ export interface ISharedCell<T = any> extends ISharedObject<ISharedCellEvents<T>
34
92
  * Delete the value from the cell.
35
93
  */
36
94
  delete(): void;
95
+ /**
96
+ * @alpha
97
+ * @returns the AttributionKey associated with the cell's most recent change.
98
+ */
99
+ getAttribution(): AttributionKey | undefined;
37
100
  }
38
- export interface ICellLocalOpMetadata {
101
+ /**
102
+ * Describes a local Cell operation (op).
103
+ */
104
+ export interface ICellLocalOpMetadata<T = any> {
105
+ /**
106
+ * Unique identifier for this local operation (op).
107
+ */
39
108
  pendingMessageId: number;
40
- previousValue?: any;
109
+ /**
110
+ * The value of the {@link ISharedCell} prior to this operation (op).
111
+ */
112
+ previousValue?: Serializable<T>;
113
+ }
114
+ /**
115
+ * Options related to attribution
116
+ *
117
+ * @alpha
118
+ */
119
+ export interface ICellOptions {
120
+ attribution?: ICellAttributionOptions;
121
+ }
122
+ /**
123
+ * This enables the cell to store the attribution information which can be accessed with the runtime
124
+ * (i.e. who creeated the content and when it was created)
125
+ *
126
+ * default: false
127
+ *
128
+ * @alpha
129
+ */
130
+ export interface ICellAttributionOptions {
131
+ track?: boolean;
132
+ }
133
+ /**
134
+ * Can be indexed into the ContainerRuntime in order to retrieve attribution info.
135
+ *
136
+ * @alpha
137
+ */
138
+ export interface AttributionKey {
139
+ /**
140
+ * The type of attribution this key corresponds to.
141
+ *
142
+ * Keys currently all represent op-based attribution, so have the form `{ type: "op", key: sequenceNumber }`.
143
+ * Thus, they can be used with an `OpStreamAttributor` to recover timestamp/user information.
144
+ *
145
+ * @remarks - If we want to support different types of attribution, a reasonable extensibility point is to make
146
+ * AttributionKey a discriminated union on the 'type' field. This would empower
147
+ * consumers with the ability to implement different attribution policies.
148
+ */
149
+ type: "op";
150
+ /**
151
+ * The sequenceNumber of the op this attribution key is for.
152
+ */
153
+ seq: number;
41
154
  }
42
155
  //# sourceMappingURL=interfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAErE,MAAM,WAAW,iBAAiB,CAAC,CAAC,CAAE,SAAQ,mBAAmB;IAC7D,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,OAAE;IACpE,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,IAAI,OAAE;CAC3C;AAED;;GAEG;AAEH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,aAAa,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAC7E;;;;OAIG;IACH,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAEnC;;;;OAIG;IACH,GAAG,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAElC;;;;OAIG;IACH,KAAK,IAAI,OAAO,CAAC;IAEjB;;OAEG;IACH,MAAM,IAAI,IAAI,CAAC;CAClB;AACD,MAAM,WAAW,oBAAoB;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,GAAG,CAAC;CACvB"}
1
+ {"version":3,"file":"interfaces.d.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ACH,MAAM,WAAW,uBAAuB;IACvC,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC9B;;;;;;;;;OASG;IACH,IAAI,EAAE,IAAI,CAAC;IAEX;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACZ"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISharedObject, ISharedObjectEvents } from \"@fluidframework/shared-object-base\";\nimport { Serializable } from \"@fluidframework/datastore-definitions\";\n\nexport interface ISharedCellEvents<T> extends ISharedObjectEvents {\n (event: \"valueChanged\", listener: (value: Serializable<T>) => void);\n (event: \"delete\", listener: () => void);\n}\n\n/**\n * Shared cell interface\n */\n\nexport interface ISharedCell<T = any> extends ISharedObject<ISharedCellEvents<T>> {\n /**\n * Retrieves the cell value.\n *\n * @returns - the value of the cell\n */\n get(): Serializable<T> | undefined;\n\n /**\n * Sets the cell value.\n *\n * @param value - a JSON-able or SharedObject value to set the cell to\n */\n set(value: Serializable<T>): void;\n\n /**\n * Checks whether cell is empty or not.\n *\n * @returns - `true` if the value of cell is `undefined`, `false` otherwise\n */\n empty(): boolean;\n\n /**\n * Delete the value from the cell.\n */\n delete(): void;\n}\nexport interface ICellLocalOpMetadata {\n pendingMessageId: number;\n previousValue?: any;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISharedObject, ISharedObjectEvents } from \"@fluidframework/shared-object-base\";\nimport { Serializable } from \"@fluidframework/datastore-definitions\";\n\n/**\n * Events emitted by {@link ISharedCell}.\n */\nexport interface ISharedCellEvents<T> extends ISharedObjectEvents {\n\t/**\n\t * Emitted when the value has changed.\n\t *\n\t * @remarks Event paramters:\n\t *\n\t * - `value`: The new value of the cell.\n\t */\n\t(event: \"valueChanged\", listener: (value: Serializable<T>) => void);\n\n\t/**\n\t * Emitted when the value has been deleted.\n\t */\n\t(event: \"delete\", listener: () => void);\n}\n\n/**\n * A Distributed Data Structure (DDS), which stores a single shared value that can be edited or deleted.\n *\n * @typeParam T - The type of cell data. Must be serializable.\n *\n * @example Creation:\n *\n * To create a `SharedCell`, call the static create method:\n *\n * ```typescript\n * const myCell = SharedCell.create(this.runtime, id);\n * ```\n *\n * @example Usage:\n *\n * The value stored in the cell can be set with the `.set()` method and retrieved with the `.get()` method:\n *\n * ```typescript\n * myCell.set(3);\n * console.log(myCell.get()); // 3\n * ```\n *\n * The value must only be plain JS objects or `SharedObject` handles (e.g. to another DDS or Fluid object).\n * In collaborative scenarios, the value is settled with a policy of _last write wins_.\n *\n * The `.delete()` method will delete the stored value from the cell:\n *\n * ```typescript\n * myCell.delete();\n * console.log(myCell.get()); // undefined\n * ```\n *\n * The `.empty()` method will check if the value is undefined.\n *\n * ```typescript\n * if (myCell.empty()) {\n * // myCell.get() will return undefined\n * } else {\n * // myCell.get() will return a non-undefined value\n * }\n * ```\n *\n * @example Eventing:\n *\n * `SharedCell` is an `EventEmitter`, and will emit events when other clients make modifications. You should\n * register for these events and respond appropriately as the data is modified. `valueChanged` will be emitted\n * in response to a `set`, and `delete` will be emitted in response to a `delete`.\n */\n// TODO: use `unknown` instead (breaking change).\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface ISharedCell<T = any> extends ISharedObject<ISharedCellEvents<T>> {\n\t/**\n\t * Retrieves the cell value.\n\t *\n\t * @returns - the value of the cell\n\t */\n\tget(): Serializable<T> | undefined;\n\n\t/**\n\t * Sets the cell value.\n\t *\n\t * @param value - a JSON-able or SharedObject value to set the cell to\n\t */\n\tset(value: Serializable<T>): void;\n\n\t/**\n\t * Checks whether cell is empty or not.\n\t *\n\t * @returns - `true` if the value of cell is `undefined`, `false` otherwise\n\t */\n\tempty(): boolean;\n\n\t/**\n\t * Delete the value from the cell.\n\t */\n\tdelete(): void;\n\n\t/**\n\t * @alpha\n\t * @returns the AttributionKey associated with the cell's most recent change.\n\t */\n\tgetAttribution(): AttributionKey | undefined;\n}\n\n/**\n * Describes a local Cell operation (op).\n */\n// TODO: use `unknown` instead.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface ICellLocalOpMetadata<T = any> {\n\t/**\n\t * Unique identifier for this local operation (op).\n\t */\n\tpendingMessageId: number;\n\n\t/**\n\t * The value of the {@link ISharedCell} prior to this operation (op).\n\t */\n\tpreviousValue?: Serializable<T>;\n}\n\n/**\n * Options related to attribution\n *\n * @alpha\n */\nexport interface ICellOptions {\n\tattribution?: ICellAttributionOptions;\n}\n\n/**\n * This enables the cell to store the attribution information which can be accessed with the runtime\n * (i.e. who creeated the content and when it was created)\n *\n * default: false\n *\n * @alpha\n */\nexport interface ICellAttributionOptions {\n\ttrack?: boolean;\n}\n\n/**\n * Can be indexed into the ContainerRuntime in order to retrieve attribution info.\n *\n * @alpha\n */\nexport interface AttributionKey {\n\t/**\n\t * The type of attribution this key corresponds to.\n\t *\n\t * Keys currently all represent op-based attribution, so have the form `{ type: \"op\", key: sequenceNumber }`.\n\t * Thus, they can be used with an `OpStreamAttributor` to recover timestamp/user information.\n\t *\n\t * @remarks - If we want to support different types of attribution, a reasonable extensibility point is to make\n\t * AttributionKey a discriminated union on the 'type' field. This would empower\n\t * consumers with the ability to implement different attribution policies.\n\t */\n\ttype: \"op\";\n\n\t/**\n\t * The sequenceNumber of the op this attribution key is for.\n\t */\n\tseq: number;\n}\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/cell";
8
- export declare const pkgVersion = "2.0.0-dev.2.3.0.115467";
8
+ export declare const pkgVersion = "2.0.0-dev.3.1.0.125672";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/cell";
11
- exports.pkgVersion = "2.0.0-dev.2.3.0.115467";
11
+ exports.pkgVersion = "2.0.0-dev.3.1.0.125672";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sBAAsB,CAAC;AACjC,QAAA,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/cell\";\nexport const pkgVersion = \"2.0.0-dev.2.3.0.115467\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,sBAAsB,CAAC;AACjC,QAAA,UAAU,GAAG,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/cell\";\nexport const pkgVersion = \"2.0.0-dev.3.1.0.125672\";\n"]}
package/lib/cell.d.ts CHANGED
@@ -6,67 +6,24 @@ import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions"
6
6
  import { IChannelAttributes, IFluidDataStoreRuntime, IChannelStorageService, IChannelFactory, Serializable } from "@fluidframework/datastore-definitions";
7
7
  import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
8
8
  import { IFluidSerializer, SharedObject } from "@fluidframework/shared-object-base";
9
- import { ISharedCell, ISharedCellEvents } from "./interfaces";
9
+ import { ISharedCell, ISharedCellEvents, AttributionKey, ICellOptions } from "./interfaces";
10
10
  /**
11
- * The SharedCell distributed data structure can be used to store a single serializable value.
12
- *
13
- * @remarks
14
- * ### Creation
15
- *
16
- * To create a `SharedCell`, call the static create method:
17
- *
18
- * ```typescript
19
- * const myCell = SharedCell.create(this.runtime, id);
20
- * ```
21
- *
22
- * ### Usage
23
- *
24
- * The value stored in the cell can be set with the `.set()` method and retrieved with the `.get()` method:
25
- *
26
- * ```typescript
27
- * myCell.set(3);
28
- * console.log(myCell.get()); // 3
29
- * ```
30
- *
31
- * The value must only be plain JS objects or `SharedObject` handles (e.g. to another DDS or Fluid object).
32
- * In collaborative scenarios, the value is settled with a policy of _last write wins_.
33
- *
34
- * The `.delete()` method will delete the stored value from the cell:
35
- *
36
- * ```typescript
37
- * myCell.delete();
38
- * console.log(myCell.get()); // undefined
39
- * ```
40
- *
41
- * The `.empty()` method will check if the value is undefined.
42
- *
43
- * ```typescript
44
- * if (myCell.empty()) {
45
- * // myCell.get() will return undefined
46
- * } else {
47
- * // myCell.get() will return a non-undefined value
48
- * }
49
- * ```
50
- *
51
- * ### Eventing
52
- *
53
- * `SharedCell` is an `EventEmitter`, and will emit events when other clients make modifications. You should
54
- * register for these events and respond appropriately as the data is modified. `valueChanged` will be emitted
55
- * in response to a `set`, and `delete` will be emitted in response to a `delete`.
11
+ * {@inheritDoc ISharedCell}
56
12
  */
57
13
  export declare class SharedCell<T = any> extends SharedObject<ISharedCellEvents<T>> implements ISharedCell<T> {
58
14
  /**
59
- * Create a new shared cell
15
+ * Create a new `SharedCell`.
60
16
  *
61
- * @param runtime - data store runtime the new shared map belongs to
62
- * @param id - optional name of the shared map
63
- * @returns newly create shared map (but not attached yet)
17
+ * @param runtime - The data store runtime to which the `SharedCell` belongs.
18
+ * @param id - Unique identifier for the `SharedCell`.
19
+ *
20
+ * @returns The newly create `SharedCell`. Note that it will not yet be attached.
64
21
  */
65
- static create(runtime: IFluidDataStoreRuntime, id?: string): SharedCell<any>;
22
+ static create(runtime: IFluidDataStoreRuntime, id?: string): SharedCell;
66
23
  /**
67
- * Get a factory for SharedCell to register with the data store.
24
+ * Gets the factory for the `SharedCell` to register with the data store.
68
25
  *
69
- * @returns a factory that creates and load SharedCell
26
+ * @returns A factory that creates and loads `SharedCell`s.
70
27
  */
71
28
  static getFactory(): IChannelFactory;
72
29
  /**
@@ -84,14 +41,18 @@ export declare class SharedCell<T = any> extends SharedObject<ISharedCellEvents<
84
41
  */
85
42
  private messageIdObserved;
86
43
  private readonly pendingMessageIds;
44
+ private attribution;
45
+ private readonly options;
87
46
  /**
88
- * Constructs a new shared cell. If the object is non-local an id and service interfaces will
89
- * be provided
47
+ * Constructs a new `SharedCell`.
48
+ * If the object is non-local an id and service interfaces will be provided.
49
+ *
50
+ * @alpha
90
51
  *
91
- * @param runtime - data store runtime the shared map belongs to
92
- * @param id - optional name of the shared map
52
+ * @param runtime - The data store runtime to which the `SharedCell` belongs.
53
+ * @param id - Unique identifier for the `SharedCell`.
93
54
  */
94
- constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
55
+ constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes, options?: ICellOptions);
95
56
  /**
96
57
  * {@inheritDoc ISharedCell.get}
97
58
  */
@@ -109,9 +70,18 @@ export declare class SharedCell<T = any> extends SharedObject<ISharedCellEvents<
109
70
  */
110
71
  empty(): boolean;
111
72
  /**
112
- * Create a summary for the cell
73
+ * {@inheritDoc ISharedCell.getAttribution}
74
+ * @alpha
75
+ */
76
+ getAttribution(): AttributionKey | undefined;
77
+ /**
78
+ * Set the attribution through the SequencedDocumentMessage
79
+ */
80
+ private setAttribution;
81
+ /**
82
+ * Creates a summary for the Cell.
113
83
  *
114
- * @returns the summary of the current state of the cell
84
+ * @returns The summary of the current state of the Cell.
115
85
  */
116
86
  protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
117
87
  /**
@@ -119,25 +89,26 @@ export declare class SharedCell<T = any> extends SharedObject<ISharedCellEvents<
119
89
  */
120
90
  protected loadCore(storage: IChannelStorageService): Promise<void>;
121
91
  /**
122
- * Initialize a local instance of cell
92
+ * Initialize a local instance of cell.
123
93
  */
124
94
  protected initializeLocalCore(): void;
125
95
  /**
126
- * Call back on disconnect
96
+ * Call back on disconnect.
127
97
  */
128
98
  protected onDisconnect(): void;
129
99
  /**
130
- * Apply inner op
100
+ * Apply inner op.
101
+ *
131
102
  * @param content - ICellOperation content
132
103
  */
133
104
  private applyInnerOp;
134
105
  /**
135
- * Process a cell operation
106
+ * Process a cell operation (op).
136
107
  *
137
- * @param message - the message to prepare
138
- * @param local - whether the message was sent by the local client
108
+ * @param message - The message to prepare.
109
+ * @param local - Whether or not the message was sent by the local client.
139
110
  * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
140
- * For messages from a remote client, this will be undefined.
111
+ * For messages from a remote client, this will be `undefined`.
141
112
  */
142
113
  protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
143
114
  private setCore;
@@ -146,20 +117,23 @@ export declare class SharedCell<T = any> extends SharedObject<ISharedCellEvents<
146
117
  private createLocalOpMetadata;
147
118
  /**
148
119
  * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
120
+ *
149
121
  * @internal
150
122
  */
151
123
  protected applyStashedOp(content: unknown): unknown;
152
124
  /**
153
- * Rollback a local op
154
- * @param content - The operation to rollback
125
+ * Rollback a local op.
126
+ *
127
+ * @param content - The operation to rollback.
155
128
  * @param localOpMetadata - The local metadata associated with the op.
156
129
  */
157
130
  protected rollback(content: any, localOpMetadata: unknown): void;
158
131
  /**
159
- * Submit a cell message to remote clients.
160
- * @param op - The cell message
161
- * @param previousValue - The value of the cell before this op
162
- */
132
+ * Submit a cell message to remote clients.
133
+ *
134
+ * @param op - The cell message.
135
+ * @param previousValue - The value of the cell before this op.
136
+ */
163
137
  private submitCellMessage;
164
138
  }
165
139
  //# sourceMappingURL=cell.d.ts.map
package/lib/cell.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cell.d.ts","sourceRoot":"","sources":["../src/cell.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,yBAAyB,EAAe,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,YAAY,EACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,OAAO,EAA2B,gBAAgB,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAE7G,OAAO,EACH,WAAW,EACX,iBAAiB,EAEpB,MAAM,cAAc,CAAC;AAuBtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,qBAAa,UAAU,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,YAAY,CAAC,iBAAiB,CAAC,CAAC,CAAC,CACtE,YAAW,WAAW,CAAC,CAAC,CAAC;IACzB;;;;;;OAMG;WACW,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,CAAC,EAAE,MAAM;IAIjE;;;;OAIG;WACW,UAAU,IAAI,eAAe;IAG3C;;OAEG;IACH,OAAO,CAAC,IAAI,CAA8B;IAE1C;;;OAGG;IACH,OAAO,CAAC,SAAS,CAAc;IAE/B;;;OAGG;IACH,OAAO,CAAC,iBAAiB,CAAc;IAEvC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAgB;IAElD;;;;;;OAMG;gBACS,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,kBAAkB;IAIvF;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