@adcops/autocore-react 3.1.1 → 3.3.2

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 (252) hide show
  1. package/additional-docs/react_performance_notes.md +94 -0
  2. package/dist/components/AutoCoreDevPanel.d.ts.map +1 -1
  3. package/dist/components/AutoCoreDevPanel.js +1 -1
  4. package/dist/components/FileList.d.ts.map +1 -1
  5. package/dist/components/FileList.js +1 -1
  6. package/dist/components/FileSelect.d.ts.map +1 -1
  7. package/dist/components/FileSelect.js +1 -1
  8. package/dist/core/AutoCoreTagContext.d.ts +59 -185
  9. package/dist/core/AutoCoreTagContext.d.ts.map +1 -1
  10. package/dist/core/AutoCoreTagContext.js +1 -1
  11. package/dist/core/AutoCoreTagTypes.d.ts +127 -6
  12. package/dist/core/AutoCoreTagTypes.d.ts.map +1 -1
  13. package/dist/core/CoreStreamTypes.d.ts +345 -0
  14. package/dist/core/CoreStreamTypes.d.ts.map +1 -0
  15. package/dist/core/CoreStreamTypes.js +1 -0
  16. package/dist/core/EventEmitterContext.d.ts +91 -473
  17. package/dist/core/EventEmitterContext.d.ts.map +1 -1
  18. package/dist/core/EventEmitterContext.js +1 -1
  19. package/dist/hooks/adsHooks.d.ts.map +1 -1
  20. package/dist/hooks/adsHooks.js +1 -1
  21. package/dist/hooks/commandHooks.d.ts +3 -3
  22. package/dist/hooks/commandHooks.d.ts.map +1 -1
  23. package/dist/hooks/commandHooks.js +1 -1
  24. package/dist/hooks/useAutoCoreTag.js +1 -1
  25. package/dist/hub/CommandMessage.d.ts +18 -9
  26. package/dist/hub/CommandMessage.d.ts.map +1 -1
  27. package/dist/hub/CommandMessage.js +1 -1
  28. package/dist/hub/DebugPanel.d.ts +31 -0
  29. package/dist/hub/DebugPanel.d.ts.map +1 -0
  30. package/dist/hub/DebugPanel.js +1 -0
  31. package/dist/hub/HubBase.d.ts +83 -129
  32. package/dist/hub/HubBase.d.ts.map +1 -1
  33. package/dist/hub/HubBase.js +1 -1
  34. package/dist/hub/HubSimulate.d.ts +41 -8
  35. package/dist/hub/HubSimulate.d.ts.map +1 -1
  36. package/dist/hub/HubSimulate.js +1 -1
  37. package/dist/hub/HubTauri.d.ts +24 -60
  38. package/dist/hub/HubTauri.d.ts.map +1 -1
  39. package/dist/hub/HubTauri.js +1 -1
  40. package/dist/hub/HubWebSocket.d.ts +33 -17
  41. package/dist/hub/HubWebSocket.d.ts.map +1 -1
  42. package/dist/hub/HubWebSocket.js +1 -1
  43. package/dist/hub/debug.d.ts +23 -0
  44. package/dist/hub/debug.d.ts.map +1 -0
  45. package/dist/hub/debug.js +1 -0
  46. package/dist/hub/index.d.ts +19 -4
  47. package/dist/hub/index.d.ts.map +1 -1
  48. package/dist/hub/index.js +1 -1
  49. package/package.json +4 -4
  50. package/src/components/AutoCoreDevPanel.tsx +14 -11
  51. package/src/components/FileList.tsx +5 -4
  52. package/src/components/FileSelect.tsx +2 -1
  53. package/src/core/ActionMode.ts +1 -1
  54. package/src/core/AutoCoreTagContext.tsx +247 -330
  55. package/src/core/AutoCoreTagTypes.ts +236 -104
  56. package/src/core/CoreStreamTypes.ts +512 -0
  57. package/src/core/EventEmitterContext.tsx +182 -520
  58. package/src/core/IndicatorButtonState.ts +1 -1
  59. package/src/core/hoc.tsx +1 -1
  60. package/src/hooks/adsHooks.tsx +21 -22
  61. package/src/hooks/commandHooks.tsx +23 -19
  62. package/src/hooks/index.ts +1 -1
  63. package/src/hooks/useAutoCoreTag.ts +2 -2
  64. package/src/hooks/useScaledValue.tsx +1 -1
  65. package/src/hub/CommandMessage.ts +71 -19
  66. package/src/hub/DebugPanel.ts +280 -0
  67. package/src/hub/HubBase.ts +147 -223
  68. package/src/hub/HubSimulate.ts +93 -24
  69. package/src/hub/HubTauri.ts +87 -96
  70. package/src/hub/HubWebSocket.ts +118 -140
  71. package/src/hub/debug.ts +211 -0
  72. package/src/hub/index.ts +49 -39
  73. package/docs/.nojekyll +0 -1
  74. package/docs/assets/hierarchy.js +0 -1
  75. package/docs/assets/highlight.css +0 -134
  76. package/docs/assets/icons.js +0 -18
  77. package/docs/assets/icons.svg +0 -1
  78. package/docs/assets/main.js +0 -60
  79. package/docs/assets/navigation.js +0 -1
  80. package/docs/assets/search.js +0 -1
  81. package/docs/assets/style.css +0 -1633
  82. package/docs/classes/components_CodeEditor.CodeEditor.html +0 -135
  83. package/docs/classes/components_Indicator.Indicator.html +0 -122
  84. package/docs/classes/components_IndicatorRect.IndicatorRect.html +0 -121
  85. package/docs/classes/components_JogPanel.JogPanel.html +0 -136
  86. package/docs/classes/components_Lamp.Lamp.html +0 -122
  87. package/docs/classes/components_OskDialog.OskDialog.html +0 -125
  88. package/docs/classes/components_TextInput.TextInput.html +0 -125
  89. package/docs/classes/components_ValueDisplay.ValueDisplay.html +0 -148
  90. package/docs/classes/components_ValueIndicator.ValueIndicator.html +0 -126
  91. package/docs/classes/core_ValueSimulator.ValueSimulator.html +0 -51
  92. package/docs/classes/hub_HubBase.HubBase.html +0 -106
  93. package/docs/classes/hub_HubSimulate.HubSimulate.html +0 -75
  94. package/docs/classes/hub_HubTauri.HubTauri.html +0 -93
  95. package/docs/classes/hub_HubWebSocket.HubWebSocket.html +0 -112
  96. package/docs/documents/core_AutoCoreTagContext.AutoCoreTagContext.html +0 -148
  97. package/docs/enums/components_JogPanel.JogDistanceAction.html +0 -5
  98. package/docs/enums/components_JogPanel.JogPanelAction.html +0 -18
  99. package/docs/enums/components_JogPanel.JogSpeedAction.html +0 -5
  100. package/docs/enums/core_ActionMode.ActionMode.html +0 -6
  101. package/docs/enums/core_IndicatorColor.IndicatorColor.html +0 -23
  102. package/docs/functions/assets.BlocklyLogo.html +0 -1
  103. package/docs/functions/assets.Distance.html +0 -1
  104. package/docs/functions/assets.JogLong.html +0 -1
  105. package/docs/functions/assets.JogMedium.html +0 -1
  106. package/docs/functions/assets.JogShort.html +0 -1
  107. package/docs/functions/assets.PythonLogo.html +0 -1
  108. package/docs/functions/assets.Rotation3D.html +0 -1
  109. package/docs/functions/assets.RotationCcw.html +0 -1
  110. package/docs/functions/assets.RotationCcwA.html +0 -1
  111. package/docs/functions/assets.RotationCcwB.html +0 -1
  112. package/docs/functions/assets.RotationCcwC.html +0 -1
  113. package/docs/functions/assets.RotationCw.html +0 -1
  114. package/docs/functions/assets.RotationCwA.html +0 -1
  115. package/docs/functions/assets.RotationCwB.html +0 -1
  116. package/docs/functions/assets.RotationCwC.html +0 -1
  117. package/docs/functions/assets.Run.html +0 -1
  118. package/docs/functions/assets.Speed.html +0 -1
  119. package/docs/functions/assets.SpeedFast.html +0 -1
  120. package/docs/functions/assets.SpeedMedium.html +0 -1
  121. package/docs/functions/assets.SpeedNone.html +0 -1
  122. package/docs/functions/assets.SpeedSlow.html +0 -1
  123. package/docs/functions/assets.Walk.html +0 -1
  124. package/docs/functions/components_BlocklyEditor.createCustomToolbox.html +0 -6
  125. package/docs/functions/core_UniqueId.UniqueId.html +0 -9
  126. package/docs/functions/core_hoc.hocAddSubscription.html +0 -6
  127. package/docs/functions/hooks_adsHooks.useAdsRegisterSymbols.html +0 -16
  128. package/docs/functions/hooks_adsHooks.useAdsTapValue.html +0 -8
  129. package/docs/functions/hooks_adsHooks.useAdsWriteScaledValue.html +0 -18
  130. package/docs/functions/hooks_adsHooks.useAdsWriteValue.html +0 -9
  131. package/docs/functions/hooks_commandHooks.useRegisterSymbols.html +0 -16
  132. package/docs/functions/hooks_commandHooks.useTapValue.html +0 -10
  133. package/docs/functions/hooks_commandHooks.useWriteScaledValue.html +0 -18
  134. package/docs/functions/hooks_commandHooks.useWriteValue.html +0 -11
  135. package/docs/functions/hooks_useAutoCoreTag.ts.makeAutoCoreTagHooks.html +0 -12
  136. package/docs/functions/hooks_useScaledValue.useScaledValue.html +0 -18
  137. package/docs/functions/hub.createHub.html +0 -3
  138. package/docs/hierarchy.html +0 -1
  139. package/docs/index.html +0 -148
  140. package/docs/interfaces/components_IndicatorButton.IndicatorButtonProps.html +0 -654
  141. package/docs/interfaces/components_IndicatorRect.IndicatorRectProps.html +0 -37
  142. package/docs/interfaces/components_JogPanel.JogPanelButtonDefinition.html +0 -5
  143. package/docs/interfaces/components_ToggleGroup.ToggleGroupProps.html +0 -644
  144. package/docs/interfaces/core_AutoCoreTagTypes.BaseContextValue.html +0 -12
  145. package/docs/interfaces/core_AutoCoreTagTypes.ScaleConfig.html +0 -13
  146. package/docs/interfaces/core_EventEmitterContext.Action.html +0 -8
  147. package/docs/interfaces/core_EventEmitterContext.EventEmitterContextType.html +0 -33
  148. package/docs/interfaces/core_EventEmitterContext.State.html +0 -8
  149. package/docs/interfaces/core_EventEmitterContext.Subscription.html +0 -6
  150. package/docs/interfaces/core_IndicatorButtonState.IndicatorButtonState.html +0 -10
  151. package/docs/interfaces/core_PositionContext.IPositionContext.html +0 -17
  152. package/docs/interfaces/hub_CommandMessage.CommandMessage.html +0 -6
  153. package/docs/interfaces/hub_CommandMessage.CommandMessageResult.html +0 -4
  154. package/docs/modules/assets.html +0 -1
  155. package/docs/modules/assets_BlocklyLogo.html +0 -1
  156. package/docs/modules/assets_Distance.html +0 -1
  157. package/docs/modules/assets_JogLong.html +0 -1
  158. package/docs/modules/assets_JogMedium.html +0 -1
  159. package/docs/modules/assets_JogShort.html +0 -1
  160. package/docs/modules/assets_PythonLogo.html +0 -1
  161. package/docs/modules/assets_Rotation3D.html +0 -1
  162. package/docs/modules/assets_RotationCcw.html +0 -1
  163. package/docs/modules/assets_RotationCcwA.html +0 -1
  164. package/docs/modules/assets_RotationCcwB.html +0 -1
  165. package/docs/modules/assets_RotationCcwC.html +0 -1
  166. package/docs/modules/assets_RotationCw.html +0 -1
  167. package/docs/modules/assets_RotationCwA.html +0 -1
  168. package/docs/modules/assets_RotationCwB.html +0 -1
  169. package/docs/modules/assets_RotationCwC.html +0 -1
  170. package/docs/modules/assets_Run.html +0 -1
  171. package/docs/modules/assets_Speed.html +0 -1
  172. package/docs/modules/assets_SpeedFast.html +0 -1
  173. package/docs/modules/assets_SpeedMedium.html +0 -1
  174. package/docs/modules/assets_SpeedNone.html +0 -1
  175. package/docs/modules/assets_SpeedSlow.html +0 -1
  176. package/docs/modules/assets_Walk.html +0 -1
  177. package/docs/modules/components_AutoCoreDevPanel.html +0 -20
  178. package/docs/modules/components_BlocklyEditor.html +0 -1
  179. package/docs/modules/components_CodeEditor.html +0 -1
  180. package/docs/modules/components_FileList.html +0 -1
  181. package/docs/modules/components_FileSelect.html +0 -1
  182. package/docs/modules/components_FitText.html +0 -1
  183. package/docs/modules/components_Indicator.html +0 -1
  184. package/docs/modules/components_IndicatorButton.html +0 -1
  185. package/docs/modules/components_IndicatorRect.html +0 -1
  186. package/docs/modules/components_JogPanel.html +0 -1
  187. package/docs/modules/components_Lamp.html +0 -1
  188. package/docs/modules/components_Osk.html +0 -1
  189. package/docs/modules/components_OskDialog.html +0 -1
  190. package/docs/modules/components_ProgressBarWithValue.html +0 -1
  191. package/docs/modules/components_TextInput.html +0 -1
  192. package/docs/modules/components_ToggleGroup.html +0 -1
  193. package/docs/modules/components_ValueDisplay.html +0 -1
  194. package/docs/modules/components_ValueIndicator.html +0 -1
  195. package/docs/modules/components_ValueInput.html +0 -1
  196. package/docs/modules/core_ActionMode.html +0 -1
  197. package/docs/modules/core_AutoCoreTagContext.html +0 -11
  198. package/docs/modules/core_AutoCoreTagTypes.html +0 -1
  199. package/docs/modules/core_EventEmitterContext.html +0 -53
  200. package/docs/modules/core_IndicatorButtonState.html +0 -1
  201. package/docs/modules/core_IndicatorColor.html +0 -1
  202. package/docs/modules/core_MaskPatterns.html +0 -1
  203. package/docs/modules/core_NumerableTypes.html +0 -1
  204. package/docs/modules/core_PositionContext.html +0 -1
  205. package/docs/modules/core_UniqueId.html +0 -1
  206. package/docs/modules/core_ValueSimulator.html +0 -1
  207. package/docs/modules/core_hoc.html +0 -1
  208. package/docs/modules/hooks.html +0 -1
  209. package/docs/modules/hooks_adsHooks.html +0 -1
  210. package/docs/modules/hooks_commandHooks.html +0 -1
  211. package/docs/modules/hooks_useAutoCoreTag.ts.html +0 -52
  212. package/docs/modules/hooks_useScaledValue.html +0 -1
  213. package/docs/modules/hub.html +0 -1
  214. package/docs/modules/hub_CommandMessage.html +0 -1
  215. package/docs/modules/hub_HubBase.html +0 -1
  216. package/docs/modules/hub_HubSimulate.html +0 -1
  217. package/docs/modules/hub_HubTauri.html +0 -1
  218. package/docs/modules/hub_HubWebSocket.html +0 -1
  219. package/docs/modules.html +0 -23
  220. package/docs/types/components_IndicatorButton.IndicatorButtonOptionsType.html +0 -1
  221. package/docs/types/core_AutoCoreTagTypes.ExtractByTag.html +0 -2
  222. package/docs/types/core_AutoCoreTagTypes.PrimitiveKind.html +0 -1
  223. package/docs/types/core_AutoCoreTagTypes.TagConfig.html +0 -16
  224. package/docs/types/core_AutoCoreTagTypes.TagValueMap.html +0 -1
  225. package/docs/types/core_AutoCoreTagTypes.TagValueOf.html +0 -1
  226. package/docs/types/core_EventEmitterContext.EmitterDispatchFunction.html +0 -3
  227. package/docs/types/core_EventEmitterContext.EmitterSubscribeFunction.html +0 -3
  228. package/docs/types/core_EventEmitterContext.EmitterUnsubscribeFunction.html +0 -3
  229. package/docs/types/core_NumerableTypes.NumerableFormatOptions.html +0 -4
  230. package/docs/types/core_hoc.HocAddSubscriptionProps.html +0 -6
  231. package/docs/variables/components_AutoCoreDevPanel.AutoCoreDevPanel.html +0 -43
  232. package/docs/variables/components_BlocklyEditor.BlocklyEditor.html +0 -13
  233. package/docs/variables/components_BlocklyEditor.StandardToolbox.html +0 -1
  234. package/docs/variables/components_FileList.FileList.html +0 -23
  235. package/docs/variables/components_FileSelect.FileSelect.html +0 -1
  236. package/docs/variables/components_FitText.FitText.html +0 -4
  237. package/docs/variables/components_IndicatorButton.IndicatorButton.html +0 -1
  238. package/docs/variables/components_JogPanel.DefaultLinearJogButtons.html +0 -2
  239. package/docs/variables/components_JogPanel.DefaultRotationJogButtons.html +0 -2
  240. package/docs/variables/components_Osk.Osk.html +0 -1
  241. package/docs/variables/components_ProgressBarWithValue.ProgressBarWithValue.html +0 -1
  242. package/docs/variables/components_ToggleGroup.ToggleGroup.html +0 -1
  243. package/docs/variables/components_ValueInput.ValueInput.html +0 -4
  244. package/docs/variables/core_AutoCoreTagContext.AutoCoreTagContext.html +0 -1
  245. package/docs/variables/core_AutoCoreTagContext.AutoCoreTagProvider.html +0 -7
  246. package/docs/variables/core_EventEmitterContext.EventEmitterContext.html +0 -64
  247. package/docs/variables/core_EventEmitterContext.EventEmitterProvider.html +0 -10
  248. package/docs/variables/core_MaskPatterns.PrimeReactMaskPatterns.html +0 -14
  249. package/docs/variables/core_MaskPatterns.RegExMaskPatterns.html +0 -15
  250. package/docs/variables/core_PositionContext.DimensionsContext.html +0 -6
  251. package/docs/variables/hooks_useScaledValue.kMillimeters2Inches.html +0 -2
  252. package/docs/variables/hooks_useScaledValue.kNewtons2Pounds.html +0 -2
@@ -2,7 +2,7 @@
2
2
  * Copyright (C) 2025 Automated Design Corp.. All Rights Reserved.
3
3
  * Created Date: 2025-09-05 07:57:49
4
4
  * -----
5
- * Last Modified: 2025-09-10 10:22:18
5
+ * Last Modified: 2026-01-29 09:31:54
6
6
  * -----
7
7
  *
8
8
  */
@@ -22,9 +22,9 @@ export type PrimitiveKind = "boolean" | "number" | "string" | "json";
22
22
  /** Strict JSON value (mirrors serde_json::Value) */
23
23
  type JsonPrimitive = string | number | boolean | null;
24
24
  export type JsonValue =
25
- | JsonPrimitive
26
- | { [key: string]: JsonValue }
27
- | JsonValue[];
25
+ | JsonPrimitive
26
+ | { [key: string]: JsonValue }
27
+ | JsonValue[];
28
28
 
29
29
  /**
30
30
  * Extended client-side value you *may* choose to present in the UI.
@@ -37,10 +37,10 @@ export type ExtendedJsonValue = JsonValue | Date | Map<string, JsonValue>;
37
37
  * - "json" becomes ExtendedJsonValue so UIs can work with Date/Map when desired.
38
38
  */
39
39
  export type TagValueOf<K extends PrimitiveKind> =
40
- K extends "boolean" ? boolean :
41
- K extends "number" ? number :
42
- K extends "string" ? string :
43
- ExtendedJsonValue;
40
+ K extends "boolean" ? boolean :
41
+ K extends "number" ? number :
42
+ K extends "string" ? string :
43
+ ExtendedJsonValue;
44
44
 
45
45
  /**
46
46
  * Runtime binding for a single tag, as returned by hooks like `useAutoCoreTag`.
@@ -50,39 +50,147 @@ export type TagValueOf<K extends PrimitiveKind> =
50
50
  * - `tap` is typically for boolean momentaries (provider may pulse true→false)
51
51
  */
52
52
  export type TagBinding<T> = Readonly<{
53
- /** App-visible value (scaled/decoded). */
54
- value: T | undefined;
55
- /** Last raw value from the server (pre-scale, pre-codec). */
56
- rawValue: unknown | undefined;
57
- /** Write a new app-visible value (provider will inverse-scale/encode). */
58
- write: (displayValue: T) => Promise<void>;
59
- /** Momentary action; typically boolean true→false pulse. */
60
- tap: () => Promise<void>;
61
- /** True while initial read/bootstrapping is in progress. */
62
- isLoading: boolean;
53
+ /** App-visible value (scaled/decoded). */
54
+ value: T | undefined;
55
+ /** Last raw value from the server (pre-scale, pre-codec). */
56
+ rawValue: unknown | undefined;
57
+ /** Write a new app-visible value (provider will inverse-scale/encode). */
58
+ write: (displayValue: T) => Promise<void>;
59
+ /** Momentary action; typically boolean true→false pulse. */
60
+ tap: () => Promise<void>;
61
+ /** True while initial read/bootstrapping is in progress. */
62
+ isLoading: boolean;
63
63
  }>;
64
64
 
65
+ /**
66
+ * Options that control how subscription updates are delivered to the client.
67
+ *
68
+ * This implements the "hybrid" subscription model where:
69
+ * - **Project configuration** defines limits and defaults (e.g., minimum sampling rate)
70
+ * - **Client requests** can customize within those bounds
71
+ *
72
+ * ## Behavior
73
+ *
74
+ * - `undefined` values mean "use server default"
75
+ * - Client requests are clamped to server limits (can't request faster than hardware supports)
76
+ * - All filtering (deadband, on_change_only) is applied server-side before sending updates
77
+ *
78
+ * @example Basic rate limiting
79
+ * ```typescript
80
+ * {
81
+ * tagName: "fastSensor",
82
+ * domain: "MODBUS",
83
+ * symbolName: "sensor.temperature",
84
+ * valueType: "number",
85
+ * subscriptionOptions: {
86
+ * sampling_interval_ms: 500, // Limit to 2 updates/sec
87
+ * on_change_only: true // Only send when value changes
88
+ * }
89
+ * }
90
+ * ```
91
+ *
92
+ * @example Deadband filtering for noisy signals
93
+ * ```typescript
94
+ * {
95
+ * tagName: "analogInput",
96
+ * domain: "MODBUS",
97
+ * symbolName: "ai.pressure",
98
+ * valueType: "number",
99
+ * subscriptionOptions: {
100
+ * deadband_percent: 1.0 // Ignore changes < 1% of full scale
101
+ * }
102
+ * }
103
+ * ```
104
+ */
105
+ export interface SubscriptionOptions {
106
+ /**
107
+ * Minimum interval between updates in milliseconds.
108
+ *
109
+ * The server will not send updates faster than this rate, even if the
110
+ * underlying data changes more frequently. This helps prevent UI overload.
111
+ *
112
+ * - `undefined`: Use server default (typically from project configuration)
113
+ * - If client requests faster than hardware polling rate, gets clamped to hardware rate
114
+ *
115
+ * @example `{ sampling_interval_ms: 100 }` - Max 10 updates/second
116
+ */
117
+ sampling_interval_ms?: number;
118
+
119
+ /**
120
+ * Only send updates when the value changes (vs periodic heartbeat).
121
+ *
122
+ * When `true`, the server only sends updates when the value differs from
123
+ * the last sent value (after applying deadband filtering).
124
+ *
125
+ * When `false` or `undefined`, updates may be sent periodically even if unchanged.
126
+ */
127
+ on_change_only?: boolean;
128
+
129
+ /**
130
+ * Deadband as a percentage of full scale (0.0 to 100.0).
131
+ *
132
+ * Updates are suppressed unless the value changes by at least this
133
+ * percentage of the full scale range. This reduces network traffic
134
+ * for noisy signals.
135
+ *
136
+ * - `deadband_percent: 1.0` means ignore changes less than 1% of full scale
137
+ * - Takes precedence over `deadband_absolute` if both are set
138
+ *
139
+ * @example `{ deadband_percent: 2.5 }` - Ignore changes < 2.5% of range
140
+ */
141
+ deadband_percent?: number;
142
+
143
+ /**
144
+ * Deadband as an absolute value change threshold.
145
+ *
146
+ * Updates are suppressed unless the value changes by at least this
147
+ * absolute amount. Useful when you know the meaningful change threshold.
148
+ *
149
+ * - Only used if `deadband_percent` is not set
150
+ *
151
+ * @example `{ deadband_absolute: 5.0 }` - Ignore changes < 5 units
152
+ */
153
+ deadband_absolute?: number;
154
+
155
+ /**
156
+ * Queue size for buffering updates when the client is slow.
157
+ *
158
+ * If the client can't consume updates fast enough, this many updates
159
+ * are queued before older ones are discarded.
160
+ *
161
+ * - `undefined`: Use server default (typically 1 - latest value only)
162
+ * - Higher values useful for historical trending or burst handling
163
+ */
164
+ queue_size?: number;
165
+
166
+
167
+ /**
168
+ * Custom arguments specific for the specified domain.
169
+ */
170
+ args?: Record<string, unknown>;
171
+ }
172
+
65
173
  /**
66
174
  * Configuration for a named scale group.
67
175
  * Apply by setting `scale: "<name>"` on numeric tags.
68
176
  */
69
177
  export interface ScaleConfig {
70
- /** Unique name for this scale group (e.g., "position", "load") */
71
- name: string;
72
- /** Current scale factor — incoming values ×= scale; outgoing values /= scale */
73
- scale: number;
74
- /** Units/label for display (e.g., "mm", "in", "lbs") */
75
- label: string;
76
- /** Optional description for debugging/documentation */
77
- description?: string;
78
- /**
79
- * Optional server tag that provides the scale dynamically.
80
- * (If used, your provider should subscribe and update `scale` when it changes.)
81
- */
82
- serverTag?: {
83
- domain: string;
84
- symbolName: string;
85
- };
178
+ /** Unique name for this scale group (e.g., "position", "load") */
179
+ name: string;
180
+ /** Current scale factor — incoming values ×= scale; outgoing values /= scale */
181
+ scale: number;
182
+ /** Units/label for display (e.g., "mm", "in", "lbs") */
183
+ label: string;
184
+ /** Optional description for debugging/documentation */
185
+ description?: string;
186
+ /**
187
+ * Optional server tag that provides the scale dynamically.
188
+ * (If used, your provider should subscribe and update `scale` when it changes.)
189
+ */
190
+ serverTag?: {
191
+ domain: string;
192
+ symbolName: string;
193
+ };
86
194
  }
87
195
 
88
196
  /**
@@ -92,10 +200,10 @@ export interface ScaleConfig {
92
200
  * - Map-like blobs: object ⇄ Map<string, JsonValue>
93
201
  */
94
202
  export type TagCodec<TIn = unknown, TOut extends JsonValue = JsonValue> = {
95
- /** raw JSON (from server) → app-visible value */
96
- fromServer?: (raw: unknown) => TIn;
97
- /** app-visible value → pure JSON (to server) */
98
- toServer?: (value: TIn) => TOut;
203
+ /** raw JSON (from server) → app-visible value */
204
+ fromServer?: (raw: unknown) => TIn;
205
+ /** app-visible value → pure JSON (to server) */
206
+ toServer?: (value: TIn) => TOut;
99
207
  };
100
208
 
101
209
  /**
@@ -105,42 +213,66 @@ export type TagCodec<TIn = unknown, TOut extends JsonValue = JsonValue> = {
105
213
  * @typeParam T - Primitive kind for type mapping (boolean/number/string/json)
106
214
  */
107
215
  export type TagConfig<
108
- K extends string = string,
109
- T extends PrimitiveKind = PrimitiveKind
216
+ K extends string = string,
217
+ T extends PrimitiveKind = PrimitiveKind
110
218
  > = {
111
- /** Local key used by UI/consumers (unique within your spec) */
112
- tagName: K;
113
- /** Domain for the symbol (e.g., "ADS", "MEMORYSTORE") */
114
- domain: string;
115
- /** Server symbol/topic name (as used by your backend invoke API) */
116
- symbolName: string;
117
- /** Declared primitive kind for typing and DevPanel rendering */
118
- valueType: T;
119
-
120
- /** Optional initial **raw** value before first server update */
121
- initialValue?: TagValueOf<T>;
122
- /** Optional per-tag hook/config options (e.g., cycle time, debounce) */
123
- options?: Record<string, unknown>;
124
-
125
- /**
126
- * Optional scale group for numeric tags.
127
- * If present, provider will:
128
- * - Multiply incoming numbers by the group's `scale`
129
- * - Divide outgoing numbers by the group's `scale`
130
- */
131
- scale?: string;
132
-
133
- /**
134
- * Optional codec to present richer UI types while keeping JSON on the wire.
135
- * Only commonly used with `valueType: "json"`.
136
- */
137
- codec?: TagCodec;
219
+ /** Local key used by UI/consumers (unique within your spec) */
220
+ tagName: K;
221
+
222
+ /** Fully-Qualified Domain Name - the complete topic path.
223
+ * Format: "domain.path.to.symbol" (e.g., "ads.plc1.gio.bControlPowerOk", "modbus.holding_registers.5")
224
+ * The first segment is the domain, used for routing to the appropriate servelet.
225
+ */
226
+ fqdn: string;
227
+
228
+ /** Declared primitive kind for typing and DevPanel rendering */
229
+ valueType: T;
230
+
231
+ /** Optional initial **raw** value before first server update */
232
+ initialValue?: TagValueOf<T>;
233
+
234
+
235
+ /**
236
+ * Optional scale group for numeric tags.
237
+ * If present, provider will:
238
+ * - Multiply incoming numbers by the group's `scale`
239
+ * - Divide outgoing numbers by the group's `scale`
240
+ */
241
+ scale?: string;
242
+
243
+ /**
244
+ * Optional codec to present richer UI types while keeping JSON on the wire.
245
+ * Only commonly used with `valueType: "json"`.
246
+ */
247
+ codec?: TagCodec;
248
+
249
+ /**
250
+ * Optional subscription options to control how updates are delivered.
251
+ *
252
+ * These options implement the hybrid subscription model where you can
253
+ * configure rate limiting, deadband filtering, and other delivery options
254
+ * to prevent overwhelming the UI with high-frequency updates.
255
+ *
256
+ * @example Rate limit a fast-updating tag
257
+ * ```typescript
258
+ * {
259
+ * tagName: "position",
260
+ * subscriptionOptions: {
261
+ * sampling_interval_ms: 100, // Max 10 updates/sec
262
+ * on_change_only: true
263
+ * }
264
+ * }
265
+ * ```
266
+ *
267
+ * @see SubscriptionOptions for all available options
268
+ */
269
+ subscriptionOptions?: SubscriptionOptions;
138
270
  };
139
271
 
140
272
  /** Extract the tag config for a particular tag name `K` from a `Spec` */
141
273
  export type ExtractByTag<
142
- Spec extends readonly TagConfig[],
143
- K
274
+ Spec extends readonly TagConfig[],
275
+ K
144
276
  > = Extract<Spec[number], { tagName: K }>;
145
277
 
146
278
  /**
@@ -148,15 +280,15 @@ export type ExtractByTag<
148
280
  * Use with `as const` specs to preserve literal tag names.
149
281
  */
150
282
  export type TagValueMap<Spec extends readonly TagConfig[]> = {
151
- [K in Spec[number]["tagName"]]: TagValueOf<ExtractByTag<Spec, K>["valueType"]>;
283
+ [K in Spec[number]["tagName"]]: TagValueOf<ExtractByTag<Spec, K>["valueType"]>;
152
284
  };
153
285
 
154
286
  /**
155
287
  * Helper: binding type for a specific tag name from a spec.
156
288
  */
157
289
  export type BindingOf<
158
- Spec extends readonly TagConfig[],
159
- K extends Spec[number]["tagName"]
290
+ Spec extends readonly TagConfig[],
291
+ K extends Spec[number]["tagName"]
160
292
  > = TagBinding<TagValueMap<Spec>[K]>;
161
293
 
162
294
  /**
@@ -167,36 +299,36 @@ export type BindingOf<
167
299
  * - Inverse-scale/encode on write(t) before invoking backend
168
300
  */
169
301
  export interface BaseContextValue<VMap extends Record<string, any>> {
170
- /** Current app-visible tag values (already scaled/decoded). */
171
- values: Partial<VMap>;
172
-
173
- /** Last raw (controller) values, as received (pre-scale, pre-codec). */
174
- rawValues: Record<string, unknown>;
175
-
176
- /** Whether initial reads are pending. */
177
- isLoading: boolean;
178
-
179
- /**
180
- * Write a single tag value (app-visible → provider will inverse-scale/encode).
181
- * Strongly typed by tag name when used with a typed Context.
182
- */
183
- write: <K extends keyof VMap & string>(tagName: K, value: VMap[K]) => Promise<void>;
184
-
185
- /**
186
- * Trigger a momentary/toggle action for a tag.
187
- * Typically used for boolean "request" bits.
188
- */
189
- tap: <K extends keyof VMap & string>(tagName: K) => Promise<void>;
190
-
191
- /** Current scale configurations by name. */
192
- scales: Record<string, ScaleConfig>;
193
-
194
- /**
195
- * Update a scale group (factor and label). Providers should recompute affected tags from **raw**.
196
- *
197
- * @param scaleName - Name of the scale group (e.g., "position")
198
- * @param newScale - New scale factor (display = raw * newScale)
199
- * @param newLabel - New units label (e.g., "inches")
200
- */
201
- updateScale: (scaleName: string, newScale: number, newLabel: string) => Promise<void>;
302
+ /** Current app-visible tag values (already scaled/decoded). */
303
+ values: Partial<VMap>;
304
+
305
+ /** Last raw (controller) values, as received (pre-scale, pre-codec). */
306
+ rawValues: Record<string, unknown>;
307
+
308
+ /** Whether initial reads are pending. */
309
+ isLoading: boolean;
310
+
311
+ /**
312
+ * Write a single tag value (app-visible → provider will inverse-scale/encode).
313
+ * Strongly typed by tag name when used with a typed Context.
314
+ */
315
+ write: <K extends keyof VMap & string>(tagName: K, value: VMap[K]) => Promise<void>;
316
+
317
+ /**
318
+ * Trigger a momentary/toggle action for a tag.
319
+ * Typically used for boolean "request" bits.
320
+ */
321
+ tap: <K extends keyof VMap & string>(tagName: K) => Promise<void>;
322
+
323
+ /** Current scale configurations by name. */
324
+ scales: Record<string, ScaleConfig>;
325
+
326
+ /**
327
+ * Update a scale group (factor and label). Providers should recompute affected tags from **raw**.
328
+ *
329
+ * @param scaleName - Name of the scale group (e.g., "position")
330
+ * @param newScale - New scale factor (display = raw * newScale)
331
+ * @param newLabel - New units label (e.g., "inches")
332
+ */
333
+ updateScale: (scaleName: string, newScale: number, newLabel: string) => Promise<void>;
202
334
  }