@fluidframework/legacy-dds 2.50.0-345060

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 (140) hide show
  1. package/.eslintrc.cjs +11 -0
  2. package/.mocharc.cjs +12 -0
  3. package/CHANGELOG.md +13 -0
  4. package/LICENSE +21 -0
  5. package/api-extractor/api-extractor-lint-bundle.json +5 -0
  6. package/api-extractor/api-extractor-lint-legacy.cjs.json +5 -0
  7. package/api-extractor/api-extractor-lint-legacy.esm.json +5 -0
  8. package/api-extractor/api-extractor-lint-public.cjs.json +5 -0
  9. package/api-extractor/api-extractor-lint-public.esm.json +5 -0
  10. package/api-extractor/api-extractor.current.json +5 -0
  11. package/api-extractor/api-extractor.legacy.json +4 -0
  12. package/api-extractor-lint.json +4 -0
  13. package/api-extractor.json +4 -0
  14. package/api-report/legacy-dds.beta.api.md +9 -0
  15. package/api-report/legacy-dds.legacy.alpha.api.md +140 -0
  16. package/api-report/legacy-dds.legacy.public.api.md +9 -0
  17. package/api-report/legacy-dds.public.api.md +9 -0
  18. package/biome.jsonc +4 -0
  19. package/dist/array/index.d.ts +10 -0
  20. package/dist/array/index.d.ts.map +1 -0
  21. package/dist/array/index.js +16 -0
  22. package/dist/array/index.js.map +1 -0
  23. package/dist/array/interfaces.d.ts +142 -0
  24. package/dist/array/interfaces.d.ts.map +1 -0
  25. package/dist/array/interfaces.js +7 -0
  26. package/dist/array/interfaces.js.map +1 -0
  27. package/dist/array/sharedArray.d.ts +175 -0
  28. package/dist/array/sharedArray.d.ts.map +1 -0
  29. package/dist/array/sharedArray.js +652 -0
  30. package/dist/array/sharedArray.js.map +1 -0
  31. package/dist/array/sharedArrayFactory.d.ts +31 -0
  32. package/dist/array/sharedArrayFactory.d.ts.map +1 -0
  33. package/dist/array/sharedArrayFactory.js +61 -0
  34. package/dist/array/sharedArrayFactory.js.map +1 -0
  35. package/dist/array/sharedArrayOperations.d.ts +77 -0
  36. package/dist/array/sharedArrayOperations.d.ts.map +1 -0
  37. package/dist/array/sharedArrayOperations.js +19 -0
  38. package/dist/array/sharedArrayOperations.js.map +1 -0
  39. package/dist/array/sharedArrayRevertible.d.ts +17 -0
  40. package/dist/array/sharedArrayRevertible.d.ts.map +1 -0
  41. package/dist/array/sharedArrayRevertible.js +47 -0
  42. package/dist/array/sharedArrayRevertible.js.map +1 -0
  43. package/dist/index.d.ts +14 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +20 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/legacy.d.ts +31 -0
  48. package/dist/package.json +4 -0
  49. package/dist/packageVersion.d.ts +9 -0
  50. package/dist/packageVersion.d.ts.map +1 -0
  51. package/dist/packageVersion.js +12 -0
  52. package/dist/packageVersion.js.map +1 -0
  53. package/dist/public.d.ts +12 -0
  54. package/dist/signal/index.d.ts +7 -0
  55. package/dist/signal/index.d.ts.map +1 -0
  56. package/dist/signal/index.js +11 -0
  57. package/dist/signal/index.js.map +1 -0
  58. package/dist/signal/interfaces.d.ts +36 -0
  59. package/dist/signal/interfaces.d.ts.map +1 -0
  60. package/dist/signal/interfaces.js +7 -0
  61. package/dist/signal/interfaces.js.map +1 -0
  62. package/dist/signal/sharedSignal.d.ts +68 -0
  63. package/dist/signal/sharedSignal.d.ts.map +1 -0
  64. package/dist/signal/sharedSignal.js +122 -0
  65. package/dist/signal/sharedSignal.js.map +1 -0
  66. package/dist/signal/sharedSignalFactory.d.ts +24 -0
  67. package/dist/signal/sharedSignalFactory.d.ts.map +1 -0
  68. package/dist/signal/sharedSignalFactory.js +45 -0
  69. package/dist/signal/sharedSignalFactory.js.map +1 -0
  70. package/internal.d.ts +11 -0
  71. package/legacy.d.ts +11 -0
  72. package/lib/array/index.d.ts +10 -0
  73. package/lib/array/index.d.ts.map +1 -0
  74. package/lib/array/index.js +8 -0
  75. package/lib/array/index.js.map +1 -0
  76. package/lib/array/interfaces.d.ts +142 -0
  77. package/lib/array/interfaces.d.ts.map +1 -0
  78. package/lib/array/interfaces.js +6 -0
  79. package/lib/array/interfaces.js.map +1 -0
  80. package/lib/array/sharedArray.d.ts +175 -0
  81. package/lib/array/sharedArray.d.ts.map +1 -0
  82. package/lib/array/sharedArray.js +648 -0
  83. package/lib/array/sharedArray.js.map +1 -0
  84. package/lib/array/sharedArrayFactory.d.ts +31 -0
  85. package/lib/array/sharedArrayFactory.d.ts.map +1 -0
  86. package/lib/array/sharedArrayFactory.js +56 -0
  87. package/lib/array/sharedArrayFactory.js.map +1 -0
  88. package/lib/array/sharedArrayOperations.d.ts +77 -0
  89. package/lib/array/sharedArrayOperations.d.ts.map +1 -0
  90. package/lib/array/sharedArrayOperations.js +16 -0
  91. package/lib/array/sharedArrayOperations.js.map +1 -0
  92. package/lib/array/sharedArrayRevertible.d.ts +17 -0
  93. package/lib/array/sharedArrayRevertible.d.ts.map +1 -0
  94. package/lib/array/sharedArrayRevertible.js +43 -0
  95. package/lib/array/sharedArrayRevertible.js.map +1 -0
  96. package/lib/index.d.ts +14 -0
  97. package/lib/index.d.ts.map +1 -0
  98. package/lib/index.js +10 -0
  99. package/lib/index.js.map +1 -0
  100. package/lib/legacy.d.ts +31 -0
  101. package/lib/packageVersion.d.ts +9 -0
  102. package/lib/packageVersion.d.ts.map +1 -0
  103. package/lib/packageVersion.js +9 -0
  104. package/lib/packageVersion.js.map +1 -0
  105. package/lib/public.d.ts +12 -0
  106. package/lib/signal/index.d.ts +7 -0
  107. package/lib/signal/index.d.ts.map +1 -0
  108. package/lib/signal/index.js +6 -0
  109. package/lib/signal/index.js.map +1 -0
  110. package/lib/signal/interfaces.d.ts +36 -0
  111. package/lib/signal/interfaces.d.ts.map +1 -0
  112. package/lib/signal/interfaces.js +6 -0
  113. package/lib/signal/interfaces.js.map +1 -0
  114. package/lib/signal/sharedSignal.d.ts +68 -0
  115. package/lib/signal/sharedSignal.d.ts.map +1 -0
  116. package/lib/signal/sharedSignal.js +118 -0
  117. package/lib/signal/sharedSignal.js.map +1 -0
  118. package/lib/signal/sharedSignalFactory.d.ts +24 -0
  119. package/lib/signal/sharedSignalFactory.d.ts.map +1 -0
  120. package/lib/signal/sharedSignalFactory.js +41 -0
  121. package/lib/signal/sharedSignalFactory.js.map +1 -0
  122. package/lib/tsdoc-metadata.json +11 -0
  123. package/package.json +158 -0
  124. package/src/array/README.md +32 -0
  125. package/src/array/index.ts +28 -0
  126. package/src/array/interfaces.ts +169 -0
  127. package/src/array/sharedArray.ts +835 -0
  128. package/src/array/sharedArrayFactory.ts +88 -0
  129. package/src/array/sharedArrayOperations.ts +89 -0
  130. package/src/array/sharedArrayRevertible.ts +50 -0
  131. package/src/index.ts +32 -0
  132. package/src/packageVersion.ts +9 -0
  133. package/src/signal/README.md +25 -0
  134. package/src/signal/index.ts +12 -0
  135. package/src/signal/interfaces.ts +53 -0
  136. package/src/signal/sharedSignal.ts +169 -0
  137. package/src/signal/sharedSignalFactory.ts +62 -0
  138. package/tsconfig.cjs.json +7 -0
  139. package/tsconfig.json +10 -0
  140. package/tsdoc.json +4 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedArray.js","sourceRoot":"","sources":["../../src/array/sharedArray.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAY7D,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AAE/F,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAEvF,OAAO,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAC3E,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAWlC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAQ7D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,MAAM,gBAAgB,GAAG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C,CAAC;QAC1D,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;QAElD,0FAA0F;QAC1F,6FAA6F;QAC7F,IAAI,aAAa,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YAC7C,SAAS,CAAC,WAAW,GAAG,aAAa,CAAC,WAAW,CAAC;YAClD,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,WAAW,GAAG,WAAW,CAAC;QACzE,CAAC;QAED,oEAAoE;QACpE,aAAa,CAAC,WAAW,GAAG,WAAW,CAAC;QACxC,SAAS,CAAC,WAAW,GAAG,eAAe,CAAC;QACxC,SAAS,CAAC,SAAS,GAAG,IAAI,CAAC;IAC5B,CAAC;IAES,cAAc,CAAC,QAAiB;QACzC,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type {\n\tSerializable,\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelFactory,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tISequencedDocumentMessage,\n\tITree,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { FileMode, MessageType, TreeEntry } from \"@fluidframework/driver-definitions/internal\";\nimport type { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions/internal\";\nimport { convertToSummaryTreeWithStats } from \"@fluidframework/runtime-utils/internal\";\nimport type { IFluidSerializer } from \"@fluidframework/shared-object-base/internal\";\nimport { SharedObject } from \"@fluidframework/shared-object-base/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport type {\n\tISharedArrayEvents,\n\tISharedArray,\n\tISharedArrayRevertible,\n\tSerializableTypeForSharedArray,\n\tSharedArrayEntry,\n\tSnapshotFormat,\n\tSharedArrayEntryCore,\n} from \"./interfaces.js\";\nimport { SharedArrayFactory } from \"./sharedArrayFactory.js\";\nimport type {\n\tISharedArrayOperation,\n\tIDeleteOperation,\n\tIMoveOperation,\n\tIToggleMoveOperation,\n\tIToggleOperation,\n} from \"./sharedArrayOperations.js\";\nimport { OperationType } from \"./sharedArrayOperations.js\";\nimport { SharedArrayRevertible } from \"./sharedArrayRevertible.js\";\n\nconst snapshotFileName = \"header\";\n\n/**\n * Represents a shared array that allows communication between distributed clients.\n *\n * @internal\n */\nexport class SharedArrayClass<T extends SerializableTypeForSharedArray>\n\textends SharedObject<ISharedArrayEvents>\n\timplements ISharedArray<T>, ISharedArrayRevertible\n{\n\t/**\n\t * Stores the data held by this shared array.\n\t */\n\tprivate sharedArray: SharedArrayEntry<T>[];\n\n\t/**\n\t * Stores a map of entryid to entries of the sharedArray. This is meant of search optimizations and\n\t * so shouldn't be snapshotted.\n\t * Note: This map needs to be updated only when the sharedArray is being deserialized and when new entries are\n\t * being added. New entries are added upon insert ops and the second leg of the move op.\n\t * As we don't delete the entries once created, deletion or move to another position needs no special\n\t * handling for this data structure\n\t */\n\tprivate readonly idToEntryMap: Map<string, SharedArrayEntry<T>>;\n\n\t/**\n\t * Create a new shared array\n\t *\n\t * @param runtime - data store runtime the new shared array belongs to\n\t * @param id - optional name of the shared array\n\t * @returns newly create shared array (but not attached yet)\n\t */\n\tpublic static create<T extends SerializableTypeForSharedArray>(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid?: string,\n\t): SharedArrayClass<T> {\n\t\treturn runtime.createChannel(id, SharedArrayFactory.Type) as SharedArrayClass<T>;\n\t}\n\n\t/**\n\t * Get a factory for SharedArray to register with the data store.\n\t *\n\t * @returns a factory that creates and load SharedArray\n\t */\n\tpublic static getFactory<T extends SerializableTypeForSharedArray>(): IChannelFactory {\n\t\treturn new SharedArrayFactory<T>();\n\t}\n\n\t/**\n\t * Constructs a new shared array. If the object is non-local an id and service interfaces will\n\t * be provided\n\t *\n\t * @param id - optional name of the shared array\n\t * @param runtime - data store runtime the shared array belongs to\n\t * @param attributes - represents the attributes of a channel/DDS.\n\t */\n\tpublic constructor(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t) {\n\t\tsuper(id, runtime, attributes, \"loop_sharedArray_\" /* telemetryContextPrefix */);\n\t\tthis.sharedArray = [];\n\t\tthis.idToEntryMap = new Map<string, SharedArrayEntry<T>>();\n\t}\n\n\t/**\n\t * Method that returns the ordered list of the items held in the DDS at this point in time.\n\t * Note: This is only a snapshot of the array\n\t */\n\tpublic get(): readonly T[] {\n\t\treturn this.sharedArray.filter((item) => !item.isDeleted).map((entry) => entry.value);\n\t}\n\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\t// Deep copy and unset the local flags. Needed when snapshotting is happening for runtime not attached\n\t\tconst dataArrayCopy: SharedArrayEntryCore<T>[] = [];\n\t\tfor (const entry of this.sharedArray) {\n\t\t\tdataArrayCopy.push({\n\t\t\t\tentryId: entry.entryId,\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\t\t\tvalue: JSON.parse(serializer.stringify(entry.value, this.handle)),\n\t\t\t\tisDeleted: entry.isDeleted,\n\t\t\t\tprevEntryId: entry.prevEntryId,\n\t\t\t\tnextEntryId: entry.nextEntryId,\n\t\t\t});\n\t\t}\n\n\t\t// We are snapshotting current client data so autoacking pending local.\n\t\t// Assumption : This should happen only for offline client creating the array. All other scenarios should\n\t\t// get to MSN - where there can be no local pending possible.\n\t\tfor (const entry of this.sharedArray) {\n\t\t\tthis.unsetLocalFlags(entry);\n\t\t}\n\t\tconst contents: SnapshotFormat<SharedArrayEntryCore<T>> = {\n\t\t\tdataArray: dataArrayCopy,\n\t\t};\n\t\tconst tree: ITree = {\n\t\t\tentries: [\n\t\t\t\t{\n\t\t\t\t\tmode: FileMode.File,\n\t\t\t\t\tpath: snapshotFileName,\n\t\t\t\t\ttype: TreeEntry[TreeEntry.Blob],\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\tcontents: serializer.stringify(contents, this.handle),\n\t\t\t\t\t\t// eslint-disable-next-line unicorn/text-encoding-identifier-case\n\t\t\t\t\t\tencoding: \"utf-8\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t};\n\t\tconst summaryTreeWithStats = convertToSummaryTreeWithStats(tree);\n\n\t\treturn summaryTreeWithStats;\n\t}\n\n\tpublic insertBulkAfter<TWrite>(\n\t\tref: T | undefined,\n\t\tvalues: (Serializable<TWrite> & T)[],\n\t): void {\n\t\tlet itemIndex: number = 0;\n\n\t\tif (ref !== undefined) {\n\t\t\tfor (itemIndex = this.sharedArray.length - 1; itemIndex > 0; itemIndex -= 1) {\n\t\t\t\tconst item = this.sharedArray[itemIndex];\n\t\t\t\tif (item && !item.isDeleted && item.value === ref) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Add one since we're inserting it after this rowId. If rowId is not found, we will get -1, which after\n\t\t\t// adding one, will be 0, which will place the new rows at the right place too\n\t\t\titemIndex += 1;\n\t\t}\n\n\t\t// Insert new elements\n\t\tfor (const value of values) {\n\t\t\tthis.insertCore(itemIndex, value);\n\t\t\titemIndex += 1;\n\t\t}\n\t}\n\n\tpublic insert<TWrite>(index: number, value: Serializable<TWrite> & T): void {\n\t\tif (index < 0) {\n\t\t\tthrow new Error(\"Invalid input: Insertion index provided is less than 0.\");\n\t\t}\n\t\tthis.insertCore(this.findInternalInsertionIndex(index), value);\n\t}\n\n\tprivate insertCore<TWrite>(indexInternal: number, value: Serializable<TWrite> & T): void {\n\t\tconst insertAfterEntryId =\n\t\t\tindexInternal >= 1 ? this.sharedArray[indexInternal - 1]?.entryId : undefined;\n\t\tconst newEntryId = this.createAddEntry(indexInternal, value);\n\n\t\tconst op = {\n\t\t\ttype: OperationType.insertEntry,\n\t\t\tentryId: newEntryId,\n\t\t\tvalue,\n\t\t\tinsertAfterEntryId,\n\t\t};\n\n\t\tthis.emitValueChangedEvent(op, true /* isLocal */);\n\t\tthis.emitRevertibleEvent(op);\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\tthis.submitLocalMessage(op);\n\t}\n\n\tpublic delete(index: number): void {\n\t\tif (index < 0) {\n\t\t\tthrow new Error(\"Invalid input: Deletion index provided is less than 0.\");\n\t\t}\n\n\t\tconst indexInternal: number = this.findInternalDeletionIndex(index);\n\n\t\tconst entry = this.sharedArray[indexInternal];\n\t\tassert(entry !== undefined, 0xb90 /* Invalid index */);\n\t\tconst entryId = entry.entryId;\n\t\tthis.deleteCore(indexInternal);\n\n\t\tconst op: IDeleteOperation = {\n\t\t\ttype: OperationType.deleteEntry,\n\t\t\tentryId,\n\t\t};\n\t\tthis.emitValueChangedEvent(op, true /* isLocal */);\n\t\tthis.emitRevertibleEvent(op);\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\tthis.submitLocalMessage(op);\n\t}\n\n\tpublic rearrangeToFront(values: T[]): void {\n\t\tfor (let toIndex = 0; toIndex < values.length; toIndex += 1) {\n\t\t\tconst value = values[toIndex];\n\t\t\t// Can skip searching first <toIndex> indices, as they contain elements we already moved.\n\t\t\tfor (let fromIndex = toIndex; fromIndex < this.sharedArray.length; fromIndex += 1) {\n\t\t\t\tconst item = this.sharedArray[fromIndex];\n\t\t\t\tassert(item !== undefined, 0xb91 /* Invalid index */);\n\t\t\t\tif (item.value !== value) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\t!item.isDeleted &&\n\t\t\t\t\t// Moving to and from the same index makes no sense, so noOp\n\t\t\t\t\tfromIndex !== toIndex &&\n\t\t\t\t\t// Moving the same entry from current location to its immediate next makes no sense so noOp\n\t\t\t\t\ttoIndex !== fromIndex + 1\n\t\t\t\t) {\n\t\t\t\t\tthis.moveCore(fromIndex, toIndex);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Moves the DDS entry from one index to another\n\t *\n\t * @param fromIndex - User index of the element to be moved\n\t * @param toIndex - User index to which the element should move to\n\t */\n\tpublic move(fromIndex: number, toIndex: number): void {\n\t\tif (fromIndex < 0) {\n\t\t\tthrow new Error(\"Invalid input: fromIndex value provided is less than 0\");\n\t\t}\n\n\t\tif (toIndex < 0) {\n\t\t\tthrow new Error(\"Invalid input: toIndex value provided is less than 0\");\n\t\t}\n\n\t\tif (\n\t\t\t// Moving to and from the same index makes no sense, so noOp\n\t\t\tfromIndex === toIndex ||\n\t\t\t// Moving the same entry from current location to its immediate next makes no sense so noOp\n\t\t\ttoIndex === fromIndex + 1\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst fromIndexInternal: number = this.findInternalDeletionIndex(fromIndex);\n\t\tconst toIndexInternal: number = this.findInternalInsertionIndex(toIndex);\n\n\t\tthis.moveCore(fromIndexInternal, toIndexInternal);\n\t}\n\n\tprivate moveCore(fromIndexInternal: number, toIndexInternal: number): void {\n\t\tconst insertAfterEntryId =\n\t\t\ttoIndexInternal >= 1 ? this.sharedArray[toIndexInternal - 1]?.entryId : undefined;\n\t\tconst entryId = this.sharedArray[fromIndexInternal]?.entryId;\n\t\tassert(entryId !== undefined, 0xb92 /* Invalid index */);\n\t\tconst changedToEntryId = this.createMoveEntry(fromIndexInternal, toIndexInternal);\n\n\t\tconst op: IMoveOperation = {\n\t\t\ttype: OperationType.moveEntry,\n\t\t\tentryId,\n\t\t\tinsertAfterEntryId,\n\t\t\tchangedToEntryId,\n\t\t};\n\t\tthis.emitValueChangedEvent(op, true /* isLocal */);\n\t\tthis.emitRevertibleEvent(op);\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\tthis.submitLocalMessage(op);\n\t}\n\n\t/**\n\t * Method used to do undo/redo operation for the given entry id. This method is\n\t * used for undo/redo of only insert and delete operations. Move operation is NOT handled\n\t * by this method\n\t *\n\t * @param entryId - Entry Id for which the the undo/redo operation is to be applied\n\t */\n\tpublic toggle(entryId: string): void {\n\t\tconst liveEntry = this.getLiveEntry(entryId);\n\t\tconst isDeleted = !liveEntry.isDeleted;\n\n\t\t// Adding local pending counter\n\t\tthis.getEntryForId(entryId).isLocalPendingDelete += 1;\n\n\t\t// Toggling the isDeleted flag to undo the last operation for the skip list payload/value\n\t\tliveEntry.isDeleted = isDeleted;\n\n\t\tconst op: IToggleOperation = {\n\t\t\ttype: OperationType.toggle,\n\t\t\tentryId,\n\t\t\tisDeleted,\n\t\t};\n\t\tthis.emitValueChangedEvent(op, true /* isLocal */);\n\t\tthis.emitRevertibleEvent(op);\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\tthis.submitLocalMessage(op);\n\t}\n\n\t/**\n\t * Method to do undo/redo of move operation. All entries of the same payload/value are stored\n\t * in the same doubly linked skip list. This skip list is updated upon every move by adding the\n\t * new location as a new entry in the skip list and update the isDeleted flag to indicate the new\n\t * entry is the cuurent live location for the user.\n\t *\n\t * @param oldEntryId - EntryId of the last live entry\n\t * @param newEntryId - EntryId of the to be live entry\n\t */\n\tpublic toggleMove(oldEntryId: string, newEntryId: string): void {\n\t\tif (this.getEntryForId(newEntryId).isDeleted) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Adding local pending counter\n\t\tthis.getEntryForId(oldEntryId).isLocalPendingMove += 1;\n\n\t\tthis.updateLiveEntry(newEntryId, oldEntryId);\n\n\t\tconst op: IToggleMoveOperation = {\n\t\t\ttype: OperationType.toggleMove,\n\t\t\tentryId: oldEntryId,\n\t\t\tchangedToEntryId: newEntryId,\n\t\t};\n\t\tthis.emitValueChangedEvent(op, true /* isLocal */);\n\t\tthis.emitRevertibleEvent(op);\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\tthis.submitLocalMessage(op);\n\t}\n\n\t/**\n\t * Load share array from snapshot\n\t *\n\t * @param storage - the storage to get the snapshot from\n\t * @returns - promise that resolved when the load is completed\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst header = await storage.readBlob(snapshotFileName);\n\t\t// eslint-disable-next-line unicorn/text-encoding-identifier-case\n\t\tconst utf8 = new TextDecoder(\"utf-8\").decode(header);\n\t\t// Note: IFluidSerializer.parse() doesn't guarantee any typing; the explicit typing here is based on this code's\n\t\t// knowledge of what it is deserializing.\n\t\tconst deserializedSharedArray = this.serializer.parse(utf8) as {\n\t\t\tdataArray: SharedArrayEntry<T>[];\n\t\t};\n\t\tthis.sharedArray = deserializedSharedArray.dataArray;\n\t\t// Initializing the idToEntryMap optimizer data set\n\t\tfor (const entry of this.sharedArray) {\n\t\t\tthis.idToEntryMap.set(entry.entryId, entry);\n\t\t\tthis.unsetLocalFlags(entry);\n\t\t}\n\t}\n\n\t/**\n\t * Callback on disconnect\n\t */\n\tprotected onDisconnect(): void {}\n\n\t/**\n\t * Tracks the doubly linked skip list for the given entry to identify local pending counter attribute.\n\t * It signifies if a local pending operation exists for the payload/value being tracked in the skip list\n\t *\n\t * returns true if counterAttribute's count \\> 0\n\t * @param entryId - id for which counter attribute is to be tracked in chian.\n\t * @param counterAttribute - flag or property name from SharedArrayEntry whose counter is to be tracked.\n\t */\n\tprivate isLocalPending(\n\t\tentryId: string,\n\t\tcounterAttribute: keyof SharedArrayEntry<T>,\n\t): boolean {\n\t\tconst getCounterAttributeValue = (\n\t\t\tentry: SharedArrayEntry<T>,\n\t\t\tcounterAttr: keyof SharedArrayEntry<T>,\n\t\t): number => {\n\t\t\treturn entry[counterAttr] as number;\n\t\t};\n\n\t\tconst inputEntry = this.getEntryForId(entryId);\n\t\tlet prevEntryId = inputEntry.prevEntryId;\n\t\tlet nextEntryId = inputEntry.nextEntryId;\n\t\tif (getCounterAttributeValue(inputEntry, counterAttribute) > 0) {\n\t\t\treturn true;\n\t\t}\n\t\t// track back in chain\n\t\twhile (prevEntryId !== undefined && prevEntryId) {\n\t\t\tconst prevEntry = this.getEntryForId(prevEntryId);\n\t\t\tif (getCounterAttributeValue(prevEntry, counterAttribute)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tprevEntryId = prevEntry.prevEntryId;\n\t\t}\n\n\t\t// track forward in the chain\n\t\twhile (nextEntryId !== undefined && nextEntryId) {\n\t\t\tconst nextEntry = this.getEntryForId(nextEntryId);\n\t\t\tif (getCounterAttributeValue(nextEntry, counterAttribute)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tnextEntryId = nextEntry.nextEntryId;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprivate getEntryForId(entryId: string): SharedArrayEntry<T> {\n\t\treturn this.idToEntryMap.get(entryId) as SharedArrayEntry<T>;\n\t}\n\n\t/**\n\t * Process a shared array operation\n\t *\n\t * @param message - the message to prepare\n\t * @param local - whether 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\t_localOpMetadata: unknown,\n\t): void {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison\n\t\tif (message.type === MessageType.Operation) {\n\t\t\tconst op = message.contents as ISharedArrayOperation<T>;\n\t\t\tconst opEntry = this.getEntryForId(op.entryId);\n\n\t\t\tswitch (op.type) {\n\t\t\t\tcase OperationType.insertEntry: {\n\t\t\t\t\tthis.handleInsertOp<SerializableTypeForSharedArray>(\n\t\t\t\t\t\top.entryId,\n\t\t\t\t\t\top.insertAfterEntryId,\n\t\t\t\t\t\tlocal,\n\t\t\t\t\t\top.value,\n\t\t\t\t\t);\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase OperationType.deleteEntry: {\n\t\t\t\t\tif (local) {\n\t\t\t\t\t\t// Decrementing local pending counter as op is already applied to local state\n\t\t\t\t\t\topEntry.isLocalPendingDelete -= 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If local pending, then ignore else apply the remote op\n\t\t\t\t\t\tif (!this.isLocalPending(op.entryId, \"isLocalPendingDelete\")) {\n\t\t\t\t\t\t\t// last element in skip list is the most recent and live entry, so marking it deleted\n\t\t\t\t\t\t\tthis.getLiveEntry(op.entryId).isDeleted = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase OperationType.moveEntry: {\n\t\t\t\t\tthis.handleInsertOp<SerializableTypeForSharedArray>(\n\t\t\t\t\t\top.changedToEntryId,\n\t\t\t\t\t\top.insertAfterEntryId,\n\t\t\t\t\t\tlocal,\n\t\t\t\t\t\topEntry.value,\n\t\t\t\t\t);\n\t\t\t\t\tif (local) {\n\t\t\t\t\t\t// decrement the local pending move op as its already applied to local state\n\t\t\t\t\t\topEntry.isLocalPendingMove -= 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst newElementEntryId = op.changedToEntryId;\n\t\t\t\t\t\tconst newElement = this.getEntryForId(newElementEntryId);\n\t\t\t\t\t\t// If local pending then simply mark the new location dead as finally the local op will win\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tthis.isLocalPending(op.entryId, \"isLocalPendingDelete\") ||\n\t\t\t\t\t\t\tthis.isLocalPending(op.entryId, \"isLocalPendingMove\")\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthis.updateDeadEntry(op.entryId, newElementEntryId);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// move the element\n\t\t\t\t\t\t\tconst liveEntry = this.getLiveEntry(op.entryId);\n\t\t\t\t\t\t\tconst isDeleted = liveEntry.isDeleted;\n\t\t\t\t\t\t\tthis.updateLiveEntry(liveEntry.entryId, newElementEntryId);\n\t\t\t\t\t\t\t// mark newly added element as deleted if existing live element was already deleted\n\t\t\t\t\t\t\tif (isDeleted) {\n\t\t\t\t\t\t\t\tnewElement.isDeleted = isDeleted;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase OperationType.toggle: {\n\t\t\t\t\tif (local) {\n\t\t\t\t\t\t// decrement the local pending delete op as its already applied to local state\n\t\t\t\t\t\tif (opEntry.isLocalPendingDelete) {\n\t\t\t\t\t\t\topEntry.isLocalPendingDelete -= 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!this.isLocalPending(op.entryId, \"isLocalPendingDelete\")) {\n\t\t\t\t\t\t\tthis.getLiveEntry(op.entryId).isDeleted = op.isDeleted;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase OperationType.toggleMove: {\n\t\t\t\t\tif (local) {\n\t\t\t\t\t\t// decrement the local pending move op as its already applied to local state\n\t\t\t\t\t\tif (opEntry.isLocalPendingMove) {\n\t\t\t\t\t\t\topEntry.isLocalPendingMove -= 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (\n\t\t\t\t\t\t!this.isLocalPending(op.entryId, \"isLocalPendingDelete\") &&\n\t\t\t\t\t\t!this.isLocalPending(op.entryId, \"isLocalPendingMove\")\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.updateLiveEntry(this.getLiveEntry(op.entryId).entryId, op.entryId);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault: {\n\t\t\t\t\tthrow new Error(\"Unknown operation\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!local) {\n\t\t\t\tthis.emitValueChangedEvent(op, local);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate findInternalIndex(countEntries: number): number {\n\t\tif (countEntries < 0) {\n\t\t\tthrow new Error(\"Input count is zero\");\n\t\t}\n\n\t\tlet countDown = countEntries;\n\t\tlet entriesIterator = 0;\n\t\tfor (; entriesIterator < this.sharedArray.length; entriesIterator = entriesIterator + 1) {\n\t\t\tconst entry = this.sharedArray[entriesIterator];\n\t\t\tassert(entry !== undefined, 0xb93 /* Invalid index */);\n\t\t\tif (entry.isDeleted === false) {\n\t\t\t\tif (countDown === 0) {\n\t\t\t\t\treturn entriesIterator;\n\t\t\t\t}\n\t\t\t\tcountDown = countDown - 1;\n\t\t\t}\n\t\t}\n\t\tthrow new Error(`Count of live entries is less than required`);\n\t}\n\n\tprivate findInternalInsertionIndex(index: number): number {\n\t\treturn index === 0 ? index : this.findInternalIndex(index - 1) + 1;\n\t}\n\n\tprivate findInternalDeletionIndex(index: number): number {\n\t\treturn this.findInternalIndex(index);\n\t}\n\n\tprivate createAddEntry<TWrite>(index: number, value: Serializable<TWrite> & T): string {\n\t\tconst newEntry = this.createNewEntry(uuid(), value);\n\t\tthis.addEntry(index, newEntry);\n\t\treturn newEntry.entryId;\n\t}\n\n\tprivate addEntry(insertIndex: number, newEntry: SharedArrayEntry<T>): void {\n\t\t// in scenario where we populate 100K rows, we insert them all at the end of array.\n\t\t// slicing array is way slower than pushing elements.\n\t\tif (insertIndex === this.sharedArray.length) {\n\t\t\tthis.sharedArray.push(newEntry);\n\t\t} else {\n\t\t\tthis.sharedArray.splice(insertIndex, 0 /* deleteCount */, newEntry);\n\t\t}\n\n\t\t// Updating the idToEntryMap optimizer data set as new entry has been added\n\t\tthis.idToEntryMap.set(newEntry.entryId, newEntry);\n\t}\n\n\tprivate emitValueChangedEvent(op: ISharedArrayOperation, isLocal: boolean): void {\n\t\tthis.emit(\"valueChanged\", op, isLocal, this);\n\t}\n\n\tprivate emitRevertibleEvent(op: ISharedArrayOperation): void {\n\t\tconst revertible = new SharedArrayRevertible(this, op);\n\t\tthis.emit(\"revertible\", revertible);\n\t}\n\n\tprivate deleteCore(index: number): void {\n\t\tconst entry = this.sharedArray[index];\n\t\tassert(entry !== undefined, 0xb94 /* Invalid index */);\n\n\t\tif (entry.isDeleted) {\n\t\t\tthrow new Error(\"Entry already deleted.\");\n\t\t}\n\t\tentry.isDeleted = true;\n\n\t\t// Adding local pending counter\n\t\tentry.isLocalPendingDelete += 1;\n\t}\n\n\tprivate createMoveEntry(oldIndex: number, newIndex: number): string {\n\t\tconst oldEntry = this.sharedArray[oldIndex];\n\t\tassert(oldEntry !== undefined, 0xb95 /* Invalid index */);\n\t\tconst newEntry = this.createNewEntry<SerializableTypeForSharedArray>(\n\t\t\tuuid(),\n\t\t\toldEntry.value,\n\t\t\toldEntry.entryId,\n\t\t);\n\n\t\toldEntry.isDeleted = true;\n\t\toldEntry.nextEntryId = newEntry.entryId;\n\n\t\t// Adding local pending counter\n\t\toldEntry.isLocalPendingMove += 1;\n\n\t\tthis.addEntry(newIndex /* insertIndex */, newEntry);\n\n\t\treturn newEntry.entryId;\n\t}\n\n\t/**\n\t * Creates new entry of type SharedArrayEntry interface.\n\t * @param entryId - id for which new entry is created\n\t * @param value - value for the new entry\n\t * @param prevEntryId - prevEntryId if exists to update the previous pointer of double ended linked list\n\t */\n\tprivate createNewEntry<TWrite>(\n\t\tentryId: string,\n\t\tvalue: Serializable<TWrite> & T,\n\t\tprevEntryId?: string,\n\t): SharedArrayEntry<T> {\n\t\treturn {\n\t\t\tentryId,\n\t\t\tvalue,\n\t\t\tisAckPending: true,\n\t\t\tisDeleted: false,\n\t\t\tprevEntryId,\n\t\t\tnextEntryId: undefined,\n\t\t\tisLocalPendingDelete: 0,\n\t\t\tisLocalPendingMove: 0,\n\t\t};\n\t}\n\n\t/**\n\t * Unsets all local flags used by the DDS. This method can be used after reading from snapshott to ensure\n\t * local flags are initialized for use by the DDS.\n\t * @param entry - Entry for which the local flags have to be cleaned up\n\t */\n\tprivate unsetLocalFlags(entry: SharedArrayEntry<T>): void {\n\t\tentry.isAckPending = false;\n\t\tentry.isLocalPendingDelete = 0;\n\t\tentry.isLocalPendingMove = 0;\n\t}\n\n\t/**\n\t * Returns the index of the first entry starting with startIndex that does not have the isAckPending flag\n\t */\n\tprivate getInternalInsertIndexByIgnoringLocalPendingInserts(startIndex: number): number {\n\t\tlet localOpsIterator = startIndex;\n\t\tfor (\n\t\t\t;\n\t\t\tlocalOpsIterator < this.sharedArray.length;\n\t\t\tlocalOpsIterator = localOpsIterator + 1\n\t\t) {\n\t\t\tconst entry = this.sharedArray[localOpsIterator];\n\t\t\tassert(entry !== undefined, 0xb96 /* Invalid index */);\n\t\t\tif (!entry.isAckPending) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn localOpsIterator;\n\t}\n\n\tprivate handleInsertOp<TWrite>(\n\t\tentryId: string,\n\t\tinsertAfterEntryId: string | undefined,\n\t\tlocal: boolean,\n\t\tvalue: Serializable<TWrite> & T,\n\t): void {\n\t\tlet index = 0;\n\t\tif (local) {\n\t\t\tthis.getEntryForId(entryId).isAckPending = false;\n\t\t} else {\n\t\t\tif (insertAfterEntryId !== undefined) {\n\t\t\t\tindex = this.findIndexOfEntryId(insertAfterEntryId) + 1;\n\t\t\t}\n\t\t\tconst newEntry = this.createNewEntry(entryId, value);\n\t\t\tnewEntry.isAckPending = false;\n\t\t\tthis.addEntry(this.getInternalInsertIndexByIgnoringLocalPendingInserts(index), newEntry);\n\t\t}\n\t}\n\n\tprivate findIndexOfEntryId(entryId: string | undefined): number {\n\t\tfor (let index = 0; index < this.sharedArray.length; index = index + 1) {\n\t\t\tif (this.sharedArray[index]?.entryId === entryId) {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\n\tprivate prepareToMakeEntryIdLive(entry: SharedArrayEntry<T>): void {\n\t\tconst prevIndex = this.findIndexOfEntryId(entry.prevEntryId);\n\t\tconst nextIndex = this.findIndexOfEntryId(entry.nextEntryId);\n\t\tif (prevIndex !== -1) {\n\t\t\tconst prevEntry = this.sharedArray[prevIndex];\n\t\t\tassert(prevEntry !== undefined, 0xb97 /* Invalid index */);\n\t\t\tprevEntry.nextEntryId = entry.nextEntryId;\n\t\t}\n\t\tif (nextIndex !== -1) {\n\t\t\tconst nextEntry = this.sharedArray[nextIndex];\n\t\t\tassert(nextEntry !== undefined, 0xb98 /* Invalid index */);\n\t\t\tnextEntry.prevEntryId = entry.prevEntryId;\n\t\t}\n\t\tentry.prevEntryId = undefined;\n\t\tentry.nextEntryId = undefined;\n\t}\n\n\t/**\n\t * Method that returns the live entry.\n\t * The shared array internally can store a skip list of all related entries which got created\n\t * due to move operations for the same payload/value. However, all elements except for one element\n\t * can have isDeleted flag as false indicating this is the live entry for the value.\n\t * Current implementation ensures that the last element in the skip list of entries is the liveEntry/\n\t * last live entry\n\t *\n\t * @param entryId - Entry id of any node in the skip list for the same payload/value\n\t */\n\tprivate getLiveEntry(entryId: string): SharedArrayEntry<T> {\n\t\tlet liveEntry = this.getEntryForId(entryId);\n\t\twhile (liveEntry.nextEntryId !== undefined && liveEntry.nextEntryId) {\n\t\t\tliveEntry = this.getEntryForId(liveEntry.nextEntryId);\n\t\t}\n\t\treturn liveEntry;\n\t}\n\n\t/**\n\t * We track sequence of moves for a entry in the shared array using doubly linked skip list.\n\t * This utility function helps us keep track of the current position of an entry.value by marking the entry\n\t * at previous position deleted and appending the entry at the new position at the end of the double linked\n\t * list for that entry.value.\n\t */\n\tprivate updateLiveEntry(oldLiveEntryEntryId: string, newLiveEntryEntryId: string): void {\n\t\tconst oldLiveEntry = this.getEntryForId(oldLiveEntryEntryId);\n\t\tconst newLiveEntry = this.getEntryForId(newLiveEntryEntryId);\n\t\tif (oldLiveEntryEntryId === newLiveEntryEntryId) {\n\t\t\toldLiveEntry.isDeleted = false;\n\t\t} else {\n\t\t\tthis.prepareToMakeEntryIdLive(newLiveEntry);\n\t\t\t// Make entryId live\n\t\t\toldLiveEntry.nextEntryId = newLiveEntryEntryId;\n\t\t\tnewLiveEntry.prevEntryId = oldLiveEntryEntryId;\n\t\t\tnewLiveEntry.isDeleted = false;\n\t\t\toldLiveEntry.isDeleted = true;\n\t\t}\n\t}\n\n\t/**\n\t * We track sequence of moves for a entry in the shared array using doubly linked skip list.\n\t * This utility function helps to insert the new entry as dead entry and reconnecting the double linked list with\n\t * existingEntry -\\> deadeEntry(appended) -\\> existing chain(if any).\n\t */\n\tprivate updateDeadEntry(existingEntryId: string, deadEntryId: string): void {\n\t\tconst existingEntry = this.getEntryForId(existingEntryId);\n\t\tconst deadEntry = this.getEntryForId(deadEntryId);\n\n\t\t// update dead entry's next to existingEntry's next, if existingEntry's next entry exists.\n\t\t// It can be undefined if the exiting element is the last element (or only element) of chain.\n\t\tif (existingEntry.nextEntryId !== undefined) {\n\t\t\tdeadEntry.nextEntryId = existingEntry.nextEntryId;\n\t\t\tthis.getEntryForId(existingEntry.nextEntryId).prevEntryId = deadEntryId;\n\t\t}\n\n\t\t// update current entry's next pointer to dead entry and vice versa.\n\t\texistingEntry.nextEntryId = deadEntryId;\n\t\tdeadEntry.prevEntryId = existingEntryId;\n\t\tdeadEntry.isDeleted = true;\n\t}\n\n\tprotected applyStashedOp(_content: unknown): void {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n"]}
@@ -0,0 +1,31 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import type { IChannelServices, IChannelAttributes, IFluidDataStoreRuntime, IChannelFactory } from "@fluidframework/datastore-definitions/internal";
6
+ import { type ISharedObjectKind, type SharedObjectKind } from "@fluidframework/shared-object-base/internal";
7
+ import type { ISharedArray, SerializableTypeForSharedArray } from "./interfaces.js";
8
+ /**
9
+ * @internal
10
+ */
11
+ export declare class SharedArrayFactory<T extends SerializableTypeForSharedArray> implements IChannelFactory {
12
+ static readonly Type = "https://graph.microsoft.com/types/SharedArray";
13
+ static readonly Attributes: IChannelAttributes;
14
+ get type(): string;
15
+ get attributes(): IChannelAttributes;
16
+ load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<ISharedArray<T>>;
17
+ create(document: IFluidDataStoreRuntime, id: string): ISharedArray<T>;
18
+ }
19
+ /**
20
+ * Entrypoint for {@link ISharedArray} creation.
21
+ * @legacy
22
+ * @alpha
23
+ */
24
+ export declare const SharedArray: ISharedObjectKind<ISharedArray<SerializableTypeForSharedArray>> & SharedObjectKind<ISharedArray<SerializableTypeForSharedArray>>;
25
+ /**
26
+ * Entrypoint for {@link ISharedArray} creation.
27
+ * @legacy
28
+ * @alpha
29
+ */
30
+ export declare const SharedArrayBuilder: <T extends SerializableTypeForSharedArray>() => ISharedObjectKind<ISharedArray<T>> & SharedObjectKind<ISharedArray<T>>;
31
+ //# sourceMappingURL=sharedArrayFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedArrayFactory.d.ts","sourceRoot":"","sources":["../../src/array/sharedArrayFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAEN,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,MAAM,6CAA6C,CAAC;AAIrD,OAAO,KAAK,EAAE,YAAY,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAGpF;;GAEG;AACH,qBAAa,kBAAkB,CAAC,CAAC,SAAS,8BAA8B,CACvE,YAAW,eAAe;IAE1B,gBAAuB,IAAI,mDAAmD;IAE9E,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAW,UAAU,IAAI,kBAAkB,CAE1C;IAEY,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC5B,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IASpB,MAAM,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC;CAQ5E;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,YAAY,CAAC,8BAA8B,CAAC,CAAC,GACxF,gBAAgB,CAAC,YAAY,CAAC,8BAA8B,CAAC,CAC2B,CAAC;AAE1F;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,kDAE1B,kBAAkB,aAAa,CAAC,CAAC,CAAC,GAAG,iBAAiB,aAAa,CAAC,CAAC,CAGzE,CAAC"}
@@ -0,0 +1,56 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { createSharedObjectKind, } from "@fluidframework/shared-object-base/internal";
6
+ import { pkgVersion } from "../packageVersion.js";
7
+ import { SharedArrayClass } from "./sharedArray.js";
8
+ /**
9
+ * @internal
10
+ */
11
+ export class SharedArrayFactory {
12
+ get type() {
13
+ return SharedArrayFactory.Type;
14
+ }
15
+ get attributes() {
16
+ return SharedArrayFactory.Attributes;
17
+ }
18
+ async load(runtime, id, services, attributes) {
19
+ /**
20
+ * * The SharedArray
21
+ */
22
+ const sharedArray = new SharedArrayClass(id, runtime, attributes);
23
+ await sharedArray.load(services);
24
+ return sharedArray;
25
+ }
26
+ create(document, id) {
27
+ /**
28
+ * * The SharedArray
29
+ */
30
+ const sharedArray = new SharedArrayClass(id, document, this.attributes);
31
+ sharedArray.initializeLocal();
32
+ return sharedArray;
33
+ }
34
+ }
35
+ SharedArrayFactory.Type = "https://graph.microsoft.com/types/SharedArray";
36
+ SharedArrayFactory.Attributes = {
37
+ type: SharedArrayFactory.Type,
38
+ snapshotFormatVersion: "0.1",
39
+ packageVersion: pkgVersion,
40
+ };
41
+ /**
42
+ * Entrypoint for {@link ISharedArray} creation.
43
+ * @legacy
44
+ * @alpha
45
+ */
46
+ export const SharedArray = createSharedObjectKind(SharedArrayFactory);
47
+ /**
48
+ * Entrypoint for {@link ISharedArray} creation.
49
+ * @legacy
50
+ * @alpha
51
+ */
52
+ export const SharedArrayBuilder = () => {
53
+ const factory = (SharedArrayFactory);
54
+ return createSharedObjectKind(factory);
55
+ };
56
+ //# sourceMappingURL=sharedArrayFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedArrayFactory.js","sourceRoot":"","sources":["../../src/array/sharedArrayFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EACN,sBAAsB,GAGtB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAW9B,IAAW,IAAI;QACd,OAAO,kBAAkB,CAAC,IAAI,CAAC;IAChC,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,kBAAkB,CAAC,UAAU,CAAC;IACtC,CAAC;IAEM,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B;;WAEG;QACH,MAAM,WAAW,GAAG,IAAI,gBAAgB,CAAI,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACrE,MAAM,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjC,OAAO,WAAW,CAAC;IACpB,CAAC;IAEM,MAAM,CAAC,QAAgC,EAAE,EAAU;QACzD;;WAEG;QACH,MAAM,WAAW,GAAG,IAAI,gBAAgB,CAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3E,WAAW,CAAC,eAAe,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC;IACpB,CAAC;;AArCsB,uBAAI,GAAG,+CAA+C,CAAC;AAEvD,6BAAU,GAAuB;IACvD,IAAI,EAAE,kBAAkB,CAAC,IAAI;IAC7B,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,UAAU;CAC1B,CAAC;AAkCH;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAEvB,sBAAsB,CAA+C,kBAAkB,CAAC,CAAC;AAE1F;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAE0C,EAAE;IAC7E,MAAM,OAAO,GAAG,CAAA,kBAAqB,CAAA,CAAC;IACtC,OAAO,sBAAsB,CAAkB,OAAO,CAAC,CAAC;AACzD,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIChannelServices,\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport {\n\tcreateSharedObjectKind,\n\ttype ISharedObjectKind,\n\ttype SharedObjectKind,\n} from \"@fluidframework/shared-object-base/internal\";\n\nimport { pkgVersion } from \"../packageVersion.js\";\n\nimport type { ISharedArray, SerializableTypeForSharedArray } from \"./interfaces.js\";\nimport { SharedArrayClass } from \"./sharedArray.js\";\n\n/**\n * @internal\n */\nexport class SharedArrayFactory<T extends SerializableTypeForSharedArray>\n\timplements IChannelFactory\n{\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/SharedArray\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: SharedArrayFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic get type(): string {\n\t\treturn SharedArrayFactory.Type;\n\t}\n\n\tpublic get attributes(): IChannelAttributes {\n\t\treturn SharedArrayFactory.Attributes;\n\t}\n\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<ISharedArray<T>> {\n\t\t/**\n\t\t * * The SharedArray\n\t\t */\n\t\tconst sharedArray = new SharedArrayClass<T>(id, runtime, attributes);\n\t\tawait sharedArray.load(services);\n\t\treturn sharedArray;\n\t}\n\n\tpublic create(document: IFluidDataStoreRuntime, id: string): ISharedArray<T> {\n\t\t/**\n\t\t * * The SharedArray\n\t\t */\n\t\tconst sharedArray = new SharedArrayClass<T>(id, document, this.attributes);\n\t\tsharedArray.initializeLocal();\n\t\treturn sharedArray;\n\t}\n}\n\n/**\n * Entrypoint for {@link ISharedArray} creation.\n * @legacy\n * @alpha\n */\nexport const SharedArray: ISharedObjectKind<ISharedArray<SerializableTypeForSharedArray>> &\n\tSharedObjectKind<ISharedArray<SerializableTypeForSharedArray>> =\n\tcreateSharedObjectKind<ISharedArray<SerializableTypeForSharedArray>>(SharedArrayFactory);\n\n/**\n * Entrypoint for {@link ISharedArray} creation.\n * @legacy\n * @alpha\n */\nexport const SharedArrayBuilder = <\n\tT extends SerializableTypeForSharedArray,\n>(): ISharedObjectKind<ISharedArray<T>> & SharedObjectKind<ISharedArray<T>> => {\n\tconst factory = SharedArrayFactory<T>;\n\treturn createSharedObjectKind<ISharedArray<T>>(factory);\n};\n"]}
@@ -0,0 +1,77 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * @legacy
7
+ * @alpha
8
+ */
9
+ export declare const OperationType: {
10
+ readonly insertEntry: 0;
11
+ readonly deleteEntry: 1;
12
+ readonly moveEntry: 2;
13
+ readonly toggle: 3;
14
+ readonly toggleMove: 4;
15
+ };
16
+ /**
17
+ * @legacy
18
+ * @alpha
19
+ */
20
+ export type OperationType = (typeof OperationType)[keyof typeof OperationType];
21
+ /**
22
+ * @legacy
23
+ * @alpha
24
+ */
25
+ export interface IInsertOperation<T = unknown> {
26
+ type: typeof OperationType.insertEntry;
27
+ entryId: string;
28
+ value: T;
29
+ insertAfterEntryId?: string;
30
+ }
31
+ /**
32
+ * @legacy
33
+ * @alpha
34
+ */
35
+ export interface IDeleteOperation {
36
+ type: typeof OperationType.deleteEntry;
37
+ entryId: string;
38
+ }
39
+ /**
40
+ * @legacy
41
+ * @alpha
42
+ */
43
+ export interface IMoveOperation {
44
+ type: typeof OperationType.moveEntry;
45
+ entryId: string;
46
+ insertAfterEntryId?: string;
47
+ changedToEntryId: string;
48
+ }
49
+ /**
50
+ * @legacy
51
+ * @alpha
52
+ */
53
+ export interface IToggleOperation {
54
+ type: typeof OperationType.toggle;
55
+ entryId: string;
56
+ isDeleted: boolean;
57
+ }
58
+ /**
59
+ * @legacy
60
+ * @alpha
61
+ */
62
+ export interface IToggleMoveOperation {
63
+ type: typeof OperationType.toggleMove;
64
+ entryId: string;
65
+ changedToEntryId: string;
66
+ }
67
+ /**
68
+ * @legacy
69
+ * @alpha
70
+ */
71
+ export type ISharedArrayRevertibleOperation = IToggleOperation | IToggleMoveOperation;
72
+ /**
73
+ * @legacy
74
+ * @alpha
75
+ */
76
+ export type ISharedArrayOperation<T = unknown> = IInsertOperation<T> | IDeleteOperation | IMoveOperation | ISharedArrayRevertibleOperation;
77
+ //# sourceMappingURL=sharedArrayOperations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedArrayOperations.d.ts","sourceRoot":"","sources":["../../src/array/sharedArrayOperations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE/E;;;GAGG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,OAAO;IAC5C,IAAI,EAAE,OAAO,aAAa,CAAC,WAAW,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,CAAC,CAAC;IACT,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,OAAO,aAAa,CAAC,WAAW,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,OAAO,aAAa,CAAC,SAAS,CAAC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,OAAO,aAAa,CAAC,MAAM,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,OAAO,aAAa,CAAC,UAAU,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,MAAM,+BAA+B,GAAG,gBAAgB,GAAG,oBAAoB,CAAC;AAEtF;;;GAGG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,GAAG,OAAO,IAC1C,gBAAgB,CAAC,CAAC,CAAC,GACnB,gBAAgB,GAChB,cAAc,GACd,+BAA+B,CAAC"}
@@ -0,0 +1,16 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * @legacy
7
+ * @alpha
8
+ */
9
+ export const OperationType = {
10
+ insertEntry: 0,
11
+ deleteEntry: 1,
12
+ moveEntry: 2,
13
+ toggle: 3,
14
+ toggleMove: 4,
15
+ };
16
+ //# sourceMappingURL=sharedArrayOperations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedArrayOperations.js","sourceRoot":"","sources":["../../src/array/sharedArrayOperations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B,WAAW,EAAE,CAAC;IACd,WAAW,EAAE,CAAC;IACd,SAAS,EAAE,CAAC;IACZ,MAAM,EAAE,CAAC;IACT,UAAU,EAAE,CAAC;CACJ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @legacy\n * @alpha\n */\nexport const OperationType = {\n\tinsertEntry: 0,\n\tdeleteEntry: 1,\n\tmoveEntry: 2,\n\ttoggle: 3,\n\ttoggleMove: 4,\n} as const;\n\n/**\n * @legacy\n * @alpha\n */\nexport type OperationType = (typeof OperationType)[keyof typeof OperationType];\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IInsertOperation<T = unknown> {\n\ttype: typeof OperationType.insertEntry;\n\tentryId: string;\n\tvalue: T;\n\tinsertAfterEntryId?: string;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDeleteOperation {\n\ttype: typeof OperationType.deleteEntry;\n\tentryId: string;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IMoveOperation {\n\ttype: typeof OperationType.moveEntry;\n\tentryId: string;\n\tinsertAfterEntryId?: string;\n\tchangedToEntryId: string;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IToggleOperation {\n\ttype: typeof OperationType.toggle;\n\tentryId: string;\n\tisDeleted: boolean;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IToggleMoveOperation {\n\ttype: typeof OperationType.toggleMove;\n\tentryId: string;\n\tchangedToEntryId: string;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport type ISharedArrayRevertibleOperation = IToggleOperation | IToggleMoveOperation;\n\n/**\n * @legacy\n * @alpha\n */\nexport type ISharedArrayOperation<T = unknown> =\n\t| IInsertOperation<T>\n\t| IDeleteOperation\n\t| IMoveOperation\n\t| ISharedArrayRevertibleOperation;\n"]}
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import type { ISharedArrayRevertible, IRevertible } from "./interfaces.js";
6
+ import type { ISharedArrayOperation } from "./sharedArrayOperations.js";
7
+ /**
8
+ * @internal
9
+ */
10
+ export declare class SharedArrayRevertible implements IRevertible {
11
+ private readonly sharedArray;
12
+ private readonly op;
13
+ constructor(sharedArray: ISharedArrayRevertible, op: ISharedArrayOperation);
14
+ revert(): void;
15
+ dispose(): void;
16
+ }
17
+ //# sourceMappingURL=sharedArrayRevertible.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedArrayRevertible.d.ts","sourceRoot":"","sources":["../../src/array/sharedArrayRevertible.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGxE;;GAEG;AACH,qBAAa,qBAAsB,YAAW,WAAW;IACxD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAyB;IACrD,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAwB;gBACxB,WAAW,EAAE,sBAAsB,EAAE,EAAE,EAAE,qBAAqB;IAK1E,MAAM,IAAI,IAAI;IA4Bd,OAAO,IAAI,IAAI;CACtB"}
@@ -0,0 +1,43 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { OperationType } from "./sharedArrayOperations.js";
6
+ /**
7
+ * @internal
8
+ */
9
+ export class SharedArrayRevertible {
10
+ constructor(sharedArray, op) {
11
+ this.sharedArray = sharedArray;
12
+ this.op = op;
13
+ }
14
+ revert() {
15
+ switch (this.op.type) {
16
+ case OperationType.insertEntry: {
17
+ this.sharedArray.toggle(this.op.entryId);
18
+ break;
19
+ }
20
+ case OperationType.deleteEntry: {
21
+ this.sharedArray.toggle(this.op.entryId);
22
+ break;
23
+ }
24
+ case OperationType.toggle: {
25
+ this.sharedArray.toggle(this.op.entryId);
26
+ break;
27
+ }
28
+ case OperationType.moveEntry: {
29
+ this.sharedArray.toggleMove(this.op.entryId, this.op.changedToEntryId);
30
+ break;
31
+ }
32
+ case OperationType.toggleMove: {
33
+ this.sharedArray.toggleMove(this.op.changedToEntryId, this.op.entryId);
34
+ break;
35
+ }
36
+ default: {
37
+ throw new Error(`Unknown operation type`);
38
+ }
39
+ }
40
+ }
41
+ dispose() { }
42
+ }
43
+ //# sourceMappingURL=sharedArrayRevertible.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedArrayRevertible.js","sourceRoot":"","sources":["../../src/array/sharedArrayRevertible.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAGjC,YAAmB,WAAmC,EAAE,EAAyB;QAChF,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACd,CAAC;IAEM,MAAM;QACZ,QAAQ,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;YACtB,KAAK,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;gBAChC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;gBACzC,MAAM;YACP,CAAC;YACD,KAAK,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;gBAChC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;gBACzC,MAAM;YACP,CAAC;YACD,KAAK,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC3B,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;gBACzC,MAAM;YACP,CAAC;YACD,KAAK,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;gBAC9B,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC;gBACvE,MAAM;YACP,CAAC;YACD,KAAK,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC;gBAC/B,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,EAAE,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;gBACvE,MAAM;YACP,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACT,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;YAC3C,CAAC;QACF,CAAC;IACF,CAAC;IAEM,OAAO,KAAU,CAAC;CACzB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ISharedArrayRevertible, IRevertible } from \"./interfaces.js\";\nimport type { ISharedArrayOperation } from \"./sharedArrayOperations.js\";\nimport { OperationType } from \"./sharedArrayOperations.js\";\n\n/**\n * @internal\n */\nexport class SharedArrayRevertible implements IRevertible {\n\tprivate readonly sharedArray: ISharedArrayRevertible;\n\tprivate readonly op: ISharedArrayOperation;\n\tpublic constructor(sharedArray: ISharedArrayRevertible, op: ISharedArrayOperation) {\n\t\tthis.sharedArray = sharedArray;\n\t\tthis.op = op;\n\t}\n\n\tpublic revert(): void {\n\t\tswitch (this.op.type) {\n\t\t\tcase OperationType.insertEntry: {\n\t\t\t\tthis.sharedArray.toggle(this.op.entryId);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase OperationType.deleteEntry: {\n\t\t\t\tthis.sharedArray.toggle(this.op.entryId);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase OperationType.toggle: {\n\t\t\t\tthis.sharedArray.toggle(this.op.entryId);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase OperationType.moveEntry: {\n\t\t\t\tthis.sharedArray.toggleMove(this.op.entryId, this.op.changedToEntryId);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase OperationType.toggleMove: {\n\t\t\t\tthis.sharedArray.toggleMove(this.op.changedToEntryId, this.op.entryId);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tthrow new Error(`Unknown operation type`);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic dispose(): void {}\n}\n"]}
package/lib/index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ export type { SerializableTypeForSharedSignal, ISharedSignal, ISharedSignalEvents, ISignalOperation, } from "./signal/index.js";
6
+ export { SharedSignal } from "./signal/index.js";
7
+ export { SharedSignalFactory } from "./signal/index.js";
8
+ export { SharedArray, SharedArrayBuilder, OperationType } from "./array/index.js";
9
+ export { SharedArrayFactory } from "./array/index.js";
10
+ export { SharedArrayRevertible } from "./array/index.js";
11
+ export type { SerializableTypeForSharedArray, ISharedArray, ISharedArrayEvents, ISharedArrayRevertible, } from "./array/index.js";
12
+ export type { ISharedArrayOperation, IDeleteOperation, IInsertOperation, IMoveOperation, ISharedArrayRevertibleOperation, IToggleMoveOperation, IToggleOperation, } from "./array/index.js";
13
+ export type { IRevertible } from "./array/index.js";
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,+BAA+B,EAC/B,aAAa,EACb,mBAAmB,EACnB,gBAAgB,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,YAAY,EACX,8BAA8B,EAC9B,YAAY,EACZ,kBAAkB,EAClB,sBAAsB,GACtB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACX,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,+BAA+B,EAC/B,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,10 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ export { SharedSignal } from "./signal/index.js";
6
+ export { SharedSignalFactory } from "./signal/index.js";
7
+ export { SharedArray, SharedArrayBuilder, OperationType } from "./array/index.js";
8
+ export { SharedArrayFactory } from "./array/index.js";
9
+ export { SharedArrayRevertible } from "./array/index.js";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tSerializableTypeForSharedSignal,\n\tISharedSignal,\n\tISharedSignalEvents,\n\tISignalOperation,\n} from \"./signal/index.js\";\nexport { SharedSignal } from \"./signal/index.js\";\nexport { SharedSignalFactory } from \"./signal/index.js\";\nexport { SharedArray, SharedArrayBuilder, OperationType } from \"./array/index.js\";\nexport { SharedArrayFactory } from \"./array/index.js\";\nexport { SharedArrayRevertible } from \"./array/index.js\";\nexport type {\n\tSerializableTypeForSharedArray,\n\tISharedArray,\n\tISharedArrayEvents,\n\tISharedArrayRevertible,\n} from \"./array/index.js\";\nexport type {\n\tISharedArrayOperation,\n\tIDeleteOperation,\n\tIInsertOperation,\n\tIMoveOperation,\n\tISharedArrayRevertibleOperation,\n\tIToggleMoveOperation,\n\tIToggleOperation,\n} from \"./array/index.js\";\nexport type { IRevertible } from \"./array/index.js\";\n"]}
@@ -0,0 +1,31 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
9
+ */
10
+
11
+ export {
12
+ // @legacy APIs
13
+ IDeleteOperation,
14
+ IInsertOperation,
15
+ IMoveOperation,
16
+ IRevertible,
17
+ ISharedArray,
18
+ ISharedArrayEvents,
19
+ ISharedArrayOperation,
20
+ ISharedArrayRevertibleOperation,
21
+ ISharedSignal,
22
+ ISharedSignalEvents,
23
+ IToggleMoveOperation,
24
+ IToggleOperation,
25
+ OperationType,
26
+ SerializableTypeForSharedArray,
27
+ SerializableTypeForSharedSignal,
28
+ SharedArray,
29
+ SharedArrayBuilder,
30
+ SharedSignal
31
+ } from "./index.js";
@@ -0,0 +1,9 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
+ */
7
+ export declare const pkgName = "@fluidframework/legacy-dds";
8
+ export declare const pkgVersion = "2.50.0-345060";
9
+ //# sourceMappingURL=packageVersion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,+BAA+B,CAAC;AACpD,eAAO,MAAM,UAAU,kBAAkB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
+ */
7
+ export const pkgName = "@fluidframework/legacy-dds";
8
+ export const pkgVersion = "2.50.0-345060";
9
+ //# sourceMappingURL=packageVersion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,4BAA4B,CAAC;AACpD,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,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/legacy-dds\";\nexport const pkgVersion = \"2.50.0-345060\";\n"]}
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
9
+ */
10
+
11
+ export {}
12
+
@@ -0,0 +1,7 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ export type { SerializableTypeForSharedSignal, ISharedSignal, ISharedSignalEvents, ISignalOperation, } from "./interfaces.js";
6
+ export { SharedSignalFactory, SharedSignal } from "./sharedSignalFactory.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signal/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,+BAA+B,EAC/B,aAAa,EACb,mBAAmB,EACnB,gBAAgB,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ export { SharedSignalFactory, SharedSignal } from "./sharedSignalFactory.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/signal/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tSerializableTypeForSharedSignal,\n\tISharedSignal,\n\tISharedSignalEvents,\n\tISignalOperation,\n} from \"./interfaces.js\";\nexport { SharedSignalFactory, SharedSignal } from \"./sharedSignalFactory.js\";\n"]}
@@ -0,0 +1,36 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import type { IFluidHandle } from "@fluidframework/core-interfaces";
6
+ import type { ISharedObject, ISharedObjectEvents } from "@fluidframework/shared-object-base/internal";
7
+ /**
8
+ * Basic types for the SharedSignal DDS
9
+ * It can be used as a generic constraint (`extends SerializableTypeForSharedSignal`) but is
10
+ * *never* meant to be a concrete/real type on its own.
11
+ * @legacy
12
+ * @alpha
13
+ */
14
+ export type SerializableTypeForSharedSignal = boolean | number | string | IFluidHandle | object;
15
+ /**
16
+ * @legacy
17
+ * @alpha
18
+ */
19
+ export interface ISharedSignalEvents<T extends SerializableTypeForSharedSignal> extends ISharedObjectEvents {
20
+ (event: "notify", listener: (value: T, isLocal: boolean) => void): any;
21
+ }
22
+ /**
23
+ * @legacy
24
+ * @alpha
25
+ */
26
+ export interface ISharedSignal<T extends SerializableTypeForSharedSignal = any> extends ISharedObject<ISharedSignalEvents<T>> {
27
+ notify(metadata?: T): void;
28
+ }
29
+ /**
30
+ * @internal
31
+ */
32
+ export interface ISignalOperation<out T = unknown> {
33
+ type: "signal";
34
+ readonly metadata?: T;
35
+ }
36
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../src/signal/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EACX,aAAa,EACb,mBAAmB,EACnB,MAAM,6CAA6C,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,MAAM,+BAA+B,GACxC,OAAO,GACP,MAAM,GACN,MAAM,GACN,YAAY,GACZ,MAAM,CAAC;AAEV;;;GAGG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,+BAA+B,CAC7E,SAAQ,mBAAmB;IAG3B,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,GAAG,CAAC;CACvE;AAED;;;GAGG;AAEH,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,+BAA+B,GAAG,GAAG,CAC7E,SAAQ,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAC7C,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO;IAChD,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;CACtB"}
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/signal/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 type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport type {\n\tISharedObject,\n\tISharedObjectEvents,\n} from \"@fluidframework/shared-object-base/internal\";\n\n/**\n * Basic types for the SharedSignal DDS\n * It can be used as a generic constraint (`extends SerializableTypeForSharedSignal`) but is\n * *never* meant to be a concrete/real type on its own.\n * @legacy\n * @alpha\n */\nexport type SerializableTypeForSharedSignal =\n\t| boolean\n\t| number\n\t| string\n\t| IFluidHandle\n\t| object;\n\n/**\n * @legacy\n * @alpha\n */\nexport interface ISharedSignalEvents<T extends SerializableTypeForSharedSignal>\n\textends ISharedObjectEvents {\n\t/* eslint-disable-next-line @typescript-eslint/no-explicit-any\n-- TODO: Using 'any' type defeats the purpose of TypeScript. Consider replacing it with a concrete type, or 'unknown'. */\n\t(event: \"notify\", listener: (value: T, isLocal: boolean) => void): any;\n}\n\n/**\n * @legacy\n * @alpha\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface ISharedSignal<T extends SerializableTypeForSharedSignal = any>\n\textends ISharedObject<ISharedSignalEvents<T>> {\n\tnotify(metadata?: T): void;\n}\n\n/**\n * @internal\n */\nexport interface ISignalOperation<out T = unknown> {\n\ttype: \"signal\";\n\treadonly metadata?: T;\n}\n"]}