@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,68 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import type { IChannelAttributes, IFluidDataStoreRuntime, IChannelStorageService, IChannelFactory } from "@fluidframework/datastore-definitions/internal";
6
+ import type { ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
7
+ import type { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions/internal";
8
+ import type { IFluidSerializer } from "@fluidframework/shared-object-base/internal";
9
+ import { SharedObject } from "@fluidframework/shared-object-base/internal";
10
+ import type { ISharedSignal, ISharedSignalEvents, SerializableTypeForSharedSignal } from "./interfaces.js";
11
+ /**
12
+ * Represents a shared signal that allows communication between distributed clients.
13
+ *
14
+ * @internal
15
+ */
16
+ export declare class SharedSignalClass<T extends SerializableTypeForSharedSignal = any> extends SharedObject<ISharedSignalEvents<T>> implements ISharedSignal<T> {
17
+ /**
18
+ * Create a new shared signal
19
+ *
20
+ * @param runtime - data store runtime the new shared signal belongs to
21
+ * @param id - optional name of the shared signal
22
+ * @returns newly create shared signal (but not attached yet)
23
+ */
24
+ static create(runtime: IFluidDataStoreRuntime, id?: string): SharedSignalClass;
25
+ /**
26
+ * Get a factory for SharedSignal to register with the data store.
27
+ *
28
+ * @returns a factory that creates and load SharedSignal
29
+ */
30
+ static getFactory(): IChannelFactory;
31
+ /**
32
+ * Constructs a new shared signal. If the object is non-local an id and service interfaces will
33
+ * be provided
34
+ * @param id - optional name of the shared signal
35
+ * @param runtime - data store runtime the shared signal belongs to
36
+ * @param attributes - represents the attributes of a channel/DDS.
37
+ */
38
+ constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
39
+ /**
40
+ * Method used for generating a signal.
41
+ */
42
+ notify(metadata?: T): void;
43
+ protected summarizeCore(_serializer: IFluidSerializer): ISummaryTreeWithStats;
44
+ /**
45
+ * Load share signal from snapshot
46
+ *
47
+ * @param _storage - the storage to get the snapshot from
48
+ * @returns - promise that resolved when the load is completed
49
+ */
50
+ protected loadCore(_storage: IChannelStorageService): Promise<void>;
51
+ protected initializeLocalCore(): void;
52
+ /**
53
+ * Callback on disconnect
54
+ */
55
+ protected onDisconnect(): void;
56
+ /**
57
+ * Process a shared signal operation
58
+ *
59
+ * @param message - the message to prepare
60
+ * @param local - whether the message was sent by the local client
61
+ * @param _localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
62
+ * For messages from a remote client, this will be undefined.
63
+ */
64
+ protected processCore(message: ISequencedDocumentMessage, local: boolean, _localOpMetadata: unknown): void;
65
+ private notifyCore;
66
+ protected applyStashedOp(_content: unknown): void;
67
+ }
68
+ //# sourceMappingURL=sharedSignal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedSignal.d.ts","sourceRoot":"","sources":["../../src/signal/sharedSignal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EACX,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,MAAM,gDAAgD,CAAC;AAExD,OAAO,KAAK,EACX,yBAAyB,EAEzB,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAE1F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAE3E,OAAO,KAAK,EACX,aAAa,EACb,mBAAmB,EAEnB,+BAA+B,EAC/B,MAAM,iBAAiB,CAAC;AAKzB;;;;GAIG;AACH,qBAAa,iBAAiB,CAAC,CAAC,SAAS,+BAA+B,GAAG,GAAG,CAC7E,SAAQ,YAAY,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAC3C,YAAW,aAAa,CAAC,CAAC,CAAC;IAE3B;;;;;;OAMG;WACW,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,iBAAiB;IAIrF;;;;OAIG;WACW,UAAU,IAAI,eAAe;IAI3C;;;;;;OAMG;gBAEF,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,sBAAsB,EAC/B,UAAU,EAAE,kBAAkB;IAK/B;;OAEG;IACI,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI;IAgBjC,SAAS,CAAC,aAAa,CAAC,WAAW,EAAE,gBAAgB,GAAG,qBAAqB;IAqB7E;;;;;OAKG;cACa,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;cAEtD,mBAAmB,IAAI,IAAI;IAE9C;;OAEG;IACH,SAAS,CAAC,YAAY,IAAI,IAAI;IAE9B;;;;;;;OAOG;IACH,SAAS,CAAC,WAAW,CACpB,OAAO,EAAE,yBAAyB,EAClC,KAAK,EAAE,OAAO,EACd,gBAAgB,EAAE,OAAO,GACvB,IAAI;IAiBP,OAAO,CAAC,UAAU;IAIlB,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;CAGjD"}
@@ -0,0 +1,118 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { FileMode, MessageType, TreeEntry } from "@fluidframework/driver-definitions/internal";
6
+ import { convertToSummaryTreeWithStats } from "@fluidframework/runtime-utils/internal";
7
+ import { SharedObject } from "@fluidframework/shared-object-base/internal";
8
+ import { SharedSignalFactory } from "./sharedSignalFactory.js";
9
+ const snapshotFileName = "header";
10
+ /**
11
+ * Represents a shared signal that allows communication between distributed clients.
12
+ *
13
+ * @internal
14
+ */
15
+ export class SharedSignalClass extends SharedObject {
16
+ /**
17
+ * Create a new shared signal
18
+ *
19
+ * @param runtime - data store runtime the new shared signal belongs to
20
+ * @param id - optional name of the shared signal
21
+ * @returns newly create shared signal (but not attached yet)
22
+ */
23
+ static create(runtime, id) {
24
+ return runtime.createChannel(id, SharedSignalFactory.Type);
25
+ }
26
+ /**
27
+ * Get a factory for SharedSignal to register with the data store.
28
+ *
29
+ * @returns a factory that creates and load SharedSignal
30
+ */
31
+ static getFactory() {
32
+ return new SharedSignalFactory();
33
+ }
34
+ /**
35
+ * Constructs a new shared signal. If the object is non-local an id and service interfaces will
36
+ * be provided
37
+ * @param id - optional name of the shared signal
38
+ * @param runtime - data store runtime the shared signal belongs to
39
+ * @param attributes - represents the attributes of a channel/DDS.
40
+ */
41
+ constructor(id, runtime, attributes) {
42
+ super(id, runtime, attributes, "loop_sharedSignal_" /* telemetryContextPrefix */);
43
+ }
44
+ /**
45
+ * Method used for generating a signal.
46
+ */
47
+ notify(metadata) {
48
+ // If we are not attached, don't submit the op.
49
+ if (!this.isAttached()) {
50
+ return;
51
+ }
52
+ const op = {
53
+ type: "signal",
54
+ metadata,
55
+ };
56
+ this.notifyCore(op, true);
57
+ this.submitLocalMessage(op);
58
+ }
59
+ summarizeCore(_serializer) {
60
+ const tree = {
61
+ entries: [
62
+ {
63
+ mode: FileMode.File,
64
+ path: snapshotFileName,
65
+ type: TreeEntry[TreeEntry.Blob],
66
+ value: {
67
+ contents: JSON.stringify(""),
68
+ // eslint-disable-next-line unicorn/text-encoding-identifier-case
69
+ encoding: "utf-8",
70
+ },
71
+ },
72
+ ],
73
+ };
74
+ const summaryTreeWithStats = convertToSummaryTreeWithStats(tree);
75
+ return summaryTreeWithStats;
76
+ }
77
+ /**
78
+ * Load share signal from snapshot
79
+ *
80
+ * @param _storage - the storage to get the snapshot from
81
+ * @returns - promise that resolved when the load is completed
82
+ */
83
+ async loadCore(_storage) { }
84
+ initializeLocalCore() { }
85
+ /**
86
+ * Callback on disconnect
87
+ */
88
+ onDisconnect() { }
89
+ /**
90
+ * Process a shared signal operation
91
+ *
92
+ * @param message - the message to prepare
93
+ * @param local - whether the message was sent by the local client
94
+ * @param _localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
95
+ * For messages from a remote client, this will be undefined.
96
+ */
97
+ processCore(message, local, _localOpMetadata) {
98
+ if (message.type === MessageType.Operation && !local) {
99
+ const op = message.contents;
100
+ switch (op.type) {
101
+ case "signal": {
102
+ this.notifyCore(op, local);
103
+ break;
104
+ }
105
+ default: {
106
+ throw new Error("Unknown operation");
107
+ }
108
+ }
109
+ }
110
+ }
111
+ notifyCore(op, isLocal) {
112
+ this.emit("notify", op.metadata, isLocal);
113
+ }
114
+ applyStashedOp(_content) {
115
+ throw new Error("Not implemented");
116
+ }
117
+ }
118
+ //# sourceMappingURL=sharedSignal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedSignal.js","sourceRoot":"","sources":["../../src/signal/sharedSignal.ts"],"names":[],"mappings":"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","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { FileMode, MessageType, TreeEntry } from \"@fluidframework/driver-definitions/internal\";\nimport type {\n\tISequencedDocumentMessage,\n\tITree,\n} 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\";\n\nimport type {\n\tISharedSignal,\n\tISharedSignalEvents,\n\tISignalOperation,\n\tSerializableTypeForSharedSignal,\n} from \"./interfaces.js\";\nimport { SharedSignalFactory } from \"./sharedSignalFactory.js\";\n\nconst snapshotFileName = \"header\";\n\n/**\n * Represents a shared signal that allows communication between distributed clients.\n *\n * @internal\n */\nexport class SharedSignalClass<T extends SerializableTypeForSharedSignal = any>\n\textends SharedObject<ISharedSignalEvents<T>>\n\timplements ISharedSignal<T>\n{\n\t/**\n\t * Create a new shared signal\n\t *\n\t * @param runtime - data store runtime the new shared signal belongs to\n\t * @param id - optional name of the shared signal\n\t * @returns newly create shared signal (but not attached yet)\n\t */\n\tpublic static create(runtime: IFluidDataStoreRuntime, id?: string): SharedSignalClass {\n\t\treturn runtime.createChannel(id, SharedSignalFactory.Type) as SharedSignalClass;\n\t}\n\n\t/**\n\t * Get a factory for SharedSignal to register with the data store.\n\t *\n\t * @returns a factory that creates and load SharedSignal\n\t */\n\tpublic static getFactory(): IChannelFactory {\n\t\treturn new SharedSignalFactory();\n\t}\n\n\t/**\n\t * Constructs a new shared signal. If the object is non-local an id and service interfaces will\n\t * be provided\n\t * @param id - optional name of the shared signal\n\t * @param runtime - data store runtime the shared signal 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_sharedSignal_\" /* telemetryContextPrefix */);\n\t}\n\n\t/**\n\t * Method used for generating a signal.\n\t */\n\tpublic notify(metadata?: T): void {\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: ISignalOperation<T> = {\n\t\t\ttype: \"signal\",\n\t\t\tmetadata,\n\t\t};\n\n\t\tthis.notifyCore(op, true);\n\n\t\tthis.submitLocalMessage(op);\n\t}\n\n\tprotected summarizeCore(_serializer: IFluidSerializer): ISummaryTreeWithStats {\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: JSON.stringify(\"\"),\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\n\t\tconst summaryTreeWithStats = convertToSummaryTreeWithStats(tree);\n\n\t\treturn summaryTreeWithStats;\n\t}\n\n\t/**\n\t * Load share signal 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\n\tprotected override initializeLocalCore(): void {}\n\n\t/**\n\t * Callback on disconnect\n\t */\n\tprotected onDisconnect(): void {}\n\n\t/**\n\t * Process a shared signal 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\tif ((message.type as MessageType) === MessageType.Operation && !local) {\n\t\t\tconst op = message.contents as ISignalOperation<T>;\n\n\t\t\tswitch (op.type) {\n\t\t\t\tcase \"signal\": {\n\t\t\t\t\tthis.notifyCore(op, local);\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}\n\t}\n\n\tprivate notifyCore(op: ISignalOperation<T>, isLocal: boolean): void {\n\t\tthis.emit(\"notify\", op.metadata, isLocal);\n\t}\n\n\tprotected applyStashedOp(_content: unknown): void {\n\t\tthrow new Error(\"Not implemented\");\n\t}\n}\n"]}
@@ -0,0 +1,24 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import type { IChannelAttributes, IFluidDataStoreRuntime, IChannelFactory, IChannelServices } from "@fluidframework/datastore-definitions/internal";
6
+ import type { ISharedSignal } from "./interfaces.js";
7
+ /**
8
+ * @internal
9
+ */
10
+ export declare class SharedSignalFactory implements IChannelFactory<ISharedSignal> {
11
+ static readonly Type: string;
12
+ static readonly Attributes: IChannelAttributes;
13
+ get type(): string;
14
+ get attributes(): IChannelAttributes;
15
+ load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<ISharedSignal>;
16
+ create(document: IFluidDataStoreRuntime, id: string): ISharedSignal;
17
+ }
18
+ /**
19
+ * Entrypoint for {@link ISharedSignal} creation.
20
+ * @legacy
21
+ * @alpha
22
+ */
23
+ export declare const SharedSignal: import("@fluidframework/shared-object-base/internal").ISharedObjectKind<ISharedSignal<any>> & import("@fluidframework/shared-object-base/internal").SharedObjectKind<ISharedSignal<any>>;
24
+ //# sourceMappingURL=sharedSignalFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedSignalFactory.d.ts","sourceRoot":"","sources":["../../src/signal/sharedSignalFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,MAAM,gDAAgD,CAAC;AAKxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD;;GAEG;AACH,qBAAa,mBAAoB,YAAW,eAAe,CAAC,aAAa,CAAC;IACzE,gBAAuB,IAAI,EAAE,MAAM,CAA8C;IAEjF,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,aAAa,CAAC;IAMlB,MAAM,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa;CAK1E;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,0LAA6D,CAAC"}
@@ -0,0 +1,41 @@
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 { SharedSignalClass } from "./sharedSignal.js";
8
+ /**
9
+ * @internal
10
+ */
11
+ export class SharedSignalFactory {
12
+ get type() {
13
+ return SharedSignalFactory.Type;
14
+ }
15
+ get attributes() {
16
+ return SharedSignalFactory.Attributes;
17
+ }
18
+ async load(runtime, id, services, attributes) {
19
+ const signal = new SharedSignalClass(id, runtime, attributes);
20
+ await signal.load(services);
21
+ return signal;
22
+ }
23
+ create(document, id) {
24
+ const signal = new SharedSignalClass(id, document, this.attributes);
25
+ signal.initializeLocal();
26
+ return signal;
27
+ }
28
+ }
29
+ SharedSignalFactory.Type = "https://graph.microsoft.com/types/signal";
30
+ SharedSignalFactory.Attributes = {
31
+ type: SharedSignalFactory.Type,
32
+ snapshotFormatVersion: "0.1",
33
+ packageVersion: pkgVersion,
34
+ };
35
+ /**
36
+ * Entrypoint for {@link ISharedSignal} creation.
37
+ * @legacy
38
+ * @alpha
39
+ */
40
+ export const SharedSignal = createSharedObjectKind(SharedSignalFactory);
41
+ //# sourceMappingURL=sharedSignalFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedSignalFactory.js","sourceRoot":"","sources":["../../src/signal/sharedSignalFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAErF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAS/B,IAAW,IAAI;QACd,OAAO,mBAAmB,CAAC,IAAI,CAAC;IACjC,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,mBAAmB,CAAC,UAAU,CAAC;IACvC,CAAC;IAEM,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,MAAM,GAAG,IAAI,iBAAiB,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAC9D,MAAM,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC5B,OAAO,MAAM,CAAC;IACf,CAAC;IAEM,MAAM,CAAC,QAAgC,EAAE,EAAU;QACzD,MAAM,MAAM,GAAG,IAAI,iBAAiB,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACpE,MAAM,CAAC,eAAe,EAAE,CAAC;QACzB,OAAO,MAAM,CAAC;IACf,CAAC;;AA/BsB,wBAAI,GAAW,0CAA0C,CAAC;AAE1D,8BAAU,GAAuB;IACvD,IAAI,EAAE,mBAAmB,CAAC,IAAI;IAC9B,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,UAAU;CAC1B,CAAC;AA4BH;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,sBAAsB,CAAgB,mBAAmB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelFactory,\n\tIChannelServices,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { createSharedObjectKind } from \"@fluidframework/shared-object-base/internal\";\n\nimport { pkgVersion } from \"../packageVersion.js\";\n\nimport type { ISharedSignal } from \"./interfaces.js\";\nimport { SharedSignalClass } from \"./sharedSignal.js\";\n\n/**\n * @internal\n */\nexport class SharedSignalFactory implements IChannelFactory<ISharedSignal> {\n\tpublic static readonly Type: string = \"https://graph.microsoft.com/types/signal\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: SharedSignalFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic get type(): string {\n\t\treturn SharedSignalFactory.Type;\n\t}\n\n\tpublic get attributes(): IChannelAttributes {\n\t\treturn SharedSignalFactory.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<ISharedSignal> {\n\t\tconst signal = new SharedSignalClass(id, runtime, attributes);\n\t\tawait signal.load(services);\n\t\treturn signal;\n\t}\n\n\tpublic create(document: IFluidDataStoreRuntime, id: string): ISharedSignal {\n\t\tconst signal = new SharedSignalClass(id, document, this.attributes);\n\t\tsignal.initializeLocal();\n\t\treturn signal;\n\t}\n}\n\n/**\n * Entrypoint for {@link ISharedSignal} creation.\n * @legacy\n * @alpha\n */\nexport const SharedSignal = createSharedObjectKind<ISharedSignal>(SharedSignalFactory);\n"]}
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.52.8"
9
+ }
10
+ ]
11
+ }
package/package.json ADDED
@@ -0,0 +1,158 @@
1
+ {
2
+ "name": "@fluidframework/legacy-dds",
3
+ "version": "2.50.0-345060",
4
+ "description": "Legacy DDSs for the Fluid Framework. These are not intended for use in new code.",
5
+ "homepage": "https://fluidframework.com",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/microsoft/FluidFramework.git",
9
+ "directory": "packages/dds/legacy-dds"
10
+ },
11
+ "license": "MIT",
12
+ "author": "Microsoft and contributors",
13
+ "sideEffects": false,
14
+ "type": "module",
15
+ "exports": {
16
+ ".": {
17
+ "import": {
18
+ "types": "./lib/public.d.ts",
19
+ "default": "./lib/index.js"
20
+ },
21
+ "require": {
22
+ "types": "./dist/public.d.ts",
23
+ "default": "./dist/index.js"
24
+ }
25
+ },
26
+ "./legacy": {
27
+ "import": {
28
+ "types": "./lib/legacy.d.ts",
29
+ "default": "./lib/index.js"
30
+ },
31
+ "require": {
32
+ "types": "./dist/legacy.d.ts",
33
+ "default": "./dist/index.js"
34
+ }
35
+ },
36
+ "./internal": {
37
+ "import": {
38
+ "types": "./lib/index.d.ts",
39
+ "default": "./lib/index.js"
40
+ },
41
+ "require": {
42
+ "types": "./dist/index.d.ts",
43
+ "default": "./dist/index.js"
44
+ }
45
+ }
46
+ },
47
+ "main": "lib/index.js",
48
+ "types": "lib/public.d.ts",
49
+ "c8": {
50
+ "all": true,
51
+ "cache-dir": "nyc/.cache",
52
+ "exclude": [
53
+ "src/test/**/*.*ts",
54
+ "dist/test/**/*.*js",
55
+ "lib/test/**/*.*js"
56
+ ],
57
+ "exclude-after-remap": false,
58
+ "include": [
59
+ "src/**/*.*ts",
60
+ "dist/**/*.*js",
61
+ "lib/**/*.*js"
62
+ ],
63
+ "report-dir": "nyc/report",
64
+ "reporter": [
65
+ "cobertura",
66
+ "html",
67
+ "text"
68
+ ],
69
+ "temp-directory": "nyc/.nyc_output"
70
+ },
71
+ "dependencies": {
72
+ "@fluidframework/core-interfaces": "2.50.0-345060",
73
+ "@fluidframework/core-utils": "2.50.0-345060",
74
+ "@fluidframework/datastore-definitions": "2.50.0-345060",
75
+ "@fluidframework/driver-definitions": "2.50.0-345060",
76
+ "@fluidframework/driver-utils": "2.50.0-345060",
77
+ "@fluidframework/runtime-definitions": "2.50.0-345060",
78
+ "@fluidframework/runtime-utils": "2.50.0-345060",
79
+ "@fluidframework/shared-object-base": "2.50.0-345060",
80
+ "uuid": "^9.0.0"
81
+ },
82
+ "devDependencies": {
83
+ "@arethetypeswrong/cli": "^0.17.1",
84
+ "@biomejs/biome": "~1.9.3",
85
+ "@fluid-internal/mocha-test-setup": "2.50.0-345060",
86
+ "@fluid-tools/build-cli": "^0.56.0",
87
+ "@fluidframework/build-common": "^2.0.3",
88
+ "@fluidframework/build-tools": "^0.56.0",
89
+ "@fluidframework/container-definitions": "2.50.0-345060",
90
+ "@fluidframework/eslint-config-fluid": "^5.7.4",
91
+ "@fluidframework/test-runtime-utils": "2.50.0-345060",
92
+ "@microsoft/api-extractor": "7.52.8",
93
+ "@types/jest": "29.5.3",
94
+ "@types/mocha": "^10.0.10",
95
+ "@types/node": "^18.19.0",
96
+ "@types/uuid": "^9.0.2",
97
+ "c8": "^8.0.1",
98
+ "concurrently": "^8.2.1",
99
+ "copyfiles": "^2.4.1",
100
+ "cross-env": "^7.0.3",
101
+ "eslint": "~8.55.0",
102
+ "mocha": "^10.8.2",
103
+ "mocha-multi-reporters": "^1.5.1",
104
+ "rimraf": "^4.4.0",
105
+ "typescript": "~5.4.5"
106
+ },
107
+ "typeValidation": {
108
+ "disabled": true,
109
+ "broken": {},
110
+ "entrypoint": "legacy"
111
+ },
112
+ "scripts": {
113
+ "api": "fluid-build . --task api",
114
+ "api-extractor:commonjs": "flub generate entrypoints --outDir ./dist",
115
+ "api-extractor:esnext": "flub generate entrypoints --outDir ./lib --node10TypeCompat",
116
+ "build": "fluid-build . --task build",
117
+ "build:api-reports": "concurrently \"npm:build:api-reports:*\"",
118
+ "build:api-reports:current": "api-extractor run --local --config api-extractor/api-extractor.current.json",
119
+ "build:api-reports:legacy": "api-extractor run --local --config api-extractor/api-extractor.legacy.json",
120
+ "build:commonjs": "fluid-build . --task commonjs",
121
+ "build:compile": "fluid-build . --task compile",
122
+ "build:docs": "api-extractor run --local",
123
+ "build:esnext": "tsc --project ./tsconfig.json",
124
+ "build:genver": "gen-version",
125
+ "build:test": "npm run build:test:esm && npm run build:test:cjs",
126
+ "build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
127
+ "build:test:esm": "tsc --project ./src/test/tsconfig.json",
128
+ "check:are-the-types-wrong": "attw --pack .",
129
+ "check:biome": "biome check .",
130
+ "check:exports": "concurrently \"npm:check:exports:*\"",
131
+ "check:exports:bundle-release-tags": "api-extractor run --config api-extractor/api-extractor-lint-bundle.json",
132
+ "check:exports:cjs:legacy": "api-extractor run --config api-extractor/api-extractor-lint-legacy.cjs.json",
133
+ "check:exports:cjs:public": "api-extractor run --config api-extractor/api-extractor-lint-public.cjs.json",
134
+ "check:exports:esm:legacy": "api-extractor run --config api-extractor/api-extractor-lint-legacy.esm.json",
135
+ "check:exports:esm:public": "api-extractor run --config api-extractor/api-extractor-lint-public.esm.json",
136
+ "check:format": "npm run check:biome",
137
+ "ci:build:api-reports": "concurrently \"npm:ci:build:api-reports:*\"",
138
+ "ci:build:api-reports:current": "api-extractor run --config api-extractor/api-extractor.current.json",
139
+ "ci:build:api-reports:legacy": "api-extractor run --config api-extractor/api-extractor.legacy.json",
140
+ "ci:build:docs": "api-extractor run",
141
+ "clean": "rimraf --glob dist lib {alpha,beta,internal,legacy}.d.ts \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
142
+ "eslint": "eslint --format stylish src",
143
+ "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
144
+ "format": "npm run format:biome",
145
+ "format:biome": "biome check . --write",
146
+ "lint": "fluid-build . --task lint",
147
+ "lint:fix": "fluid-build . --task eslint:fix --task format",
148
+ "test": "npm run test:mocha",
149
+ "test:coverage": "c8 npm test",
150
+ "test:mocha": "npm run test:mocha:esm && echo skipping cjs to avoid overhead - npm run test:mocha:cjs",
151
+ "test:mocha:cjs": "mocha --recursive \"dist/test/**/*.spec.*js\"",
152
+ "test:mocha:esm": "mocha --recursive \"lib/test/**/*.spec.*js\"",
153
+ "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
154
+ "tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
155
+ "typetests:gen": "flub generate typetests --dir . -v",
156
+ "typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
157
+ }
158
+ }
@@ -0,0 +1,32 @@
1
+ # @SharedArray
2
+
3
+ ## SharedArray
4
+
5
+ A DDS created by Loop which we now take ownership. Following README content is provided by them. Last commit in the office bohemia repo before migrating:
6
+ b148d32c796c79a4d934de89436aed0bdbba621f
7
+
8
+ The SharedArray distributed data structure can be used to store ordered sequence of values. It provides APIs to insert, delete and move a specific entry.
9
+
10
+ ### Creation
11
+
12
+ To create a `SharedArray`, call the static create method:
13
+
14
+ ```typescript
15
+ const myArray = SharedArray.create(this.runtime, id);
16
+ ```
17
+
18
+ ### Usage
19
+
20
+ Values in `SharedArray` must only be plain JS objects or handles (e.g. to another DDS or component).
21
+
22
+ In collaborative scenarios, the value is settled with a policy of _last write wins_ except for if a delete preceeds any other operation (in this case the element is considered deleted and hence no other operations for this entry is applied)
23
+
24
+ The DDS also supports undo/redo of any of the aforesaid operations.
25
+
26
+ #### `.move(fromIndex, toIndex)`
27
+
28
+ `SharedArray` has a `move` method in addition to the normal `insert` and `delete`, which moves the value of the curent index to the destination index.
29
+
30
+ ### Eventing
31
+
32
+ `SharedArray` is an `EventEmitter`, and will emit events when other clients make modifications. You should register for these events and respond appropriately as the data is modified. `valueChanged` will be emitted in response to a `insert` or `delete` or `move`.
@@ -0,0 +1,28 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ export {
7
+ SharedArrayFactory,
8
+ SharedArray,
9
+ SharedArrayBuilder,
10
+ } from "./sharedArrayFactory.js";
11
+ export { SharedArrayRevertible } from "./sharedArrayRevertible.js";
12
+ export type {
13
+ SerializableTypeForSharedArray,
14
+ ISharedArray,
15
+ ISharedArrayEvents,
16
+ ISharedArrayRevertible,
17
+ IRevertible,
18
+ } from "./interfaces.js";
19
+ export type {
20
+ ISharedArrayOperation,
21
+ IInsertOperation,
22
+ IDeleteOperation,
23
+ IMoveOperation,
24
+ ISharedArrayRevertibleOperation,
25
+ IToggleMoveOperation,
26
+ IToggleOperation,
27
+ } from "./sharedArrayOperations.js";
28
+ export { OperationType } from "./sharedArrayOperations.js";