@fluidframework/presence 2.92.0 → 2.100.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 (260) 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/lib/tsdoc-metadata.json +11 -0
  28. package/package.json +32 -78
  29. package/dist/baseTypes.d.ts +0 -24
  30. package/dist/baseTypes.d.ts.map +0 -1
  31. package/dist/baseTypes.js +0 -7
  32. package/dist/baseTypes.js.map +0 -1
  33. package/dist/broadcastControls.d.ts +0 -37
  34. package/dist/broadcastControls.d.ts.map +0 -1
  35. package/dist/broadcastControls.js +0 -60
  36. package/dist/broadcastControls.js.map +0 -1
  37. package/dist/broadcastControlsTypes.d.ts +0 -38
  38. package/dist/broadcastControlsTypes.d.ts.map +0 -1
  39. package/dist/broadcastControlsTypes.js +0 -7
  40. package/dist/broadcastControlsTypes.js.map +0 -1
  41. package/dist/exposedInternalTypes.d.ts +0 -138
  42. package/dist/exposedInternalTypes.d.ts.map +0 -1
  43. package/dist/exposedInternalTypes.js +0 -19
  44. package/dist/exposedInternalTypes.js.map +0 -1
  45. package/dist/exposedUtilityTypes.d.ts +0 -108
  46. package/dist/exposedUtilityTypes.d.ts.map +0 -1
  47. package/dist/exposedUtilityTypes.js +0 -7
  48. package/dist/exposedUtilityTypes.js.map +0 -1
  49. package/dist/internalUtils.d.ts +0 -125
  50. package/dist/internalUtils.d.ts.map +0 -1
  51. package/dist/internalUtils.js +0 -99
  52. package/dist/internalUtils.js.map +0 -1
  53. package/dist/latestMapTypes.d.ts +0 -343
  54. package/dist/latestMapTypes.d.ts.map +0 -1
  55. package/dist/latestMapTypes.js +0 -7
  56. package/dist/latestMapTypes.js.map +0 -1
  57. package/dist/latestMapValueManager.d.ts +0 -52
  58. package/dist/latestMapValueManager.d.ts.map +0 -1
  59. package/dist/latestMapValueManager.js +0 -250
  60. package/dist/latestMapValueManager.js.map +0 -1
  61. package/dist/latestTypes.d.ts +0 -183
  62. package/dist/latestTypes.d.ts.map +0 -1
  63. package/dist/latestTypes.js +0 -7
  64. package/dist/latestTypes.js.map +0 -1
  65. package/dist/latestValueManager.d.ts +0 -10
  66. package/dist/latestValueManager.d.ts.map +0 -1
  67. package/dist/latestValueManager.js +0 -117
  68. package/dist/latestValueManager.js.map +0 -1
  69. package/dist/latestValueTypes.d.ts +0 -108
  70. package/dist/latestValueTypes.d.ts.map +0 -1
  71. package/dist/latestValueTypes.js +0 -7
  72. package/dist/latestValueTypes.js.map +0 -1
  73. package/dist/notificationsManager.d.ts +0 -27
  74. package/dist/notificationsManager.d.ts.map +0 -1
  75. package/dist/notificationsManager.js +0 -98
  76. package/dist/notificationsManager.js.map +0 -1
  77. package/dist/notificationsManagerTypes.d.ts +0 -144
  78. package/dist/notificationsManagerTypes.d.ts.map +0 -1
  79. package/dist/notificationsManagerTypes.js +0 -7
  80. package/dist/notificationsManagerTypes.js.map +0 -1
  81. package/dist/packageVersion.d.ts +0 -9
  82. package/dist/packageVersion.d.ts.map +0 -1
  83. package/dist/packageVersion.js +0 -12
  84. package/dist/packageVersion.js.map +0 -1
  85. package/dist/presence.d.ts +0 -229
  86. package/dist/presence.d.ts.map +0 -1
  87. package/dist/presence.js +0 -23
  88. package/dist/presence.js.map +0 -1
  89. package/dist/presenceDatastoreManager.d.ts +0 -149
  90. package/dist/presenceDatastoreManager.d.ts.map +0 -1
  91. package/dist/presenceDatastoreManager.js +0 -667
  92. package/dist/presenceDatastoreManager.js.map +0 -1
  93. package/dist/presenceManager.d.ts +0 -16
  94. package/dist/presenceManager.d.ts.map +0 -1
  95. package/dist/presenceManager.js +0 -140
  96. package/dist/presenceManager.js.map +0 -1
  97. package/dist/presenceStates.d.ts +0 -102
  98. package/dist/presenceStates.d.ts.map +0 -1
  99. package/dist/presenceStates.js +0 -231
  100. package/dist/presenceStates.js.map +0 -1
  101. package/dist/protocol.d.ts +0 -111
  102. package/dist/protocol.d.ts.map +0 -1
  103. package/dist/protocol.js +0 -20
  104. package/dist/protocol.js.map +0 -1
  105. package/dist/runtimeTypes.d.ts +0 -26
  106. package/dist/runtimeTypes.d.ts.map +0 -1
  107. package/dist/runtimeTypes.js +0 -7
  108. package/dist/runtimeTypes.js.map +0 -1
  109. package/dist/stateDatastore.d.ts +0 -56
  110. package/dist/stateDatastore.d.ts.map +0 -1
  111. package/dist/stateDatastore.js +0 -22
  112. package/dist/stateDatastore.js.map +0 -1
  113. package/dist/stateFactory.d.ts +0 -18
  114. package/dist/stateFactory.d.ts.map +0 -1
  115. package/dist/stateFactory.js +0 -23
  116. package/dist/stateFactory.js.map +0 -1
  117. package/dist/statesManagerTypes.d.ts +0 -27
  118. package/dist/statesManagerTypes.d.ts.map +0 -1
  119. package/dist/statesManagerTypes.js +0 -7
  120. package/dist/statesManagerTypes.js.map +0 -1
  121. package/dist/systemWorkspace.d.ts +0 -58
  122. package/dist/systemWorkspace.d.ts.map +0 -1
  123. package/dist/systemWorkspace.js +0 -265
  124. package/dist/systemWorkspace.js.map +0 -1
  125. package/dist/timerManager.d.ts +0 -37
  126. package/dist/timerManager.d.ts.map +0 -1
  127. package/dist/timerManager.js +0 -65
  128. package/dist/timerManager.js.map +0 -1
  129. package/dist/types.d.ts +0 -132
  130. package/dist/types.d.ts.map +0 -1
  131. package/dist/types.js +0 -7
  132. package/dist/types.js.map +0 -1
  133. package/dist/validatableTypes.d.ts +0 -69
  134. package/dist/validatableTypes.d.ts.map +0 -1
  135. package/dist/validatableTypes.js +0 -7
  136. package/dist/validatableTypes.js.map +0 -1
  137. package/dist/validatedGetter.d.ts +0 -18
  138. package/dist/validatedGetter.d.ts.map +0 -1
  139. package/dist/validatedGetter.js +0 -43
  140. package/dist/validatedGetter.js.map +0 -1
  141. package/dist/valueManager.d.ts +0 -15
  142. package/dist/valueManager.d.ts.map +0 -1
  143. package/dist/valueManager.js +0 -22
  144. package/dist/valueManager.js.map +0 -1
  145. package/lib/baseTypes.d.ts +0 -24
  146. package/lib/baseTypes.d.ts.map +0 -1
  147. package/lib/baseTypes.js +0 -6
  148. package/lib/baseTypes.js.map +0 -1
  149. package/lib/broadcastControls.d.ts +0 -37
  150. package/lib/broadcastControls.d.ts.map +0 -1
  151. package/lib/broadcastControls.js +0 -55
  152. package/lib/broadcastControls.js.map +0 -1
  153. package/lib/broadcastControlsTypes.d.ts +0 -38
  154. package/lib/broadcastControlsTypes.d.ts.map +0 -1
  155. package/lib/broadcastControlsTypes.js +0 -6
  156. package/lib/broadcastControlsTypes.js.map +0 -1
  157. package/lib/exposedInternalTypes.d.ts +0 -138
  158. package/lib/exposedInternalTypes.d.ts.map +0 -1
  159. package/lib/exposedInternalTypes.js +0 -16
  160. package/lib/exposedInternalTypes.js.map +0 -1
  161. package/lib/exposedUtilityTypes.d.ts +0 -108
  162. package/lib/exposedUtilityTypes.d.ts.map +0 -1
  163. package/lib/exposedUtilityTypes.js +0 -6
  164. package/lib/exposedUtilityTypes.js.map +0 -1
  165. package/lib/internalUtils.d.ts +0 -125
  166. package/lib/internalUtils.d.ts.map +0 -1
  167. package/lib/internalUtils.js +0 -90
  168. package/lib/internalUtils.js.map +0 -1
  169. package/lib/latestMapTypes.d.ts +0 -343
  170. package/lib/latestMapTypes.d.ts.map +0 -1
  171. package/lib/latestMapTypes.js +0 -6
  172. package/lib/latestMapTypes.js.map +0 -1
  173. package/lib/latestMapValueManager.d.ts +0 -52
  174. package/lib/latestMapValueManager.d.ts.map +0 -1
  175. package/lib/latestMapValueManager.js +0 -246
  176. package/lib/latestMapValueManager.js.map +0 -1
  177. package/lib/latestTypes.d.ts +0 -183
  178. package/lib/latestTypes.d.ts.map +0 -1
  179. package/lib/latestTypes.js +0 -6
  180. package/lib/latestTypes.js.map +0 -1
  181. package/lib/latestValueManager.d.ts +0 -10
  182. package/lib/latestValueManager.d.ts.map +0 -1
  183. package/lib/latestValueManager.js +0 -113
  184. package/lib/latestValueManager.js.map +0 -1
  185. package/lib/latestValueTypes.d.ts +0 -108
  186. package/lib/latestValueTypes.d.ts.map +0 -1
  187. package/lib/latestValueTypes.js +0 -6
  188. package/lib/latestValueTypes.js.map +0 -1
  189. package/lib/notificationsManager.d.ts +0 -27
  190. package/lib/notificationsManager.d.ts.map +0 -1
  191. package/lib/notificationsManager.js +0 -94
  192. package/lib/notificationsManager.js.map +0 -1
  193. package/lib/notificationsManagerTypes.d.ts +0 -144
  194. package/lib/notificationsManagerTypes.d.ts.map +0 -1
  195. package/lib/notificationsManagerTypes.js +0 -6
  196. package/lib/notificationsManagerTypes.js.map +0 -1
  197. package/lib/packageVersion.d.ts +0 -9
  198. package/lib/packageVersion.d.ts.map +0 -1
  199. package/lib/packageVersion.js +0 -9
  200. package/lib/packageVersion.js.map +0 -1
  201. package/lib/presence.d.ts +0 -229
  202. package/lib/presence.d.ts.map +0 -1
  203. package/lib/presence.js +0 -20
  204. package/lib/presence.js.map +0 -1
  205. package/lib/presenceDatastoreManager.d.ts +0 -149
  206. package/lib/presenceDatastoreManager.d.ts.map +0 -1
  207. package/lib/presenceDatastoreManager.js +0 -663
  208. package/lib/presenceDatastoreManager.js.map +0 -1
  209. package/lib/presenceManager.d.ts +0 -16
  210. package/lib/presenceManager.d.ts.map +0 -1
  211. package/lib/presenceManager.js +0 -136
  212. package/lib/presenceManager.js.map +0 -1
  213. package/lib/presenceStates.d.ts +0 -102
  214. package/lib/presenceStates.d.ts.map +0 -1
  215. package/lib/presenceStates.js +0 -225
  216. package/lib/presenceStates.js.map +0 -1
  217. package/lib/protocol.d.ts +0 -111
  218. package/lib/protocol.d.ts.map +0 -1
  219. package/lib/protocol.js +0 -17
  220. package/lib/protocol.js.map +0 -1
  221. package/lib/runtimeTypes.d.ts +0 -26
  222. package/lib/runtimeTypes.d.ts.map +0 -1
  223. package/lib/runtimeTypes.js +0 -6
  224. package/lib/runtimeTypes.js.map +0 -1
  225. package/lib/stateDatastore.d.ts +0 -56
  226. package/lib/stateDatastore.d.ts.map +0 -1
  227. package/lib/stateDatastore.js +0 -17
  228. package/lib/stateDatastore.js.map +0 -1
  229. package/lib/stateFactory.d.ts +0 -18
  230. package/lib/stateFactory.d.ts.map +0 -1
  231. package/lib/stateFactory.js +0 -20
  232. package/lib/stateFactory.js.map +0 -1
  233. package/lib/statesManagerTypes.d.ts +0 -27
  234. package/lib/statesManagerTypes.d.ts.map +0 -1
  235. package/lib/statesManagerTypes.js +0 -6
  236. package/lib/statesManagerTypes.js.map +0 -1
  237. package/lib/systemWorkspace.d.ts +0 -58
  238. package/lib/systemWorkspace.d.ts.map +0 -1
  239. package/lib/systemWorkspace.js +0 -261
  240. package/lib/systemWorkspace.js.map +0 -1
  241. package/lib/timerManager.d.ts +0 -37
  242. package/lib/timerManager.d.ts.map +0 -1
  243. package/lib/timerManager.js +0 -61
  244. package/lib/timerManager.js.map +0 -1
  245. package/lib/types.d.ts +0 -132
  246. package/lib/types.d.ts.map +0 -1
  247. package/lib/types.js +0 -6
  248. package/lib/types.js.map +0 -1
  249. package/lib/validatableTypes.d.ts +0 -69
  250. package/lib/validatableTypes.d.ts.map +0 -1
  251. package/lib/validatableTypes.js +0 -6
  252. package/lib/validatableTypes.js.map +0 -1
  253. package/lib/validatedGetter.d.ts +0 -18
  254. package/lib/validatedGetter.d.ts.map +0 -1
  255. package/lib/validatedGetter.js +0 -39
  256. package/lib/validatedGetter.js.map +0 -1
  257. package/lib/valueManager.d.ts +0 -15
  258. package/lib/valueManager.d.ts.map +0 -1
  259. package/lib/valueManager.js +0 -17
  260. package/lib/valueManager.js.map +0 -1
package/dist/types.d.ts DELETED
@@ -1,132 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import type { BroadcastControls } from "./broadcastControlsTypes.js";
6
- import type { InternalTypes } from "./exposedInternalTypes.js";
7
- import type { InternalUtilityTypes } from "./exposedUtilityTypes.js";
8
- import type { NotificationsManager } from "./notificationsManagerTypes.js";
9
- import type { Presence, PresenceWithNotifications } from "./presence.js";
10
- /**
11
- * Unique address within a session.
12
- *
13
- * @remarks
14
- * A string known to all clients working with a certain Workspace and unique
15
- * among Workspaces. Recommend using specifying concatenation of: type of
16
- * unique identifier, `:` (required), and unique identifier.
17
- *
18
- * @example Examples
19
- * ```typescript
20
- * "guid:g0fl001d-1415-5000-c00l-g0fa54g0b1g1"
21
- * "address:object0/sub-object2:pointers"
22
- * ```
23
- *
24
- * @beta
25
- */
26
- export type WorkspaceAddress = `${string}:${string}`;
27
- /**
28
- * Single entry in {@link StatesWorkspaceSchema} or {@link NotificationsWorkspaceSchema}.
29
- *
30
- * @beta
31
- */
32
- export type StatesWorkspaceEntry<TKey extends string, TValue extends InternalTypes.ValueDirectoryOrState<unknown>, TManager = unknown> = InternalTypes.ManagerFactory<TKey, TValue, TManager>;
33
- /**
34
- * Schema for a {@link StatesWorkspace} workspace.
35
- *
36
- * Keys of schema are the keys of the {@link StatesWorkspace} providing access to State objects.
37
- *
38
- * @beta
39
- */
40
- export type StatesWorkspaceSchema<Keys extends string = string> = {
41
- [Key in Keys]: StatesWorkspaceEntry<Key, InternalTypes.ValueDirectoryOrState<unknown>>;
42
- };
43
- /**
44
- * Map of State objects registered with {@link StatesWorkspace}.
45
- *
46
- * @sealed
47
- * @beta
48
- */
49
- export type StatesWorkspaceEntries<TSchema extends Partial<StatesWorkspaceSchema<TSchemaKeys>>, TSchemaKeys extends string & keyof TSchema = string & keyof TSchema> = {
50
- /**
51
- * Registered State objects.
52
- */
53
- readonly [Key in keyof TSchema]: ReturnType<Exclude<TSchema[Key], undefined>>["manager"] extends InternalTypes.StateValue<infer TManager> ? TManager : never;
54
- };
55
- /**
56
- * `StatesWorkspace` maintains a registry of State objects that all share and provide access to
57
- * presence state values across client members in a session.
58
- *
59
- * State objects offer variations on how to manage states, but all share same principle that
60
- * each client's state is independent and may only be updated by originating client.
61
- *
62
- * @sealed
63
- * @beta
64
- */
65
- export interface StatesWorkspace<TSchema extends Partial<StatesWorkspaceSchema<TSchemaKeys>>, TManagerConstraints = unknown, TSchemaKeys extends string & keyof TSchema = string & keyof TSchema> {
66
- /**
67
- * Registers a new State object with the {@link StatesWorkspace}.
68
- * @param key - new unique key for the State object within the workspace
69
- * @param configuration - factory/settings for creating a State object. Use
70
- * {@link StateFactory} to create.
71
- */
72
- add<TKey extends string, TValue extends InternalTypes.ValueDirectoryOrState<unknown>, TManager extends TManagerConstraints>(key: TKey, configuration: InternalTypes.ManagerFactory<TKey, TValue, TManager>): asserts this is StatesWorkspace<TSchema & Record<TKey, InternalTypes.ManagerFactory<TKey, TValue, TManager>>, TManagerConstraints>;
73
- /**
74
- * Registry of State objects.
75
- */
76
- readonly states: StatesWorkspaceEntries<TSchema, TSchemaKeys>;
77
- /**
78
- * Default controls for management of broadcast updates.
79
- */
80
- readonly controls: BroadcastControls;
81
- /**
82
- * Containing {@link Presence}
83
- */
84
- readonly presence: Presence;
85
- }
86
- /**
87
- * Schema for a {@link NotificationsWorkspace} workspace.
88
- *
89
- * Keys of schema are the keys of the {@link NotificationsWorkspace} providing access to {@link NotificationsManager}s.
90
- *
91
- * @alpha
92
- */
93
- export type NotificationsWorkspaceSchema<Keys extends string = string> = {
94
- [Key in Keys]: InternalTypes.ManagerFactory<Key, InternalTypes.ValueRequiredState<InternalTypes.NotificationType>, NotificationsManager<InternalUtilityTypes.NotificationListeners<unknown>>>;
95
- };
96
- /**
97
- * `NotificationsWorkspace` maintains a registry of {@link NotificationsManager}s
98
- * that facilitate messages across client members in a session.
99
- *
100
- * @privateRemarks
101
- * This should be kept mostly in sync with {@link StatesWorkspace}. Notably the
102
- * return type of `add` is limited here and the `controls` property is omitted.
103
- * The `PresenceStatesImpl` class implements `AnyWorkspace` and therefore
104
- * `NotificationsWorkspace`, so long as this is proper subset.
105
- *
106
- * @sealed
107
- * @alpha
108
- */
109
- export interface NotificationsWorkspace<TSchema extends Partial<NotificationsWorkspaceSchema<TSchemaKeys>>, TSchemaKeys extends string & keyof TSchema = string & keyof TSchema> {
110
- /**
111
- * Registers a new `NotificationsManager` with the {@link NotificationsWorkspace}.
112
- * @param key - new unique key for the `NotificationsManager` within the workspace
113
- * @param manager - factory for creating a `NotificationsManager`
114
- */
115
- add<TKey extends string, TValue extends InternalTypes.ValueDirectoryOrState<unknown>, TManager extends NotificationsManager<InternalUtilityTypes.NotificationListeners<unknown>>>(key: TKey, manager: InternalTypes.ManagerFactory<TKey, TValue, TManager>): asserts this is NotificationsWorkspace<TSchema & Record<TKey, InternalTypes.ManagerFactory<TKey, TValue, TManager>>>;
116
- /**
117
- * Registry of `NotificationsManager`s.
118
- */
119
- readonly notifications: StatesWorkspaceEntries<TSchema, TSchemaKeys>;
120
- /**
121
- * Containing {@link PresenceWithNotifications}
122
- */
123
- readonly presence: PresenceWithNotifications;
124
- }
125
- /**
126
- * `AnyWorkspace` is a superset of {@link StatesWorkspace} and {@link NotificationsWorkspace}.
127
- */
128
- export interface AnyWorkspace<TSchema extends StatesWorkspaceSchema, TManagerConstraints = unknown> extends StatesWorkspace<TSchema, TManagerConstraints> {
129
- readonly notifications: StatesWorkspaceEntries<TSchema>;
130
- readonly presence: PresenceWithNotifications;
131
- }
132
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"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"}
package/dist/types.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=types.js.map
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.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 { BroadcastControls } from \"./broadcastControlsTypes.js\";\nimport type { InternalTypes } from \"./exposedInternalTypes.js\";\nimport type { InternalUtilityTypes } from \"./exposedUtilityTypes.js\";\nimport type { NotificationsManager } from \"./notificationsManagerTypes.js\";\nimport type { Presence, PresenceWithNotifications } from \"./presence.js\";\n\n/**\n * Unique address within a session.\n *\n * @remarks\n * A string known to all clients working with a certain Workspace and unique\n * among Workspaces. Recommend using specifying concatenation of: type of\n * unique identifier, `:` (required), and unique identifier.\n *\n * @example Examples\n * ```typescript\n * \"guid:g0fl001d-1415-5000-c00l-g0fa54g0b1g1\"\n * \"address:object0/sub-object2:pointers\"\n * ```\n *\n * @beta\n */\nexport type WorkspaceAddress = `${string}:${string}`;\n\n/**\n * Single entry in {@link StatesWorkspaceSchema} or {@link NotificationsWorkspaceSchema}.\n *\n * @beta\n */\nexport type StatesWorkspaceEntry<\n\tTKey extends string,\n\tTValue extends InternalTypes.ValueDirectoryOrState<unknown>,\n\tTManager = unknown,\n> = InternalTypes.ManagerFactory<TKey, TValue, TManager>;\n\n// #region StatesWorkspace\n\n/**\n * Schema for a {@link StatesWorkspace} workspace.\n *\n * Keys of schema are the keys of the {@link StatesWorkspace} providing access to State objects.\n *\n * @beta\n */\nexport type StatesWorkspaceSchema<Keys extends string = string> = {\n\t/**\n\t * Key-value pairs of State objects registered with the {@link StatesWorkspace}.\n\t */\n\t[Key in Keys]: StatesWorkspaceEntry<Key, InternalTypes.ValueDirectoryOrState<unknown>>;\n};\n\n/**\n * Map of State objects registered with {@link StatesWorkspace}.\n *\n * @sealed\n * @beta\n */\nexport type StatesWorkspaceEntries<\n\tTSchema extends Partial<StatesWorkspaceSchema<TSchemaKeys>>,\n\tTSchemaKeys extends string & keyof TSchema = string & keyof TSchema,\n> = {\n\t/**\n\t * Registered State objects.\n\t */\n\treadonly [Key in keyof TSchema]: ReturnType<\n\t\tExclude<TSchema[Key], undefined>\n\t>[\"manager\"] extends InternalTypes.StateValue<infer TManager>\n\t\t? TManager\n\t\t: never;\n};\n\n/**\n * `StatesWorkspace` maintains a registry of State objects that all share and provide access to\n * presence state values across client members in a session.\n *\n * State objects offer variations on how to manage states, but all share same principle that\n * each client's state is independent and may only be updated by originating client.\n *\n * @sealed\n * @beta\n */\nexport interface StatesWorkspace<\n\tTSchema extends Partial<StatesWorkspaceSchema<TSchemaKeys>>,\n\tTManagerConstraints = unknown,\n\tTSchemaKeys extends string & keyof TSchema = string & keyof TSchema,\n> {\n\t/**\n\t * Registers a new State object with the {@link StatesWorkspace}.\n\t * @param key - new unique key for the State object within the workspace\n\t * @param configuration - factory/settings for creating a State object. Use\n\t * {@link StateFactory} to create.\n\t */\n\tadd<\n\t\tTKey extends string,\n\t\tTValue extends InternalTypes.ValueDirectoryOrState<unknown>,\n\t\tTManager extends TManagerConstraints,\n\t>(\n\t\tkey: TKey,\n\t\tconfiguration: InternalTypes.ManagerFactory<TKey, TValue, TManager>,\n\t): asserts this is StatesWorkspace<\n\t\tTSchema & Record<TKey, InternalTypes.ManagerFactory<TKey, TValue, TManager>>,\n\t\tTManagerConstraints\n\t>;\n\n\t/**\n\t * Registry of State objects.\n\t */\n\treadonly states: StatesWorkspaceEntries<TSchema, TSchemaKeys>;\n\n\t/**\n\t * Default controls for management of broadcast updates.\n\t */\n\treadonly controls: BroadcastControls;\n\n\t/**\n\t * Containing {@link Presence}\n\t */\n\treadonly presence: Presence;\n}\n\n// #endregion StatesWorkspace\n\n// #region NotificationsWorkspace\n\n/**\n * Schema for a {@link NotificationsWorkspace} workspace.\n *\n * Keys of schema are the keys of the {@link NotificationsWorkspace} providing access to {@link NotificationsManager}s.\n *\n * @alpha\n */\nexport type NotificationsWorkspaceSchema<Keys extends string = string> = {\n\t[Key in Keys]: InternalTypes.ManagerFactory<\n\t\tKey,\n\t\tInternalTypes.ValueRequiredState<InternalTypes.NotificationType>,\n\t\tNotificationsManager<InternalUtilityTypes.NotificationListeners<unknown>>\n\t>;\n};\n\n/**\n * `NotificationsWorkspace` maintains a registry of {@link NotificationsManager}s\n * that facilitate messages across client members in a session.\n *\n * @privateRemarks\n * This should be kept mostly in sync with {@link StatesWorkspace}. Notably the\n * return type of `add` is limited here and the `controls` property is omitted.\n * The `PresenceStatesImpl` class implements `AnyWorkspace` and therefore\n * `NotificationsWorkspace`, so long as this is proper subset.\n *\n * @sealed\n * @alpha\n */\nexport interface NotificationsWorkspace<\n\tTSchema extends Partial<NotificationsWorkspaceSchema<TSchemaKeys>>,\n\tTSchemaKeys extends string & keyof TSchema = string & keyof TSchema,\n> {\n\t/**\n\t * Registers a new `NotificationsManager` with the {@link NotificationsWorkspace}.\n\t * @param key - new unique key for the `NotificationsManager` within the workspace\n\t * @param manager - factory for creating a `NotificationsManager`\n\t */\n\tadd<\n\t\tTKey extends string,\n\t\tTValue extends InternalTypes.ValueDirectoryOrState<unknown>,\n\t\tTManager extends NotificationsManager<InternalUtilityTypes.NotificationListeners<unknown>>,\n\t>(\n\t\tkey: TKey,\n\t\tmanager: InternalTypes.ManagerFactory<TKey, TValue, TManager>,\n\t): asserts this is NotificationsWorkspace<\n\t\tTSchema & Record<TKey, InternalTypes.ManagerFactory<TKey, TValue, TManager>>\n\t>;\n\n\t/**\n\t * Registry of `NotificationsManager`s.\n\t */\n\treadonly notifications: StatesWorkspaceEntries<TSchema, TSchemaKeys>;\n\n\t/**\n\t * Containing {@link PresenceWithNotifications}\n\t */\n\treadonly presence: PresenceWithNotifications;\n}\n\n// #endregion NotificationsWorkspace\n\n/**\n * `AnyWorkspace` is a superset of {@link StatesWorkspace} and {@link NotificationsWorkspace}.\n */\nexport interface AnyWorkspace<\n\tTSchema extends StatesWorkspaceSchema,\n\tTManagerConstraints = unknown,\n> extends StatesWorkspace<TSchema, TManagerConstraints> {\n\treadonly notifications: StatesWorkspaceEntries<TSchema>;\n\t// TO be removed if/when notifications are fully supported\n\treadonly presence: PresenceWithNotifications;\n}\n"]}
@@ -1,69 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import type { InternalCoreInterfacesUtilityTypes, OpaqueJsonDeserialized } from "@fluidframework/core-interfaces/internal";
6
- import type { InternalTypes } from "./exposedInternalTypes.js";
7
- /**
8
- * Metadata for a value that may have been validated by a {@link StateSchemaValidator} function.
9
- */
10
- interface ValidatableMetadata<TValue> {
11
- /**
12
- * Contains a validated value or undefined if `value` is invalid.
13
- *
14
- * This property will not be present if the data has not been validated.
15
- * If it is present and `undefined`, the value has been checked and found to be invalid.
16
- * Otherwise it will be the validated value.
17
- */
18
- validatedValue?: OpaqueJsonDeserialized<TValue> | undefined;
19
- }
20
- /**
21
- * Represents data with optional value that may have been validated by a
22
- * {@link StateSchemaValidator} function.
23
- */
24
- export interface ValidatableOptionalState<TValue> extends Omit<InternalTypes.ValueOptionalState<TValue>, keyof ValidatableMetadata<TValue>>, ValidatableMetadata<TValue> {
25
- }
26
- /**
27
- * Represents data with required value that may have been validated by a
28
- * {@link StateSchemaValidator} function.
29
- */
30
- export interface ValidatableRequiredState<TValue> extends Omit<InternalTypes.ValueRequiredState<TValue>, keyof ValidatableMetadata<TValue>>, ValidatableMetadata<TValue> {
31
- }
32
- /**
33
- * A directory of validatable values, where each value may be an optional
34
- * state or another directory.
35
- *
36
- * @remarks
37
- * The is the validatable version of {@link InternalTypes.ValueDirectory}.
38
- */
39
- export interface ValidatableValueDirectory<T> {
40
- rev: number;
41
- items: {
42
- [name: string | number]: ValidatableOptionalState<T> | ValidatableValueDirectory<T>;
43
- };
44
- }
45
- /**
46
- * Convenience type for a validatable required state or a directory of values.
47
- *
48
- * @remarks
49
- * This is the validatable version of {@link InternalTypes.ValueDirectoryOrState}.
50
- */
51
- export type ValidatableValueDirectoryOrState<T> = ValidatableRequiredState<T> | ValidatableValueDirectory<T>;
52
- /**
53
- * Transforms basic value datastore / protocol type into equivalent type
54
- * with validation support.
55
- *
56
- * @remarks
57
- * Use when some more specific or parameterized type equivalent of
58
- * `InternalTypes.Value(Directory|RequiredState|OptionalState)` is needed.
59
- *
60
- * Basically, wherever a `*ValueState` appears it is extended with
61
- * {@link ValidatableMetadata} to support validation.
62
- */
63
- export type ValidatableValueStructure<T extends InternalTypes.ValueDirectory<unknown> | InternalTypes.ValueRequiredState<unknown> | InternalTypes.ValueOptionalState<unknown>> = T extends InternalTypes.ValueDirectory<infer TValue> ? InternalCoreInterfacesUtilityTypes.IfSameType<T, InternalTypes.ValueDirectory<T>, ValidatableValueDirectory<TValue>, InternalCoreInterfacesUtilityTypes.FlattenIntersection<Omit<T, "items"> & {
64
- items: {
65
- [KItems in keyof T["items"]]: ValidatableValueStructure<T["items"][KItems]>;
66
- };
67
- }>> : T extends InternalTypes.ValueRequiredState<infer TValue> | InternalTypes.ValueOptionalState<infer TValue> ? InternalCoreInterfacesUtilityTypes.FlattenIntersection<Omit<T, keyof ValidatableMetadata<TValue>> & ValidatableMetadata<TValue>> : never;
68
- export {};
69
- //# sourceMappingURL=validatableTypes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validatableTypes.d.ts","sourceRoot":"","sources":["../src/validatableTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,kCAAkC,EAClC,sBAAsB,EACtB,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D;;GAEG;AACH,UAAU,mBAAmB,CAAC,MAAM;IACnC;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;CAE5D;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB,CAAC,MAAM,CAC/C,SAAQ,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,mBAAmB,CAAC,MAAM,CAAC,CAAC,EACxF,mBAAmB,CAAC,MAAM,CAAC;CAAG;AAEhC;;;GAGG;AACH,MAAM,WAAW,wBAAwB,CAAC,MAAM,CAC/C,SAAQ,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,mBAAmB,CAAC,MAAM,CAAC,CAAC,EACxF,mBAAmB,CAAC,MAAM,CAAC;CAAG;AAEhC;;;;;;GAMG;AACH,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE;QAIN,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,wBAAwB,CAAC,CAAC,CAAC,GAAG,yBAAyB,CAAC,CAAC,CAAC,CAAC;KACpF,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,MAAM,gCAAgC,CAAC,CAAC,IAC3C,wBAAwB,CAAC,CAAC,CAAC,GAC3B,yBAAyB,CAAC,CAAC,CAAC,CAAC;AAEhC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,yBAAyB,CACpC,CAAC,SACE,aAAa,CAAC,cAAc,CAAC,OAAO,CAAC,GACrC,aAAa,CAAC,kBAAkB,CAAC,OAAO,CAAC,GACzC,aAAa,CAAC,kBAAkB,CAAC,OAAO,CAAC,IAE5C,CAAC,SAAS,aAAa,CAAC,cAAc,CAAC,MAAM,MAAM,CAAC,GACjD,kCAAkC,CAAC,UAAU,CAC7C,CAAC,EACD,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,EAE/B,yBAAyB,CAAC,MAAM,CAAC,EAEjC,kCAAkC,CAAC,mBAAmB,CACrD,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG;IAClB,KAAK,EAAE;SACL,MAAM,IAAI,MAAM,CAAC,CAAC,OAAO,CAAC,GAAG,yBAAyB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;KAC3E,CAAC;CACF,CACD,CACD,GACA,CAAC,SACE,aAAa,CAAC,kBAAkB,CAAC,MAAM,MAAM,CAAC,GAC9C,aAAa,CAAC,kBAAkB,CAAC,MAAM,MAAM,CAAC,GAChD,kCAAkC,CAAC,mBAAmB,CACtD,IAAI,CAAC,CAAC,EAAE,MAAM,mBAAmB,CAAC,MAAM,CAAC,CAAC,GAAG,mBAAmB,CAAC,MAAM,CAAC,CACxE,GACA,KAAK,CAAC"}
@@ -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=validatableTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validatableTypes.js","sourceRoot":"","sources":["../src/validatableTypes.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 {\n\tInternalCoreInterfacesUtilityTypes,\n\tOpaqueJsonDeserialized,\n} from \"@fluidframework/core-interfaces/internal\";\n\nimport type { InternalTypes } from \"./exposedInternalTypes.js\";\n\n/**\n * Metadata for a value that may have been validated by a {@link StateSchemaValidator} function.\n */\ninterface ValidatableMetadata<TValue> {\n\t/**\n\t * Contains a validated value or undefined if `value` is invalid.\n\t *\n\t * This property will not be present if the data has not been validated.\n\t * If it is present and `undefined`, the value has been checked and found to be invalid.\n\t * Otherwise it will be the validated value.\n\t */\n\tvalidatedValue?: OpaqueJsonDeserialized<TValue> | undefined;\n\t// typeCheck: \"do you have me?\";\n}\n\n/**\n * Represents data with optional value that may have been validated by a\n * {@link StateSchemaValidator} function.\n */\nexport interface ValidatableOptionalState<TValue>\n\textends Omit<InternalTypes.ValueOptionalState<TValue>, keyof ValidatableMetadata<TValue>>,\n\t\tValidatableMetadata<TValue> {}\n\n/**\n * Represents data with required value that may have been validated by a\n * {@link StateSchemaValidator} function.\n */\nexport interface ValidatableRequiredState<TValue>\n\textends Omit<InternalTypes.ValueRequiredState<TValue>, keyof ValidatableMetadata<TValue>>,\n\t\tValidatableMetadata<TValue> {}\n\n/**\n * A directory of validatable values, where each value may be an optional\n * state or another directory.\n *\n * @remarks\n * The is the validatable version of {@link InternalTypes.ValueDirectory}.\n */\nexport interface ValidatableValueDirectory<T> {\n\trev: number;\n\titems: {\n\t\t// Caution: any particular item may or may not exist\n\t\t// Typescript does not support absent keys without forcing type to also be undefined.\n\t\t// See https://github.com/microsoft/TypeScript/issues/42810.\n\t\t[name: string | number]: ValidatableOptionalState<T> | ValidatableValueDirectory<T>;\n\t};\n}\n\n/**\n * Convenience type for a validatable required state or a directory of values.\n *\n * @remarks\n * This is the validatable version of {@link InternalTypes.ValueDirectoryOrState}.\n */\nexport type ValidatableValueDirectoryOrState<T> =\n\t| ValidatableRequiredState<T>\n\t| ValidatableValueDirectory<T>;\n\n/**\n * Transforms basic value datastore / protocol type into equivalent type\n * with validation support.\n *\n * @remarks\n * Use when some more specific or parameterized type equivalent of\n * `InternalTypes.Value(Directory|RequiredState|OptionalState)` is needed.\n *\n * Basically, wherever a `*ValueState` appears it is extended with\n * {@link ValidatableMetadata} to support validation.\n */\nexport type ValidatableValueStructure<\n\tT extends\n\t\t| InternalTypes.ValueDirectory<unknown>\n\t\t| InternalTypes.ValueRequiredState<unknown>\n\t\t| InternalTypes.ValueOptionalState<unknown>,\n> =\n\tT extends InternalTypes.ValueDirectory<infer TValue>\n\t\t? InternalCoreInterfacesUtilityTypes.IfSameType<\n\t\t\t\tT,\n\t\t\t\tInternalTypes.ValueDirectory<T>,\n\t\t\t\t// Use canonical type for exact match\n\t\t\t\tValidatableValueDirectory<TValue>,\n\t\t\t\t// Inexact match => recurse\n\t\t\t\tInternalCoreInterfacesUtilityTypes.FlattenIntersection<\n\t\t\t\t\tOmit<T, \"items\"> & {\n\t\t\t\t\t\titems: {\n\t\t\t\t\t\t\t[KItems in keyof T[\"items\"]]: ValidatableValueStructure<T[\"items\"][KItems]>;\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t>\n\t\t: T extends\n\t\t\t\t\t| InternalTypes.ValueRequiredState<infer TValue>\n\t\t\t\t\t| InternalTypes.ValueOptionalState<infer TValue>\n\t\t\t? InternalCoreInterfacesUtilityTypes.FlattenIntersection<\n\t\t\t\t\tOmit<T, keyof ValidatableMetadata<TValue>> & ValidatableMetadata<TValue>\n\t\t\t\t>\n\t\t\t: never;\n"]}
@@ -1,18 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import type { DeepReadonly, JsonDeserialized } from "@fluidframework/core-interfaces/internal/exposedUtilityTypes";
6
- import type { StateSchemaValidator } from "./latestValueTypes.js";
7
- import type { ValidatableRequiredState } from "./validatableTypes.js";
8
- /**
9
- * Creates a getter for a state value that validates the data with a validator if one is provided. Otherwise the value
10
- * is returned directly.
11
- *
12
- * @param clientState - The client state to be validated.
13
- * @param validator - The validator function to run.
14
- * @returns Either returns the value directly if a validator is not provided, or a function that will return the
15
- * validated data.
16
- */
17
- export declare function createValidatedGetter<T>(clientState: ValidatableRequiredState<T>, validator: StateSchemaValidator<T> | undefined): (() => DeepReadonly<JsonDeserialized<T>> | undefined) | DeepReadonly<JsonDeserialized<T>>;
18
- //# sourceMappingURL=validatedGetter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validatedGetter.d.ts","sourceRoot":"","sources":["../src/validatedGetter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,YAAY,EACZ,gBAAgB,EAEhB,MAAM,8DAA8D,CAAC;AAGtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAmBtE;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACtC,WAAW,EAAE,wBAAwB,CAAC,CAAC,CAAC,EACxC,SAAS,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,SAAS,GAC5C,CAAC,MAAM,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAgB3F"}
@@ -1,43 +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.createValidatedGetter = void 0;
8
- const internalUtils_js_1 = require("./internalUtils.js");
9
- function createGetterFunction(clientState, validator) {
10
- return () => {
11
- if (!("validatedValue" in clientState)) {
12
- // Stored `value` has not been validated yet, so validate it and save the result.
13
- clientState.validatedValue = validator(clientState.value);
14
- }
15
- return (0, internalUtils_js_1.asDeeplyReadonlyDeserializedJson)(clientState.validatedValue);
16
- };
17
- }
18
- /**
19
- * Creates a getter for a state value that validates the data with a validator if one is provided. Otherwise the value
20
- * is returned directly.
21
- *
22
- * @param clientState - The client state to be validated.
23
- * @param validator - The validator function to run.
24
- * @returns Either returns the value directly if a validator is not provided, or a function that will return the
25
- * validated data.
26
- */
27
- function createValidatedGetter(clientState, validator) {
28
- // No validator
29
- if (validator === undefined) {
30
- return (0, internalUtils_js_1.asDeeplyReadonlyDeserializedJson)(clientState.value);
31
- }
32
- // Avoid creating another function since one already exists on the item
33
- if (typeof clientState.value === "function") {
34
- return clientState.value;
35
- }
36
- // OpaqueJsonDeserialized<T> is just a branded alias of JsonDeserialized<T>. At runtime the functions are still passed
37
- // JSON data, regardless of their type representation. Passing that data to a function that expects `unknown`, like
38
- // the user-provided validator function, is always valid, so StateSchemaValidator and StateSchemaValidatorToOpaque are
39
- // functionally equivalent.
40
- return createGetterFunction(clientState, validator);
41
- }
42
- exports.createValidatedGetter = createValidatedGetter;
43
- //# sourceMappingURL=validatedGetter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validatedGetter.js","sourceRoot":"","sources":["../src/validatedGetter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,yDAAsE;AAQtE,SAAS,oBAAoB,CAC5B,WAAwC,EACxC,SAA0C;IAE1C,OAAO,GAAkD,EAAE;QAC1D,IAAI,CAAC,CAAC,gBAAgB,IAAI,WAAW,CAAC,EAAE,CAAC;YACxC,iFAAiF;YACjF,WAAW,CAAC,cAAc,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,IAAA,mDAAgC,EAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IACrE,CAAC,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,qBAAqB,CACpC,WAAwC,EACxC,SAA8C;IAE9C,eAAe;IACf,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,IAAA,mDAAgC,EAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC5D,CAAC;IAED,uEAAuE;IACvE,IAAI,OAAO,WAAW,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;QAC7C,OAAO,WAAW,CAAC,KAAK,CAAC;IAC1B,CAAC;IAED,sHAAsH;IACtH,mHAAmH;IACnH,sHAAsH;IACtH,2BAA2B;IAC3B,OAAO,oBAAoB,CAAC,WAAW,EAAE,SAA4C,CAAC,CAAC;AACxF,CAAC;AAnBD,sDAmBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tDeepReadonly,\n\tJsonDeserialized,\n\tOpaqueJsonDeserialized,\n} from \"@fluidframework/core-interfaces/internal/exposedUtilityTypes\";\n\nimport { asDeeplyReadonlyDeserializedJson } from \"./internalUtils.js\";\nimport type { StateSchemaValidator } from \"./latestValueTypes.js\";\nimport type { ValidatableRequiredState } from \"./validatableTypes.js\";\n\ntype StateSchemaValidatorToOpaque<T> = (\n\trawData: OpaqueJsonDeserialized<T>,\n) => OpaqueJsonDeserialized<T> | undefined;\n\nfunction createGetterFunction<T>(\n\tclientState: ValidatableRequiredState<T>,\n\tvalidator: StateSchemaValidatorToOpaque<T>,\n): () => DeepReadonly<JsonDeserialized<T>> | undefined {\n\treturn (): DeepReadonly<JsonDeserialized<T>> | undefined => {\n\t\tif (!(\"validatedValue\" in clientState)) {\n\t\t\t// Stored `value` has not been validated yet, so validate it and save the result.\n\t\t\tclientState.validatedValue = validator(clientState.value);\n\t\t}\n\t\treturn asDeeplyReadonlyDeserializedJson(clientState.validatedValue);\n\t};\n}\n\n/**\n * Creates a getter for a state value that validates the data with a validator if one is provided. Otherwise the value\n * is returned directly.\n *\n * @param clientState - The client state to be validated.\n * @param validator - The validator function to run.\n * @returns Either returns the value directly if a validator is not provided, or a function that will return the\n * validated data.\n */\nexport function createValidatedGetter<T>(\n\tclientState: ValidatableRequiredState<T>,\n\tvalidator: StateSchemaValidator<T> | undefined,\n): (() => DeepReadonly<JsonDeserialized<T>> | undefined) | DeepReadonly<JsonDeserialized<T>> {\n\t// No validator\n\tif (validator === undefined) {\n\t\treturn asDeeplyReadonlyDeserializedJson(clientState.value);\n\t}\n\n\t// Avoid creating another function since one already exists on the item\n\tif (typeof clientState.value === \"function\") {\n\t\treturn clientState.value;\n\t}\n\n\t// OpaqueJsonDeserialized<T> is just a branded alias of JsonDeserialized<T>. At runtime the functions are still passed\n\t// JSON data, regardless of their type representation. Passing that data to a function that expects `unknown`, like\n\t// the user-provided validator function, is always valid, so StateSchemaValidator and StateSchemaValidatorToOpaque are\n\t// functionally equivalent.\n\treturn createGetterFunction(clientState, validator as StateSchemaValidatorToOpaque<T>);\n}\n"]}
@@ -1,15 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- import type { InternalTypes } from "./exposedInternalTypes.js";
6
- import type { ValueManager } from "./statesManagerTypes.js";
7
- /**
8
- * Given a value manager, return opaque InternalTypes.StateValue.
9
- */
10
- export declare function brandIVM<TManagerInterface, TValue, TValueState extends InternalTypes.ValueDirectoryOrState<TValue>>(manager: TManagerInterface & ValueManager<TValue, TValueState>): InternalTypes.StateValue<TManagerInterface>;
11
- /**
12
- * Extract the value manager from an opaque InternalTypes.StateValue.
13
- */
14
- export declare function unbrandIVM<TManagerInterface, TValue, TValueState extends InternalTypes.ValueDirectoryOrState<TValue>>(branded: InternalTypes.StateValue<TManagerInterface>): ValueManager<TValue, TValueState>;
15
- //# sourceMappingURL=valueManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"valueManager.d.ts","sourceRoot":"","sources":["../src/valueManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D;;GAEG;AACH,wBAAgB,QAAQ,CACvB,iBAAiB,EACjB,MAAM,EACN,WAAW,SAAS,aAAa,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAE/D,OAAO,EAAE,iBAAiB,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,GAC5D,aAAa,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAE7C;AAED;;GAEG;AACH,wBAAgB,UAAU,CACzB,iBAAiB,EACjB,MAAM,EACN,WAAW,SAAS,aAAa,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAC9D,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,iBAAiB,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,CAEzF"}
@@ -1,22 +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.unbrandIVM = exports.brandIVM = void 0;
8
- /**
9
- * Given a value manager, return opaque InternalTypes.StateValue.
10
- */
11
- function brandIVM(manager) {
12
- return manager;
13
- }
14
- exports.brandIVM = brandIVM;
15
- /**
16
- * Extract the value manager from an opaque InternalTypes.StateValue.
17
- */
18
- function unbrandIVM(branded) {
19
- return branded;
20
- }
21
- exports.unbrandIVM = unbrandIVM;
22
- //# sourceMappingURL=valueManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"valueManager.js","sourceRoot":"","sources":["../src/valueManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH;;GAEG;AACH,SAAgB,QAAQ,CAKvB,OAA8D;IAE9D,OAAO,OAA2E,CAAC;AACpF,CAAC;AARD,4BAQC;AAED;;GAEG;AACH,SAAgB,UAAU,CAIxB,OAAoD;IACrD,OAAO,OAAuD,CAAC;AAChE,CAAC;AAND,gCAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { InternalTypes } from \"./exposedInternalTypes.js\";\nimport type { ValueManager } from \"./statesManagerTypes.js\";\n\n/**\n * Given a value manager, return opaque InternalTypes.StateValue.\n */\nexport function brandIVM<\n\tTManagerInterface,\n\tTValue,\n\tTValueState extends InternalTypes.ValueDirectoryOrState<TValue>,\n>(\n\tmanager: TManagerInterface & ValueManager<TValue, TValueState>,\n): InternalTypes.StateValue<TManagerInterface> {\n\treturn manager as TManagerInterface as InternalTypes.StateValue<TManagerInterface>;\n}\n\n/**\n * Extract the value manager from an opaque InternalTypes.StateValue.\n */\nexport function unbrandIVM<\n\tTManagerInterface,\n\tTValue,\n\tTValueState extends InternalTypes.ValueDirectoryOrState<TValue>,\n>(branded: InternalTypes.StateValue<TManagerInterface>): ValueManager<TValue, TValueState> {\n\treturn branded as unknown as ValueManager<TValue, TValueState>;\n}\n"]}
@@ -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/lib/baseTypes.js DELETED
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- export {};
6
- //# 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,55 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- class ForcedRefreshControl {
6
- constructor(settings) {
7
- // this._forcedRefreshInterval = settings?.forcedRefreshIntervalMs;
8
- }
9
- get forcedRefreshIntervalMs() {
10
- return this._forcedRefreshInterval;
11
- }
12
- set forcedRefreshIntervalMs(value) {
13
- if (value === undefined) {
14
- this._forcedRefreshInterval = undefined;
15
- }
16
- else {
17
- this._forcedRefreshInterval = value >= 10 ? value : undefined;
18
- if (value >= 10) {
19
- // TODO: enable periodic forced refresh
20
- throw new Error("Forced Refresh feature is not implemented");
21
- }
22
- }
23
- }
24
- }
25
- /**
26
- * Implements {@link BroadcastControls} for States Managers
27
- * where returning `undefined` settings are allowed.
28
- */
29
- export class OptionalBroadcastControl extends ForcedRefreshControl {
30
- constructor(settings) {
31
- super(settings);
32
- this.allowableUpdateLatencyMs = settings?.allowableUpdateLatencyMs;
33
- }
34
- }
35
- /**
36
- * Implements {@link BroadcastControls} but always provides defined value for
37
- * {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}.
38
- *
39
- * If {@link BroadcastControls.allowableUpdateLatencyMs | allowableUpdateLatencyMs}
40
- * is set to `undefined`, the default will be restored.
41
- */
42
- export class RequiredBroadcastControl extends ForcedRefreshControl {
43
- constructor(defaultAllowableUpdateLatencyMs) {
44
- super();
45
- this.defaultAllowableUpdateLatencyMs = defaultAllowableUpdateLatencyMs;
46
- this._allowableUpdateLatencyMs = defaultAllowableUpdateLatencyMs;
47
- }
48
- get allowableUpdateLatencyMs() {
49
- return this._allowableUpdateLatencyMs;
50
- }
51
- set allowableUpdateLatencyMs(value) {
52
- this._allowableUpdateLatencyMs = value ?? this.defaultAllowableUpdateLatencyMs;
53
- }
54
- }
55
- //# 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,MAAM,OAAO,wBACZ,SAAQ,oBAAoB;IAK5B,YAAmB,QAAmC;QACrD,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,wBAAwB,GAAG,QAAQ,EAAE,wBAAwB,CAAC;IACpE,CAAC;CACD;AAED;;;;;;GAMG;AACH,MAAM,OAAO,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","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"]}
@@ -1,38 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- /**
6
- * Common controls for States objects.
7
- *
8
- * @sealed
9
- * @beta
10
- */
11
- export interface BroadcastControls {
12
- /**
13
- * Maximum time in milliseconds that a local value update is allowed
14
- * to remain pending before it must be broadcast.
15
- *
16
- * @remarks
17
- * There is no guarantee of broadcast within time allowed
18
- * as other conditions such as disconnect or service throttling may
19
- * cause a delay.
20
- *
21
- * Setting to `undefined` will restore to a system default.
22
- */
23
- allowableUpdateLatencyMs: number | undefined;
24
- }
25
- /**
26
- * Value set to configure {@link BroadcastControls}.
27
- *
28
- * @beta
29
- */
30
- export interface BroadcastControlSettings {
31
- /**
32
- * {@inheritdoc BroadcastControls.allowableUpdateLatencyMs}
33
- *
34
- * @defaultValue 60 [milliseconds]
35
- */
36
- readonly allowableUpdateLatencyMs?: number;
37
- }
38
- //# sourceMappingURL=broadcastControlsTypes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"broadcastControlsTypes.d.ts","sourceRoot":"","sources":["../src/broadcastControlsTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;;;;;;;OAUG;IACH,wBAAwB,EAAE,MAAM,GAAG,SAAS,CAAC;CAc7C;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;;OAIG;IACH,QAAQ,CAAC,wBAAwB,CAAC,EAAE,MAAM,CAAC;CAS3C"}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
- export {};
6
- //# sourceMappingURL=broadcastControlsTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"broadcastControlsTypes.js","sourceRoot":"","sources":["../src/broadcastControlsTypes.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 * Common controls for States objects.\n *\n * @sealed\n * @beta\n */\nexport interface BroadcastControls {\n\t/**\n\t * Maximum time in milliseconds that a local value update is allowed\n\t * to remain pending before it must be broadcast.\n\t *\n\t * @remarks\n\t * There is no guarantee of broadcast within time allowed\n\t * as other conditions such as disconnect or service throttling may\n\t * cause a delay.\n\t *\n\t * Setting to `undefined` will restore to a system default.\n\t */\n\tallowableUpdateLatencyMs: number | undefined;\n\n\t/**\n\t * Target time in milliseconds between oldest changed local state\n\t * has been broadcast and forced rebroadcast of all local values.\n\t * A value of less than 10 disables forced refresh.\n\t *\n\t * @privateRemarks\n\t * Any time less than 10 milliseconds is likely to generate too\n\t * many signals. Ideally this feature becomes obsolete as\n\t * we understand the system better and account for holes.\n\t */\n\t// forcedRefreshIntervalMs is removed until it is supported.\n\t// forcedRefreshIntervalMs: number | undefined;\n}\n\n/**\n * Value set to configure {@link BroadcastControls}.\n *\n * @beta\n */\nexport interface BroadcastControlSettings {\n\t/**\n\t * {@inheritdoc BroadcastControls.allowableUpdateLatencyMs}\n\t *\n\t * @defaultValue 60 [milliseconds]\n\t */\n\treadonly allowableUpdateLatencyMs?: number;\n\n\t/**\n\t * {@inheritdoc BroadcastControls.forcedRefreshIntervalMs}\n\t *\n\t * @defaultValue 0 (disabled)\n\t */\n\t// forcedRefreshIntervalMs is removed until it is supported.\n\t// readonly forcedRefreshIntervalMs?: number;\n}\n"]}