@adcops/autocore-react 3.0.40 → 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 (296) hide show
  1. package/additional-docs/AutoCoreTagContext.md +441 -0
  2. package/additional-docs/react_performance_notes.md +94 -0
  3. package/dist/assets/BlocklyLogo.d.ts +1 -0
  4. package/dist/assets/BlocklyLogo.d.ts.map +1 -0
  5. package/dist/assets/Distance.d.ts +1 -0
  6. package/dist/assets/Distance.d.ts.map +1 -0
  7. package/dist/assets/JogLong.d.ts +1 -0
  8. package/dist/assets/JogLong.d.ts.map +1 -0
  9. package/dist/assets/JogMedium.d.ts +1 -0
  10. package/dist/assets/JogMedium.d.ts.map +1 -0
  11. package/dist/assets/JogShort.d.ts +1 -0
  12. package/dist/assets/JogShort.d.ts.map +1 -0
  13. package/dist/assets/PythonLogo.d.ts +1 -0
  14. package/dist/assets/PythonLogo.d.ts.map +1 -0
  15. package/dist/assets/Rotation3D.d.ts +1 -0
  16. package/dist/assets/Rotation3D.d.ts.map +1 -0
  17. package/dist/assets/RotationCcw.d.ts +1 -0
  18. package/dist/assets/RotationCcw.d.ts.map +1 -0
  19. package/dist/assets/RotationCcwA.d.ts +1 -0
  20. package/dist/assets/RotationCcwA.d.ts.map +1 -0
  21. package/dist/assets/RotationCcwB.d.ts +1 -0
  22. package/dist/assets/RotationCcwB.d.ts.map +1 -0
  23. package/dist/assets/RotationCcwC.d.ts +1 -0
  24. package/dist/assets/RotationCcwC.d.ts.map +1 -0
  25. package/dist/assets/RotationCw.d.ts +1 -0
  26. package/dist/assets/RotationCw.d.ts.map +1 -0
  27. package/dist/assets/RotationCwA.d.ts +1 -0
  28. package/dist/assets/RotationCwA.d.ts.map +1 -0
  29. package/dist/assets/RotationCwB.d.ts +1 -0
  30. package/dist/assets/RotationCwB.d.ts.map +1 -0
  31. package/dist/assets/RotationCwC.d.ts +1 -0
  32. package/dist/assets/RotationCwC.d.ts.map +1 -0
  33. package/dist/assets/Run.d.ts +1 -0
  34. package/dist/assets/Run.d.ts.map +1 -0
  35. package/dist/assets/Speed.d.ts +1 -0
  36. package/dist/assets/Speed.d.ts.map +1 -0
  37. package/dist/assets/SpeedFast.d.ts +1 -0
  38. package/dist/assets/SpeedFast.d.ts.map +1 -0
  39. package/dist/assets/SpeedMedium.d.ts +1 -0
  40. package/dist/assets/SpeedMedium.d.ts.map +1 -0
  41. package/dist/assets/SpeedNone.d.ts +1 -0
  42. package/dist/assets/SpeedNone.d.ts.map +1 -0
  43. package/dist/assets/SpeedSlow.d.ts +1 -0
  44. package/dist/assets/SpeedSlow.d.ts.map +1 -0
  45. package/dist/assets/Walk.d.ts +1 -0
  46. package/dist/assets/Walk.d.ts.map +1 -0
  47. package/dist/assets/index.d.ts +1 -0
  48. package/dist/assets/index.d.ts.map +1 -0
  49. package/dist/components/AutoCoreDevPanel.d.ts +144 -0
  50. package/dist/components/AutoCoreDevPanel.d.ts.map +1 -0
  51. package/dist/components/AutoCoreDevPanel.js +1 -0
  52. package/dist/components/BlocklyEditor.d.ts +1 -0
  53. package/dist/components/BlocklyEditor.d.ts.map +1 -0
  54. package/dist/components/BlocklyEditor.js +1 -1
  55. package/dist/components/CodeEditor.d.ts +2 -1
  56. package/dist/components/CodeEditor.d.ts.map +1 -0
  57. package/dist/components/CodeEditor.js +1 -1
  58. package/dist/components/FileList.d.ts +1 -0
  59. package/dist/components/FileList.d.ts.map +1 -0
  60. package/dist/components/FileList.js +1 -1
  61. package/dist/components/FileSelect.d.ts +1 -0
  62. package/dist/components/FileSelect.d.ts.map +1 -0
  63. package/dist/components/FileSelect.js +1 -1
  64. package/dist/components/FitText.d.ts +1 -0
  65. package/dist/components/FitText.d.ts.map +1 -0
  66. package/dist/components/FitText.js +1 -1
  67. package/dist/components/Indicator.d.ts +2 -1
  68. package/dist/components/Indicator.d.ts.map +1 -0
  69. package/dist/components/Indicator.js +1 -1
  70. package/dist/components/IndicatorButton.d.ts +2 -1
  71. package/dist/components/IndicatorButton.d.ts.map +1 -0
  72. package/dist/components/IndicatorButton.js +1 -1
  73. package/dist/components/IndicatorRect.d.ts +2 -1
  74. package/dist/components/IndicatorRect.d.ts.map +1 -0
  75. package/dist/components/JogPanel.d.ts +1 -0
  76. package/dist/components/JogPanel.d.ts.map +1 -0
  77. package/dist/components/Lamp.d.ts +2 -1
  78. package/dist/components/Lamp.d.ts.map +1 -0
  79. package/dist/components/Lamp.js +1 -1
  80. package/dist/components/Osk.d.ts +1 -0
  81. package/dist/components/Osk.d.ts.map +1 -0
  82. package/dist/components/Osk.js +1 -1
  83. package/dist/components/OskDialog.d.ts +1 -0
  84. package/dist/components/OskDialog.d.ts.map +1 -0
  85. package/dist/components/ProgressBarWithValue.d.ts +1 -0
  86. package/dist/components/ProgressBarWithValue.d.ts.map +1 -0
  87. package/dist/components/ProgressBarWithValue.js +1 -1
  88. package/dist/components/TextInput.d.ts +62 -103
  89. package/dist/components/TextInput.d.ts.map +1 -0
  90. package/dist/components/TextInput.js +1 -1
  91. package/dist/components/ToggleGroup.d.ts +2 -1
  92. package/dist/components/ToggleGroup.d.ts.map +1 -0
  93. package/dist/components/ToggleGroup.js +1 -1
  94. package/dist/components/ValueDisplay.d.ts +3 -2
  95. package/dist/components/ValueDisplay.d.ts.map +1 -0
  96. package/dist/components/ValueDisplay.js +1 -1
  97. package/dist/components/ValueIndicator.d.ts +2 -1
  98. package/dist/components/ValueIndicator.d.ts.map +1 -0
  99. package/dist/components/ValueIndicator.js +1 -1
  100. package/dist/components/ValueInput.d.ts +2 -1
  101. package/dist/components/ValueInput.d.ts.map +1 -0
  102. package/dist/components/ValueInput.js +1 -1
  103. package/dist/core/ActionMode.d.ts +1 -0
  104. package/dist/core/ActionMode.d.ts.map +1 -0
  105. package/dist/core/AutoCoreTagContext.d.ts +98 -0
  106. package/dist/core/AutoCoreTagContext.d.ts.map +1 -0
  107. package/dist/core/AutoCoreTagContext.js +1 -0
  108. package/dist/core/AutoCoreTagTypes.d.ts +283 -0
  109. package/dist/core/AutoCoreTagTypes.d.ts.map +1 -0
  110. package/dist/core/AutoCoreTagTypes.js +1 -0
  111. package/dist/core/CoreStreamTypes.d.ts +345 -0
  112. package/dist/core/CoreStreamTypes.d.ts.map +1 -0
  113. package/dist/core/CoreStreamTypes.js +1 -0
  114. package/dist/core/EventEmitterContext.d.ts +113 -202
  115. package/dist/core/EventEmitterContext.d.ts.map +1 -0
  116. package/dist/core/EventEmitterContext.js +1 -1
  117. package/dist/core/IndicatorButtonState.d.ts +1 -0
  118. package/dist/core/IndicatorButtonState.d.ts.map +1 -0
  119. package/dist/core/IndicatorColor.d.ts +1 -0
  120. package/dist/core/IndicatorColor.d.ts.map +1 -0
  121. package/dist/core/MaskPatterns.d.ts +1 -0
  122. package/dist/core/MaskPatterns.d.ts.map +1 -0
  123. package/dist/core/NumerableTypes.d.ts +1 -0
  124. package/dist/core/NumerableTypes.d.ts.map +1 -0
  125. package/dist/core/NumerableTypes.js +1 -1
  126. package/dist/core/PositionContext.d.ts +1 -1
  127. package/dist/core/PositionContext.d.ts.map +1 -0
  128. package/dist/core/UniqueId.d.ts +1 -0
  129. package/dist/core/UniqueId.d.ts.map +1 -0
  130. package/dist/core/ValueSimulator.d.ts +2 -1
  131. package/dist/core/ValueSimulator.d.ts.map +1 -0
  132. package/dist/core/ValueSimulator.js +1 -1
  133. package/dist/core/hoc.d.ts +1 -0
  134. package/dist/core/hoc.d.ts.map +1 -0
  135. package/dist/core/hoc.js +1 -1
  136. package/dist/hooks/adsHooks.d.ts +1 -0
  137. package/dist/hooks/adsHooks.d.ts.map +1 -0
  138. package/dist/hooks/adsHooks.js +1 -1
  139. package/dist/hooks/commandHooks.d.ts +4 -3
  140. package/dist/hooks/commandHooks.d.ts.map +1 -0
  141. package/dist/hooks/commandHooks.js +1 -1
  142. package/dist/hooks/index.d.ts +1 -0
  143. package/dist/hooks/index.d.ts.map +1 -0
  144. package/dist/hooks/useAutoCoreTag.d.ts +26 -0
  145. package/dist/hooks/useAutoCoreTag.d.ts.map +1 -0
  146. package/dist/hooks/useAutoCoreTag.js +1 -0
  147. package/dist/hooks/useScaledValue.d.ts +1 -0
  148. package/dist/hooks/useScaledValue.d.ts.map +1 -0
  149. package/dist/hooks/useScaledValue.js +1 -1
  150. package/dist/hub/CommandMessage.d.ts +19 -9
  151. package/dist/hub/CommandMessage.d.ts.map +1 -0
  152. package/dist/hub/CommandMessage.js +1 -1
  153. package/dist/hub/DebugPanel.d.ts +31 -0
  154. package/dist/hub/DebugPanel.d.ts.map +1 -0
  155. package/dist/hub/DebugPanel.js +1 -0
  156. package/dist/hub/HubBase.d.ts +85 -130
  157. package/dist/hub/HubBase.d.ts.map +1 -0
  158. package/dist/hub/HubBase.js +1 -1
  159. package/dist/hub/HubSimulate.d.ts +42 -8
  160. package/dist/hub/HubSimulate.d.ts.map +1 -0
  161. package/dist/hub/HubSimulate.js +1 -1
  162. package/dist/hub/HubTauri.d.ts +25 -60
  163. package/dist/hub/HubTauri.d.ts.map +1 -0
  164. package/dist/hub/HubTauri.js +1 -1
  165. package/dist/hub/HubWebSocket.d.ts +34 -17
  166. package/dist/hub/HubWebSocket.d.ts.map +1 -0
  167. package/dist/hub/HubWebSocket.js +1 -1
  168. package/dist/hub/debug.d.ts +23 -0
  169. package/dist/hub/debug.d.ts.map +1 -0
  170. package/dist/hub/debug.js +1 -0
  171. package/dist/hub/index.d.ts +20 -4
  172. package/dist/hub/index.d.ts.map +1 -0
  173. package/dist/hub/index.js +1 -1
  174. package/package.json +32 -27
  175. package/readme.md +193 -22
  176. package/src/components/AutoCoreDevPanel.tsx +414 -0
  177. package/src/components/CodeEditor.tsx +2 -2
  178. package/src/components/FileList.tsx +7 -6
  179. package/src/components/FileSelect.tsx +2 -1
  180. package/src/components/Indicator.tsx +2 -2
  181. package/src/components/IndicatorButton.tsx +2 -2
  182. package/src/components/IndicatorRect.tsx +2 -2
  183. package/src/components/Lamp.tsx +3 -3
  184. package/src/components/TextInput.tsx +159 -240
  185. package/src/components/ToggleGroup.tsx +3 -3
  186. package/src/components/ValueDisplay.tsx +4 -4
  187. package/src/components/ValueIndicator.tsx +2 -2
  188. package/src/components/ValueInput.tsx +2 -2
  189. package/src/core/ActionMode.ts +1 -1
  190. package/src/core/AutoCoreTagContext.tsx +615 -0
  191. package/src/core/AutoCoreTagTypes.ts +334 -0
  192. package/src/core/CoreStreamTypes.ts +512 -0
  193. package/src/core/EventEmitterContext.tsx +257 -281
  194. package/src/core/IndicatorButtonState.ts +1 -1
  195. package/src/core/ValueSimulator.ts +2 -2
  196. package/src/core/hoc.tsx +1 -1
  197. package/src/hooks/adsHooks.tsx +21 -22
  198. package/src/hooks/commandHooks.tsx +23 -19
  199. package/src/hooks/index.ts +1 -1
  200. package/src/hooks/useAutoCoreTag.ts +103 -0
  201. package/src/hooks/useScaledValue.tsx +1 -1
  202. package/src/hub/CommandMessage.ts +71 -19
  203. package/src/hub/DebugPanel.ts +280 -0
  204. package/src/hub/HubBase.ts +147 -223
  205. package/src/hub/HubSimulate.ts +93 -24
  206. package/src/hub/HubTauri.ts +87 -96
  207. package/src/hub/HubWebSocket.ts +133 -158
  208. package/src/hub/debug.ts +211 -0
  209. package/src/hub/index.ts +49 -39
  210. package/tsconfig.json +43 -28
  211. package/docs/classes/components_BlocklyEditor.BlocklyEditor.html +0 -124
  212. package/docs/classes/components_CodeEditor.CodeEditor.html +0 -128
  213. package/docs/classes/components_JogPanel.JogPanel.html +0 -138
  214. package/docs/classes/components_Lamp.Lamp.html +0 -105
  215. package/docs/classes/components_TextInput.TextInput.html +0 -115
  216. package/docs/classes/components_ValueIndicator.ValueIndicator.html +0 -119
  217. package/docs/classes/components_ValueInput.ValueInput.html +0 -113
  218. package/docs/classes/hub_HubWebSocket.HubWebSocket.html +0 -106
  219. package/docs/enums/components_JogPanel.JogDistanceAction.html +0 -5
  220. package/docs/enums/components_JogPanel.JogPanelAction.html +0 -18
  221. package/docs/enums/components_JogPanel.JogSpeedAction.html +0 -5
  222. package/docs/enums/core_ActionMode.ActionMode.html +0 -6
  223. package/docs/enums/core_IndicatorColor.IndicatorColor.html +0 -23
  224. package/docs/functions/assets_BlocklyLogo.default.html +0 -1
  225. package/docs/functions/assets_Distance.default.html +0 -1
  226. package/docs/functions/assets_JogLong.default.html +0 -1
  227. package/docs/functions/assets_JogMedium.default.html +0 -1
  228. package/docs/functions/assets_JogShort.default.html +0 -1
  229. package/docs/functions/assets_PythonLogo.default.html +0 -1
  230. package/docs/functions/assets_Rotation3D.default.html +0 -1
  231. package/docs/functions/assets_RotationCcw.default.html +0 -1
  232. package/docs/functions/assets_RotationCcwA.default.html +0 -1
  233. package/docs/functions/assets_RotationCcwB.default.html +0 -1
  234. package/docs/functions/assets_RotationCcwC.default.html +0 -1
  235. package/docs/functions/assets_RotationCw.default.html +0 -1
  236. package/docs/functions/assets_RotationCwA.default.html +0 -1
  237. package/docs/functions/assets_RotationCwB.default.html +0 -1
  238. package/docs/functions/assets_RotationCwC.default.html +0 -1
  239. package/docs/functions/assets_Run.default.html +0 -1
  240. package/docs/functions/assets_Speed.default.html +0 -1
  241. package/docs/functions/assets_SpeedFast.default.html +0 -1
  242. package/docs/functions/assets_SpeedMedium.default.html +0 -1
  243. package/docs/functions/assets_SpeedNone.default.html +0 -1
  244. package/docs/functions/assets_SpeedSlow.default.html +0 -1
  245. package/docs/functions/assets_Walk.default.html +0 -1
  246. package/docs/functions/components_BlocklyEditor.createCustomToolbox.html +0 -6
  247. package/docs/functions/components_FileList.FileList.html +0 -21
  248. package/docs/functions/components_FitText.FitText.html +0 -8
  249. package/docs/functions/components_ToggleGroup.ToggleGroup.html +0 -5
  250. package/docs/interfaces/components_JogPanel.JogPanelButtonDefinition.html +0 -5
  251. package/docs/interfaces/components_ToggleGroup.ToggleGroupProps.html +0 -618
  252. package/docs/interfaces/core_IndicatorButtonState.IndicatorButtonState.html +0 -10
  253. package/docs/interfaces/hub_CommandMessage.CommandMessage.html +0 -6
  254. package/docs/interfaces/hub_CommandMessage.CommandMessageResult.html +0 -4
  255. package/docs/modules/assets.html +0 -23
  256. package/docs/modules/assets_BlocklyLogo.html +0 -2
  257. package/docs/modules/assets_Distance.html +0 -2
  258. package/docs/modules/assets_JogLong.html +0 -2
  259. package/docs/modules/assets_JogMedium.html +0 -2
  260. package/docs/modules/assets_JogShort.html +0 -2
  261. package/docs/modules/assets_PythonLogo.html +0 -2
  262. package/docs/modules/assets_Rotation3D.html +0 -2
  263. package/docs/modules/assets_RotationCcw.html +0 -2
  264. package/docs/modules/assets_RotationCcwA.html +0 -2
  265. package/docs/modules/assets_RotationCcwB.html +0 -2
  266. package/docs/modules/assets_RotationCcwC.html +0 -2
  267. package/docs/modules/assets_RotationCw.html +0 -2
  268. package/docs/modules/assets_RotationCwA.html +0 -2
  269. package/docs/modules/assets_RotationCwB.html +0 -2
  270. package/docs/modules/assets_RotationCwC.html +0 -2
  271. package/docs/modules/assets_Run.html +0 -2
  272. package/docs/modules/assets_Speed.html +0 -2
  273. package/docs/modules/assets_SpeedFast.html +0 -2
  274. package/docs/modules/assets_SpeedMedium.html +0 -2
  275. package/docs/modules/assets_SpeedNone.html +0 -2
  276. package/docs/modules/assets_SpeedSlow.html +0 -2
  277. package/docs/modules/assets_Walk.html +0 -2
  278. package/docs/modules/components_BlocklyEditor.html +0 -5
  279. package/docs/modules/components_CodeEditor.html +0 -3
  280. package/docs/modules/components_FileList.html +0 -3
  281. package/docs/modules/components_FitText.html +0 -3
  282. package/docs/modules/components_JogPanel.html +0 -9
  283. package/docs/modules/components_Lamp.html +0 -4
  284. package/docs/modules/components_TextInput.html +0 -2
  285. package/docs/modules/components_ToggleGroup.html +0 -6
  286. package/docs/modules/components_ValueIndicator.html +0 -4
  287. package/docs/modules/components_ValueInput.html +0 -2
  288. package/docs/modules/core_ActionMode.html +0 -2
  289. package/docs/modules/core_IndicatorButtonState.html +0 -2
  290. package/docs/modules/core_IndicatorColor.html +0 -2
  291. package/docs/modules/hub_CommandMessage.html +0 -3
  292. package/docs/modules/hub_HubWebSocket.html +0 -2
  293. package/docs/types/components_IndicatorButton.IndicatorButtonOptionsType.html +0 -1
  294. package/docs/variables/components_BlocklyEditor.StandardToolbox.html +0 -1
  295. package/docs/variables/components_JogPanel.DefaultLinearJogButtons.html +0 -2
  296. package/docs/variables/components_JogPanel.DefaultRotationJogButtons.html +0 -2
@@ -0,0 +1,283 @@
1
+ /**
2
+ * @module core/AutoCoreTagTypes
3
+ *
4
+ * Core type system for AutoCore's tag layer:
5
+ * - Strongly-typed tag values (boolean/number/string/json)
6
+ * - Optional **scales** for numeric unit conversion (e.g., mm ⇄ in)
7
+ * - Optional **codecs** to present richer client-side types (Date/Map) while
8
+ * keeping pure JSON across the wire (serde_json::Value on the server)
9
+ */
10
+ export type PrimitiveKind = "boolean" | "number" | "string" | "json";
11
+ /** Strict JSON value (mirrors serde_json::Value) */
12
+ type JsonPrimitive = string | number | boolean | null;
13
+ export type JsonValue = JsonPrimitive | {
14
+ [key: string]: JsonValue;
15
+ } | JsonValue[];
16
+ /**
17
+ * Extended client-side value you *may* choose to present in the UI.
18
+ * Use codecs to round-trip these as pure JSON to the server.
19
+ */
20
+ export type ExtendedJsonValue = JsonValue | Date | Map<string, JsonValue>;
21
+ /**
22
+ * Map a tag's declared primitive kind to the app-visible type.
23
+ * - "json" becomes ExtendedJsonValue so UIs can work with Date/Map when desired.
24
+ */
25
+ export type TagValueOf<K extends PrimitiveKind> = K extends "boolean" ? boolean : K extends "number" ? number : K extends "string" ? string : ExtendedJsonValue;
26
+ /**
27
+ * Runtime binding for a single tag, as returned by hooks like `useAutoCoreTag`.
28
+ * - `value` is app-visible (already scaled/decoded)
29
+ * - `rawValue` is the last **unscaled, un-decoded** controller value received (server JSON)
30
+ * - `write` expects app-visible value (provider will inverse-scale/encode)
31
+ * - `tap` is typically for boolean momentaries (provider may pulse true→false)
32
+ */
33
+ export type TagBinding<T> = Readonly<{
34
+ /** App-visible value (scaled/decoded). */
35
+ value: T | undefined;
36
+ /** Last raw value from the server (pre-scale, pre-codec). */
37
+ rawValue: unknown | undefined;
38
+ /** Write a new app-visible value (provider will inverse-scale/encode). */
39
+ write: (displayValue: T) => Promise<void>;
40
+ /** Momentary action; typically boolean true→false pulse. */
41
+ tap: () => Promise<void>;
42
+ /** True while initial read/bootstrapping is in progress. */
43
+ isLoading: boolean;
44
+ }>;
45
+ /**
46
+ * Options that control how subscription updates are delivered to the client.
47
+ *
48
+ * This implements the "hybrid" subscription model where:
49
+ * - **Project configuration** defines limits and defaults (e.g., minimum sampling rate)
50
+ * - **Client requests** can customize within those bounds
51
+ *
52
+ * ## Behavior
53
+ *
54
+ * - `undefined` values mean "use server default"
55
+ * - Client requests are clamped to server limits (can't request faster than hardware supports)
56
+ * - All filtering (deadband, on_change_only) is applied server-side before sending updates
57
+ *
58
+ * @example Basic rate limiting
59
+ * ```typescript
60
+ * {
61
+ * tagName: "fastSensor",
62
+ * domain: "MODBUS",
63
+ * symbolName: "sensor.temperature",
64
+ * valueType: "number",
65
+ * subscriptionOptions: {
66
+ * sampling_interval_ms: 500, // Limit to 2 updates/sec
67
+ * on_change_only: true // Only send when value changes
68
+ * }
69
+ * }
70
+ * ```
71
+ *
72
+ * @example Deadband filtering for noisy signals
73
+ * ```typescript
74
+ * {
75
+ * tagName: "analogInput",
76
+ * domain: "MODBUS",
77
+ * symbolName: "ai.pressure",
78
+ * valueType: "number",
79
+ * subscriptionOptions: {
80
+ * deadband_percent: 1.0 // Ignore changes < 1% of full scale
81
+ * }
82
+ * }
83
+ * ```
84
+ */
85
+ export interface SubscriptionOptions {
86
+ /**
87
+ * Minimum interval between updates in milliseconds.
88
+ *
89
+ * The server will not send updates faster than this rate, even if the
90
+ * underlying data changes more frequently. This helps prevent UI overload.
91
+ *
92
+ * - `undefined`: Use server default (typically from project configuration)
93
+ * - If client requests faster than hardware polling rate, gets clamped to hardware rate
94
+ *
95
+ * @example `{ sampling_interval_ms: 100 }` - Max 10 updates/second
96
+ */
97
+ sampling_interval_ms?: number;
98
+ /**
99
+ * Only send updates when the value changes (vs periodic heartbeat).
100
+ *
101
+ * When `true`, the server only sends updates when the value differs from
102
+ * the last sent value (after applying deadband filtering).
103
+ *
104
+ * When `false` or `undefined`, updates may be sent periodically even if unchanged.
105
+ */
106
+ on_change_only?: boolean;
107
+ /**
108
+ * Deadband as a percentage of full scale (0.0 to 100.0).
109
+ *
110
+ * Updates are suppressed unless the value changes by at least this
111
+ * percentage of the full scale range. This reduces network traffic
112
+ * for noisy signals.
113
+ *
114
+ * - `deadband_percent: 1.0` means ignore changes less than 1% of full scale
115
+ * - Takes precedence over `deadband_absolute` if both are set
116
+ *
117
+ * @example `{ deadband_percent: 2.5 }` - Ignore changes < 2.5% of range
118
+ */
119
+ deadband_percent?: number;
120
+ /**
121
+ * Deadband as an absolute value change threshold.
122
+ *
123
+ * Updates are suppressed unless the value changes by at least this
124
+ * absolute amount. Useful when you know the meaningful change threshold.
125
+ *
126
+ * - Only used if `deadband_percent` is not set
127
+ *
128
+ * @example `{ deadband_absolute: 5.0 }` - Ignore changes < 5 units
129
+ */
130
+ deadband_absolute?: number;
131
+ /**
132
+ * Queue size for buffering updates when the client is slow.
133
+ *
134
+ * If the client can't consume updates fast enough, this many updates
135
+ * are queued before older ones are discarded.
136
+ *
137
+ * - `undefined`: Use server default (typically 1 - latest value only)
138
+ * - Higher values useful for historical trending or burst handling
139
+ */
140
+ queue_size?: number;
141
+ /**
142
+ * Custom arguments specific for the specified domain.
143
+ */
144
+ args?: Record<string, unknown>;
145
+ }
146
+ /**
147
+ * Configuration for a named scale group.
148
+ * Apply by setting `scale: "<name>"` on numeric tags.
149
+ */
150
+ export interface ScaleConfig {
151
+ /** Unique name for this scale group (e.g., "position", "load") */
152
+ name: string;
153
+ /** Current scale factor — incoming values ×= scale; outgoing values /= scale */
154
+ scale: number;
155
+ /** Units/label for display (e.g., "mm", "in", "lbs") */
156
+ label: string;
157
+ /** Optional description for debugging/documentation */
158
+ description?: string;
159
+ /**
160
+ * Optional server tag that provides the scale dynamically.
161
+ * (If used, your provider should subscribe and update `scale` when it changes.)
162
+ */
163
+ serverTag?: {
164
+ domain: string;
165
+ symbolName: string;
166
+ };
167
+ }
168
+ /**
169
+ * A codec lets a tag expose a richer client-side type while staying JSON on the wire.
170
+ * Common examples:
171
+ * - Date values: ISO string ⇄ Date
172
+ * - Map-like blobs: object ⇄ Map<string, JsonValue>
173
+ */
174
+ export type TagCodec<TIn = unknown, TOut extends JsonValue = JsonValue> = {
175
+ /** raw JSON (from server) → app-visible value */
176
+ fromServer?: (raw: unknown) => TIn;
177
+ /** app-visible value → pure JSON (to server) */
178
+ toServer?: (value: TIn) => TOut;
179
+ };
180
+ /**
181
+ * Tag configuration descriptor used to build a typed spec.
182
+ *
183
+ * @typeParam K - Literal tag name (use `as const` on your spec array)
184
+ * @typeParam T - Primitive kind for type mapping (boolean/number/string/json)
185
+ */
186
+ export type TagConfig<K extends string = string, T extends PrimitiveKind = PrimitiveKind> = {
187
+ /** Local key used by UI/consumers (unique within your spec) */
188
+ tagName: K;
189
+ /** Fully-Qualified Domain Name - the complete topic path.
190
+ * Format: "domain.path.to.symbol" (e.g., "ads.plc1.gio.bControlPowerOk", "modbus.holding_registers.5")
191
+ * The first segment is the domain, used for routing to the appropriate servelet.
192
+ */
193
+ fqdn: string;
194
+ /** Declared primitive kind for typing and DevPanel rendering */
195
+ valueType: T;
196
+ /** Optional initial **raw** value before first server update */
197
+ initialValue?: TagValueOf<T>;
198
+ /**
199
+ * Optional scale group for numeric tags.
200
+ * If present, provider will:
201
+ * - Multiply incoming numbers by the group's `scale`
202
+ * - Divide outgoing numbers by the group's `scale`
203
+ */
204
+ scale?: string;
205
+ /**
206
+ * Optional codec to present richer UI types while keeping JSON on the wire.
207
+ * Only commonly used with `valueType: "json"`.
208
+ */
209
+ codec?: TagCodec;
210
+ /**
211
+ * Optional subscription options to control how updates are delivered.
212
+ *
213
+ * These options implement the hybrid subscription model where you can
214
+ * configure rate limiting, deadband filtering, and other delivery options
215
+ * to prevent overwhelming the UI with high-frequency updates.
216
+ *
217
+ * @example Rate limit a fast-updating tag
218
+ * ```typescript
219
+ * {
220
+ * tagName: "position",
221
+ * subscriptionOptions: {
222
+ * sampling_interval_ms: 100, // Max 10 updates/sec
223
+ * on_change_only: true
224
+ * }
225
+ * }
226
+ * ```
227
+ *
228
+ * @see SubscriptionOptions for all available options
229
+ */
230
+ subscriptionOptions?: SubscriptionOptions;
231
+ };
232
+ /** Extract the tag config for a particular tag name `K` from a `Spec` */
233
+ export type ExtractByTag<Spec extends readonly TagConfig[], K> = Extract<Spec[number], {
234
+ tagName: K;
235
+ }>;
236
+ /**
237
+ * Build a strongly-typed map of tagName → app-visible value type.
238
+ * Use with `as const` specs to preserve literal tag names.
239
+ */
240
+ export type TagValueMap<Spec extends readonly TagConfig[]> = {
241
+ [K in Spec[number]["tagName"]]: TagValueOf<ExtractByTag<Spec, K>["valueType"]>;
242
+ };
243
+ /**
244
+ * Helper: binding type for a specific tag name from a spec.
245
+ */
246
+ export type BindingOf<Spec extends readonly TagConfig[], K extends Spec[number]["tagName"]> = TagBinding<TagValueMap<Spec>[K]>;
247
+ /**
248
+ * Enhanced context value with scale management.
249
+ * Providers should:
250
+ * - Buffer **raw** values in `rawValues` (pre-scale, pre-codec)
251
+ * - Populate `values` from `rawValues` using current scales/codecs
252
+ * - Inverse-scale/encode on write(t) before invoking backend
253
+ */
254
+ export interface BaseContextValue<VMap extends Record<string, any>> {
255
+ /** Current app-visible tag values (already scaled/decoded). */
256
+ values: Partial<VMap>;
257
+ /** Last raw (controller) values, as received (pre-scale, pre-codec). */
258
+ rawValues: Record<string, unknown>;
259
+ /** Whether initial reads are pending. */
260
+ isLoading: boolean;
261
+ /**
262
+ * Write a single tag value (app-visible → provider will inverse-scale/encode).
263
+ * Strongly typed by tag name when used with a typed Context.
264
+ */
265
+ write: <K extends keyof VMap & string>(tagName: K, value: VMap[K]) => Promise<void>;
266
+ /**
267
+ * Trigger a momentary/toggle action for a tag.
268
+ * Typically used for boolean "request" bits.
269
+ */
270
+ tap: <K extends keyof VMap & string>(tagName: K) => Promise<void>;
271
+ /** Current scale configurations by name. */
272
+ scales: Record<string, ScaleConfig>;
273
+ /**
274
+ * Update a scale group (factor and label). Providers should recompute affected tags from **raw**.
275
+ *
276
+ * @param scaleName - Name of the scale group (e.g., "position")
277
+ * @param newScale - New scale factor (display = raw * newScale)
278
+ * @param newLabel - New units label (e.g., "inches")
279
+ */
280
+ updateScale: (scaleName: string, newScale: number, newLabel: string) => Promise<void>;
281
+ }
282
+ export {};
283
+ //# sourceMappingURL=AutoCoreTagTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutoCoreTagTypes.d.ts","sourceRoot":"","sources":["../../src/core/AutoCoreTagTypes.ts"],"names":[],"mappings":"AASA;;;;;;;;GAQG;AAEH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAErE,oDAAoD;AACpD,KAAK,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AACtD,MAAM,MAAM,SAAS,GACf,aAAa,GACb;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC5B,SAAS,EAAE,CAAC;AAElB;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,IAAI,GAAG,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAE1E;;;GAGG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,aAAa,IAC1C,CAAC,SAAS,SAAS,GAAG,OAAO,GAC7B,CAAC,SAAS,QAAQ,GAAG,MAAM,GAC3B,CAAC,SAAS,QAAQ,GAAG,MAAM,GAC3B,iBAAiB,CAAC;AAEtB;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,QAAQ,CAAC;IACjC,0CAA0C;IAC1C,KAAK,EAAE,CAAC,GAAG,SAAS,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,CAAC,CAAC,CAAC,CAAC,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB,CAAC,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAC9D,+DAA+D;IAC/D,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtB,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC,yCAAyC;IACzC,SAAS,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,KAAK,EAAE,CAAC,CAAC,SAAS,MAAM,IAAI,GAAG,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpF;;;OAGG;IACH,GAAG,EAAE,CAAC,CAAC,SAAS,MAAM,IAAI,GAAG,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAElE,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAEpC;;;;;;OAMG;IACH,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACzF"}
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,345 @@
1
+ /** Message type discriminator */
2
+ export type MessageType = "sdo" | "cyclic" | "system" | "rpc";
3
+ /**
4
+ * Address can be either a symbol name (FQDN) or CANopen-style index:subindex.
5
+ * Modules accept both formats and resolve internally.
6
+ */
7
+ export type SymbolAddress = {
8
+ symbol: string;
9
+ } | {
10
+ index: number;
11
+ subindex: number;
12
+ };
13
+ /** Data types supported by the protocol */
14
+ export type DataType = "bool" | "i8" | "i16" | "i32" | "i64" | "u8" | "u16" | "u32" | "u64" | "f32" | "f64" | "string" | "bytes" | "json";
15
+ /** Access mode for symbols */
16
+ export type AccessMode = "ro" | "wo" | "rw";
17
+ /** Base structure for all CoreStream messages */
18
+ export interface CoreStreamMessage<T extends MessageType = MessageType> {
19
+ /** Message type discriminator */
20
+ type: T;
21
+ /** Command within the message type */
22
+ command: string;
23
+ /** Request ID for request/response matching (optional for push messages) */
24
+ request_id?: number;
25
+ /** Message payload (type-specific) */
26
+ payload: unknown;
27
+ }
28
+ export type SdoCommand = "upload_request" | "upload_response" | "download_request" | "download_response" | "abort";
29
+ /** SDO Upload Request - Read a value */
30
+ export interface SdoUploadRequest extends CoreStreamMessage<"sdo"> {
31
+ command: "upload_request";
32
+ request_id: number;
33
+ payload: SymbolAddress;
34
+ }
35
+ /** SDO Upload Response - Read result */
36
+ export interface SdoUploadResponse extends CoreStreamMessage<"sdo"> {
37
+ command: "upload_response";
38
+ request_id: number;
39
+ payload: {
40
+ /** The address that was read (echoed back) */
41
+ address: SymbolAddress;
42
+ /** The value read */
43
+ value: unknown;
44
+ /** Data type of the value */
45
+ datatype: DataType;
46
+ };
47
+ }
48
+ /** SDO Download Request - Write a value */
49
+ export interface SdoDownloadRequest extends CoreStreamMessage<"sdo"> {
50
+ command: "download_request";
51
+ request_id: number;
52
+ payload: SymbolAddress & {
53
+ /** The value to write */
54
+ value: unknown;
55
+ /** Optional: data type hint */
56
+ datatype?: DataType;
57
+ };
58
+ }
59
+ /** SDO Download Response - Write acknowledgment */
60
+ export interface SdoDownloadResponse extends CoreStreamMessage<"sdo"> {
61
+ command: "download_response";
62
+ request_id: number;
63
+ payload: {
64
+ /** The address that was written (echoed back) */
65
+ address: SymbolAddress;
66
+ /** Whether the write succeeded */
67
+ success: boolean;
68
+ };
69
+ }
70
+ /** SDO Abort - Error response */
71
+ export interface SdoAbort extends CoreStreamMessage<"sdo"> {
72
+ command: "abort";
73
+ request_id: number;
74
+ payload: {
75
+ /** The address that caused the error */
76
+ address: SymbolAddress;
77
+ /** CANopen-style abort code */
78
+ abort_code: number;
79
+ /** Human-readable error message */
80
+ message: string;
81
+ };
82
+ }
83
+ /** Standard SDO abort codes (CANopen-compatible) */
84
+ export declare const SdoAbortCode: {
85
+ readonly TOGGLE_BIT_NOT_ALTERED: 84082688;
86
+ readonly SDO_PROTOCOL_TIMEOUT: 84148224;
87
+ readonly INVALID_COMMAND: 84148225;
88
+ readonly OUT_OF_MEMORY: 84148229;
89
+ readonly UNSUPPORTED_ACCESS: 100728832;
90
+ readonly WRITE_ONLY: 100728833;
91
+ readonly READ_ONLY: 100728834;
92
+ readonly OBJECT_NOT_EXIST: 100794368;
93
+ readonly SUBINDEX_NOT_EXIST: 101253137;
94
+ readonly GENERAL_ERROR: 134217728;
95
+ readonly DATA_TRANSFER_ERROR: 134217760;
96
+ readonly DATA_LENGTH_MISMATCH: 134217762;
97
+ };
98
+ export type SdoMessage = SdoUploadRequest | SdoUploadResponse | SdoDownloadRequest | SdoDownloadResponse | SdoAbort;
99
+ export type CyclicCommand = "subscribe" | "subscribe_ack" | "unsubscribe" | "unsubscribe_ack" | "data_update" | "data_update_batch";
100
+ /** Subscription options for cyclic updates */
101
+ export interface SubscriptionOptions {
102
+ /** Minimum interval between updates in milliseconds */
103
+ sampling_interval_ms?: number;
104
+ /** Only send updates when value changes */
105
+ on_change_only?: boolean;
106
+ /** Deadband as percentage of full scale (0-100) */
107
+ deadband_percent?: number;
108
+ /** Deadband as absolute value */
109
+ deadband_absolute?: number;
110
+ /** Queue size for buffering (default: 1 = latest only) */
111
+ queue_size?: number;
112
+ }
113
+ /** Subscribe to cyclic updates for a symbol */
114
+ export interface CyclicSubscribe extends CoreStreamMessage<"cyclic"> {
115
+ command: "subscribe";
116
+ request_id: number;
117
+ payload: SymbolAddress & {
118
+ /** Optional subscription options */
119
+ options?: SubscriptionOptions;
120
+ };
121
+ }
122
+ /** Subscribe acknowledgment */
123
+ export interface CyclicSubscribeAck extends CoreStreamMessage<"cyclic"> {
124
+ command: "subscribe_ack";
125
+ request_id: number;
126
+ payload: {
127
+ /** The address subscribed to */
128
+ address: SymbolAddress;
129
+ /** Whether subscription succeeded */
130
+ success: boolean;
131
+ /** Error message if failed */
132
+ error?: string;
133
+ /** Effective options after server clamping */
134
+ effective_options?: SubscriptionOptions;
135
+ };
136
+ }
137
+ /** Unsubscribe from cyclic updates */
138
+ export interface CyclicUnsubscribe extends CoreStreamMessage<"cyclic"> {
139
+ command: "unsubscribe";
140
+ request_id: number;
141
+ payload: SymbolAddress;
142
+ }
143
+ /** Unsubscribe acknowledgment */
144
+ export interface CyclicUnsubscribeAck extends CoreStreamMessage<"cyclic"> {
145
+ command: "unsubscribe_ack";
146
+ request_id: number;
147
+ payload: {
148
+ address: SymbolAddress;
149
+ success: boolean;
150
+ };
151
+ }
152
+ /** Single value update (pushed from server) */
153
+ export interface CyclicDataUpdate extends CoreStreamMessage<"cyclic"> {
154
+ command: "data_update";
155
+ payload: {
156
+ /** The symbol that changed */
157
+ symbol: string;
158
+ /** The new value */
159
+ value: unknown;
160
+ /** Server timestamp (nanoseconds since epoch, optional) */
161
+ timestamp_ns?: number;
162
+ /** Data type */
163
+ datatype?: DataType;
164
+ };
165
+ }
166
+ /** Batch value update (multiple values in one message) */
167
+ export interface CyclicDataUpdateBatch extends CoreStreamMessage<"cyclic"> {
168
+ command: "data_update_batch";
169
+ payload: {
170
+ /** Array of updates */
171
+ updates: Array<{
172
+ symbol: string;
173
+ value: unknown;
174
+ timestamp_ns?: number;
175
+ datatype?: DataType;
176
+ }>;
177
+ };
178
+ }
179
+ export type CyclicMessage = CyclicSubscribe | CyclicSubscribeAck | CyclicUnsubscribe | CyclicUnsubscribeAck | CyclicDataUpdate | CyclicDataUpdateBatch;
180
+ export type SystemCommand = "announce" | "announce_ack" | "discovery" | "discovery_response" | "leaving" | "start" | "stop" | "health_request" | "health_response";
181
+ /** Symbol descriptor in module announcement */
182
+ export interface SymbolDescriptor {
183
+ /** Human-readable symbol name (FQDN within module) */
184
+ name: string;
185
+ /** CANopen-style index */
186
+ index: number;
187
+ /** CANopen-style subindex */
188
+ subindex: number;
189
+ /** Data type */
190
+ datatype: DataType;
191
+ /** Access mode */
192
+ access: AccessMode;
193
+ /** Optional description */
194
+ description?: string;
195
+ /** Optional unit (e.g., "mm", "Hz") */
196
+ unit?: string;
197
+ /** Optional min value (for validation) */
198
+ min?: number;
199
+ /** Optional max value (for validation) */
200
+ max?: number;
201
+ }
202
+ /** Module capabilities */
203
+ export interface ModuleCapabilities {
204
+ /** Supports SDO read */
205
+ sdo_read: boolean;
206
+ /** Supports SDO write */
207
+ sdo_write: boolean;
208
+ /** Supports cyclic subscriptions */
209
+ cyclic: boolean;
210
+ /** Supports batch operations */
211
+ batch: boolean;
212
+ /** Maximum symbols per batch */
213
+ max_batch_size?: number;
214
+ }
215
+ /** Module announces itself and its symbol catalog */
216
+ export interface SystemAnnounce extends CoreStreamMessage<"system"> {
217
+ command: "announce";
218
+ payload: {
219
+ /** Module name (used as FQDN prefix) */
220
+ module_name: string;
221
+ /** Module version */
222
+ version?: string;
223
+ /** Module capabilities */
224
+ capabilities: ModuleCapabilities;
225
+ /** Symbol catalog */
226
+ symbols: SymbolDescriptor[];
227
+ };
228
+ }
229
+ /** Announcement acknowledgment */
230
+ export interface SystemAnnounceAck extends CoreStreamMessage<"system"> {
231
+ command: "announce_ack";
232
+ payload: {
233
+ /** Whether announcement was accepted */
234
+ success: boolean;
235
+ /** Assigned module ID (if applicable) */
236
+ module_id?: number;
237
+ /** Error message if failed */
238
+ error?: string;
239
+ };
240
+ }
241
+ /** Request list of all connected modules */
242
+ export interface SystemDiscovery extends CoreStreamMessage<"system"> {
243
+ command: "discovery";
244
+ request_id: number;
245
+ payload: Record<string, never>;
246
+ }
247
+ /** Discovery response with module list */
248
+ export interface SystemDiscoveryResponse extends CoreStreamMessage<"system"> {
249
+ command: "discovery_response";
250
+ request_id: number;
251
+ payload: {
252
+ modules: Array<{
253
+ module_name: string;
254
+ version?: string;
255
+ capabilities: ModuleCapabilities;
256
+ symbol_count: number;
257
+ state: "running" | "stopped" | "error";
258
+ }>;
259
+ };
260
+ }
261
+ /** Module leaving notification */
262
+ export interface SystemLeaving extends CoreStreamMessage<"system"> {
263
+ command: "leaving";
264
+ payload: {
265
+ module_name: string;
266
+ reason?: string;
267
+ };
268
+ }
269
+ /** Health check request */
270
+ export interface SystemHealthRequest extends CoreStreamMessage<"system"> {
271
+ command: "health_request";
272
+ request_id: number;
273
+ payload: {
274
+ /** Optional: specific module to check */
275
+ module_name?: string;
276
+ };
277
+ }
278
+ /** Health check response */
279
+ export interface SystemHealthResponse extends CoreStreamMessage<"system"> {
280
+ command: "health_response";
281
+ request_id: number;
282
+ payload: {
283
+ healthy: boolean;
284
+ modules: Array<{
285
+ module_name: string;
286
+ state: "running" | "stopped" | "error";
287
+ uptime_secs?: number;
288
+ error?: string;
289
+ }>;
290
+ };
291
+ }
292
+ export type SystemMessage = SystemAnnounce | SystemAnnounceAck | SystemDiscovery | SystemDiscoveryResponse | SystemLeaving | SystemHealthRequest | SystemHealthResponse;
293
+ export type RpcCommand = "invoke" | "response";
294
+ /** RPC invoke request - call a function on a module */
295
+ export interface RpcInvoke extends CoreStreamMessage<"rpc"> {
296
+ command: "invoke";
297
+ request_id: number;
298
+ payload: {
299
+ /** Target module name */
300
+ module: string;
301
+ /** Method/function name */
302
+ method: string;
303
+ /** Arguments (JSON object) */
304
+ args?: Record<string, unknown>;
305
+ };
306
+ }
307
+ /** RPC response - function result */
308
+ export interface RpcResponse extends CoreStreamMessage<"rpc"> {
309
+ command: "response";
310
+ request_id: number;
311
+ payload: {
312
+ /** Whether the call succeeded */
313
+ success: boolean;
314
+ /** Return value (if success) */
315
+ data?: unknown;
316
+ /** Error message (if failed) */
317
+ error?: string;
318
+ /** Error code (if failed) */
319
+ error_code?: number;
320
+ };
321
+ }
322
+ export type RpcMessage = RpcInvoke | RpcResponse;
323
+ export type AnyCoreSteamMessage = SdoMessage | CyclicMessage | SystemMessage | RpcMessage;
324
+ /** Type guard for SDO messages */
325
+ export declare function isSdoMessage(msg: CoreStreamMessage): msg is SdoMessage;
326
+ /** Type guard for Cyclic messages */
327
+ export declare function isCyclicMessage(msg: CoreStreamMessage): msg is CyclicMessage;
328
+ /** Type guard for System messages */
329
+ export declare function isSystemMessage(msg: CoreStreamMessage): msg is SystemMessage;
330
+ /** Type guard for RPC messages */
331
+ export declare function isRpcMessage(msg: CoreStreamMessage): msg is RpcMessage;
332
+ /** Check if an address uses symbol format */
333
+ export declare function isSymbolAddress(addr: SymbolAddress): addr is {
334
+ symbol: string;
335
+ };
336
+ /** Check if an address uses index:subindex format */
337
+ export declare function isIndexAddress(addr: SymbolAddress): addr is {
338
+ index: number;
339
+ subindex: number;
340
+ };
341
+ /** Convert address to string for display/logging */
342
+ export declare function addressToString(addr: SymbolAddress): string;
343
+ /** Parse an address string (either "vfd.frequency" or "0x2000:01") */
344
+ export declare function parseAddress(str: string): SymbolAddress;
345
+ //# sourceMappingURL=CoreStreamTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoreStreamTypes.d.ts","sourceRoot":"","sources":["../../src/core/CoreStreamTypes.ts"],"names":[],"mappings":"AAuBA,iCAAiC;AACjC,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,aAAa,GACrB;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAExC,2CAA2C;AAC3C,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAC5B,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAC5B,KAAK,GAAG,KAAK,GACb,QAAQ,GACR,OAAO,GACP,MAAM,CAAC;AAEX,8BAA8B;AAC9B,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAA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AAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAE/F;AAED,oDAAoD;AACpD,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAM3D;AAED,sEAAsE;AACtE,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAWvD"}
@@ -0,0 +1 @@
1
+ export const SdoAbortCode={TOGGLE_BIT_NOT_ALTERED:84082688,SDO_PROTOCOL_TIMEOUT:84148224,INVALID_COMMAND:84148225,OUT_OF_MEMORY:84148229,UNSUPPORTED_ACCESS:100728832,WRITE_ONLY:100728833,READ_ONLY:100728834,OBJECT_NOT_EXIST:100794368,SUBINDEX_NOT_EXIST:101253137,GENERAL_ERROR:134217728,DATA_TRANSFER_ERROR:134217760,DATA_LENGTH_MISMATCH:134217762};export function isSdoMessage(e){return"sdo"===e.type}export function isCyclicMessage(e){return"cyclic"===e.type}export function isSystemMessage(e){return"system"===e.type}export function isRpcMessage(e){return"rpc"===e.type}export function isSymbolAddress(e){return"symbol"in e}export function isIndexAddress(e){return"index"in e&&"subindex"in e}export function addressToString(e){return isSymbolAddress(e)?e.symbol:`0x${e.index.toString(16).padStart(4,"0")}:${e.subindex.toString(16).padStart(2,"0")}`}export function parseAddress(e){const t=e.match(/^(?:0x)?([0-9a-fA-F]{1,4}):([0-9a-fA-F]{1,2})$/);return t?{index:parseInt(t[1],16),subindex:parseInt(t[2],16)}:{symbol:e}}