@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
package/.eslintrc.cjs ADDED
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ module.exports = {
7
+ extends: [require.resolve("@fluidframework/eslint-config-fluid/strict"), "prettier"],
8
+ parserOptions: {
9
+ project: ["./tsconfig.json", "./src/test/tsconfig.json"],
10
+ },
11
+ };
package/.mocharc.cjs ADDED
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ "use strict";
7
+
8
+ const getFluidTestMochaConfig = require("@fluid-internal/mocha-test-setup/mocharc-common");
9
+
10
+ const packageDir = __dirname;
11
+ const config = getFluidTestMochaConfig(packageDir);
12
+ module.exports = config;
package/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # @fluid-private/legacy-dds
2
+
3
+ ## 2.43.0
4
+
5
+ Dependency updates only.
6
+
7
+ ## 2.42.0
8
+
9
+ Dependency updates only.
10
+
11
+ ## 2.41.0
12
+
13
+ New package.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ Copyright (c) Microsoft Corporation and contributors. All rights reserved.
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.json",
4
+ "mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
4
+ "mainEntryPointFilePath": "<projectFolder>/dist/legacy.d.ts"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
4
+ "mainEntryPointFilePath": "<projectFolder>/lib/legacy.d.ts"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
4
+ "mainEntryPointFilePath": "<projectFolder>/dist/public.d.ts"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
4
+ "mainEntryPointFilePath": "<projectFolder>/lib/public.d.ts"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-report.esm.current.json",
4
+ "mainEntryPointFilePath": "<projectFolder>/lib/public.d.ts"
5
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-report.esm.legacy.json"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../common/build/build-common/api-extractor-lint.esm.primary.json"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../common/build/build-common/api-extractor-model.esm.json"
4
+ }
@@ -0,0 +1,9 @@
1
+ ## Beta API Report File for "@fluidframework/legacy-dds"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ // (No @packageDocumentation comment for this package)
8
+
9
+ ```
@@ -0,0 +1,140 @@
1
+ ## Alpha API Report File for "@fluidframework/legacy-dds"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ // @alpha @legacy (undocumented)
8
+ export interface IDeleteOperation {
9
+ // (undocumented)
10
+ entryId: string;
11
+ // (undocumented)
12
+ type: typeof OperationType.deleteEntry;
13
+ }
14
+
15
+ // @alpha @legacy (undocumented)
16
+ export interface IInsertOperation<T = unknown> {
17
+ // (undocumented)
18
+ entryId: string;
19
+ // (undocumented)
20
+ insertAfterEntryId?: string;
21
+ // (undocumented)
22
+ type: typeof OperationType.insertEntry;
23
+ // (undocumented)
24
+ value: T;
25
+ }
26
+
27
+ // @alpha @legacy (undocumented)
28
+ export interface IMoveOperation {
29
+ // (undocumented)
30
+ changedToEntryId: string;
31
+ // (undocumented)
32
+ entryId: string;
33
+ // (undocumented)
34
+ insertAfterEntryId?: string;
35
+ // (undocumented)
36
+ type: typeof OperationType.moveEntry;
37
+ }
38
+
39
+ // @alpha @legacy (undocumented)
40
+ export interface IRevertible {
41
+ // (undocumented)
42
+ dispose(): void;
43
+ // (undocumented)
44
+ revert(): void;
45
+ }
46
+
47
+ // @alpha @legacy
48
+ export interface ISharedArray<T extends SerializableTypeForSharedArray> extends ISharedObject<ISharedArrayEvents> {
49
+ // (undocumented)
50
+ delete(index: number): void;
51
+ // (undocumented)
52
+ get(): readonly T[];
53
+ // (undocumented)
54
+ insert<TWrite>(index: number, value: Serializable<TWrite> & T): void;
55
+ // (undocumented)
56
+ insertBulkAfter<TWrite>(ref: T | undefined, values: (Serializable<TWrite> & T)[]): void;
57
+ // (undocumented)
58
+ move(oldIndex: number, newIndex: number): void;
59
+ // (undocumented)
60
+ toggle(entryId: string): void;
61
+ // (undocumented)
62
+ toggleMove(oldEntryId: string, newEntryId: string): void;
63
+ }
64
+
65
+ // @alpha @legacy
66
+ export interface ISharedArrayEvents extends ISharedObjectEvents {
67
+ // @eventProperty (undocumented)
68
+ (event: "valueChanged", listener: (op: ISharedArrayOperation, isLocal: boolean, target: IEventThisPlaceHolder) => void): void;
69
+ // @eventProperty (undocumented)
70
+ (event: "revertible", listener: (revertible: IRevertible) => void): void;
71
+ }
72
+
73
+ // @alpha @legacy (undocumented)
74
+ export type ISharedArrayOperation<T = unknown> = IInsertOperation<T> | IDeleteOperation | IMoveOperation | ISharedArrayRevertibleOperation;
75
+
76
+ // @alpha @legacy (undocumented)
77
+ export type ISharedArrayRevertibleOperation = IToggleOperation | IToggleMoveOperation;
78
+
79
+ // @alpha @legacy (undocumented)
80
+ export interface ISharedSignal<T extends SerializableTypeForSharedSignal = any> extends ISharedObject<ISharedSignalEvents<T>> {
81
+ // (undocumented)
82
+ notify(metadata?: T): void;
83
+ }
84
+
85
+ // @alpha @legacy (undocumented)
86
+ export interface ISharedSignalEvents<T extends SerializableTypeForSharedSignal> extends ISharedObjectEvents {
87
+ // (undocumented)
88
+ (event: "notify", listener: (value: T, isLocal: boolean) => void): any;
89
+ }
90
+
91
+ // @alpha @legacy (undocumented)
92
+ export interface IToggleMoveOperation {
93
+ // (undocumented)
94
+ changedToEntryId: string;
95
+ // (undocumented)
96
+ entryId: string;
97
+ // (undocumented)
98
+ type: typeof OperationType.toggleMove;
99
+ }
100
+
101
+ // @alpha @legacy (undocumented)
102
+ export interface IToggleOperation {
103
+ // (undocumented)
104
+ entryId: string;
105
+ // (undocumented)
106
+ isDeleted: boolean;
107
+ // (undocumented)
108
+ type: typeof OperationType.toggle;
109
+ }
110
+
111
+ // @alpha @legacy (undocumented)
112
+ export const OperationType: {
113
+ readonly insertEntry: 0;
114
+ readonly deleteEntry: 1;
115
+ readonly moveEntry: 2;
116
+ readonly toggle: 3;
117
+ readonly toggleMove: 4;
118
+ };
119
+
120
+ // @alpha @legacy (undocumented)
121
+ export type OperationType = (typeof OperationType)[keyof typeof OperationType];
122
+
123
+ // @alpha @legacy
124
+ export type SerializableTypeForSharedArray = boolean | number | string | object | IFluidHandle;
125
+
126
+ // @alpha @legacy
127
+ export type SerializableTypeForSharedSignal = boolean | number | string | IFluidHandle | object;
128
+
129
+ // @alpha @legacy
130
+ export const SharedArray: ISharedObjectKind<ISharedArray<SerializableTypeForSharedArray>> & SharedObjectKind<ISharedArray<SerializableTypeForSharedArray>>;
131
+
132
+ // @alpha @legacy
133
+ export const SharedArrayBuilder: <T extends SerializableTypeForSharedArray>() => ISharedObjectKind<ISharedArray<T>> & SharedObjectKind<ISharedArray<T>>;
134
+
135
+ // @alpha @legacy
136
+ export const SharedSignal: ISharedObjectKind<ISharedSignal<any>> & SharedObjectKind<ISharedSignal<any>>;
137
+
138
+ // (No @packageDocumentation comment for this package)
139
+
140
+ ```
@@ -0,0 +1,9 @@
1
+ ## Public API Report File for "@fluidframework/legacy-dds"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ // (No @packageDocumentation comment for this package)
8
+
9
+ ```
@@ -0,0 +1,9 @@
1
+ ## Public API Report File for "@fluidframework/legacy-dds"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ // (No @packageDocumentation comment for this package)
8
+
9
+ ```
package/biome.jsonc ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3
+ "extends": ["../../../biome.jsonc"]
4
+ }
@@ -0,0 +1,10 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ export { SharedArrayFactory, SharedArray, SharedArrayBuilder, } from "./sharedArrayFactory.js";
6
+ export { SharedArrayRevertible } from "./sharedArrayRevertible.js";
7
+ export type { SerializableTypeForSharedArray, ISharedArray, ISharedArrayEvents, ISharedArrayRevertible, IRevertible, } from "./interfaces.js";
8
+ export type { ISharedArrayOperation, IInsertOperation, IDeleteOperation, IMoveOperation, ISharedArrayRevertibleOperation, IToggleMoveOperation, IToggleOperation, } from "./sharedArrayOperations.js";
9
+ export { OperationType } from "./sharedArrayOperations.js";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/array/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,WAAW,EACX,kBAAkB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,YAAY,EACX,8BAA8B,EAC9B,YAAY,EACZ,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,GACX,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACX,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,+BAA+B,EAC/B,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.OperationType = exports.SharedArrayRevertible = exports.SharedArrayBuilder = exports.SharedArray = exports.SharedArrayFactory = void 0;
8
+ var sharedArrayFactory_js_1 = require("./sharedArrayFactory.js");
9
+ Object.defineProperty(exports, "SharedArrayFactory", { enumerable: true, get: function () { return sharedArrayFactory_js_1.SharedArrayFactory; } });
10
+ Object.defineProperty(exports, "SharedArray", { enumerable: true, get: function () { return sharedArrayFactory_js_1.SharedArray; } });
11
+ Object.defineProperty(exports, "SharedArrayBuilder", { enumerable: true, get: function () { return sharedArrayFactory_js_1.SharedArrayBuilder; } });
12
+ var sharedArrayRevertible_js_1 = require("./sharedArrayRevertible.js");
13
+ Object.defineProperty(exports, "SharedArrayRevertible", { enumerable: true, get: function () { return sharedArrayRevertible_js_1.SharedArrayRevertible; } });
14
+ var sharedArrayOperations_js_1 = require("./sharedArrayOperations.js");
15
+ Object.defineProperty(exports, "OperationType", { enumerable: true, get: function () { return sharedArrayOperations_js_1.OperationType; } });
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/array/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iEAIiC;AAHhC,2HAAA,kBAAkB,OAAA;AAClB,oHAAA,WAAW,OAAA;AACX,2HAAA,kBAAkB,OAAA;AAEnB,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAiB9B,uEAA2D;AAAlD,yHAAA,aAAa,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tSharedArrayFactory,\n\tSharedArray,\n\tSharedArrayBuilder,\n} from \"./sharedArrayFactory.js\";\nexport { SharedArrayRevertible } from \"./sharedArrayRevertible.js\";\nexport type {\n\tSerializableTypeForSharedArray,\n\tISharedArray,\n\tISharedArrayEvents,\n\tISharedArrayRevertible,\n\tIRevertible,\n} from \"./interfaces.js\";\nexport type {\n\tISharedArrayOperation,\n\tIInsertOperation,\n\tIDeleteOperation,\n\tIMoveOperation,\n\tISharedArrayRevertibleOperation,\n\tIToggleMoveOperation,\n\tIToggleOperation,\n} from \"./sharedArrayOperations.js\";\nexport { OperationType } from \"./sharedArrayOperations.js\";\n"]}
@@ -0,0 +1,142 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import type { IEventThisPlaceHolder, IFluidHandle } from "@fluidframework/core-interfaces";
6
+ import type { Serializable } from "@fluidframework/datastore-definitions/internal";
7
+ import type { ISharedObjectEvents, ISharedObject } from "@fluidframework/shared-object-base/internal";
8
+ import type { ISharedArrayOperation } from "./sharedArrayOperations.js";
9
+ /**
10
+ * Basic types for the SharedArray DDS
11
+ * It can be used as a generic constraint (`extends SerializableTypeForSharedArray`) but is
12
+ * *never* meant to be a concrete/real type on its own.
13
+ *
14
+ * @legacy
15
+ * @alpha
16
+ */
17
+ export type SerializableTypeForSharedArray = boolean | number | string | object | IFluidHandle;
18
+ /**
19
+ * Interface defining the events that can be emitted by the SharedArray DDS
20
+ * and the events that can be listened to by the SharedArray DDS
21
+ *
22
+ * @legacy
23
+ * @alpha
24
+ */
25
+ export interface ISharedArrayEvents extends ISharedObjectEvents {
26
+ /**
27
+ *
28
+ * @param event - The event name.
29
+ * @param listener - An event listener.
30
+ *
31
+ * @eventProperty
32
+ */
33
+ (event: "valueChanged", listener: (op: ISharedArrayOperation, isLocal: boolean, target: IEventThisPlaceHolder) => void): void;
34
+ /**
35
+ *
36
+ * @param event - The event name.
37
+ * @param listener - An event listener.
38
+ *
39
+ * @eventProperty
40
+ */
41
+ (event: "revertible", listener: (revertible: IRevertible) => void): void;
42
+ }
43
+ /**
44
+ * Interface defining the SharedArray DDS
45
+ * It is a generic interface that can be used to create a SharedArray of any type
46
+ * The type of the SharedArray is defined by the type parameter T
47
+ *
48
+ * @typeParam T - The type of the SharedArray
49
+ *
50
+ * @legacy
51
+ * @alpha
52
+ */
53
+ export interface ISharedArray<T extends SerializableTypeForSharedArray> extends ISharedObject<ISharedArrayEvents> {
54
+ get(): readonly T[];
55
+ insert<TWrite>(index: number, value: Serializable<TWrite> & T): void;
56
+ delete(index: number): void;
57
+ move(oldIndex: number, newIndex: number): void;
58
+ toggle(entryId: string): void;
59
+ toggleMove(oldEntryId: string, newEntryId: string): void;
60
+ insertBulkAfter<TWrite>(ref: T | undefined, values: (Serializable<TWrite> & T)[]): void;
61
+ }
62
+ /**
63
+ *
64
+ * @internal
65
+ */
66
+ export interface ISharedArrayRevertible extends ISharedObject<ISharedArrayEvents> {
67
+ toggle(entryId: string): void;
68
+ toggleMove(oldEntryId: string, newEntryId: string): void;
69
+ }
70
+ /**
71
+ * Interface defining the in memory shared array entry of the DDS
72
+ *
73
+ * @internal
74
+ */
75
+ export interface SharedArrayEntry<T extends SerializableTypeForSharedArray> extends SharedArrayEntryCore<T> {
76
+ /**
77
+ * Flag that tracks whether an ack from the server has been received for a local insert.
78
+ * True for local changes.
79
+ */
80
+ isAckPending: boolean;
81
+ /**
82
+ * Counter is shared by delete and undo/redo (of delete and insert) as undo/redo simply
83
+ * operates on the isDeleted flag of the DDS. This flag will help us skip local op acks as
84
+ * they have already inflicted state change. The flag helps us ignore remote ops if there is a
85
+ * local pending delete as we would be getting the pending op after server stamping
86
+ */
87
+ isLocalPendingDelete: number;
88
+ /**
89
+ * Counter is for move and its undo/redo. This flag will be used to skip local op acks as
90
+ * they have already inflicted state change. The flag helps us ignore remote ops if there is a
91
+ * local pending delete as we would be getting the pending op after server stamping. Only exception
92
+ * being if there is a remote delete, we will have to respect that
93
+ */
94
+ isLocalPendingMove: number;
95
+ }
96
+ /**
97
+ * Interface defining the core entry attributes
98
+ *
99
+ * @internal
100
+ */
101
+ export interface SharedArrayEntryCore<T extends SerializableTypeForSharedArray> {
102
+ /**
103
+ * a unique ID for this particular entry
104
+ */
105
+ entryId: string;
106
+ /**
107
+ * the value stored in this entry, may not be unique
108
+ */
109
+ value: T;
110
+ /**
111
+ * Flag to track whether this entry is deleted or not.
112
+ */
113
+ isDeleted: boolean;
114
+ /**
115
+ * Primarily used for move op and tracks the old entry id from which this entry was changed from.
116
+ */
117
+ prevEntryId?: string;
118
+ /**
119
+ * Primarily used for move op and tracks the new entry id to which this entry was changed to.
120
+ */
121
+ nextEntryId?: string;
122
+ }
123
+ /**
124
+ * Format of the snapshot for the DDS
125
+ *
126
+ * @internal
127
+ */
128
+ export interface SnapshotFormat<T> {
129
+ /**
130
+ * Array of the data entries that represent the DDS in-memory representation
131
+ */
132
+ dataArray: T[];
133
+ }
134
+ /**
135
+ * @legacy
136
+ * @alpha
137
+ */
138
+ export interface IRevertible {
139
+ revert(): void;
140
+ dispose(): void;
141
+ }
142
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../src/array/interfaces.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/array/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 { IEventThisPlaceHolder, IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport type { Serializable } from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tISharedObjectEvents,\n\tISharedObject,\n} from \"@fluidframework/shared-object-base/internal\";\n\nimport type { ISharedArrayOperation } from \"./sharedArrayOperations.js\";\n/**\n * Basic types for the SharedArray DDS\n * It can be used as a generic constraint (`extends SerializableTypeForSharedArray`) but is\n * *never* meant to be a concrete/real type on its own.\n *\n * @legacy\n * @alpha\n */\nexport type SerializableTypeForSharedArray = boolean | number | string | object | IFluidHandle;\n\n/**\n * Interface defining the events that can be emitted by the SharedArray DDS\n * and the events that can be listened to by the SharedArray DDS\n *\n * @legacy\n * @alpha\n */\nexport interface ISharedArrayEvents extends ISharedObjectEvents {\n\t/**\n\t *\n\t * @param event - The event name.\n\t * @param listener - An event listener.\n\t *\n\t * @eventProperty\n\t */\n\t(\n\t\tevent: \"valueChanged\",\n\t\tlistener: (\n\t\t\top: ISharedArrayOperation,\n\t\t\tisLocal: boolean,\n\t\t\ttarget: IEventThisPlaceHolder,\n\t\t) => void,\n\t): void;\n\n\t/**\n\t *\n\t * @param event - The event name.\n\t * @param listener - An event listener.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"revertible\", listener: (revertible: IRevertible) => void): void;\n}\n\n/**\n * Interface defining the SharedArray DDS\n * It is a generic interface that can be used to create a SharedArray of any type\n * The type of the SharedArray is defined by the type parameter T\n *\n * @typeParam T - The type of the SharedArray\n *\n * @legacy\n * @alpha\n */\nexport interface ISharedArray<T extends SerializableTypeForSharedArray>\n\textends ISharedObject<ISharedArrayEvents> {\n\tget(): readonly T[];\n\tinsert<TWrite>(index: number, value: Serializable<TWrite> & T): void;\n\tdelete(index: number): void;\n\tmove(oldIndex: number, newIndex: number): void;\n\ttoggle(entryId: string): void;\n\ttoggleMove(oldEntryId: string, newEntryId: string): void;\n\tinsertBulkAfter<TWrite>(ref: T | undefined, values: (Serializable<TWrite> & T)[]): void;\n}\n\n/**\n *\n * @internal\n */\nexport interface ISharedArrayRevertible extends ISharedObject<ISharedArrayEvents> {\n\ttoggle(entryId: string): void;\n\ttoggleMove(oldEntryId: string, newEntryId: string): void;\n}\n\n/**\n * Interface defining the in memory shared array entry of the DDS\n *\n * @internal\n */\nexport interface SharedArrayEntry<T extends SerializableTypeForSharedArray>\n\textends SharedArrayEntryCore<T> {\n\t/**\n\t * Flag that tracks whether an ack from the server has been received for a local insert.\n\t * True for local changes.\n\t */\n\tisAckPending: boolean;\n\n\t/**\n\t * Counter is shared by delete and undo/redo (of delete and insert) as undo/redo simply\n\t * operates on the isDeleted flag of the DDS. This flag will help us skip local op acks as\n\t * they have already inflicted state change. The flag helps us ignore remote ops if there is a\n\t * local pending delete as we would be getting the pending op after server stamping\n\t */\n\tisLocalPendingDelete: number;\n\n\t/**\n\t * Counter is for move and its undo/redo. This flag will be used to skip local op acks as\n\t * they have already inflicted state change. The flag helps us ignore remote ops if there is a\n\t * local pending delete as we would be getting the pending op after server stamping. Only exception\n\t * being if there is a remote delete, we will have to respect that\n\t */\n\tisLocalPendingMove: number;\n}\n\n/**\n * Interface defining the core entry attributes\n *\n * @internal\n */\nexport interface SharedArrayEntryCore<T extends SerializableTypeForSharedArray> {\n\t/**\n\t * a unique ID for this particular entry\n\t */\n\tentryId: string;\n\n\t/**\n\t * the value stored in this entry, may not be unique\n\t */\n\tvalue: T;\n\n\t/**\n\t * Flag to track whether this entry is deleted or not.\n\t */\n\tisDeleted: boolean;\n\n\t/**\n\t * Primarily used for move op and tracks the old entry id from which this entry was changed from.\n\t */\n\tprevEntryId?: string;\n\n\t/**\n\t * Primarily used for move op and tracks the new entry id to which this entry was changed to.\n\t */\n\tnextEntryId?: string;\n}\n\n/**\n * Format of the snapshot for the DDS\n *\n * @internal\n */\nexport interface SnapshotFormat<T> {\n\t/**\n\t * Array of the data entries that represent the DDS in-memory representation\n\t */\n\tdataArray: T[];\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IRevertible {\n\trevert(): void;\n\tdispose(): void;\n}\n"]}