@fluidframework/presence 2.92.0 → 2.93.0

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 (259) hide show
  1. package/README.md +4 -4
  2. package/dist/alpha.d.ts +6 -4
  3. package/dist/beta.d.ts +5 -2
  4. package/dist/getPresence.d.ts +4 -9
  5. package/dist/getPresence.d.ts.map +1 -1
  6. package/dist/getPresence.js +6 -86
  7. package/dist/getPresence.js.map +1 -1
  8. package/dist/index.d.ts +4 -13
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +8 -8
  11. package/dist/index.js.map +1 -1
  12. package/dist/legacy.alpha.d.ts +6 -4
  13. package/dist/package.json +1 -15
  14. package/dist/public.d.ts +69 -0
  15. package/lib/alpha.d.ts +6 -4
  16. package/lib/beta.d.ts +5 -2
  17. package/lib/getPresence.d.ts +4 -9
  18. package/lib/getPresence.d.ts.map +1 -1
  19. package/lib/getPresence.js +6 -85
  20. package/lib/getPresence.js.map +1 -1
  21. package/lib/index.d.ts +4 -13
  22. package/lib/index.d.ts.map +1 -1
  23. package/lib/index.js +5 -4
  24. package/lib/index.js.map +1 -1
  25. package/lib/legacy.alpha.d.ts +6 -4
  26. package/lib/public.d.ts +69 -0
  27. package/package.json +27 -76
  28. package/dist/baseTypes.d.ts +0 -24
  29. package/dist/baseTypes.d.ts.map +0 -1
  30. package/dist/baseTypes.js +0 -7
  31. package/dist/baseTypes.js.map +0 -1
  32. package/dist/broadcastControls.d.ts +0 -37
  33. package/dist/broadcastControls.d.ts.map +0 -1
  34. package/dist/broadcastControls.js +0 -60
  35. package/dist/broadcastControls.js.map +0 -1
  36. package/dist/broadcastControlsTypes.d.ts +0 -38
  37. package/dist/broadcastControlsTypes.d.ts.map +0 -1
  38. package/dist/broadcastControlsTypes.js +0 -7
  39. package/dist/broadcastControlsTypes.js.map +0 -1
  40. package/dist/exposedInternalTypes.d.ts +0 -138
  41. package/dist/exposedInternalTypes.d.ts.map +0 -1
  42. package/dist/exposedInternalTypes.js +0 -19
  43. package/dist/exposedInternalTypes.js.map +0 -1
  44. package/dist/exposedUtilityTypes.d.ts +0 -108
  45. package/dist/exposedUtilityTypes.d.ts.map +0 -1
  46. package/dist/exposedUtilityTypes.js +0 -7
  47. package/dist/exposedUtilityTypes.js.map +0 -1
  48. package/dist/internalUtils.d.ts +0 -125
  49. package/dist/internalUtils.d.ts.map +0 -1
  50. package/dist/internalUtils.js +0 -99
  51. package/dist/internalUtils.js.map +0 -1
  52. package/dist/latestMapTypes.d.ts +0 -343
  53. package/dist/latestMapTypes.d.ts.map +0 -1
  54. package/dist/latestMapTypes.js +0 -7
  55. package/dist/latestMapTypes.js.map +0 -1
  56. package/dist/latestMapValueManager.d.ts +0 -52
  57. package/dist/latestMapValueManager.d.ts.map +0 -1
  58. package/dist/latestMapValueManager.js +0 -250
  59. package/dist/latestMapValueManager.js.map +0 -1
  60. package/dist/latestTypes.d.ts +0 -183
  61. package/dist/latestTypes.d.ts.map +0 -1
  62. package/dist/latestTypes.js +0 -7
  63. package/dist/latestTypes.js.map +0 -1
  64. package/dist/latestValueManager.d.ts +0 -10
  65. package/dist/latestValueManager.d.ts.map +0 -1
  66. package/dist/latestValueManager.js +0 -117
  67. package/dist/latestValueManager.js.map +0 -1
  68. package/dist/latestValueTypes.d.ts +0 -108
  69. package/dist/latestValueTypes.d.ts.map +0 -1
  70. package/dist/latestValueTypes.js +0 -7
  71. package/dist/latestValueTypes.js.map +0 -1
  72. package/dist/notificationsManager.d.ts +0 -27
  73. package/dist/notificationsManager.d.ts.map +0 -1
  74. package/dist/notificationsManager.js +0 -98
  75. package/dist/notificationsManager.js.map +0 -1
  76. package/dist/notificationsManagerTypes.d.ts +0 -144
  77. package/dist/notificationsManagerTypes.d.ts.map +0 -1
  78. package/dist/notificationsManagerTypes.js +0 -7
  79. package/dist/notificationsManagerTypes.js.map +0 -1
  80. package/dist/packageVersion.d.ts +0 -9
  81. package/dist/packageVersion.d.ts.map +0 -1
  82. package/dist/packageVersion.js +0 -12
  83. package/dist/packageVersion.js.map +0 -1
  84. package/dist/presence.d.ts +0 -229
  85. package/dist/presence.d.ts.map +0 -1
  86. package/dist/presence.js +0 -23
  87. package/dist/presence.js.map +0 -1
  88. package/dist/presenceDatastoreManager.d.ts +0 -149
  89. package/dist/presenceDatastoreManager.d.ts.map +0 -1
  90. package/dist/presenceDatastoreManager.js +0 -667
  91. package/dist/presenceDatastoreManager.js.map +0 -1
  92. package/dist/presenceManager.d.ts +0 -16
  93. package/dist/presenceManager.d.ts.map +0 -1
  94. package/dist/presenceManager.js +0 -140
  95. package/dist/presenceManager.js.map +0 -1
  96. package/dist/presenceStates.d.ts +0 -102
  97. package/dist/presenceStates.d.ts.map +0 -1
  98. package/dist/presenceStates.js +0 -231
  99. package/dist/presenceStates.js.map +0 -1
  100. package/dist/protocol.d.ts +0 -111
  101. package/dist/protocol.d.ts.map +0 -1
  102. package/dist/protocol.js +0 -20
  103. package/dist/protocol.js.map +0 -1
  104. package/dist/runtimeTypes.d.ts +0 -26
  105. package/dist/runtimeTypes.d.ts.map +0 -1
  106. package/dist/runtimeTypes.js +0 -7
  107. package/dist/runtimeTypes.js.map +0 -1
  108. package/dist/stateDatastore.d.ts +0 -56
  109. package/dist/stateDatastore.d.ts.map +0 -1
  110. package/dist/stateDatastore.js +0 -22
  111. package/dist/stateDatastore.js.map +0 -1
  112. package/dist/stateFactory.d.ts +0 -18
  113. package/dist/stateFactory.d.ts.map +0 -1
  114. package/dist/stateFactory.js +0 -23
  115. package/dist/stateFactory.js.map +0 -1
  116. package/dist/statesManagerTypes.d.ts +0 -27
  117. package/dist/statesManagerTypes.d.ts.map +0 -1
  118. package/dist/statesManagerTypes.js +0 -7
  119. package/dist/statesManagerTypes.js.map +0 -1
  120. package/dist/systemWorkspace.d.ts +0 -58
  121. package/dist/systemWorkspace.d.ts.map +0 -1
  122. package/dist/systemWorkspace.js +0 -265
  123. package/dist/systemWorkspace.js.map +0 -1
  124. package/dist/timerManager.d.ts +0 -37
  125. package/dist/timerManager.d.ts.map +0 -1
  126. package/dist/timerManager.js +0 -65
  127. package/dist/timerManager.js.map +0 -1
  128. package/dist/types.d.ts +0 -132
  129. package/dist/types.d.ts.map +0 -1
  130. package/dist/types.js +0 -7
  131. package/dist/types.js.map +0 -1
  132. package/dist/validatableTypes.d.ts +0 -69
  133. package/dist/validatableTypes.d.ts.map +0 -1
  134. package/dist/validatableTypes.js +0 -7
  135. package/dist/validatableTypes.js.map +0 -1
  136. package/dist/validatedGetter.d.ts +0 -18
  137. package/dist/validatedGetter.d.ts.map +0 -1
  138. package/dist/validatedGetter.js +0 -43
  139. package/dist/validatedGetter.js.map +0 -1
  140. package/dist/valueManager.d.ts +0 -15
  141. package/dist/valueManager.d.ts.map +0 -1
  142. package/dist/valueManager.js +0 -22
  143. package/dist/valueManager.js.map +0 -1
  144. package/lib/baseTypes.d.ts +0 -24
  145. package/lib/baseTypes.d.ts.map +0 -1
  146. package/lib/baseTypes.js +0 -6
  147. package/lib/baseTypes.js.map +0 -1
  148. package/lib/broadcastControls.d.ts +0 -37
  149. package/lib/broadcastControls.d.ts.map +0 -1
  150. package/lib/broadcastControls.js +0 -55
  151. package/lib/broadcastControls.js.map +0 -1
  152. package/lib/broadcastControlsTypes.d.ts +0 -38
  153. package/lib/broadcastControlsTypes.d.ts.map +0 -1
  154. package/lib/broadcastControlsTypes.js +0 -6
  155. package/lib/broadcastControlsTypes.js.map +0 -1
  156. package/lib/exposedInternalTypes.d.ts +0 -138
  157. package/lib/exposedInternalTypes.d.ts.map +0 -1
  158. package/lib/exposedInternalTypes.js +0 -16
  159. package/lib/exposedInternalTypes.js.map +0 -1
  160. package/lib/exposedUtilityTypes.d.ts +0 -108
  161. package/lib/exposedUtilityTypes.d.ts.map +0 -1
  162. package/lib/exposedUtilityTypes.js +0 -6
  163. package/lib/exposedUtilityTypes.js.map +0 -1
  164. package/lib/internalUtils.d.ts +0 -125
  165. package/lib/internalUtils.d.ts.map +0 -1
  166. package/lib/internalUtils.js +0 -90
  167. package/lib/internalUtils.js.map +0 -1
  168. package/lib/latestMapTypes.d.ts +0 -343
  169. package/lib/latestMapTypes.d.ts.map +0 -1
  170. package/lib/latestMapTypes.js +0 -6
  171. package/lib/latestMapTypes.js.map +0 -1
  172. package/lib/latestMapValueManager.d.ts +0 -52
  173. package/lib/latestMapValueManager.d.ts.map +0 -1
  174. package/lib/latestMapValueManager.js +0 -246
  175. package/lib/latestMapValueManager.js.map +0 -1
  176. package/lib/latestTypes.d.ts +0 -183
  177. package/lib/latestTypes.d.ts.map +0 -1
  178. package/lib/latestTypes.js +0 -6
  179. package/lib/latestTypes.js.map +0 -1
  180. package/lib/latestValueManager.d.ts +0 -10
  181. package/lib/latestValueManager.d.ts.map +0 -1
  182. package/lib/latestValueManager.js +0 -113
  183. package/lib/latestValueManager.js.map +0 -1
  184. package/lib/latestValueTypes.d.ts +0 -108
  185. package/lib/latestValueTypes.d.ts.map +0 -1
  186. package/lib/latestValueTypes.js +0 -6
  187. package/lib/latestValueTypes.js.map +0 -1
  188. package/lib/notificationsManager.d.ts +0 -27
  189. package/lib/notificationsManager.d.ts.map +0 -1
  190. package/lib/notificationsManager.js +0 -94
  191. package/lib/notificationsManager.js.map +0 -1
  192. package/lib/notificationsManagerTypes.d.ts +0 -144
  193. package/lib/notificationsManagerTypes.d.ts.map +0 -1
  194. package/lib/notificationsManagerTypes.js +0 -6
  195. package/lib/notificationsManagerTypes.js.map +0 -1
  196. package/lib/packageVersion.d.ts +0 -9
  197. package/lib/packageVersion.d.ts.map +0 -1
  198. package/lib/packageVersion.js +0 -9
  199. package/lib/packageVersion.js.map +0 -1
  200. package/lib/presence.d.ts +0 -229
  201. package/lib/presence.d.ts.map +0 -1
  202. package/lib/presence.js +0 -20
  203. package/lib/presence.js.map +0 -1
  204. package/lib/presenceDatastoreManager.d.ts +0 -149
  205. package/lib/presenceDatastoreManager.d.ts.map +0 -1
  206. package/lib/presenceDatastoreManager.js +0 -663
  207. package/lib/presenceDatastoreManager.js.map +0 -1
  208. package/lib/presenceManager.d.ts +0 -16
  209. package/lib/presenceManager.d.ts.map +0 -1
  210. package/lib/presenceManager.js +0 -136
  211. package/lib/presenceManager.js.map +0 -1
  212. package/lib/presenceStates.d.ts +0 -102
  213. package/lib/presenceStates.d.ts.map +0 -1
  214. package/lib/presenceStates.js +0 -225
  215. package/lib/presenceStates.js.map +0 -1
  216. package/lib/protocol.d.ts +0 -111
  217. package/lib/protocol.d.ts.map +0 -1
  218. package/lib/protocol.js +0 -17
  219. package/lib/protocol.js.map +0 -1
  220. package/lib/runtimeTypes.d.ts +0 -26
  221. package/lib/runtimeTypes.d.ts.map +0 -1
  222. package/lib/runtimeTypes.js +0 -6
  223. package/lib/runtimeTypes.js.map +0 -1
  224. package/lib/stateDatastore.d.ts +0 -56
  225. package/lib/stateDatastore.d.ts.map +0 -1
  226. package/lib/stateDatastore.js +0 -17
  227. package/lib/stateDatastore.js.map +0 -1
  228. package/lib/stateFactory.d.ts +0 -18
  229. package/lib/stateFactory.d.ts.map +0 -1
  230. package/lib/stateFactory.js +0 -20
  231. package/lib/stateFactory.js.map +0 -1
  232. package/lib/statesManagerTypes.d.ts +0 -27
  233. package/lib/statesManagerTypes.d.ts.map +0 -1
  234. package/lib/statesManagerTypes.js +0 -6
  235. package/lib/statesManagerTypes.js.map +0 -1
  236. package/lib/systemWorkspace.d.ts +0 -58
  237. package/lib/systemWorkspace.d.ts.map +0 -1
  238. package/lib/systemWorkspace.js +0 -261
  239. package/lib/systemWorkspace.js.map +0 -1
  240. package/lib/timerManager.d.ts +0 -37
  241. package/lib/timerManager.d.ts.map +0 -1
  242. package/lib/timerManager.js +0 -61
  243. package/lib/timerManager.js.map +0 -1
  244. package/lib/types.d.ts +0 -132
  245. package/lib/types.d.ts.map +0 -1
  246. package/lib/types.js +0 -6
  247. package/lib/types.js.map +0 -1
  248. package/lib/validatableTypes.d.ts +0 -69
  249. package/lib/validatableTypes.d.ts.map +0 -1
  250. package/lib/validatableTypes.js +0 -6
  251. package/lib/validatableTypes.js.map +0 -1
  252. package/lib/validatedGetter.d.ts +0 -18
  253. package/lib/validatedGetter.d.ts.map +0 -1
  254. package/lib/validatedGetter.js +0 -39
  255. package/lib/validatedGetter.js.map +0 -1
  256. package/lib/valueManager.d.ts +0 -15
  257. package/lib/valueManager.d.ts.map +0 -1
  258. package/lib/valueManager.js +0 -17
  259. package/lib/valueManager.js.map +0 -1
@@ -2,99 +2,20 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { assert, fail } from "@fluidframework/core-utils/internal";
6
- import { isInternalFluidContainer } from "@fluidframework/fluid-static/internal";
7
- import { pkgVersion } from "./packageVersion.js";
8
- import { createPresenceManager } from "./presenceManager.js";
9
- const presenceCompatibility = {
10
- generation: 1,
11
- version: pkgVersion,
12
- capabilities: new Set([]),
13
- };
14
- /**
15
- * Minimal compatible package version.
16
- * If an existing presence extension is registered with this version or higher,
17
- * it can be used instead of instantiating new instance from this version of
18
- * the package (assuming also capabilities are compatible).
19
- */
20
- const minimalCompatiblePackageVersion = "2.71.0";
21
- function assertCompatibilityInvariants(compatibility) {
22
- assert(compatibility.generation === presenceCompatibility.generation, 0xc97 /* Presence compatibility generation mismatch. */);
23
- assert(compatibility.version.startsWith("2."), 0xc98 /* Registered version is not major version 2. */);
24
- assert(Number.parseFloat(compatibility.version.slice(2)) <
25
- Number.parseFloat(presenceCompatibility.version.slice(2)), 0xc99 /* Registered version is not less than the current version. */);
26
- assert(presenceCompatibility.capabilities.size === 0, 0xc9a /* Presence capabilities should be empty. */);
27
- }
28
- /**
29
- * Common Presence manager for a container
30
- */
31
- class ContainerPresenceManager {
32
- constructor(host) {
33
- // ContainerExtensionFactory return elements
34
- this.compatibility = presenceCompatibility;
35
- this.extension = this;
36
- this.interface = this.manager = createPresenceManager({
37
- ...host,
38
- submitSignal: (message) => {
39
- host.submitAddressedSignal([], message);
40
- },
41
- });
42
- }
43
- handleVersionOrCapabilitiesMismatch(ourExistingInstantiation, newCompatibilityRequest) {
44
- assert(ourExistingInstantiation.compatibility === presenceCompatibility, 0xc9b /* Presence extension called without own compatibility details */);
45
- assertCompatibilityInvariants(newCompatibilityRequest);
46
- // There have not yet been any changes that would require action to upgrade.
47
- // But also mixed runtime versions are not yet expected.
48
- fail(0xcb1 /* Presence is only expected to be accessed with a single version. */);
49
- }
50
- onNewUse() {
51
- // No-op
52
- }
53
- processSignal(addressChain, message, local) {
54
- this.manager.processSignal(addressChain, message, local);
55
- }
56
- }
57
- const extensionId = "dis:bb89f4c0-80fd-4f0c-8469-4f2848ee7f4a";
58
- const ContainerPresenceFactory = {
59
- hostRequirements: {
60
- minSupportedGeneration: 1,
61
- requiredFeatures: [],
62
- },
63
- instanceExpectations: { ...presenceCompatibility, version: minimalCompatiblePackageVersion },
64
- resolvePriorInstantiation(existingInstantiation) {
65
- // Validate assumptions about existing instance
66
- assertCompatibilityInvariants(existingInstantiation.compatibility);
67
- // There have not yet been any changes that would require action to upgrade.
68
- // But also mixed runtime versions are not yet expected.
69
- fail(0xcb2 /* Presence is only expected to be accessed with a single version. */);
70
- },
71
- instantiateExtension(host) {
72
- return new ContainerPresenceManager(host);
73
- },
74
- [Symbol.hasInstance]: (instance) => {
75
- return instance instanceof ContainerPresenceManager;
76
- },
77
- };
5
+ import { ContainerPresenceFactory, extensionId, } from "@fluid-internal/presence-runtime/extension";
6
+ import { assert } from "@fluidframework/core-utils/internal";
7
+ import { getPresenceAlpha } from "@fluidframework/fluid-static/internal";
78
8
  /**
79
9
  * Acquire a {@link Presence} from a Fluid Container
80
10
  * @param fluidContainer - Fluid Container to acquire the map from
81
11
  * @returns the {@link Presence}
82
12
  *
83
13
  * @beta
84
- */
85
- export const getPresence = getPresenceAlpha;
86
- /**
87
- * Acquire a {@link PresenceWithNotifications} from a Fluid Container
88
- * @param fluidContainer - Fluid Container to acquire the map from
89
- * @returns the {@link PresenceWithNotifications}
90
14
  *
91
- * @alpha
15
+ * @deprecated Import from `fluid-framework` instead. This export will be removed in the 2.110.0 release.
16
+ * See {@link https://github.com/microsoft/FluidFramework/issues/26397}
92
17
  */
93
- export function getPresenceAlpha(fluidContainer) {
94
- assert(isInternalFluidContainer(fluidContainer), 0xa2f /* IFluidContainer was not recognized. Only Containers generated by the Fluid Framework are supported. */);
95
- const presence = fluidContainer.acquireExtension(extensionId, ContainerPresenceFactory);
96
- return presence;
97
- }
18
+ export const getPresence = getPresenceAlpha;
98
19
  function assertContextHasExtensionProvider(context) {
99
20
  assert("getExtension" in context, 0xc9c /* Data store context does not implement ContainerExtensionProvider */);
100
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getPresence.js","sourceRoot":"","sources":["../src/getPresence.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\nimport type { ILayerCompatSupportRequirements } from \"@fluid-internal/client-utils\";\nimport type {\n\tContainerExtension,\n\tContainerExtensionFactory,\n\tExtensionInstantiationResult,\n\tExtensionRuntimeProperties as GenericExtensionRuntimeProperties,\n\tInboundExtensionMessage,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport type { IFluidContainer } from \"@fluidframework/fluid-static\";\nimport { isInternalFluidContainer } from \"@fluidframework/fluid-static/internal\";\nimport type {\n\tExtensionCompatibilityDetails,\n\tFluidDataStoreContextInternal,\n\tIFluidDataStoreContext,\n} from \"@fluidframework/runtime-definitions/internal\";\n\nimport { pkgVersion } from \"./packageVersion.js\";\nimport type { Presence, PresenceWithNotifications } from \"./presence.js\";\nimport type { PresenceExtensionInterface } from \"./presenceManager.js\";\nimport { createPresenceManager } from \"./presenceManager.js\";\nimport type { SignalMessages } from \"./protocol.js\";\nimport type { ExtensionHost, ExtensionRuntimeProperties } from \"./runtimeTypes.js\";\n\nconst presenceCompatibility = {\n\tgeneration: 1,\n\tversion: pkgVersion,\n\tcapabilities: new Set([]),\n} as const satisfies ExtensionCompatibilityDetails;\n\n/**\n * Minimal compatible package version.\n * If an existing presence extension is registered with this version or higher,\n * it can be used instead of instantiating new instance from this version of\n * the package (assuming also capabilities are compatible).\n */\nconst minimalCompatiblePackageVersion = \"2.71.0\";\n\nfunction assertCompatibilityInvariants(compatibility: ExtensionCompatibilityDetails): void {\n\tassert(\n\t\tcompatibility.generation === presenceCompatibility.generation,\n\t\t0xc97 /* Presence compatibility generation mismatch. */,\n\t);\n\tassert(\n\t\tcompatibility.version.startsWith(\"2.\"),\n\t\t0xc98 /* Registered version is not major version 2. */,\n\t);\n\tassert(\n\t\tNumber.parseFloat(compatibility.version.slice(2)) <\n\t\t\tNumber.parseFloat(presenceCompatibility.version.slice(2)),\n\t\t0xc99 /* Registered version is not less than the current version. */,\n\t);\n\tassert(\n\t\tpresenceCompatibility.capabilities.size === 0,\n\t\t0xc9a /* Presence capabilities should be empty. */,\n\t);\n}\n\n/**\n * Common Presence manager for a container\n */\nclass ContainerPresenceManager\n\timplements\n\t\tContainerExtension<ExtensionRuntimeProperties>,\n\t\tReturnType<\n\t\t\tContainerExtensionFactory<\n\t\t\t\tPresenceWithNotifications,\n\t\t\t\tExtensionRuntimeProperties\n\t\t\t>[\"instantiateExtension\"]\n\t\t>\n{\n\t// ContainerExtensionFactory return elements\n\tpublic readonly compatibility = presenceCompatibility;\n\tpublic readonly interface: PresenceWithNotifications;\n\tpublic readonly extension = this;\n\n\tprivate readonly manager: PresenceExtensionInterface;\n\n\tpublic constructor(host: ExtensionHost) {\n\t\tthis.interface = this.manager = createPresenceManager({\n\t\t\t...host,\n\t\t\tsubmitSignal: (message) => {\n\t\t\t\thost.submitAddressedSignal([], message);\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic handleVersionOrCapabilitiesMismatch<_TRequestedInterface>(\n\t\tourExistingInstantiation: Readonly<\n\t\t\tExtensionInstantiationResult<PresenceWithNotifications, ExtensionRuntimeProperties, []>\n\t\t>,\n\t\tnewCompatibilityRequest: ExtensionCompatibilityDetails,\n\t): never {\n\t\tassert(\n\t\t\tourExistingInstantiation.compatibility === presenceCompatibility,\n\t\t\t0xc9b /* Presence extension called without own compatibility details */,\n\t\t);\n\t\tassertCompatibilityInvariants(newCompatibilityRequest);\n\t\t// There have not yet been any changes that would require action to upgrade.\n\t\t// But also mixed runtime versions are not yet expected.\n\t\tfail(0xcb1 /* Presence is only expected to be accessed with a single version. */);\n\t}\n\n\tpublic onNewUse(): void {\n\t\t// No-op\n\t}\n\n\tpublic processSignal(\n\t\taddressChain: string[],\n\t\tmessage: InboundExtensionMessage<SignalMessages>,\n\t\tlocal: boolean,\n\t): void {\n\t\tthis.manager.processSignal(addressChain, message, local);\n\t}\n}\n\nconst extensionId = \"dis:bb89f4c0-80fd-4f0c-8469-4f2848ee7f4a\";\n\nconst ContainerPresenceFactory = {\n\thostRequirements: {\n\t\tminSupportedGeneration: 1,\n\t\trequiredFeatures: [],\n\t} as const satisfies ILayerCompatSupportRequirements,\n\n\tinstanceExpectations: { ...presenceCompatibility, version: minimalCompatiblePackageVersion },\n\n\tresolvePriorInstantiation(\n\t\texistingInstantiation: ExtensionInstantiationResult<\n\t\t\tunknown,\n\t\t\tGenericExtensionRuntimeProperties,\n\t\t\tunknown[]\n\t\t>,\n\t): never {\n\t\t// Validate assumptions about existing instance\n\t\tassertCompatibilityInvariants(existingInstantiation.compatibility);\n\t\t// There have not yet been any changes that would require action to upgrade.\n\t\t// But also mixed runtime versions are not yet expected.\n\t\tfail(0xcb2 /* Presence is only expected to be accessed with a single version. */);\n\t},\n\n\tinstantiateExtension(host: ExtensionHost): ContainerPresenceManager {\n\t\treturn new ContainerPresenceManager(host);\n\t},\n\n\t[Symbol.hasInstance]: (instance: unknown): instance is ContainerPresenceManager => {\n\t\treturn instance instanceof ContainerPresenceManager;\n\t},\n} as const satisfies ContainerExtensionFactory<\n\tPresenceWithNotifications,\n\tExtensionRuntimeProperties\n>;\n\n/**\n * Acquire a {@link Presence} from a Fluid Container\n * @param fluidContainer - Fluid Container to acquire the map from\n * @returns the {@link Presence}\n *\n * @beta\n */\nexport const getPresence: (fluidContainer: IFluidContainer) => Presence = getPresenceAlpha;\n\n/**\n * Acquire a {@link PresenceWithNotifications} from a Fluid Container\n * @param fluidContainer - Fluid Container to acquire the map from\n * @returns the {@link PresenceWithNotifications}\n *\n * @alpha\n */\nexport function getPresenceAlpha(fluidContainer: IFluidContainer): PresenceWithNotifications {\n\tassert(\n\t\tisInternalFluidContainer(fluidContainer),\n\t\t0xa2f /* IFluidContainer was not recognized. Only Containers generated by the Fluid Framework are supported. */,\n\t);\n\tconst presence = fluidContainer.acquireExtension(extensionId, ContainerPresenceFactory);\n\treturn presence;\n}\n\nfunction assertContextHasExtensionProvider(\n\tcontext: IFluidDataStoreContext,\n): asserts context is FluidDataStoreContextInternal {\n\tassert(\n\t\t\"getExtension\" in context,\n\t\t0xc9c /* Data store context does not implement ContainerExtensionProvider */,\n\t);\n}\n\n/**\n * Get {@link Presence} from a Fluid Data Store Context\n *\n * @legacy @alpha\n */\nexport function getPresenceFromDataStoreContext(context: IFluidDataStoreContext): Presence {\n\tassertContextHasExtensionProvider(context);\n\treturn context.getExtension(extensionId, ContainerPresenceFactory);\n}\n"]}
1
+ {"version":3,"file":"getPresence.js","sourceRoot":"","sources":["../src/getPresence.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,wBAAwB,EACxB,WAAW,GACX,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAMzE;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,WAAW,GAAkD,gBAAgB,CAAC;AAE3F,SAAS,iCAAiC,CACzC,OAA+B;IAE/B,MAAM,CACL,cAAc,IAAI,OAAO,EACzB,KAAK,CAAC,sEAAsE,CAC5E,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,+BAA+B,CAAC,OAA+B;IAC9E,iCAAiC,CAAC,OAAO,CAAC,CAAC;IAC3C,OAAO,OAAO,CAAC,YAAY,CAAC,WAAW,EAAE,wBAAwB,CAAC,CAAC;AACpE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { Presence } from \"@fluid-internal/presence-definitions\";\nimport {\n\tContainerPresenceFactory,\n\textensionId,\n} from \"@fluid-internal/presence-runtime/extension\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IFluidContainer } from \"@fluidframework/fluid-static\";\nimport { getPresenceAlpha } from \"@fluidframework/fluid-static/internal\";\nimport type {\n\tFluidDataStoreContextInternal,\n\tIFluidDataStoreContext,\n} from \"@fluidframework/runtime-definitions/internal\";\n\n/**\n * Acquire a {@link Presence} from a Fluid Container\n * @param fluidContainer - Fluid Container to acquire the map from\n * @returns the {@link Presence}\n *\n * @beta\n *\n * @deprecated Import from `fluid-framework` instead. This export will be removed in the 2.110.0 release.\n * See {@link https://github.com/microsoft/FluidFramework/issues/26397}\n */\nexport const getPresence: (fluidContainer: IFluidContainer) => Presence = getPresenceAlpha;\n\nfunction assertContextHasExtensionProvider(\n\tcontext: IFluidDataStoreContext,\n): asserts context is FluidDataStoreContextInternal {\n\tassert(\n\t\t\"getExtension\" in context,\n\t\t0xc9c /* Data store context does not implement ContainerExtensionProvider */,\n\t);\n}\n\n/**\n * Get {@link Presence} from a Fluid Data Store Context\n *\n * @legacy @alpha\n */\nexport function getPresenceFromDataStoreContext(context: IFluidDataStoreContext): Presence {\n\tassertContextHasExtensionProvider(context);\n\treturn context.getExtension(extensionId, ContainerPresenceFactory);\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -9,17 +9,8 @@
9
9
  *
10
10
  * @packageDocumentation
11
11
  */
12
- export type { ClientConnectionId } from "./baseTypes.js";
13
- export type { NotificationsWorkspace, NotificationsWorkspaceSchema, StatesWorkspace, StatesWorkspaceEntries, StatesWorkspaceSchema, StatesWorkspaceEntry, WorkspaceAddress, } from "./types.js";
14
- export { type Attendee, type AttendeesEvents, type AttendeeId, AttendeeStatus, type Presence, type PresenceEvents, type PresenceWithNotifications, } from "./presence.js";
15
- export type { BroadcastControls, BroadcastControlSettings, } from "./broadcastControlsTypes.js";
16
- export { getPresence, getPresenceAlpha, getPresenceFromDataStoreContext, } from "./getPresence.js";
17
- export type { KeySchemaValidator, LatestMap, LatestMapArguments, LatestMapArgumentsRaw, LatestMapClientData, LatestMapConfiguration, LatestMapEvents, LatestMapFactory, LatestMapItemRemovedClientData, LatestMapItemUpdatedClientData, LatestMapRaw, LatestMapRawConfiguration, LatestMapRawEvents, StateMap, } from "./latestMapTypes.js";
18
- export type { Latest, LatestArguments, LatestArgumentsRaw, LatestConfiguration, LatestEvents, LatestFactory, LatestRaw, LatestRawConfiguration, LatestRawEvents, } from "./latestTypes.js";
19
- export type { Accessor, LatestClientData, LatestData, LatestMetadata, ProxiedValueAccessor, RawValueAccessor, StateSchemaValidator, ValueAccessor, } from "./latestValueTypes.js";
20
- export { Notifications } from "./notificationsManager.js";
21
- export type { NotificationEmitter, NotificationListenable, NotificationsConfiguration, NotificationSubscriberSignatures, NotificationsManager, NotificationsManagerEvents, NotificationsWithSubscriptionsConfiguration, } from "./notificationsManagerTypes.js";
22
- export { StateFactory } from "./stateFactory.js";
23
- export type { InternalTypes as InternalPresenceTypes } from "./exposedInternalTypes.js";
24
- export type { InternalUtilityTypes as InternalPresenceUtilityTypes } from "./exposedUtilityTypes.js";
12
+ export type { Accessor, Attendee, AttendeeId, AttendeesEvents, BroadcastControls, BroadcastControlSettings, ClientConnectionId, InternalPresenceTypes, InternalPresenceUtilityTypes, KeySchemaValidator, Latest, LatestArguments, LatestArgumentsRaw, LatestClientData, LatestConfiguration, LatestData, LatestEvents, LatestFactory, LatestMap, LatestMapArguments, LatestMapArgumentsRaw, LatestMapClientData, LatestMapConfiguration, LatestMapEvents, LatestMapFactory, LatestMapItemRemovedClientData, LatestMapItemUpdatedClientData, LatestMapRaw, LatestMapRawConfiguration, LatestMapRawEvents, LatestMetadata, LatestRaw, LatestRawConfiguration, LatestRawEvents, NotificationEmitter, NotificationListenable, NotificationsConfiguration, NotificationsManager, NotificationsManagerEvents, NotificationSubscriberSignatures, NotificationsWithSubscriptionsConfiguration, NotificationsWorkspace, NotificationsWorkspaceSchema, Presence, PresenceEvents, PresenceWithNotifications, ProxiedValueAccessor, RawValueAccessor, StateMap, StateSchemaValidator, StatesWorkspace, StatesWorkspaceEntries, StatesWorkspaceEntry, StatesWorkspaceSchema, ValueAccessor, WorkspaceAddress, } from "@fluid-internal/presence-definitions";
13
+ export { AttendeeStatus } from "@fluid-internal/presence-definitions";
14
+ export { Notifications, StateFactory, } from "@fluid-internal/presence-runtime/states";
15
+ export { getPresence, getPresenceFromDataStoreContext, } from "./getPresence.js";
25
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,YAAY,EACX,sBAAsB,EACtB,4BAA4B,EAC5B,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,cAAc,EACd,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,yBAAyB,GAC9B,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,iBAAiB,EACjB,wBAAwB,GACxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACN,WAAW,EACX,gBAAgB,EAChB,+BAA+B,GAC/B,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACX,kBAAkB,EAClB,SAAS,EACT,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,8BAA8B,EAC9B,8BAA8B,EAC9B,YAAY,EACZ,yBAAyB,EACzB,kBAAkB,EAClB,QAAQ,GACR,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACX,MAAM,EACN,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,sBAAsB,EACtB,eAAe,GACf,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACX,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,GACb,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,YAAY,EACX,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,gCAAgC,EAChC,oBAAoB,EACpB,0BAA0B,EAC1B,2CAA2C,GAC3C,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,YAAY,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACxF,YAAY,EAAE,oBAAoB,IAAI,4BAA4B,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAGH,YAAY,EACX,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,qBAAqB,EACrB,4BAA4B,EAC5B,kBAAkB,EAClB,MAAM,EACN,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,8BAA8B,EAC9B,8BAA8B,EAC9B,YAAY,EACZ,yBAAyB,EACzB,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,oBAAoB,EACpB,0BAA0B,EAC1B,gCAAgC,EAChC,2CAA2C,EAC3C,sBAAsB,EACtB,4BAA4B,EAC5B,QAAQ,EACR,cAAc,EACd,yBAAyB,EACzB,oBAAoB,EACpB,gBAAgB,EAChB,QAAQ,EACR,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,GAChB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAGtE,OAAO,EACN,aAAa,EACb,YAAY,GACZ,MAAM,yCAAyC,CAAC;AAGjD,OAAO,EACN,WAAW,EACX,+BAA+B,GAC/B,MAAM,kBAAkB,CAAC"}
package/lib/index.js CHANGED
@@ -2,8 +2,9 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { AttendeeStatus, } from "./presence.js";
6
- export { getPresence, getPresenceAlpha, getPresenceFromDataStoreContext, } from "./getPresence.js";
7
- export { Notifications } from "./notificationsManager.js";
8
- export { StateFactory } from "./stateFactory.js";
5
+ export { AttendeeStatus } from "@fluid-internal/presence-definitions";
6
+ // Re-export from presence-runtime
7
+ export { Notifications, StateFactory, } from "@fluid-internal/presence-runtime/states";
8
+ // Local exports
9
+ export { getPresence, getPresenceFromDataStoreContext, } from "./getPresence.js";
9
10
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsBH,OAAO,EAIN,cAAc,GAId,MAAM,eAAe,CAAC;AAOvB,OAAO,EACN,WAAW,EACX,gBAAgB,EAChB,+BAA+B,GAC/B,MAAM,kBAAkB,CAAC;AAwC1B,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAW1D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Package for client presence within a connected session.\n *\n * See {@link https://github.com/microsoft/FluidFramework/tree/main/packages/framework/presence#readme | README.md } for an overview of the package.\n *\n * @packageDocumentation\n */\n\nexport type { ClientConnectionId } from \"./baseTypes.js\";\n\nexport type {\n\tNotificationsWorkspace,\n\tNotificationsWorkspaceSchema,\n\tStatesWorkspace,\n\tStatesWorkspaceEntries,\n\tStatesWorkspaceSchema,\n\tStatesWorkspaceEntry,\n\tWorkspaceAddress,\n} from \"./types.js\";\n\nexport {\n\ttype Attendee,\n\ttype AttendeesEvents,\n\ttype AttendeeId,\n\tAttendeeStatus,\n\ttype Presence,\n\ttype PresenceEvents,\n\ttype PresenceWithNotifications,\n} from \"./presence.js\";\n\nexport type {\n\tBroadcastControls,\n\tBroadcastControlSettings,\n} from \"./broadcastControlsTypes.js\";\n\nexport {\n\tgetPresence,\n\tgetPresenceAlpha,\n\tgetPresenceFromDataStoreContext,\n} from \"./getPresence.js\";\n\nexport type {\n\tKeySchemaValidator,\n\tLatestMap,\n\tLatestMapArguments,\n\tLatestMapArgumentsRaw,\n\tLatestMapClientData,\n\tLatestMapConfiguration,\n\tLatestMapEvents,\n\tLatestMapFactory,\n\tLatestMapItemRemovedClientData,\n\tLatestMapItemUpdatedClientData,\n\tLatestMapRaw,\n\tLatestMapRawConfiguration,\n\tLatestMapRawEvents,\n\tStateMap,\n} from \"./latestMapTypes.js\";\nexport type {\n\tLatest,\n\tLatestArguments,\n\tLatestArgumentsRaw,\n\tLatestConfiguration,\n\tLatestEvents,\n\tLatestFactory,\n\tLatestRaw,\n\tLatestRawConfiguration,\n\tLatestRawEvents,\n} from \"./latestTypes.js\";\nexport type {\n\tAccessor,\n\tLatestClientData,\n\tLatestData,\n\tLatestMetadata,\n\tProxiedValueAccessor,\n\tRawValueAccessor,\n\tStateSchemaValidator,\n\tValueAccessor,\n} from \"./latestValueTypes.js\";\n\nexport { Notifications } from \"./notificationsManager.js\";\nexport type {\n\tNotificationEmitter,\n\tNotificationListenable,\n\tNotificationsConfiguration,\n\tNotificationSubscriberSignatures,\n\tNotificationsManager,\n\tNotificationsManagerEvents,\n\tNotificationsWithSubscriptionsConfiguration,\n} from \"./notificationsManagerTypes.js\";\n\nexport { StateFactory } from \"./stateFactory.js\";\n\nexport type { InternalTypes as InternalPresenceTypes } from \"./exposedInternalTypes.js\";\nexport type { InternalUtilityTypes as InternalPresenceUtilityTypes } from \"./exposedUtilityTypes.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqEH,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,kCAAkC;AAClC,OAAO,EACN,aAAa,EACb,YAAY,GACZ,MAAM,yCAAyC,CAAC;AAEjD,gBAAgB;AAChB,OAAO,EACN,WAAW,EACX,+BAA+B,GAC/B,MAAM,kBAAkB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Package for client presence within a connected session.\n *\n * See {@link https://github.com/microsoft/FluidFramework/tree/main/packages/framework/presence#readme | README.md } for an overview of the package.\n *\n * @packageDocumentation\n */\n\n// Re-export from presence-definitions\nexport type {\n\tAccessor,\n\tAttendee,\n\tAttendeeId,\n\tAttendeesEvents,\n\tBroadcastControls,\n\tBroadcastControlSettings,\n\tClientConnectionId,\n\tInternalPresenceTypes,\n\tInternalPresenceUtilityTypes,\n\tKeySchemaValidator,\n\tLatest,\n\tLatestArguments,\n\tLatestArgumentsRaw,\n\tLatestClientData,\n\tLatestConfiguration,\n\tLatestData,\n\tLatestEvents,\n\tLatestFactory,\n\tLatestMap,\n\tLatestMapArguments,\n\tLatestMapArgumentsRaw,\n\tLatestMapClientData,\n\tLatestMapConfiguration,\n\tLatestMapEvents,\n\tLatestMapFactory,\n\tLatestMapItemRemovedClientData,\n\tLatestMapItemUpdatedClientData,\n\tLatestMapRaw,\n\tLatestMapRawConfiguration,\n\tLatestMapRawEvents,\n\tLatestMetadata,\n\tLatestRaw,\n\tLatestRawConfiguration,\n\tLatestRawEvents,\n\tNotificationEmitter,\n\tNotificationListenable,\n\tNotificationsConfiguration,\n\tNotificationsManager,\n\tNotificationsManagerEvents,\n\tNotificationSubscriberSignatures,\n\tNotificationsWithSubscriptionsConfiguration,\n\tNotificationsWorkspace,\n\tNotificationsWorkspaceSchema,\n\tPresence,\n\tPresenceEvents,\n\tPresenceWithNotifications,\n\tProxiedValueAccessor,\n\tRawValueAccessor,\n\tStateMap,\n\tStateSchemaValidator,\n\tStatesWorkspace,\n\tStatesWorkspaceEntries,\n\tStatesWorkspaceEntry,\n\tStatesWorkspaceSchema,\n\tValueAccessor,\n\tWorkspaceAddress,\n} from \"@fluid-internal/presence-definitions\";\nexport { AttendeeStatus } from \"@fluid-internal/presence-definitions\";\n\n// Re-export from presence-runtime\nexport {\n\tNotifications,\n\tStateFactory,\n} from \"@fluid-internal/presence-runtime/states\";\n\n// Local exports\nexport {\n\tgetPresence,\n\tgetPresenceFromDataStoreContext,\n} from \"./getPresence.js\";\n"]}
@@ -17,7 +17,7 @@
17
17
  */
18
18
 
19
19
  export {
20
- // #region @beta APIs
20
+ // #region @public APIs
21
21
  Accessor,
22
22
  Attendee,
23
23
  AttendeeId,
@@ -64,7 +64,10 @@ export {
64
64
  StatesWorkspaceEntry,
65
65
  StatesWorkspaceSchema,
66
66
  ValueAccessor,
67
- WorkspaceAddress,
67
+ WorkspaceAddress,
68
+ // #endregion
69
+
70
+ // #region @beta APIs
68
71
  getPresence,
69
72
  // #endregion
70
73
 
@@ -80,8 +83,7 @@ export {
80
83
  NotificationsWithSubscriptionsConfiguration,
81
84
  NotificationsWorkspace,
82
85
  NotificationsWorkspaceSchema,
83
- PresenceWithNotifications,
84
- getPresenceAlpha,
86
+ PresenceWithNotifications,
85
87
  // #endregion
86
88
 
87
89
  // #region @legacyAlpha APIs
@@ -0,0 +1,69 @@
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 --outFileLegacyAlpha legacy.alpha --outDir ./lib" in @fluid-tools/build-cli.
9
+ */
10
+
11
+ /**
12
+ * Package for client presence within a connected session.
13
+ *
14
+ * See {@link https://github.com/microsoft/FluidFramework/tree/main/packages/framework/presence#readme | README.md } for an overview of the package.
15
+ *
16
+ * @packageDocumentation
17
+ */
18
+
19
+ export {
20
+ // #region @public APIs
21
+ Accessor,
22
+ Attendee,
23
+ AttendeeId,
24
+ AttendeeStatus,
25
+ AttendeesEvents,
26
+ BroadcastControlSettings,
27
+ BroadcastControls,
28
+ ClientConnectionId,
29
+ InternalPresenceTypes,
30
+ KeySchemaValidator,
31
+ Latest,
32
+ LatestArguments,
33
+ LatestArgumentsRaw,
34
+ LatestClientData,
35
+ LatestConfiguration,
36
+ LatestData,
37
+ LatestEvents,
38
+ LatestFactory,
39
+ LatestMap,
40
+ LatestMapArguments,
41
+ LatestMapArgumentsRaw,
42
+ LatestMapClientData,
43
+ LatestMapConfiguration,
44
+ LatestMapEvents,
45
+ LatestMapFactory,
46
+ LatestMapItemRemovedClientData,
47
+ LatestMapItemUpdatedClientData,
48
+ LatestMapRaw,
49
+ LatestMapRawConfiguration,
50
+ LatestMapRawEvents,
51
+ LatestMetadata,
52
+ LatestRaw,
53
+ LatestRawConfiguration,
54
+ LatestRawEvents,
55
+ Presence,
56
+ PresenceEvents,
57
+ ProxiedValueAccessor,
58
+ RawValueAccessor,
59
+ StateFactory,
60
+ StateMap,
61
+ StateSchemaValidator,
62
+ StatesWorkspace,
63
+ StatesWorkspaceEntries,
64
+ StatesWorkspaceEntry,
65
+ StatesWorkspaceSchema,
66
+ ValueAccessor,
67
+ WorkspaceAddress
68
+ // #endregion
69
+ } from "./index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/presence",
3
- "version": "2.92.0",
3
+ "version": "2.93.0",
4
4
  "description": "A component for lightweight data sharing within a single session",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -13,6 +13,16 @@
13
13
  "sideEffects": false,
14
14
  "type": "module",
15
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
+ },
16
26
  "./beta": {
17
27
  "import": {
18
28
  "types": "./lib/beta.d.ts",
@@ -50,87 +60,42 @@
50
60
  "*.d.ts",
51
61
  "!**/test/**"
52
62
  ],
53
- "c8": {
54
- "all": true,
55
- "cache-dir": "nyc/.cache",
56
- "exclude": [
57
- "src/test/**/*.*ts",
58
- "dist/test/**/*.*js",
59
- "lib/test/**/*.*js"
60
- ],
61
- "exclude-after-remap": false,
62
- "include": [
63
- "src/**/*.*ts",
64
- "dist/**/*.*js",
65
- "lib/**/*.*js"
66
- ],
67
- "report-dir": "nyc/report",
68
- "reporter": [
69
- "cobertura",
70
- "html",
71
- "text"
72
- ],
73
- "temp-directory": "nyc/.nyc_output"
74
- },
75
63
  "dependencies": {
76
- "@fluid-internal/client-utils": "~2.92.0",
77
- "@fluidframework/container-definitions": "~2.92.0",
78
- "@fluidframework/container-runtime-definitions": "~2.92.0",
79
- "@fluidframework/core-interfaces": "~2.92.0",
80
- "@fluidframework/core-utils": "~2.92.0",
81
- "@fluidframework/fluid-static": "~2.92.0",
82
- "@fluidframework/id-compressor": "~2.92.0",
83
- "@fluidframework/runtime-definitions": "~2.92.0",
84
- "@fluidframework/telemetry-utils": "~2.92.0"
64
+ "@fluid-internal/presence-definitions": "~2.93.0",
65
+ "@fluid-internal/presence-runtime": "~2.93.0",
66
+ "@fluidframework/core-utils": "~2.93.0",
67
+ "@fluidframework/fluid-static": "~2.93.0",
68
+ "@fluidframework/runtime-definitions": "~2.93.0"
85
69
  },
86
70
  "devDependencies": {
87
71
  "@arethetypeswrong/cli": "^0.18.2",
88
72
  "@biomejs/biome": "~2.4.5",
89
- "@fluid-internal/mocha-test-setup": "~2.92.0",
73
+ "@fluid-internal/mocha-test-setup": "~2.93.0",
90
74
  "@fluid-tools/build-cli": "^0.64.0",
91
75
  "@fluidframework/build-common": "^2.0.3",
92
76
  "@fluidframework/build-tools": "^0.64.0",
93
- "@fluidframework/driver-definitions": "~2.92.0",
94
77
  "@fluidframework/eslint-config-fluid": "^9.0.0",
95
- "@fluidframework/test-runtime-utils": "~2.92.0",
96
- "@fluidframework/test-utils": "~2.92.0",
97
- "@microsoft/api-extractor": "7.52.11",
98
- "@types/mocha": "^10.0.10",
99
- "@types/node": "~20.19.30",
100
- "@types/sinon": "^17.0.3",
101
- "c8": "^10.1.3",
78
+ "@microsoft/api-extractor": "7.58.1",
102
79
  "concurrently": "^9.2.1",
103
80
  "copyfiles": "^2.4.1",
104
81
  "cross-env": "^10.1.0",
105
82
  "eslint": "~9.39.1",
106
83
  "jiti": "^2.6.1",
107
- "mocha": "^11.7.5",
108
- "mocha-multi-reporters": "^1.5.1",
109
84
  "rimraf": "^6.1.3",
110
- "sinon": "^18.0.1",
111
85
  "typescript": "~5.4.5"
112
86
  },
113
87
  "fluidBuild": {
114
88
  "tasks": {
115
- "build:esnext:experimental": [
116
- "build:esnext:main"
117
- ],
118
- "build:esnext:main": [
89
+ "build:esnext": [
119
90
  "^api",
120
- "^build:esnext",
121
- "build:genver"
91
+ "^build:esnext"
122
92
  ],
123
93
  "eslint": [
124
- "api-extractor:esnext",
125
- "^build:test:esm"
126
- ],
127
- "tsc:experimental": [
128
- "tsc:main"
94
+ "api-extractor:esnext"
129
95
  ],
130
- "tsc:main": [
96
+ "tsc": [
131
97
  "^api",
132
- "^tsc",
133
- "build:genver"
98
+ "^tsc"
134
99
  ]
135
100
  }
136
101
  },
@@ -148,13 +113,7 @@
148
113
  "build:commonjs": "fluid-build . --task commonjs",
149
114
  "build:compile": "fluid-build . --task compile",
150
115
  "build:docs": "api-extractor run --local",
151
- "build:esnext": "npm run build:esnext:main && npm run build:esnext:experimental",
152
- "build:esnext:experimental": "tsc --project ./tsconfig.json",
153
- "build:esnext:main": "tsc --project ./tsconfig.main.json",
154
- "build:genver": "gen-version",
155
- "build:test": "npm run build:test:esm && npm run build:test:cjs",
156
- "build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
157
- "build:test:esm": "tsc --project ./src/test/tsconfig.json",
116
+ "build:esnext": "tsc --project ./tsconfig.json",
158
117
  "check:are-the-types-wrong": "attw --pack . --profile node16",
159
118
  "check:biome": "biome check .",
160
119
  "check:exports": "concurrently \"npm:check:exports:*\"",
@@ -162,9 +121,11 @@
162
121
  "check:exports:cjs:alpha": "api-extractor run --config api-extractor/api-extractor-lint-alpha.cjs.json",
163
122
  "check:exports:cjs:beta": "api-extractor run --config api-extractor/api-extractor-lint-beta.cjs.json",
164
123
  "check:exports:cjs:legacy.alpha": "api-extractor run --config api-extractor/api-extractor-lint-legacy.alpha.cjs.json",
124
+ "check:exports:cjs:public": "api-extractor run --config api-extractor/api-extractor-lint-public.cjs.json",
165
125
  "check:exports:esm:alpha": "api-extractor run --config api-extractor/api-extractor-lint-alpha.esm.json",
166
126
  "check:exports:esm:beta": "api-extractor run --config api-extractor/api-extractor-lint-beta.esm.json",
167
127
  "check:exports:esm:legacy.alpha": "api-extractor run --config api-extractor/api-extractor-lint-legacy.alpha.esm.json",
128
+ "check:exports:esm:public": "api-extractor run --config api-extractor/api-extractor-lint-public.esm.json",
168
129
  "check:format": "npm run check:biome",
169
130
  "ci:build:docs": "api-extractor run",
170
131
  "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
@@ -174,16 +135,6 @@
174
135
  "format:biome": "biome check . --write",
175
136
  "lint": "fluid-build . --task lint",
176
137
  "lint:fix": "fluid-build . --task eslint:fix --task format",
177
- "test": "npm run test:mocha",
178
- "test:coverage": "c8 npm test",
179
- "test:mocha": "npm run test:mocha:esm && npm run test:mocha:cjs",
180
- "test:mocha:cjs": "cross-env FLUID_TEST_MODULE_SYSTEM=CJS mocha",
181
- "test:mocha:esm": "mocha",
182
- "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
183
- "tsc": "npm run tsc:main && npm run tsc:experimental",
184
- "tsc:experimental": "fluid-tsc commonjs --project ./tsconfig.cjs.json",
185
- "tsc:main": "fluid-tsc commonjs --project ./tsconfig.main.cjs.json && copyfiles -f ./src/cjs/package.json ./dist",
186
- "typetests:gen": "flub generate typetests --dir . -v",
187
- "typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
138
+ "tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist"
188
139
  }
189
140
  }
@@ -1,24 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- /**
6
- * A Fluid client connection identifier.
7
- *
8
- * @remarks
9
- * Each client connection is given a unique identifier for the duration of the
10
- * connection. If a client disconnects and reconnects, it will be given a new
11
- * identifier. Prefer use of {@link Attendee} as a way to identify clients
12
- * in a session. {@link Attendee.getConnectionId} will provide the current
13
- * connection identifier for a logical attendee.
14
- *
15
- * @privateRemarks
16
- * This represents what is commonly `clientId` in Fluid code. Ideally this is
17
- * moved somewhere more central and we brand it to avoid confusion with other
18
- * strings. Branding broadly is likely a breaking change and may take decent
19
- * effort to manage.
20
- *
21
- * @beta
22
- */
23
- export type ClientConnectionId = string;
24
- //# sourceMappingURL=baseTypes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"baseTypes.d.ts","sourceRoot":"","sources":["../src/baseTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC"}
package/dist/baseTypes.js DELETED
@@ -1,7 +0,0 @@
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=baseTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"baseTypes.js","sourceRoot":"","sources":["../src/baseTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * A Fluid client connection identifier.\n *\n * @remarks\n * Each client connection is given a unique identifier for the duration of the\n * connection. If a client disconnects and reconnects, it will be given a new\n * identifier. Prefer use of {@link Attendee} as a way to identify clients\n * in a session. {@link Attendee.getConnectionId} will provide the current\n * connection identifier for a logical attendee.\n *\n * @privateRemarks\n * This represents what is commonly `clientId` in Fluid code. Ideally this is\n * moved somewhere more central and we brand it to avoid confusion with other\n * strings. Branding broadly is likely a breaking change and may take decent\n * effort to manage.\n *\n * @beta\n */\nexport type ClientConnectionId = string;\n"]}
@@ -1,37 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import type { BroadcastControls, BroadcastControlSettings } from "./broadcastControlsTypes.js";
6
- declare class ForcedRefreshControl implements Pick<BroadcastControls & {
7
- forcedRefreshIntervalMs: number | undefined;
8
- }, "forcedRefreshIntervalMs"> {
9
- private _forcedRefreshInterval;
10
- constructor(settings?: BroadcastControlSettings);
11
- get forcedRefreshIntervalMs(): number | undefined;
12
- set forcedRefreshIntervalMs(value: number | undefined);
13
- }
14
- /**
15
- * Implements {@link BroadcastControls} for States Managers
16
- * where returning `undefined` settings are allowed.
17
- */
18
- export declare class OptionalBroadcastControl extends ForcedRefreshControl implements BroadcastControls {
19
- allowableUpdateLatencyMs: number | undefined;
20
- constructor(settings?: BroadcastControlSettings);
21
- }
22
- /**
23
- * Implements {@link BroadcastControls} but always provides defined value for
24
- * {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}.
25
- *
26
- * If {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}
27
- * is set to `undefined`, the default will be restored.
28
- */
29
- export declare class RequiredBroadcastControl extends ForcedRefreshControl implements BroadcastControls {
30
- private readonly defaultAllowableUpdateLatencyMs;
31
- private _allowableUpdateLatencyMs;
32
- constructor(defaultAllowableUpdateLatencyMs: number);
33
- get allowableUpdateLatencyMs(): number;
34
- set allowableUpdateLatencyMs(value: number | undefined);
35
- }
36
- export {};
37
- //# sourceMappingURL=broadcastControls.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"broadcastControls.d.ts","sourceRoot":"","sources":["../src/broadcastControls.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAE/F,cAAM,oBACL,YACC,IAAI,CACH,iBAAiB,GAAG;IAAE,uBAAuB,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EACnE,yBAAyB,CACzB;IAEF,OAAO,CAAC,sBAAsB,CAAqB;gBAEhC,QAAQ,CAAC,EAAE,wBAAwB;IAItD,IAAW,uBAAuB,IAAI,MAAM,GAAG,SAAS,CAEvD;IACD,IAAW,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAU3D;CACD;AAED;;;GAGG;AACH,qBAAa,wBACZ,SAAQ,oBACR,YAAW,iBAAiB;IAErB,wBAAwB,EAAE,MAAM,GAAG,SAAS,CAAC;gBAEjC,QAAQ,CAAC,EAAE,wBAAwB;CAItD;AAED;;;;;;GAMG;AACH,qBAAa,wBACZ,SAAQ,oBACR,YAAW,iBAAiB;IAIT,OAAO,CAAC,QAAQ,CAAC,+BAA+B;IAFnE,OAAO,CAAC,yBAAyB,CAAS;gBAEN,+BAA+B,EAAE,MAAM;IAK3E,IAAW,wBAAwB,IAAI,MAAM,CAE5C;IACD,IAAW,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAE5D;CACD"}
@@ -1,60 +0,0 @@
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.RequiredBroadcastControl = exports.OptionalBroadcastControl = void 0;
8
- class ForcedRefreshControl {
9
- constructor(settings) {
10
- // this._forcedRefreshInterval = settings?.forcedRefreshIntervalMs;
11
- }
12
- get forcedRefreshIntervalMs() {
13
- return this._forcedRefreshInterval;
14
- }
15
- set forcedRefreshIntervalMs(value) {
16
- if (value === undefined) {
17
- this._forcedRefreshInterval = undefined;
18
- }
19
- else {
20
- this._forcedRefreshInterval = value >= 10 ? value : undefined;
21
- if (value >= 10) {
22
- // TODO: enable periodic forced refresh
23
- throw new Error("Forced Refresh feature is not implemented");
24
- }
25
- }
26
- }
27
- }
28
- /**
29
- * Implements {@link BroadcastControls} for States Managers
30
- * where returning `undefined` settings are allowed.
31
- */
32
- class OptionalBroadcastControl extends ForcedRefreshControl {
33
- constructor(settings) {
34
- super(settings);
35
- this.allowableUpdateLatencyMs = settings?.allowableUpdateLatencyMs;
36
- }
37
- }
38
- exports.OptionalBroadcastControl = OptionalBroadcastControl;
39
- /**
40
- * Implements {@link BroadcastControls} but always provides defined value for
41
- * {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}.
42
- *
43
- * If {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}
44
- * is set to `undefined`, the default will be restored.
45
- */
46
- class RequiredBroadcastControl extends ForcedRefreshControl {
47
- constructor(defaultAllowableUpdateLatencyMs) {
48
- super();
49
- this.defaultAllowableUpdateLatencyMs = defaultAllowableUpdateLatencyMs;
50
- this._allowableUpdateLatencyMs = defaultAllowableUpdateLatencyMs;
51
- }
52
- get allowableUpdateLatencyMs() {
53
- return this._allowableUpdateLatencyMs;
54
- }
55
- set allowableUpdateLatencyMs(value) {
56
- this._allowableUpdateLatencyMs = value ?? this.defaultAllowableUpdateLatencyMs;
57
- }
58
- }
59
- exports.RequiredBroadcastControl = RequiredBroadcastControl;
60
- //# sourceMappingURL=broadcastControls.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"broadcastControls.js","sourceRoot":"","sources":["../src/broadcastControls.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,MAAM,oBAAoB;IASzB,YAAmB,QAAmC;QACrD,mEAAmE;IACpE,CAAC;IAED,IAAW,uBAAuB;QACjC,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACpC,CAAC;IACD,IAAW,uBAAuB,CAAC,KAAyB;QAC3D,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,IAAI,CAAC,sBAAsB,GAAG,SAAS,CAAC;QACzC,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,sBAAsB,GAAG,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;YAC9D,IAAI,KAAK,IAAI,EAAE,EAAE,CAAC;gBACjB,uCAAuC;gBACvC,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;YAC9D,CAAC;QACF,CAAC;IACF,CAAC;CACD;AAED;;;GAGG;AACH,MAAa,wBACZ,SAAQ,oBAAoB;IAK5B,YAAmB,QAAmC;QACrD,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,wBAAwB,GAAG,QAAQ,EAAE,wBAAwB,CAAC;IACpE,CAAC;CACD;AAVD,4DAUC;AAED;;;;;;GAMG;AACH,MAAa,wBACZ,SAAQ,oBAAoB;IAK5B,YAAoC,+BAAuC;QAC1E,KAAK,EAAE,CAAC;QAD2B,oCAA+B,GAA/B,+BAA+B,CAAQ;QAE1E,IAAI,CAAC,yBAAyB,GAAG,+BAA+B,CAAC;IAClE,CAAC;IAED,IAAW,wBAAwB;QAClC,OAAO,IAAI,CAAC,yBAAyB,CAAC;IACvC,CAAC;IACD,IAAW,wBAAwB,CAAC,KAAyB;QAC5D,IAAI,CAAC,yBAAyB,GAAG,KAAK,IAAI,IAAI,CAAC,+BAA+B,CAAC;IAChF,CAAC;CACD;AAjBD,4DAiBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { BroadcastControls, BroadcastControlSettings } from \"./broadcastControlsTypes.js\";\n\nclass ForcedRefreshControl\n\timplements\n\t\tPick<\n\t\t\tBroadcastControls & { forcedRefreshIntervalMs: number | undefined },\n\t\t\t\"forcedRefreshIntervalMs\"\n\t\t>\n{\n\tprivate _forcedRefreshInterval: number | undefined;\n\n\tpublic constructor(settings?: BroadcastControlSettings) {\n\t\t// this._forcedRefreshInterval = settings?.forcedRefreshIntervalMs;\n\t}\n\n\tpublic get forcedRefreshIntervalMs(): number | undefined {\n\t\treturn this._forcedRefreshInterval;\n\t}\n\tpublic set forcedRefreshIntervalMs(value: number | undefined) {\n\t\tif (value === undefined) {\n\t\t\tthis._forcedRefreshInterval = undefined;\n\t\t} else {\n\t\t\tthis._forcedRefreshInterval = value >= 10 ? value : undefined;\n\t\t\tif (value >= 10) {\n\t\t\t\t// TODO: enable periodic forced refresh\n\t\t\t\tthrow new Error(\"Forced Refresh feature is not implemented\");\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Implements {@link BroadcastControls} for States Managers\n * where returning `undefined` settings are allowed.\n */\nexport class OptionalBroadcastControl\n\textends ForcedRefreshControl\n\timplements BroadcastControls\n{\n\tpublic allowableUpdateLatencyMs: number | undefined;\n\n\tpublic constructor(settings?: BroadcastControlSettings) {\n\t\tsuper(settings);\n\t\tthis.allowableUpdateLatencyMs = settings?.allowableUpdateLatencyMs;\n\t}\n}\n\n/**\n * Implements {@link BroadcastControls} but always provides defined value for\n * {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}.\n *\n * If {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}\n * is set to `undefined`, the default will be restored.\n */\nexport class RequiredBroadcastControl\n\textends ForcedRefreshControl\n\timplements BroadcastControls\n{\n\tprivate _allowableUpdateLatencyMs: number;\n\n\tpublic constructor(private readonly defaultAllowableUpdateLatencyMs: number) {\n\t\tsuper();\n\t\tthis._allowableUpdateLatencyMs = defaultAllowableUpdateLatencyMs;\n\t}\n\n\tpublic get allowableUpdateLatencyMs(): number {\n\t\treturn this._allowableUpdateLatencyMs;\n\t}\n\tpublic set allowableUpdateLatencyMs(value: number | undefined) {\n\t\tthis._allowableUpdateLatencyMs = value ?? this.defaultAllowableUpdateLatencyMs;\n\t}\n}\n"]}