@aryacode/dsh-engineering 0.0.0-stage → 0.3.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 (281) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/LICENSE +21 -0
  3. package/README.md +228 -2
  4. package/cordis.patch.yml +122 -0
  5. package/locale/en.json +6 -0
  6. package/locale/zh.json +6 -0
  7. package/package.json +77 -3
  8. package/vendor/ftview/README.md +55 -0
  9. package/vendor/ftview/SKILL.md +74 -0
  10. package/vendor/ftview/lib/checks.d.ts +27 -0
  11. package/vendor/ftview/lib/checks.js +39 -0
  12. package/vendor/ftview/lib/core.d.ts +208 -0
  13. package/vendor/ftview/lib/core.js +160 -0
  14. package/vendor/ftview/lib/edit/drafts.d.ts +49 -0
  15. package/vendor/ftview/lib/edit/drafts.js +84 -0
  16. package/vendor/ftview/lib/edit/operations.d.ts +62 -0
  17. package/vendor/ftview/lib/edit/operations.js +126 -0
  18. package/vendor/ftview/lib/edit/prepare.d.ts +38 -0
  19. package/vendor/ftview/lib/edit/prepare.js +133 -0
  20. package/vendor/ftview/lib/edit/tools.d.ts +25 -0
  21. package/vendor/ftview/lib/edit/tools.js +198 -0
  22. package/vendor/ftview/lib/edit.d.ts +30 -0
  23. package/vendor/ftview/lib/edit.js +38 -0
  24. package/vendor/ftview/lib/index.d.ts +31 -0
  25. package/vendor/ftview/lib/index.js +36 -0
  26. package/vendor/ftview/lib/model.d.ts +80 -0
  27. package/vendor/ftview/lib/model.js +267 -0
  28. package/vendor/ftview/lib/session.d.ts +48 -0
  29. package/vendor/ftview/lib/session.js +98 -0
  30. package/vendor/ftview/lib/skill.d.ts +29 -0
  31. package/vendor/ftview/lib/skill.js +43 -0
  32. package/vendor/ftview/lib/studio/discover.d.ts +36 -0
  33. package/vendor/ftview/lib/studio/discover.js +87 -0
  34. package/vendor/ftview/lib/studio/preflight.d.ts +51 -0
  35. package/vendor/ftview/lib/studio/preflight.js +64 -0
  36. package/vendor/ftview/lib/studio/tools.d.ts +15 -0
  37. package/vendor/ftview/lib/studio/tools.js +83 -0
  38. package/vendor/ftview/lib/studio.d.ts +30 -0
  39. package/vendor/ftview/lib/studio.js +37 -0
  40. package/vendor/ftview/lib/tools.d.ts +14 -0
  41. package/vendor/ftview/lib/tools.js +202 -0
  42. package/vendor/l5x/README.md +62 -0
  43. package/vendor/l5x/SKILL.md +81 -0
  44. package/vendor/l5x/lib/approvals.d.ts +50 -0
  45. package/vendor/l5x/lib/approvals.js +93 -0
  46. package/vendor/l5x/lib/client.js +412 -0
  47. package/vendor/l5x/lib/client.js.map +1 -0
  48. package/vendor/l5x/lib/core/errors.d.ts +38 -0
  49. package/vendor/l5x/lib/core/errors.js +48 -0
  50. package/vendor/l5x/lib/core/params.d.ts +49 -0
  51. package/vendor/l5x/lib/core/params.js +39 -0
  52. package/vendor/l5x/lib/core/result.d.ts +46 -0
  53. package/vendor/l5x/lib/core/result.js +21 -0
  54. package/vendor/l5x/lib/core/tool.d.ts +102 -0
  55. package/vendor/l5x/lib/core/tool.js +19 -0
  56. package/vendor/l5x/lib/drafts.d.ts +66 -0
  57. package/vendor/l5x/lib/drafts.js +98 -0
  58. package/vendor/l5x/lib/editing.d.ts +30 -0
  59. package/vendor/l5x/lib/editing.js +42 -0
  60. package/vendor/l5x/lib/engine/acd-edit.d.ts +13 -0
  61. package/vendor/l5x/lib/engine/acd-edit.js +115 -0
  62. package/vendor/l5x/lib/engine/analysis.d.ts +22 -0
  63. package/vendor/l5x/lib/engine/analysis.js +258 -0
  64. package/vendor/l5x/lib/engine/capabilities.d.ts +9 -0
  65. package/vendor/l5x/lib/engine/capabilities.js +40 -0
  66. package/vendor/l5x/lib/engine/change-set.d.ts +122 -0
  67. package/vendor/l5x/lib/engine/change-set.js +446 -0
  68. package/vendor/l5x/lib/engine/configuration.d.ts +21 -0
  69. package/vendor/l5x/lib/engine/configuration.js +42 -0
  70. package/vendor/l5x/lib/engine/details.d.ts +47 -0
  71. package/vendor/l5x/lib/engine/details.js +173 -0
  72. package/vendor/l5x/lib/engine/direct-polling.d.ts +91 -0
  73. package/vendor/l5x/lib/engine/direct-polling.js +193 -0
  74. package/vendor/l5x/lib/engine/download-review.d.ts +15 -0
  75. package/vendor/l5x/lib/engine/download-review.js +63 -0
  76. package/vendor/l5x/lib/engine/logic-syntax.d.ts +60 -0
  77. package/vendor/l5x/lib/engine/logic-syntax.js +237 -0
  78. package/vendor/l5x/lib/engine/observations.d.ts +41 -0
  79. package/vendor/l5x/lib/engine/observations.js +67 -0
  80. package/vendor/l5x/lib/engine/project-analysis.d.ts +131 -0
  81. package/vendor/l5x/lib/engine/project-analysis.js +314 -0
  82. package/vendor/l5x/lib/engine/review-evidence.d.ts +8 -0
  83. package/vendor/l5x/lib/engine/review-evidence.js +49 -0
  84. package/vendor/l5x/lib/engine/review.d.ts +18 -0
  85. package/vendor/l5x/lib/engine/review.js +123 -0
  86. package/vendor/l5x/lib/engine/studio-sdk.d.ts +101 -0
  87. package/vendor/l5x/lib/engine/studio-sdk.js +571 -0
  88. package/vendor/l5x/lib/engine/tag-resolution.d.ts +20 -0
  89. package/vendor/l5x/lib/engine/tag-resolution.js +169 -0
  90. package/vendor/l5x/lib/engine/usage.d.ts +16 -0
  91. package/vendor/l5x/lib/engine/usage.js +92 -0
  92. package/vendor/l5x/lib/engine/xml-regions.d.ts +23 -0
  93. package/vendor/l5x/lib/engine/xml-regions.js +77 -0
  94. package/vendor/l5x/lib/fs.d.ts +17 -0
  95. package/vendor/l5x/lib/fs.js +36 -0
  96. package/vendor/l5x/lib/index.d.ts +36 -0
  97. package/vendor/l5x/lib/index.js +42 -0
  98. package/vendor/l5x/lib/live.d.ts +48 -0
  99. package/vendor/l5x/lib/live.js +48 -0
  100. package/vendor/l5x/lib/model/aois.d.ts +39 -0
  101. package/vendor/l5x/lib/model/aois.js +112 -0
  102. package/vendor/l5x/lib/model/errors.d.ts +15 -0
  103. package/vendor/l5x/lib/model/errors.js +18 -0
  104. package/vendor/l5x/lib/model/index.d.ts +20 -0
  105. package/vendor/l5x/lib/model/index.js +19 -0
  106. package/vendor/l5x/lib/model/module.d.ts +37 -0
  107. package/vendor/l5x/lib/model/module.js +54 -0
  108. package/vendor/l5x/lib/model/modules.d.ts +24 -0
  109. package/vendor/l5x/lib/model/modules.js +55 -0
  110. package/vendor/l5x/lib/model/parse.d.ts +32 -0
  111. package/vendor/l5x/lib/model/parse.js +116 -0
  112. package/vendor/l5x/lib/model/project.d.ts +15 -0
  113. package/vendor/l5x/lib/model/project.js +31 -0
  114. package/vendor/l5x/lib/model/routines.d.ts +71 -0
  115. package/vendor/l5x/lib/model/routines.js +183 -0
  116. package/vendor/l5x/lib/model/tags.d.ts +51 -0
  117. package/vendor/l5x/lib/model/tags.js +119 -0
  118. package/vendor/l5x/lib/model/types.d.ts +304 -0
  119. package/vendor/l5x/lib/model/types.js +12 -0
  120. package/vendor/l5x/lib/model/udts.d.ts +34 -0
  121. package/vendor/l5x/lib/model/udts.js +81 -0
  122. package/vendor/l5x/lib/model/xml.d.ts +139 -0
  123. package/vendor/l5x/lib/model/xml.js +291 -0
  124. package/vendor/l5x/lib/model/xref.d.ts +28 -0
  125. package/vendor/l5x/lib/model/xref.js +154 -0
  126. package/vendor/l5x/lib/session.d.ts +119 -0
  127. package/vendor/l5x/lib/session.js +236 -0
  128. package/vendor/l5x/lib/skill.d.ts +30 -0
  129. package/vendor/l5x/lib/skill.js +44 -0
  130. package/vendor/l5x/lib/studio-state.d.ts +77 -0
  131. package/vendor/l5x/lib/studio-state.js +79 -0
  132. package/vendor/l5x/lib/studio.d.ts +29 -0
  133. package/vendor/l5x/lib/studio.js +40 -0
  134. package/vendor/l5x/lib/tools/checks.d.ts +19 -0
  135. package/vendor/l5x/lib/tools/checks.js +140 -0
  136. package/vendor/l5x/lib/tools/common.d.ts +41 -0
  137. package/vendor/l5x/lib/tools/common.js +84 -0
  138. package/vendor/l5x/lib/tools/controller.d.ts +21 -0
  139. package/vendor/l5x/lib/tools/controller.js +170 -0
  140. package/vendor/l5x/lib/tools/drafts.d.ts +23 -0
  141. package/vendor/l5x/lib/tools/drafts.js +270 -0
  142. package/vendor/l5x/lib/tools/live.d.ts +21 -0
  143. package/vendor/l5x/lib/tools/live.js +175 -0
  144. package/vendor/l5x/lib/tools/read.d.ts +19 -0
  145. package/vendor/l5x/lib/tools/read.js +245 -0
  146. package/vendor/l5x/lib/tools/references.d.ts +20 -0
  147. package/vendor/l5x/lib/tools/references.js +269 -0
  148. package/vendor/l5x/lib/tools/studio.d.ts +21 -0
  149. package/vendor/l5x/lib/tools/studio.js +193 -0
  150. package/vendor/l5x/poll-worker.mjs +77 -0
  151. package/vendor/l5x/studio-bridge/NuGet.Config +1 -0
  152. package/vendor/l5x/studio-bridge/Program.cs +304 -0
  153. package/vendor/l5x/studio-bridge/StudioBridge.csproj +11 -0
  154. package/vendor/mwi/README.md +60 -0
  155. package/vendor/mwi/SKILL.md +87 -0
  156. package/vendor/mwi/bridge/README.md +8 -0
  157. package/vendor/mwi/bridge/mw_bridge.ps1 +2763 -0
  158. package/vendor/mwi/bridge/sdk-interop-importer.cs +30 -0
  159. package/vendor/mwi/bridge/sdk-variable-reader.cs +22 -0
  160. package/vendor/mwi/bridge/start_bridge.cmd +21 -0
  161. package/vendor/mwi/bridge/watch_dialogs.cmd +13 -0
  162. package/vendor/mwi/bridge/watch_dialogs.ps1 +153 -0
  163. package/vendor/mwi/code/engine/motionworks_iec_mcp/__init__.py +14 -0
  164. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/__init__.cpython-312.pyc +0 -0
  165. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/block_interfaces.cpython-312.pyc +0 -0
  166. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/cfb.cpython-312.pyc +0 -0
  167. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/datatypes.cpython-312.pyc +0 -0
  168. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/declarations.cpython-312.pyc +0 -0
  169. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/errors.cpython-312.pyc +0 -0
  170. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/graphical_listing.cpython-312.pyc +0 -0
  171. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/grid.cpython-312.pyc +0 -0
  172. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/knowledge.cpython-312.pyc +0 -0
  173. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/mwt_bind.cpython-312.pyc +0 -0
  174. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/navigation.cpython-312.pyc +0 -0
  175. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/program_checks.cpython-312.pyc +0 -0
  176. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/project.cpython-312.pyc +0 -0
  177. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/staging.cpython-312.pyc +0 -0
  178. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/structure.cpython-312.pyc +0 -0
  179. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/task_bindings.cpython-312.pyc +0 -0
  180. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/tasks.cpython-312.pyc +0 -0
  181. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/tree.cpython-312.pyc +0 -0
  182. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/validation.cpython-312.pyc +0 -0
  183. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/variable_edit.cpython-312.pyc +0 -0
  184. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/variables.cpython-312.pyc +0 -0
  185. package/vendor/mwi/code/engine/motionworks_iec_mcp/__pycache__/workflow.cpython-312.pyc +0 -0
  186. package/vendor/mwi/code/engine/motionworks_iec_mcp/block_interfaces.py +275 -0
  187. package/vendor/mwi/code/engine/motionworks_iec_mcp/build.py +339 -0
  188. package/vendor/mwi/code/engine/motionworks_iec_mcp/capture.py +448 -0
  189. package/vendor/mwi/code/engine/motionworks_iec_mcp/cfb.py +765 -0
  190. package/vendor/mwi/code/engine/motionworks_iec_mcp/com.py +268 -0
  191. package/vendor/mwi/code/engine/motionworks_iec_mcp/datatypes.py +204 -0
  192. package/vendor/mwi/code/engine/motionworks_iec_mcp/declarations.py +399 -0
  193. package/vendor/mwi/code/engine/motionworks_iec_mcp/descriptions.py +30 -0
  194. package/vendor/mwi/code/engine/motionworks_iec_mcp/eip.py +292 -0
  195. package/vendor/mwi/code/engine/motionworks_iec_mcp/errors.py +36 -0
  196. package/vendor/mwi/code/engine/motionworks_iec_mcp/graphical_listing.py +208 -0
  197. package/vendor/mwi/code/engine/motionworks_iec_mcp/grid.py +227 -0
  198. package/vendor/mwi/code/engine/motionworks_iec_mcp/ide.py +317 -0
  199. package/vendor/mwi/code/engine/motionworks_iec_mcp/iec.py +317 -0
  200. package/vendor/mwi/code/engine/motionworks_iec_mcp/installed_help.py +151 -0
  201. package/vendor/mwi/code/engine/motionworks_iec_mcp/knowledge.py +218 -0
  202. package/vendor/mwi/code/engine/motionworks_iec_mcp/libraries.py +250 -0
  203. package/vendor/mwi/code/engine/motionworks_iec_mcp/manuals.py +520 -0
  204. package/vendor/mwi/code/engine/motionworks_iec_mcp/mwt_bind.py +133 -0
  205. package/vendor/mwi/code/engine/motionworks_iec_mcp/navigation.py +44 -0
  206. package/vendor/mwi/code/engine/motionworks_iec_mcp/pou_writer.py +1547 -0
  207. package/vendor/mwi/code/engine/motionworks_iec_mcp/program_checks.py +360 -0
  208. package/vendor/mwi/code/engine/motionworks_iec_mcp/project.py +704 -0
  209. package/vendor/mwi/code/engine/motionworks_iec_mcp/reference_data/catalog.json +672 -0
  210. package/vendor/mwi/code/engine/motionworks_iec_mcp/reference_data/patterns.json +86 -0
  211. package/vendor/mwi/code/engine/motionworks_iec_mcp/restore.py +208 -0
  212. package/vendor/mwi/code/engine/motionworks_iec_mcp/server.py +1913 -0
  213. package/vendor/mwi/code/engine/motionworks_iec_mcp/snapshot.py +138 -0
  214. package/vendor/mwi/code/engine/motionworks_iec_mcp/st_comments.py +25 -0
  215. package/vendor/mwi/code/engine/motionworks_iec_mcp/staging.py +179 -0
  216. package/vendor/mwi/code/engine/motionworks_iec_mcp/stlint.py +676 -0
  217. package/vendor/mwi/code/engine/motionworks_iec_mcp/structure.py +98 -0
  218. package/vendor/mwi/code/engine/motionworks_iec_mcp/task_bindings.py +68 -0
  219. package/vendor/mwi/code/engine/motionworks_iec_mcp/tasks.py +162 -0
  220. package/vendor/mwi/code/engine/motionworks_iec_mcp/transaction.py +157 -0
  221. package/vendor/mwi/code/engine/motionworks_iec_mcp/tree.py +563 -0
  222. package/vendor/mwi/code/engine/motionworks_iec_mcp/tree_writer.py +790 -0
  223. package/vendor/mwi/code/engine/motionworks_iec_mcp/uia.py +465 -0
  224. package/vendor/mwi/code/engine/motionworks_iec_mcp/validation.py +41 -0
  225. package/vendor/mwi/code/engine/motionworks_iec_mcp/variable_edit.py +183 -0
  226. package/vendor/mwi/code/engine/motionworks_iec_mcp/variables.py +472 -0
  227. package/vendor/mwi/code/engine/motionworks_iec_mcp/workflow.py +130 -0
  228. package/vendor/mwi/code/engine/motionworks_iec_mcp/writer.py +666 -0
  229. package/vendor/mwi/code/mw_code.py +1258 -0
  230. package/vendor/mwi/legacy/edit-session.js +50 -0
  231. package/vendor/mwi/legacy/fb-insertion.js +74 -0
  232. package/vendor/mwi/legacy/native-code.js +83 -0
  233. package/vendor/mwi/legacy/native-groups.js +75 -0
  234. package/vendor/mwi/legacy/native-structure.js +143 -0
  235. package/vendor/mwi/legacy/native-variables.js +77 -0
  236. package/vendor/mwi/legacy/pou-conversion.js +47 -0
  237. package/vendor/mwi/legacy/pou-package.js +66 -0
  238. package/vendor/mwi/lib/core/bridge.d.ts +71 -0
  239. package/vendor/mwi/lib/core/bridge.js +53 -0
  240. package/vendor/mwi/lib/core/code-engine.d.ts +47 -0
  241. package/vendor/mwi/lib/core/code-engine.js +109 -0
  242. package/vendor/mwi/lib/core/errors.d.ts +37 -0
  243. package/vendor/mwi/lib/core/errors.js +47 -0
  244. package/vendor/mwi/lib/core/params.d.ts +52 -0
  245. package/vendor/mwi/lib/core/params.js +46 -0
  246. package/vendor/mwi/lib/core/ps-bridge.d.ts +62 -0
  247. package/vendor/mwi/lib/core/ps-bridge.js +127 -0
  248. package/vendor/mwi/lib/core/result.d.ts +45 -0
  249. package/vendor/mwi/lib/core/result.js +20 -0
  250. package/vendor/mwi/lib/core/tool.d.ts +80 -0
  251. package/vendor/mwi/lib/core/tool.js +55 -0
  252. package/vendor/mwi/lib/edit/compare.d.ts +33 -0
  253. package/vendor/mwi/lib/edit/compare.js +70 -0
  254. package/vendor/mwi/lib/edit.d.ts +20 -0
  255. package/vendor/mwi/lib/edit.js +32 -0
  256. package/vendor/mwi/lib/index.d.ts +21 -0
  257. package/vendor/mwi/lib/index.js +33 -0
  258. package/vendor/mwi/lib/read/service.d.ts +117 -0
  259. package/vendor/mwi/lib/read/service.js +229 -0
  260. package/vendor/mwi/lib/read.d.ts +21 -0
  261. package/vendor/mwi/lib/read.js +33 -0
  262. package/vendor/mwi/lib/session/project.d.ts +34 -0
  263. package/vendor/mwi/lib/session/project.js +54 -0
  264. package/vendor/mwi/lib/session/service.d.ts +167 -0
  265. package/vendor/mwi/lib/session/service.js +566 -0
  266. package/vendor/mwi/lib/session/stage.d.ts +84 -0
  267. package/vendor/mwi/lib/session/stage.js +187 -0
  268. package/vendor/mwi/lib/session/workspace.d.ts +52 -0
  269. package/vendor/mwi/lib/session/workspace.js +90 -0
  270. package/vendor/mwi/lib/skill.d.ts +36 -0
  271. package/vendor/mwi/lib/skill.js +56 -0
  272. package/vendor/mwi/lib/tools/edit.d.ts +20 -0
  273. package/vendor/mwi/lib/tools/edit.js +286 -0
  274. package/vendor/mwi/lib/tools/read.d.ts +19 -0
  275. package/vendor/mwi/lib/tools/read.js +161 -0
  276. package/vendor/mwi/lib/tools/session.d.ts +20 -0
  277. package/vendor/mwi/lib/tools/session.js +166 -0
  278. package/vendor/mwi/lib/tools/verify.d.ts +19 -0
  279. package/vendor/mwi/lib/tools/verify.js +85 -0
  280. package/vendor/mwi/lib/verify.d.ts +17 -0
  281. package/vendor/mwi/lib/verify.js +29 -0
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Add-on-instruction reader.
3
+ *
4
+ * An AOI carries both its interface — parameters and local tags — and its
5
+ * internal logic, and both are reported together because an instruction is only
6
+ * usable when its pins and its behavior are known.
7
+ */
8
+ import { descriptionOf } from "./module.js";
9
+ import { elementChildren, firstChild, optionalAttribute } from "./xml.js";
10
+ import { routineBody } from "./routines.js";
11
+ /**
12
+ * List the add-on instructions the controller defines.
13
+ *
14
+ * @param document - The parsed project.
15
+ * @returns One entry per instruction, in written order.
16
+ */
17
+ export function listAois(document) {
18
+ return document.aois.map(aoi => ({ name: aoi.name, description: aoi.description, revision: aoi.revision }));
19
+ }
20
+ /**
21
+ * Read every add-on instruction, with its interface and internal logic.
22
+ *
23
+ * @param document - The parsed project.
24
+ * @returns One definition per instruction, in written order.
25
+ */
26
+ export function getAois(document) {
27
+ return document.aois;
28
+ }
29
+ /**
30
+ * Read one add-on instruction, with its interface and internal logic.
31
+ *
32
+ * @param document - The parsed project.
33
+ * @param name - Instruction name.
34
+ * @returns The definition, or undefined when the controller does not define
35
+ * that instruction.
36
+ */
37
+ export function getAoi(document, name) {
38
+ return document.aois.find(aoi => aoi.name === name);
39
+ }
40
+ /**
41
+ * Read every add-on instruction definition of a controller.
42
+ *
43
+ * @param controller - The controller element.
44
+ * @returns The definitions, in written order.
45
+ */
46
+ export function buildAois(controller) {
47
+ return aoiElements(controller).map(aoi => ({
48
+ name: optionalAttribute(aoi, 'Name', ''),
49
+ description: descriptionOf(aoi),
50
+ revision: optionalAttribute(aoi, 'Revision', ''),
51
+ vendor: optionalAttribute(aoi, 'Vendor', ''),
52
+ parameters: aoiParameters(aoi),
53
+ localTags: aoiLocalTags(aoi),
54
+ routines: aoiRoutines(aoi),
55
+ }));
56
+ }
57
+ /** The `<AddOnInstructionDefinition>` elements, in written order. */
58
+ function aoiElements(controller) {
59
+ const definitions = firstChild(controller, 'AddOnInstructionDefinitions');
60
+ return definitions === undefined ? [] : elementChildren(definitions, 'AddOnInstructionDefinition');
61
+ }
62
+ /** One instruction's parameters, in written order. */
63
+ function aoiParameters(aoi) {
64
+ const parameters = firstChild(aoi, 'Parameters');
65
+ if (parameters === undefined)
66
+ return [];
67
+ const results = [];
68
+ for (const parameter of elementChildren(parameters, 'Parameter')) {
69
+ const entry = {
70
+ name: optionalAttribute(parameter, 'Name', ''),
71
+ dataType: optionalAttribute(parameter, 'DataType', ''),
72
+ usage: optionalAttribute(parameter, 'Usage', ''),
73
+ };
74
+ const description = descriptionOf(parameter);
75
+ if (description !== '')
76
+ entry.description = description;
77
+ if (parameter.attrs['Required'] === 'true')
78
+ entry.required = true;
79
+ if (parameter.attrs['Visible'] === 'false')
80
+ entry.visible = false;
81
+ results.push(entry);
82
+ }
83
+ return results;
84
+ }
85
+ /** One instruction's local tags, in written order. */
86
+ function aoiLocalTags(aoi) {
87
+ const localTags = firstChild(aoi, 'LocalTags');
88
+ if (localTags === undefined)
89
+ return [];
90
+ const results = [];
91
+ for (const localTag of elementChildren(localTags, 'LocalTag')) {
92
+ const entry = {
93
+ name: optionalAttribute(localTag, 'Name', ''),
94
+ dataType: optionalAttribute(localTag, 'DataType', ''),
95
+ };
96
+ const description = descriptionOf(localTag);
97
+ if (description !== '')
98
+ entry.description = description;
99
+ results.push(entry);
100
+ }
101
+ return results;
102
+ }
103
+ /** One instruction's internal routines with their bodies decoded. */
104
+ function aoiRoutines(aoi) {
105
+ const name = optionalAttribute(aoi, 'Name', '');
106
+ return rawAoiRoutines(aoi).map(routine => routineBody(name, routine));
107
+ }
108
+ /** One instruction's `<Routine>` elements, in written order. */
109
+ function rawAoiRoutines(aoi) {
110
+ const routines = firstChild(aoi, 'Routines');
111
+ return routines === undefined ? [] : elementChildren(routines, 'Routine');
112
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The error a reader raises when the text it was given is not an L5X export.
3
+ *
4
+ * A caller distinguishes "this is not a project" from "this is a project whose
5
+ * answer is empty": the reference parser raises for the former and returns an
6
+ * empty result for the latter. The message names the offending fact — the root
7
+ * element it found, or the element it could not — so a caller can report it
8
+ * without re-reading the file.
9
+ */
10
+ export declare class L5xParseError extends Error {
11
+ /**
12
+ * @param message - What was wrong with the text, in the terms the export itself uses.
13
+ */
14
+ constructor(message: string);
15
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The error a reader raises when the text it was given is not an L5X export.
3
+ *
4
+ * A caller distinguishes "this is not a project" from "this is a project whose
5
+ * answer is empty": the reference parser raises for the former and returns an
6
+ * empty result for the latter. The message names the offending fact — the root
7
+ * element it found, or the element it could not — so a caller can report it
8
+ * without re-reading the file.
9
+ */
10
+ export class L5xParseError extends Error {
11
+ /**
12
+ * @param message - What was wrong with the text, in the terms the export itself uses.
13
+ */
14
+ constructor(message) {
15
+ super(message);
16
+ this.name = 'L5xParseError';
17
+ }
18
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The parsed-document seam: parse a Studio 5000 `.l5x` export, then read it.
3
+ *
4
+ * A consumer parses once and asks as many questions as it needs, because every
5
+ * read is pure over the parsed document and none of them touches XML again. The
6
+ * XML layer and the readers stay behind this module: a consumer names a
7
+ * document, a scope, or a pattern, never an element.
8
+ */
9
+ export { L5xParseError } from './errors.ts';
10
+ export type { L5xAoiDefinition, L5xAoiInfo, L5xAoiLocalTag, L5xAoiParameter, L5xAlarm, L5xControllerSummary, L5xDocument, L5xDiagramNode, L5xModule, L5xProgram, L5xProjectSummary, L5xRoutine, L5xRoutineBody, L5xRoutineInfo, L5xRung, L5xSymbolReference, L5xSymbolUsage, L5xTag, L5xTask, L5xUdt, L5xUdtMember, } from './types.ts';
11
+ export { controllerElementOf, loadL5x } from './parse.ts';
12
+ export { loadProject } from './project.ts';
13
+ export { getAoi, getAois, listAois } from './aois.ts';
14
+ export { getRoutine, listRoutines } from './routines.ts';
15
+ export { findTag, listTags } from './tags.ts';
16
+ export { getUdt, listUdtNames } from './udts.ts';
17
+ export { listModules } from './modules.ts';
18
+ export { searchLogic } from './xref.ts';
19
+ /** The literal a health check returns. */
20
+ export declare const PING_RESULT = "pong";
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The parsed-document seam: parse a Studio 5000 `.l5x` export, then read it.
3
+ *
4
+ * A consumer parses once and asks as many questions as it needs, because every
5
+ * read is pure over the parsed document and none of them touches XML again. The
6
+ * XML layer and the readers stay behind this module: a consumer names a
7
+ * document, a scope, or a pattern, never an element.
8
+ */
9
+ export { L5xParseError } from "./errors.js";
10
+ export { controllerElementOf, loadL5x } from "./parse.js";
11
+ export { loadProject } from "./project.js";
12
+ export { getAoi, getAois, listAois } from "./aois.js";
13
+ export { getRoutine, listRoutines } from "./routines.js";
14
+ export { findTag, listTags } from "./tags.js";
15
+ export { getUdt, listUdtNames } from "./udts.js";
16
+ export { listModules } from "./modules.js";
17
+ export { searchLogic } from "./xref.js";
18
+ /** The literal a health check returns. */
19
+ export const PING_RESULT = 'pong';
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Controller-level elements shared by the readers that scan the export.
3
+ *
4
+ * A reader asks for the controller element or for the program elements under
5
+ * it; the two navigation steps live here so the readers do not each restate
6
+ * where the export keeps programs and controller-scoped tags.
7
+ */
8
+ import { type XmlElement } from './xml.ts';
9
+ /** The root element's tag name in a Studio 5000 export. */
10
+ export declare const L5X_ROOT_TAG = "RSLogix5000Content";
11
+ /**
12
+ * The `<Controller>` element of a parsed export.
13
+ *
14
+ * @param root - The document element.
15
+ * @returns The controller element.
16
+ * @throws L5xParseError When the document has no controller.
17
+ */
18
+ export declare function controllerElement(root: XmlElement): XmlElement;
19
+ /**
20
+ * The `<Program>` elements the controller owns.
21
+ *
22
+ * @param controller - The controller element.
23
+ * @returns Program elements, in written order.
24
+ */
25
+ export declare function programElements(controller: XmlElement): readonly XmlElement[];
26
+ /**
27
+ * A tag element's description: the `Description` attribute if it is non-empty,
28
+ * otherwise the `<Description>` child element's trimmed text.
29
+ *
30
+ * The attribute wins because the reference parser reads it first, and an empty
31
+ * attribute is treated as absent so a simplified export that writes the child
32
+ * form still yields its text.
33
+ *
34
+ * @param element - The element carrying the description.
35
+ * @returns The description, or an empty string when there is none.
36
+ */
37
+ export declare function descriptionOf(element: XmlElement): string;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Controller-level elements shared by the readers that scan the export.
3
+ *
4
+ * A reader asks for the controller element or for the program elements under
5
+ * it; the two navigation steps live here so the readers do not each restate
6
+ * where the export keeps programs and controller-scoped tags.
7
+ */
8
+ import { firstChild, elementChildren, nodeText, presentAttribute } from "./xml.js";
9
+ import { L5xParseError } from "./errors.js";
10
+ /** The root element's tag name in a Studio 5000 export. */
11
+ export const L5X_ROOT_TAG = 'RSLogix5000Content';
12
+ /**
13
+ * The `<Controller>` element of a parsed export.
14
+ *
15
+ * @param root - The document element.
16
+ * @returns The controller element.
17
+ * @throws L5xParseError When the document has no controller.
18
+ */
19
+ export function controllerElement(root) {
20
+ const controller = firstChild(root, 'Controller');
21
+ if (controller === undefined)
22
+ throw new L5xParseError('No <Controller> element found');
23
+ return controller;
24
+ }
25
+ /**
26
+ * The `<Program>` elements the controller owns.
27
+ *
28
+ * @param controller - The controller element.
29
+ * @returns Program elements, in written order.
30
+ */
31
+ export function programElements(controller) {
32
+ const programs = firstChild(controller, 'Programs');
33
+ return programs === undefined ? [] : elementChildren(programs, 'Program');
34
+ }
35
+ /**
36
+ * A tag element's description: the `Description` attribute if it is non-empty,
37
+ * otherwise the `<Description>` child element's trimmed text.
38
+ *
39
+ * The attribute wins because the reference parser reads it first, and an empty
40
+ * attribute is treated as absent so a simplified export that writes the child
41
+ * form still yields its text.
42
+ *
43
+ * @param element - The element carrying the description.
44
+ * @returns The description, or an empty string when there is none.
45
+ */
46
+ export function descriptionOf(element) {
47
+ const declared = presentAttribute(element, 'Description');
48
+ if (declared !== undefined)
49
+ return declared;
50
+ const child = firstChild(element, 'Description');
51
+ if (child === undefined)
52
+ return '';
53
+ return (nodeText(child) ?? '').trim();
54
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * I/O module reader.
3
+ *
4
+ * A module's slot is its first port's `Address`: that is what the export writes
5
+ * for a chassis-mounted module, and it is the value an operator reads off the
6
+ * chassis. A module the controller does not own directly names its parent
7
+ * instead, and an empty parent means the controller itself.
8
+ */
9
+ import type { L5xDocument, L5xModule } from './types.ts';
10
+ import { type XmlElement } from './xml.ts';
11
+ /**
12
+ * List the controller's I/O modules.
13
+ *
14
+ * @param document - The parsed project.
15
+ * @returns One entry per module, in written order.
16
+ */
17
+ export declare function listModules(document: L5xDocument): readonly L5xModule[];
18
+ /**
19
+ * Read every I/O module of a controller.
20
+ *
21
+ * @param controller - The controller element.
22
+ * @returns The modules, in written order.
23
+ */
24
+ export declare function buildModules(controller: XmlElement): readonly L5xModule[];
@@ -0,0 +1,55 @@
1
+ /**
2
+ * I/O module reader.
3
+ *
4
+ * A module's slot is its first port's `Address`: that is what the export writes
5
+ * for a chassis-mounted module, and it is the value an operator reads off the
6
+ * chassis. A module the controller does not own directly names its parent
7
+ * instead, and an empty parent means the controller itself.
8
+ */
9
+ import { controllerElementOf } from "./parse.js";
10
+ import { descriptionOf } from "./module.js";
11
+ import { elementChildren, firstChild, optionalAttribute } from "./xml.js";
12
+ /**
13
+ * List the controller's I/O modules.
14
+ *
15
+ * @param document - The parsed project.
16
+ * @returns One entry per module, in written order.
17
+ */
18
+ export function listModules(document) {
19
+ return buildModules(controllerElementOf(document));
20
+ }
21
+ /**
22
+ * Read every I/O module of a controller.
23
+ *
24
+ * @param controller - The controller element.
25
+ * @returns The modules, in written order.
26
+ */
27
+ export function buildModules(controller) {
28
+ const modules = firstChild(controller, 'Modules');
29
+ if (modules === undefined)
30
+ return [];
31
+ return elementChildren(modules, 'Module').map(parseModule);
32
+ }
33
+ /**
34
+ * One module entry.
35
+ *
36
+ * @param module - The `<Module>` element.
37
+ * @returns The module entry.
38
+ */
39
+ function parseModule(module) {
40
+ const entry = {
41
+ name: optionalAttribute(module, 'Name', ''),
42
+ catalogNumber: optionalAttribute(module, 'CatalogNumber', ''),
43
+ parentModule: optionalAttribute(module, 'ParentModule', ''),
44
+ };
45
+ const description = descriptionOf(module);
46
+ if (description !== '')
47
+ entry.description = description;
48
+ const ports = firstChild(module, 'Ports');
49
+ const port = ports === undefined ? undefined : firstChild(ports, 'Port');
50
+ if (port !== undefined)
51
+ entry.slot = optionalAttribute(port, 'Address', '');
52
+ if (module.attrs['Inhibited'] === 'true')
53
+ entry.inhibited = true;
54
+ return entry;
55
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Parse — turn an `.l5x` export into the document every reader answers from.
3
+ *
4
+ * Parsing is eager and total: one pass builds the controller summary, programs,
5
+ * tasks, routines, tags, types, instructions, and modules, so a later read never
6
+ * re-walks the XML and the same text always yields the same entries. Building
7
+ * everything up front is what lets a caller parse once and ask many questions.
8
+ */
9
+ import type { L5xDocument } from './types.ts';
10
+ import { type XmlElement } from './xml.ts';
11
+ /**
12
+ * Parse a Studio 5000 L5X export.
13
+ *
14
+ * @param xml - The export's text.
15
+ * @returns The parsed document, with every reader's answer already built.
16
+ * @throws L5xParseError When the text is not well-formed XML, when its root
17
+ * element is not `<RSLogix5000Content>`, or when it has no `<Controller>`.
18
+ */
19
+ export declare function loadL5x(xml: string): L5xDocument;
20
+ /**
21
+ * The document element behind a parsed document.
22
+ *
23
+ * The document reports a controller *summary*, so a reader that walks the XML
24
+ * asks for the element here rather than re-parsing the export. A consumer needs
25
+ * this only to reach an element-level reader; every document-level read answers
26
+ * from the parsed document alone.
27
+ *
28
+ * @param document - A document from {@link loadL5x}.
29
+ * @returns That document's controller element.
30
+ * @throws L5xParseError When the document was not produced by {@link loadL5x}.
31
+ */
32
+ export declare function controllerElementOf(document: L5xDocument): XmlElement;
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Parse — turn an `.l5x` export into the document every reader answers from.
3
+ *
4
+ * Parsing is eager and total: one pass builds the controller summary, programs,
5
+ * tasks, routines, tags, types, instructions, and modules, so a later read never
6
+ * re-walks the XML and the same text always yields the same entries. Building
7
+ * everything up front is what lets a caller parse once and ask many questions.
8
+ */
9
+ import { L5xParseError } from "./errors.js";
10
+ import { controllerElement, descriptionOf, programElements, L5X_ROOT_TAG } from "./module.js";
11
+ import { documentRoot, elementChildren, firstChild, optionalAttribute, parseXml } from "./xml.js";
12
+ import { buildRoutines } from "./routines.js";
13
+ import { buildTags } from "./tags.js";
14
+ import { buildUdts } from "./udts.js";
15
+ import { buildAois } from "./aois.js";
16
+ import { buildModules } from "./modules.js";
17
+ /** Controller elements of documents already parsed, so a reader can walk them. */
18
+ const controllerElements = new WeakMap();
19
+ /**
20
+ * Parse a Studio 5000 L5X export.
21
+ *
22
+ * @param xml - The export's text.
23
+ * @returns The parsed document, with every reader's answer already built.
24
+ * @throws L5xParseError When the text is not well-formed XML, when its root
25
+ * element is not `<RSLogix5000Content>`, or when it has no `<Controller>`.
26
+ */
27
+ export function loadL5x(xml) {
28
+ const root = documentRoot(parseXml(xml));
29
+ if (root.name !== L5X_ROOT_TAG) {
30
+ throw new L5xParseError(`Not an L5X file (root element is <${root.name}>, expected <${L5X_ROOT_TAG}>)`);
31
+ }
32
+ const controller = controllerElement(root);
33
+ const document = {
34
+ controller: controllerSummary(controller),
35
+ programs: buildPrograms(controller),
36
+ tasks: buildTasks(controller),
37
+ routines: buildRoutines(controller),
38
+ tags: buildTags(controller),
39
+ udts: buildUdts(controller),
40
+ aois: buildAois(controller),
41
+ modules: buildModules(controller),
42
+ alarms: buildAlarms(controller),
43
+ };
44
+ controllerElements.set(document, controller);
45
+ return document;
46
+ }
47
+ function buildAlarms(controller) {
48
+ const results = [];
49
+ const visit = (element) => {
50
+ if (element.name === 'Alarm' || element.name === 'TagBasedAlarm') {
51
+ results.push({ name: optionalAttribute(element, 'Name', ''), kind: element.name, description: descriptionOf(element) });
52
+ }
53
+ for (const child of element.children)
54
+ if ('attrs' in child)
55
+ visit(child);
56
+ };
57
+ visit(controller);
58
+ return results;
59
+ }
60
+ /**
61
+ * The document element behind a parsed document.
62
+ *
63
+ * The document reports a controller *summary*, so a reader that walks the XML
64
+ * asks for the element here rather than re-parsing the export. A consumer needs
65
+ * this only to reach an element-level reader; every document-level read answers
66
+ * from the parsed document alone.
67
+ *
68
+ * @param document - A document from {@link loadL5x}.
69
+ * @returns That document's controller element.
70
+ * @throws L5xParseError When the document was not produced by {@link loadL5x}.
71
+ */
72
+ export function controllerElementOf(document) {
73
+ const controller = controllerElements.get(document);
74
+ if (controller === undefined)
75
+ throw new L5xParseError('Not a parsed document: no controller element');
76
+ return controller;
77
+ }
78
+ /** The controller's own metadata. */
79
+ function controllerSummary(controller) {
80
+ return {
81
+ name: optionalAttribute(controller, 'Name', ''),
82
+ processorType: optionalAttribute(controller, 'ProcessorType', ''),
83
+ description: descriptionOf(controller),
84
+ majorRev: optionalAttribute(controller, 'MajorRev', ''),
85
+ minorRev: optionalAttribute(controller, 'MinorRev', ''),
86
+ };
87
+ }
88
+ /** The controller's programs. */
89
+ function buildPrograms(controller) {
90
+ return programElements(controller).map(program => ({
91
+ name: optionalAttribute(program, 'Name', ''),
92
+ mainRoutine: optionalAttribute(program, 'MainRoutineName', ''),
93
+ description: descriptionOf(program),
94
+ }));
95
+ }
96
+ /** The controller's tasks and what each schedules. */
97
+ function buildTasks(controller) {
98
+ const tasks = firstChild(controller, 'Tasks');
99
+ if (tasks === undefined)
100
+ return [];
101
+ return elementChildren(tasks, 'Task').map(task => ({
102
+ name: optionalAttribute(task, 'Name', ''),
103
+ type: optionalAttribute(task, 'Type', ''),
104
+ rate: optionalAttribute(task, 'Rate', ''),
105
+ priority: optionalAttribute(task, 'Priority', ''),
106
+ description: descriptionOf(task),
107
+ programs: scheduledPrograms(task),
108
+ }));
109
+ }
110
+ /** The program names one task schedules. */
111
+ function scheduledPrograms(task) {
112
+ const scheduled = firstChild(task, 'ScheduledPrograms');
113
+ if (scheduled === undefined)
114
+ return [];
115
+ return elementChildren(scheduled, 'ScheduledProgram').map(program => optionalAttribute(program, 'Name', ''));
116
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The project listing — the controller summary one call returns.
3
+ *
4
+ * The summary is the entry point a caller uses before deciding what to ask
5
+ * next, so it carries the counts and the names rather than the entries: a
6
+ * project with hundreds of tags and types still answers in one small value.
7
+ */
8
+ import type { L5xDocument, L5xProjectSummary } from './types.ts';
9
+ /**
10
+ * Summarize a parsed project.
11
+ *
12
+ * @param document - The parsed document.
13
+ * @returns The listing, with counts and names rather than the entries themselves.
14
+ */
15
+ export declare function loadProject(document: L5xDocument): L5xProjectSummary;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The project listing — the controller summary one call returns.
3
+ *
4
+ * The summary is the entry point a caller uses before deciding what to ask
5
+ * next, so it carries the counts and the names rather than the entries: a
6
+ * project with hundreds of tags and types still answers in one small value.
7
+ */
8
+ /**
9
+ * Summarize a parsed project.
10
+ *
11
+ * @param document - The parsed document.
12
+ * @returns The listing, with counts and names rather than the entries themselves.
13
+ */
14
+ export function loadProject(document) {
15
+ const udts = document.udts.map(udt => udt.name);
16
+ const aois = document.aois.map(aoi => aoi.name);
17
+ return {
18
+ controller: document.controller.name,
19
+ processorType: document.controller.processorType,
20
+ description: document.controller.description,
21
+ firmware: `${document.controller.majorRev}.${document.controller.minorRev}`,
22
+ programs: document.programs,
23
+ tasks: document.tasks,
24
+ udtCount: udts.length,
25
+ udts,
26
+ aoiCount: aois.length,
27
+ aois,
28
+ moduleCount: document.modules.length,
29
+ tagCount: document.tags.length,
30
+ };
31
+ }
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Routine reader — ladder as NeutralText with rung comments, Structured Text
3
+ * as its lines.
4
+ *
5
+ * A ladder rung is returned as the compact NeutralText the export already
6
+ * stores, e.g. `XIC(Motor_Start)XIO(Motor_Fault)OTE(Motor_Run);`, which is what
7
+ * makes one rung a single readable line instead of its graphical XML. Any other
8
+ * routine language is reported by name rather than decomposed.
9
+ */
10
+ import type { L5xDocument, L5xRoutine, L5xRoutineInfo, L5xRung } from './types.ts';
11
+ import { type XmlElement } from './xml.ts';
12
+ /**
13
+ * List routines with the size of each body.
14
+ *
15
+ * The listing names the program, so a caller can pass the name back to
16
+ * {@link getRoutine}. Only the count for the routine's own language is
17
+ * reported, which is why at most one count is ever present.
18
+ *
19
+ * @param document - The parsed project.
20
+ * @param program - Program name to restrict to; empty or omitted keeps every program.
21
+ * @returns One entry per routine, in written order.
22
+ */
23
+ export declare function listRoutines(document: L5xDocument, program?: string): readonly L5xRoutineInfo[];
24
+ /**
25
+ * Read one routine's body.
26
+ *
27
+ * @param document - The parsed project.
28
+ * @param program - Program holding the routine.
29
+ * @param routineName - Routine name.
30
+ * @returns The routine, or undefined when that program has no such routine.
31
+ */
32
+ export declare function getRoutine(document: L5xDocument, program: string, routineName: string): L5xRoutine | undefined;
33
+ /**
34
+ * Read every program's routines of a controller.
35
+ *
36
+ * @param controller - The controller element.
37
+ * @returns The routines, in program then written order.
38
+ */
39
+ export declare function buildRoutines(controller: XmlElement): readonly L5xRoutine[];
40
+ /**
41
+ * Decode one routine element's body.
42
+ *
43
+ * Add-on instructions read their internal routines through this, so an AOI's
44
+ * ladder and Structured Text are decoded exactly as a program's are.
45
+ *
46
+ * @param owner - Program or add-on instruction the routine belongs to.
47
+ * @param routine - The `<Routine>` element.
48
+ * @returns The routine with its body decoded.
49
+ */
50
+ export declare function routineBody(owner: string, routine: XmlElement): L5xRoutine;
51
+ /**
52
+ * The numbered lines of a Structured Text body.
53
+ *
54
+ * An empty body has no lines: the reader joins the export's lines with `\n`, so
55
+ * a body of no lines and a body of one empty line both read as `''`, and the
56
+ * export's own line count is what a listing reports.
57
+ *
58
+ * @param code - A Structured Text body.
59
+ * @returns One entry per line, numbered from zero in body order.
60
+ */
61
+ export declare function splitLines(code: string): readonly {
62
+ readonly number: number;
63
+ readonly text: string;
64
+ }[];
65
+ /**
66
+ * One ladder routine's rungs, as NeutralText with their comments.
67
+ *
68
+ * @param routine - The `<Routine>` element of a ladder routine.
69
+ * @returns One entry per rung, in written order.
70
+ */
71
+ export declare function decodeRungs(routine: XmlElement): readonly L5xRung[];