@hyperfixi/core 2.0.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 (381) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +218 -0
  3. package/dist/__test-utils__/context-builders.d.ts +42 -0
  4. package/dist/__test-utils__/error-testing.d.ts +18 -0
  5. package/dist/__test-utils__/index.d.ts +6 -0
  6. package/dist/__test-utils__/mock-types.d.ts +57 -0
  7. package/dist/__test-utils__/parser-context-mock.d.ts +7 -0
  8. package/dist/__test-utils__/parser-helpers.d.ts +38 -0
  9. package/dist/api/dom-processor.d.ts +17 -0
  10. package/dist/api/hyperscript-api.d.ts +68 -0
  11. package/dist/api/lokascript-api.d.ts +9 -0
  12. package/dist/ast-utils/analyzer.d.ts +19 -0
  13. package/dist/ast-utils/documentation.d.ts +8 -0
  14. package/dist/ast-utils/generator.d.ts +9 -0
  15. package/dist/ast-utils/index.d.ts +12 -0
  16. package/dist/ast-utils/index.js +3366 -0
  17. package/dist/ast-utils/index.mjs +3320 -0
  18. package/dist/ast-utils/interchange/from-core.d.ts +8 -0
  19. package/dist/ast-utils/interchange/index.d.ts +6 -0
  20. package/dist/ast-utils/interchange/lsp.d.ts +108 -0
  21. package/dist/ast-utils/interchange/to-core.d.ts +8 -0
  22. package/dist/ast-utils/interchange/types.d.ts +113 -0
  23. package/dist/ast-utils/query.d.ts +25 -0
  24. package/dist/ast-utils/transformer.d.ts +14 -0
  25. package/dist/ast-utils/types.d.ts +162 -0
  26. package/dist/ast-utils/visitor.d.ts +40 -0
  27. package/dist/behaviors/boosted.d.ts +29 -0
  28. package/dist/behaviors/history-swap.d.ts +24 -0
  29. package/dist/behaviors/index.d.ts +4 -0
  30. package/dist/behaviors/index.js +1149 -0
  31. package/dist/behaviors/index.mjs +1139 -0
  32. package/dist/bundle-generator/generator.d.ts +4 -0
  33. package/dist/bundle-generator/index.d.ts +6 -0
  34. package/dist/bundle-generator/index.js +2294 -0
  35. package/dist/bundle-generator/index.mjs +2271 -0
  36. package/dist/bundle-generator/parser-templates.d.ts +6 -0
  37. package/dist/bundle-generator/template-capabilities.d.ts +10 -0
  38. package/dist/bundle-generator/templates.d.ts +11 -0
  39. package/dist/bundle-generator/types.d.ts +34 -0
  40. package/dist/bundles/test-minimal.d.ts +3 -0
  41. package/dist/bundles/test-standard.d.ts +3 -0
  42. package/dist/chunks/bridge-I6ceoWxV.js +2 -0
  43. package/dist/chunks/browser-modular-Dv6PAV3c.js +2 -0
  44. package/dist/chunks/feature-eventsource-DWb514fy.js +2 -0
  45. package/dist/chunks/feature-sockets-3PFuvCVY.js +2 -0
  46. package/dist/chunks/feature-webworker-DTm_eh-E.js +2 -0
  47. package/dist/commands/advanced/async.d.ts +28 -0
  48. package/dist/commands/advanced/js.d.ts +28 -0
  49. package/dist/commands/animation/measure.d.ts +31 -0
  50. package/dist/commands/animation/settle.d.ts +26 -0
  51. package/dist/commands/animation/take.d.ts +28 -0
  52. package/dist/commands/animation/transition.d.ts +31 -0
  53. package/dist/commands/async/fetch.d.ts +44 -0
  54. package/dist/commands/async/wait.d.ts +41 -0
  55. package/dist/commands/behaviors/install.d.ts +41 -0
  56. package/dist/commands/content/append.d.ts +27 -0
  57. package/dist/commands/control-flow/break.d.ts +15 -0
  58. package/dist/commands/control-flow/continue.d.ts +15 -0
  59. package/dist/commands/control-flow/exit.d.ts +15 -0
  60. package/dist/commands/control-flow/halt.d.ts +25 -0
  61. package/dist/commands/control-flow/if.d.ts +45 -0
  62. package/dist/commands/control-flow/repeat.d.ts +35 -0
  63. package/dist/commands/control-flow/return.d.ts +23 -0
  64. package/dist/commands/control-flow/signal-base.d.ts +25 -0
  65. package/dist/commands/control-flow/throw.d.ts +22 -0
  66. package/dist/commands/control-flow/unless.d.ts +3 -0
  67. package/dist/commands/data/decrement.d.ts +3 -0
  68. package/dist/commands/data/default.d.ts +31 -0
  69. package/dist/commands/data/get.d.ts +23 -0
  70. package/dist/commands/data/increment.d.ts +25 -0
  71. package/dist/commands/data/set.d.ts +56 -0
  72. package/dist/commands/decorators/index.d.ts +30 -0
  73. package/dist/commands/dom/__tests__/add-standalone-helpers.d.ts +11 -0
  74. package/dist/commands/dom/add.d.ts +31 -0
  75. package/dist/commands/dom/dom-modification-base.d.ts +48 -0
  76. package/dist/commands/dom/hide.d.ts +12 -0
  77. package/dist/commands/dom/make.d.ts +21 -0
  78. package/dist/commands/dom/process-partials.d.ts +39 -0
  79. package/dist/commands/dom/put.d.ts +31 -0
  80. package/dist/commands/dom/remove.d.ts +33 -0
  81. package/dist/commands/dom/show.d.ts +13 -0
  82. package/dist/commands/dom/swap.d.ts +38 -0
  83. package/dist/commands/dom/toggle.d.ts +55 -0
  84. package/dist/commands/dom/visibility-base.d.ts +20 -0
  85. package/dist/commands/events/send.d.ts +3 -0
  86. package/dist/commands/events/trigger.d.ts +36 -0
  87. package/dist/commands/execution/call.d.ts +24 -0
  88. package/dist/commands/execution/pseudo-command.d.ts +42 -0
  89. package/dist/commands/helpers/attribute-manipulation.d.ts +11 -0
  90. package/dist/commands/helpers/batch-dom-operations.d.ts +12 -0
  91. package/dist/commands/helpers/class-manipulation.d.ts +11 -0
  92. package/dist/commands/helpers/condition-helpers.d.ts +4 -0
  93. package/dist/commands/helpers/dom-mutation.d.ts +15 -0
  94. package/dist/commands/helpers/duration-parsing.d.ts +8 -0
  95. package/dist/commands/helpers/element-property-access.d.ts +7 -0
  96. package/dist/commands/helpers/element-resolution.d.ts +17 -0
  97. package/dist/commands/helpers/error-helpers.d.ts +17 -0
  98. package/dist/commands/helpers/event-helpers.d.ts +13 -0
  99. package/dist/commands/helpers/event-waiting.d.ts +37 -0
  100. package/dist/commands/helpers/index.d.ts +32 -0
  101. package/dist/commands/helpers/input-validator.d.ts +23 -0
  102. package/dist/commands/helpers/loop-executor.d.ts +53 -0
  103. package/dist/commands/helpers/numeric-target-parser.d.ts +14 -0
  104. package/dist/commands/helpers/property-target.d.ts +30 -0
  105. package/dist/commands/helpers/selector-type-detection.d.ts +24 -0
  106. package/dist/commands/helpers/smart-element.d.ts +16 -0
  107. package/dist/commands/helpers/style-manipulation.d.ts +16 -0
  108. package/dist/commands/helpers/temporal-modifiers.d.ts +15 -0
  109. package/dist/commands/helpers/url-argument-parser.d.ts +10 -0
  110. package/dist/commands/helpers/url-validation.d.ts +7 -0
  111. package/dist/commands/helpers/variable-access.d.ts +10 -0
  112. package/dist/commands/helpers/visibility-target-parser.d.ts +11 -0
  113. package/dist/commands/index.d.ts +139 -0
  114. package/dist/commands/index.js +9186 -0
  115. package/dist/commands/index.mjs +9032 -0
  116. package/dist/commands/navigation/go.d.ts +35 -0
  117. package/dist/commands/navigation/push-url.d.ts +35 -0
  118. package/dist/commands/navigation/replace-url.d.ts +3 -0
  119. package/dist/commands/templates/render.d.ts +48 -0
  120. package/dist/commands/utility/beep.d.ts +32 -0
  121. package/dist/commands/utility/copy.d.ts +29 -0
  122. package/dist/commands/utility/log.d.ts +24 -0
  123. package/dist/commands/utility/pick.d.ts +26 -0
  124. package/dist/commands/utility/tell.d.ts +26 -0
  125. package/dist/compatibility/browser-bundle-animation-generated.d.ts +16 -0
  126. package/dist/compatibility/browser-bundle-classic-i18n.d.ts +63 -0
  127. package/dist/compatibility/browser-bundle-classic.d.ts +17 -0
  128. package/dist/compatibility/browser-bundle-forms-generated.d.ts +16 -0
  129. package/dist/compatibility/browser-bundle-hybrid-complete.d.ts +28 -0
  130. package/dist/compatibility/browser-bundle-hybrid-hx.d.ts +43 -0
  131. package/dist/compatibility/browser-bundle-lite-plus.d.ts +25 -0
  132. package/dist/compatibility/browser-bundle-lite.d.ts +23 -0
  133. package/dist/compatibility/browser-bundle-minimal-generated.d.ts +16 -0
  134. package/dist/compatibility/browser-bundle-minimal-v2.d.ts +17 -0
  135. package/dist/compatibility/browser-bundle-minimal.d.ts +8 -0
  136. package/dist/compatibility/browser-bundle-modular.d.ts +18 -0
  137. package/dist/compatibility/browser-bundle-multilingual.d.ts +19 -0
  138. package/dist/compatibility/browser-bundle-semantic-complete.d.ts +24 -0
  139. package/dist/compatibility/browser-bundle-standard-v2.d.ts +17 -0
  140. package/dist/compatibility/browser-bundle-standard.d.ts +8 -0
  141. package/dist/compatibility/browser-bundle-textshelf-minimal.d.ts +16 -0
  142. package/dist/compatibility/browser-bundle-textshelf-profile.d.ts +18 -0
  143. package/dist/compatibility/browser-bundle.d.ts +140 -0
  144. package/dist/compatibility/browser-modular.d.ts +53 -0
  145. package/dist/compatibility/browser-tests/test-utils.d.ts +21 -0
  146. package/dist/compatibility/eval-hyperscript.d.ts +15 -0
  147. package/dist/compatibility/feature-loader.d.ts +8 -0
  148. package/dist/compatibility/hyperscript-adapter.d.ts +38 -0
  149. package/dist/compatibility/hyperscript-tests/test-adapter.d.ts +13 -0
  150. package/dist/core/ast-property-utils.d.ts +2 -0
  151. package/dist/core/base-expression-evaluator.d.ts +70 -0
  152. package/dist/core/binary-expression-evaluator.d.ts +7 -0
  153. package/dist/core/call-expression-evaluator.d.ts +7 -0
  154. package/dist/core/configurable-expression-evaluator.d.ts +5 -0
  155. package/dist/core/context.d.ts +15 -0
  156. package/dist/core/dom.d.ts +15 -0
  157. package/dist/core/evaluator-types.d.ts +5 -0
  158. package/dist/core/events.d.ts +48 -0
  159. package/dist/core/executor.d.ts +34 -0
  160. package/dist/core/expression-evaluator.d.ts +6 -0
  161. package/dist/core/lazy-expression-evaluator.d.ts +22 -0
  162. package/dist/core/parser.d.ts +21 -0
  163. package/dist/core/selector-evaluator.d.ts +15 -0
  164. package/dist/core/template-literal-evaluator.d.ts +5 -0
  165. package/dist/dom/attribute-processor.d.ts +40 -0
  166. package/dist/dom/minimal-attribute-processor.d.ts +20 -0
  167. package/dist/experimental/binary-tree/accessor.d.ts +10 -0
  168. package/dist/experimental/binary-tree/ast-serializer.d.ts +26 -0
  169. package/dist/experimental/binary-tree/benchmark.d.ts +24 -0
  170. package/dist/experimental/binary-tree/buffer-context.d.ts +27 -0
  171. package/dist/experimental/binary-tree/deserializer.d.ts +17 -0
  172. package/dist/experimental/binary-tree/index.d.ts +22 -0
  173. package/dist/experimental/binary-tree/serializer.d.ts +4 -0
  174. package/dist/experimental/binary-tree/types.d.ts +54 -0
  175. package/dist/expressions/base-expression.d.ts +27 -0
  176. package/dist/expressions/bundles/common-expressions.d.ts +9 -0
  177. package/dist/expressions/bundles/core-expressions.d.ts +7 -0
  178. package/dist/expressions/bundles/full-expressions.d.ts +10 -0
  179. package/dist/expressions/bundles/index.d.ts +7 -0
  180. package/dist/expressions/comparison/index.d.ts +80 -0
  181. package/dist/expressions/comparison/utils.d.ts +2 -0
  182. package/dist/expressions/conversion/impl/bridge.d.ts +117 -0
  183. package/dist/expressions/conversion/impl/index.d.ts +59 -0
  184. package/dist/expressions/conversion/index.d.ts +23 -0
  185. package/dist/expressions/expression-tiers.d.ts +13 -0
  186. package/dist/expressions/index.d.ts +11 -0
  187. package/dist/expressions/index.js +6930 -0
  188. package/dist/expressions/index.mjs +6912 -0
  189. package/dist/expressions/logical/impl/index.d.ts +54 -0
  190. package/dist/expressions/logical/impl/pattern-matching.d.ts +58 -0
  191. package/dist/expressions/logical/index.d.ts +59 -0
  192. package/dist/expressions/mathematical/index.d.ts +69 -0
  193. package/dist/expressions/positional/impl/bridge.d.ts +95 -0
  194. package/dist/expressions/positional/impl/index.d.ts +73 -0
  195. package/dist/expressions/positional/index.d.ts +26 -0
  196. package/dist/expressions/properties/impl/index.d.ts +105 -0
  197. package/dist/expressions/properties/index.d.ts +26 -0
  198. package/dist/expressions/property/index.d.ts +55 -0
  199. package/dist/expressions/property-access-utils.d.ts +23 -0
  200. package/dist/expressions/references/impl/bridge.d.ts +54 -0
  201. package/dist/expressions/references/impl/index.d.ts +65 -0
  202. package/dist/expressions/references/index.d.ts +40 -0
  203. package/dist/expressions/shared/comparison-utils.d.ts +10 -0
  204. package/dist/expressions/shared/index.d.ts +9 -0
  205. package/dist/expressions/shared/number-utils.d.ts +7 -0
  206. package/dist/expressions/shared/validation-utils.d.ts +13 -0
  207. package/dist/expressions/special/index.d.ts +104 -0
  208. package/dist/expressions/type-helpers.d.ts +11 -0
  209. package/dist/expressions/type-registry.d.ts +57 -0
  210. package/dist/expressions/validation-helpers.d.ts +15 -0
  211. package/dist/extensions/index.d.ts +3 -0
  212. package/dist/extensions/tailwind.d.ts +22 -0
  213. package/dist/features/behaviors.d.ts +153 -0
  214. package/dist/features/def.d.ts +135 -0
  215. package/dist/features/eventsource.d.ts +140 -0
  216. package/dist/features/init.d.ts +135 -0
  217. package/dist/features/on.d.ts +131 -0
  218. package/dist/features/predefined-behaviors/dropdown-behavior.d.ts +20 -0
  219. package/dist/features/predefined-behaviors/index.d.ts +12 -0
  220. package/dist/features/predefined-behaviors/modal-behavior.d.ts +18 -0
  221. package/dist/features/predefined-behaviors/toggle-group-behavior.d.ts +23 -0
  222. package/dist/features/predefined-behaviors/types.d.ts +14 -0
  223. package/dist/features/sockets.d.ts +162 -0
  224. package/dist/features/webworker.d.ts +135 -0
  225. package/dist/htmx/htmx-attribute-processor.d.ts +84 -0
  226. package/dist/htmx/htmx-translator.d.ts +19 -0
  227. package/dist/htmx/index.d.ts +3 -0
  228. package/dist/hyperfixi-classic-i18n.js +2 -0
  229. package/dist/hyperfixi-hx.js +1 -0
  230. package/dist/hyperfixi-hybrid-complete.js +1 -0
  231. package/dist/hyperfixi-lite-plus.js +1 -0
  232. package/dist/hyperfixi-lite.js +1 -0
  233. package/dist/hyperfixi-minimal.js +1 -0
  234. package/dist/hyperfixi-multilingual.js +2 -0
  235. package/dist/hyperfixi-standard.js +2 -0
  236. package/dist/hyperfixi.js +2 -0
  237. package/dist/hyperfixi.mjs +2 -0
  238. package/dist/index.d.ts +25 -0
  239. package/dist/index.js +65387 -0
  240. package/dist/index.min.js +2 -0
  241. package/dist/index.mjs +65343 -0
  242. package/dist/lib/index.d.ts +4 -0
  243. package/dist/lib/morph-adapter.d.ts +22 -0
  244. package/dist/lib/swap-executor.d.ts +22 -0
  245. package/dist/lib/view-transitions.d.ts +33 -0
  246. package/dist/lokascript-browser-classic-i18n.js +2 -0
  247. package/dist/lokascript-browser-minimal.js +1 -0
  248. package/dist/lokascript-browser-standard.js +2 -0
  249. package/dist/lokascript-browser.js +2 -0
  250. package/dist/lokascript-hybrid-complete.js +1 -0
  251. package/dist/lokascript-hybrid-hx.js +1 -0
  252. package/dist/lokascript-lite-plus.js +1 -0
  253. package/dist/lokascript-lite.js +1 -0
  254. package/dist/lokascript-multilingual.js +2 -0
  255. package/dist/lsp-metadata.d.ts +25 -0
  256. package/dist/lsp-metadata.js +680 -0
  257. package/dist/lsp-metadata.mjs +670 -0
  258. package/dist/metadata.d.ts +213 -0
  259. package/dist/metadata.js +378 -0
  260. package/dist/metadata.mjs +368 -0
  261. package/dist/mod.d.ts +63 -0
  262. package/dist/multilingual/bridge.d.ts +36 -0
  263. package/dist/multilingual/index.d.ts +32 -0
  264. package/dist/multilingual/index.js +285 -0
  265. package/dist/multilingual/index.mjs +278 -0
  266. package/dist/parser/__types__/test-helpers.d.ts +25 -0
  267. package/dist/parser/command-node-builder.d.ts +45 -0
  268. package/dist/parser/command-parsers/animation-commands.d.ts +5 -0
  269. package/dist/parser/command-parsers/async-commands.d.ts +5 -0
  270. package/dist/parser/command-parsers/control-flow-commands.d.ts +7 -0
  271. package/dist/parser/command-parsers/dom-commands.d.ts +8 -0
  272. package/dist/parser/command-parsers/event-commands.d.ts +4 -0
  273. package/dist/parser/command-parsers/utility-commands.d.ts +9 -0
  274. package/dist/parser/command-parsers/variable-commands.d.ts +12 -0
  275. package/dist/parser/error-handler.d.ts +34 -0
  276. package/dist/parser/expression-parser.d.ts +6 -0
  277. package/dist/parser/full-parser.d.ts +4 -0
  278. package/dist/parser/full-parser.js +6532 -0
  279. package/dist/parser/full-parser.mjs +6529 -0
  280. package/dist/parser/helpers/ast-helpers.d.ts +22 -0
  281. package/dist/parser/helpers/parsing-helpers.d.ts +19 -0
  282. package/dist/parser/helpers/token-helpers.d.ts +28 -0
  283. package/dist/parser/hybrid/aliases.d.ts +7 -0
  284. package/dist/parser/hybrid/aliases.js +44 -0
  285. package/dist/parser/hybrid/aliases.mjs +37 -0
  286. package/dist/parser/hybrid/ast-types.d.ts +97 -0
  287. package/dist/parser/hybrid/ast-types.js +3 -0
  288. package/dist/parser/hybrid/ast-types.mjs +2 -0
  289. package/dist/parser/hybrid/index.d.ts +6 -0
  290. package/dist/parser/hybrid/index.js +1015 -0
  291. package/dist/parser/hybrid/index.mjs +1005 -0
  292. package/dist/parser/hybrid/parser-core.d.ts +57 -0
  293. package/dist/parser/hybrid/parser-core.js +1001 -0
  294. package/dist/parser/hybrid/parser-core.mjs +999 -0
  295. package/dist/parser/hybrid/tokenizer.d.ts +9 -0
  296. package/dist/parser/hybrid/tokenizer.js +242 -0
  297. package/dist/parser/hybrid/tokenizer.mjs +239 -0
  298. package/dist/parser/hybrid-parser.d.ts +10 -0
  299. package/dist/parser/hybrid-parser.js +1078 -0
  300. package/dist/parser/hybrid-parser.mjs +1071 -0
  301. package/dist/parser/parser-constants.d.ts +102 -0
  302. package/dist/parser/parser-interface.d.ts +11 -0
  303. package/dist/parser/parser-types.d.ts +175 -0
  304. package/dist/parser/parser.d.ts +146 -0
  305. package/dist/parser/regex-parser.d.ts +4 -0
  306. package/dist/parser/regex-parser.js +412 -0
  307. package/dist/parser/regex-parser.mjs +409 -0
  308. package/dist/parser/runtime.d.ts +3 -0
  309. package/dist/parser/semantic-integration.d.ts +61 -0
  310. package/dist/parser/token-consumer.d.ts +35 -0
  311. package/dist/parser/token-predicates.d.ts +77 -0
  312. package/dist/parser/tokenizer.d.ts +57 -0
  313. package/dist/parser/types.d.ts +118 -0
  314. package/dist/performance/expression-cache.d.ts +78 -0
  315. package/dist/performance/integration.d.ts +40 -0
  316. package/dist/performance/production-monitor.d.ts +67 -0
  317. package/dist/reference/index.d.ts +41 -0
  318. package/dist/reference/index.js +586 -0
  319. package/dist/reference/index.mjs +577 -0
  320. package/dist/registry/browser-types.d.ts +20 -0
  321. package/dist/registry/browser-types.js +81 -0
  322. package/dist/registry/browser-types.mjs +76 -0
  323. package/dist/registry/context-provider-registry.d.ts +38 -0
  324. package/dist/registry/environment.d.ts +19 -0
  325. package/dist/registry/environment.js +36 -0
  326. package/dist/registry/environment.mjs +30 -0
  327. package/dist/registry/event-source-registry.d.ts +54 -0
  328. package/dist/registry/examples/server-commands.d.ts +6 -0
  329. package/dist/registry/examples/server-event-source.d.ts +32 -0
  330. package/dist/registry/index.d.ts +54 -0
  331. package/dist/registry/index.js +7636 -0
  332. package/dist/registry/index.mjs +7612 -0
  333. package/dist/registry/multilingual/examples.d.ts +16 -0
  334. package/dist/registry/multilingual/index.d.ts +68 -0
  335. package/dist/registry/runtime-integration.d.ts +30 -0
  336. package/dist/registry/universal-types.d.ts +34 -0
  337. package/dist/registry/universal-types.js +91 -0
  338. package/dist/registry/universal-types.mjs +86 -0
  339. package/dist/runtime/cleanup-registry.d.ts +47 -0
  340. package/dist/runtime/command-adapter.d.ts +63 -0
  341. package/dist/runtime/environment.d.ts +75 -0
  342. package/dist/runtime/runtime-base.d.ts +78 -0
  343. package/dist/runtime/runtime-experimental.d.ts +18 -0
  344. package/dist/runtime/runtime-factory.d.ts +30 -0
  345. package/dist/runtime/runtime.d.ts +19 -0
  346. package/dist/runtime/temporal-modifiers.d.ts +37 -0
  347. package/dist/scripts/code-generator.d.ts +64 -0
  348. package/dist/scripts/generate-missing-commands.d.ts +4 -0
  349. package/dist/test-setup.d.ts +45 -0
  350. package/dist/test-utilities.d.ts +52 -0
  351. package/dist/tokenizer.d.ts +49 -0
  352. package/dist/types/base-types.d.ts +336 -0
  353. package/dist/types/code-fix.d.ts +39 -0
  354. package/dist/types/command-metadata.d.ts +57 -0
  355. package/dist/types/command-types.d.ts +272 -0
  356. package/dist/types/context-types.d.ts +106 -0
  357. package/dist/types/core-context.d.ts +21 -0
  358. package/dist/types/core.d.ts +203 -0
  359. package/dist/types/error-codes.d.ts +207 -0
  360. package/dist/types/expression-types.d.ts +155 -0
  361. package/dist/types/feature-types.d.ts +81 -0
  362. package/dist/types/hooks.d.ts +45 -0
  363. package/dist/types/index.d.ts +32 -0
  364. package/dist/types/result.d.ts +72 -0
  365. package/dist/types/template-types.d.ts +162 -0
  366. package/dist/types/type-guards.d.ts +24 -0
  367. package/dist/types/unified-types.d.ts +99 -0
  368. package/dist/utils/debug-events.d.ts +41 -0
  369. package/dist/utils/debug.d.ts +35 -0
  370. package/dist/utils/dom-utils.d.ts +16 -0
  371. package/dist/utils/element-check.d.ts +7 -0
  372. package/dist/utils/keyboard-shortcuts.d.ts +18 -0
  373. package/dist/utils/performance.d.ts +40 -0
  374. package/dist/validation/command-pattern-validator.d.ts +53 -0
  375. package/dist/validation/common-validators.d.ts +24 -0
  376. package/dist/validation/lightweight-validators.d.ts +113 -0
  377. package/dist/validation/partial-validation-types.d.ts +50 -0
  378. package/dist/validation/partial-validator.d.ts +6 -0
  379. package/dist/validation/partial-warning-formatter.d.ts +6 -0
  380. package/dist/validation/validate-cli.d.ts +41 -0
  381. package/package.json +292 -0
@@ -0,0 +1,16 @@
1
+ import { type MultilingualCommand } from './index';
2
+ export declare const queryCommand: MultilingualCommand;
3
+ export declare const sendEmailCommand: MultilingualCommand;
4
+ export declare const logCommand: MultilingualCommand;
5
+ export declare const cacheCommand: MultilingualCommand;
6
+ export declare const completeServerPlugin: import("../index").LokaScriptPlugin;
7
+ export declare const usageExamples: {
8
+ english: string;
9
+ japanese: string;
10
+ spanish: string;
11
+ arabic: string;
12
+ korean: string;
13
+ chinese: string;
14
+ };
15
+ export declare const expressIntegration = "\nimport express from 'express';\nimport { getDefaultRegistry } from '@hyperfixi/core/registry';\nimport { createMultilingualServerPlugin } from '@hyperfixi/core/registry/multilingual';\nimport { createRequestEventSource } from '@hyperfixi/core/registry/examples/server-event-source';\n\nconst app = express();\nconst registry = getDefaultRegistry();\n\n// Install multilingual server plugin\nconst serverPlugin = createMultilingualServerPlugin({\n languages: ['en', 'ja', 'es', 'ar'],\n});\nregistry.use(serverPlugin);\n\n// Create and register request event source\nconst requestSource = createRequestEventSource();\nregistry.eventSources.register('request', requestSource);\n\n// Middleware to inject context\napp.use((req, res, next) => {\n // Register request/response in context\n registry.context.register('request', () => req);\n registry.context.register('response', () => res);\n next();\n});\n\n// Route hyperscript handler\napp.use('/api/*', (req, res) => {\n const handled = requestSource.handleRequest(\n {\n method: req.method,\n url: req.url,\n path: req.path,\n query: req.query,\n params: req.params,\n headers: req.headers,\n body: req.body,\n },\n {\n status: (code) => { res.status(code); return res; },\n header: (name, value) => { res.set(name, value); return res; },\n json: (data) => res.json(data),\n html: (content) => res.send(content),\n text: (content) => res.send(content),\n redirect: (url, code) => res.redirect(code ?? 302, url),\n send: (data) => res.send(data),\n }\n );\n\n if (!handled) {\n res.status(404).json({ error: 'Not found' });\n }\n});\n";
16
+ //# sourceMappingURL=examples.d.ts.map
@@ -0,0 +1,68 @@
1
+ import type { LokaScriptPlugin, ContextProviderFn } from '../index';
2
+ import type { CommandWithParseInput } from '../../runtime/command-adapter';
3
+ import type { EventSource } from '../event-source-registry';
4
+ export type LanguageCode = 'en' | 'ja' | 'ko' | 'ar' | 'zh' | 'es' | 'pt' | 'fr' | 'de' | 'id' | 'qu' | 'sw' | 'th' | 'tl' | 'tr' | 'vi' | 'bn' | 'hi' | 'it' | 'ms' | 'pl' | 'ru' | 'uk';
5
+ export interface MultilingualKeyword {
6
+ primary: string;
7
+ alternatives?: string[];
8
+ }
9
+ export type MultilingualKeywordMap = Partial<Record<LanguageCode, MultilingualKeyword | string>>;
10
+ export interface MultilingualCommand extends CommandWithParseInput {
11
+ keywords?: MultilingualKeywordMap;
12
+ semanticRoles?: {
13
+ primary?: 'patient' | 'destination' | 'content' | 'source';
14
+ optional?: Array<'destination' | 'source' | 'condition' | 'style' | 'quantity'>;
15
+ };
16
+ }
17
+ export interface MultilingualEventSource extends EventSource {
18
+ patterns?: MultilingualKeywordMap;
19
+ }
20
+ export interface MultilingualServerPluginOptions {
21
+ languages?: LanguageCode[];
22
+ customKeywords?: {
23
+ respond?: MultilingualKeywordMap;
24
+ redirect?: MultilingualKeywordMap;
25
+ setHeader?: MultilingualKeywordMap;
26
+ request?: MultilingualKeywordMap;
27
+ };
28
+ commands?: MultilingualCommand[];
29
+ eventSources?: MultilingualEventSource[];
30
+ contextProviders?: Array<{
31
+ name: string;
32
+ provide: ContextProviderFn;
33
+ keywords?: MultilingualKeywordMap;
34
+ }>;
35
+ }
36
+ export declare const respondKeywords: MultilingualKeywordMap;
37
+ export declare const redirectKeywords: MultilingualKeywordMap;
38
+ export declare const setHeaderKeywords: MultilingualKeywordMap;
39
+ export declare const requestKeywords: MultilingualKeywordMap;
40
+ export declare class KeywordAliasRegistry {
41
+ private aliases;
42
+ private byCommand;
43
+ register(command: string, keyword: string, language: LanguageCode): void;
44
+ registerFromMap(command: string, keywords: MultilingualKeywordMap): void;
45
+ lookup(keyword: string): {
46
+ command: string;
47
+ language: LanguageCode;
48
+ } | undefined;
49
+ getKeywords(command: string, language: LanguageCode): string[];
50
+ getLanguages(command: string): LanguageCode[];
51
+ }
52
+ export declare function createMultilingualServerPlugin(options?: MultilingualServerPluginOptions): LokaScriptPlugin & {
53
+ keywordRegistry: KeywordAliasRegistry;
54
+ };
55
+ export declare function detectLanguage(input: string, keywordRegistry: KeywordAliasRegistry): LanguageCode;
56
+ export declare function getWordOrder(language: LanguageCode): 'SVO' | 'SOV' | 'VSO' | 'V2';
57
+ export declare function getTextDirection(language: LanguageCode): 'ltr' | 'rtl';
58
+ export declare const serverRoles: {
59
+ content: "content";
60
+ destination: "destination";
61
+ status: "status";
62
+ headerName: "headerName";
63
+ headerValue: "headerValue";
64
+ method: "method";
65
+ pattern: "pattern";
66
+ };
67
+ export declare const roleMarkers: Record<LanguageCode, Partial<Record<string, string[]>>>;
68
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,30 @@
1
+ import type { ExecutionContext } from '../types/core';
2
+ import type { EventSource, EventSourceSubscribeOptions } from './event-source-registry';
3
+ import type { ContextProviderRegistry } from './context-provider-registry';
4
+ import type { EventSourceRegistry } from './event-source-registry';
5
+ export interface RegistryIntegrationOptions {
6
+ enableContextProviders?: boolean;
7
+ enableEventSources?: boolean;
8
+ registry?: {
9
+ context?: ContextProviderRegistry;
10
+ eventSources?: EventSourceRegistry;
11
+ };
12
+ }
13
+ export declare class RegistryIntegration {
14
+ private options;
15
+ private contextRegistry;
16
+ private eventSourceRegistry;
17
+ private contextCache;
18
+ constructor(options?: RegistryIntegrationOptions);
19
+ enhanceContext(baseContext: ExecutionContext): ExecutionContext;
20
+ getEventSource(eventName: string): EventSource | undefined;
21
+ hasEventSource(eventName: string): boolean;
22
+ subscribeToEventSource(eventSourceName: string, options: EventSourceSubscribeOptions, context: ExecutionContext): import("./event-source-registry").EventSourceSubscription;
23
+ getEventSourceNames(): string[];
24
+ getContextProviderNames(): string[];
25
+ destroy(): void;
26
+ }
27
+ export declare function createRegistryIntegration(options?: RegistryIntegrationOptions): RegistryIntegration;
28
+ export declare function getDefaultRegistryIntegration(): RegistryIntegration;
29
+ export declare function resetDefaultRegistryIntegration(): void;
30
+ //# sourceMappingURL=runtime-integration.d.ts.map
@@ -0,0 +1,34 @@
1
+ import type { EventSourcePayload, EventSourceHandler, EventSource, RuntimeEnvironment } from './event-source-registry';
2
+ import type { ExecutionContext } from '../types/core';
3
+ export type UniversalEventPayload = EventSourcePayload<'universal'>;
4
+ export type UniversalEventHandler = EventSourceHandler<'universal'>;
5
+ export interface UniversalEventSource<TEnv extends RuntimeEnvironment = 'universal'> extends EventSource {
6
+ }
7
+ export interface TypedRegistry<TEnv extends RuntimeEnvironment = 'universal'> {
8
+ eventSources: {
9
+ register(name: string, source: UniversalEventSource<TEnv>): void;
10
+ get(name: string): UniversalEventSource<TEnv> | undefined;
11
+ has(name: string): boolean;
12
+ getSourceNames(): string[];
13
+ };
14
+ context: {
15
+ register<T>(name: string, provide: (ctx: ExecutionContext) => T, options?: {
16
+ description?: string;
17
+ cache?: boolean;
18
+ }): void;
19
+ has(name: string): boolean;
20
+ getProviderNames(): string[];
21
+ };
22
+ commands: {
23
+ register(command: any): void;
24
+ has(name: string): boolean;
25
+ getCommandNames(): string[];
26
+ };
27
+ }
28
+ export declare function createTimerEventSource(name: string, interval: number): UniversalEventSource;
29
+ export declare function createAdaptiveEventSource(name: string, options?: {
30
+ description?: string;
31
+ }): UniversalEventSource;
32
+ export declare function isBrowserLikePayload(payload: UniversalEventPayload): boolean;
33
+ export declare function isServerLikePayload(payload: UniversalEventPayload): boolean;
34
+ //# sourceMappingURL=universal-types.d.ts.map
@@ -0,0 +1,91 @@
1
+ 'use strict';
2
+
3
+ function isBrowserEnvironment() {
4
+ return typeof window !== 'undefined' && typeof document !== 'undefined';
5
+ }
6
+ function isNodeEnvironment() {
7
+ return (typeof process !== 'undefined' && process.versions != null && process.versions.node != null);
8
+ }
9
+
10
+ function createTimerEventSource(name, interval) {
11
+ return {
12
+ name,
13
+ description: `Timer that fires every ${interval}ms`,
14
+ supportedEvents: [name],
15
+ subscribe(options, context) {
16
+ const handler = () => {
17
+ const payload = {
18
+ type: name,
19
+ data: { timestamp: Date.now() },
20
+ target: isBrowserEnvironment() && typeof document !== 'undefined' ? document.body : {},
21
+ };
22
+ options.handler(payload, context);
23
+ };
24
+ const timerId = setInterval(handler, interval);
25
+ return {
26
+ id: `${name}_${Date.now()}_${Math.random().toString(36).slice(2)}`,
27
+ source: name,
28
+ event: name,
29
+ unsubscribe: () => clearInterval(timerId),
30
+ };
31
+ },
32
+ supports(event) {
33
+ return event === name;
34
+ },
35
+ };
36
+ }
37
+ function createAdaptiveEventSource(name, options) {
38
+ return {
39
+ name,
40
+ description: options?.description ?? `Adaptive ${name} events`,
41
+ supportedEvents: [name],
42
+ subscribe(subscribeOptions, context) {
43
+ let unsubscribe;
44
+ if (isBrowserEnvironment()) {
45
+ const handler = (e) => {
46
+ const customEvent = e;
47
+ const payload = {
48
+ type: name,
49
+ data: customEvent.detail,
50
+ target: e.target instanceof Element ? e.target : null,
51
+ nativeEvent: e,
52
+ };
53
+ subscribeOptions.handler(payload, context);
54
+ };
55
+ document.addEventListener(name, handler);
56
+ unsubscribe = () => document.removeEventListener(name, handler);
57
+ }
58
+ else if (isNodeEnvironment()) {
59
+ unsubscribe = () => {
60
+ };
61
+ }
62
+ else {
63
+ unsubscribe = () => { };
64
+ }
65
+ return {
66
+ id: `${name}_${Date.now()}_${Math.random().toString(36).slice(2)}`,
67
+ source: name,
68
+ event: name,
69
+ unsubscribe,
70
+ };
71
+ },
72
+ supports(event) {
73
+ return event === name;
74
+ },
75
+ };
76
+ }
77
+ function isBrowserLikePayload(payload) {
78
+ return isBrowserEnvironment() && (payload.target == null || payload.target instanceof Element);
79
+ }
80
+ function isServerLikePayload(payload) {
81
+ return (isNodeEnvironment() &&
82
+ typeof payload.data === 'object' &&
83
+ payload.data !== null &&
84
+ 'request' in payload.data);
85
+ }
86
+
87
+ exports.createAdaptiveEventSource = createAdaptiveEventSource;
88
+ exports.createTimerEventSource = createTimerEventSource;
89
+ exports.isBrowserLikePayload = isBrowserLikePayload;
90
+ exports.isServerLikePayload = isServerLikePayload;
91
+ //# sourceMappingURL=universal-types.js.map
@@ -0,0 +1,86 @@
1
+ function isBrowserEnvironment() {
2
+ return typeof window !== 'undefined' && typeof document !== 'undefined';
3
+ }
4
+ function isNodeEnvironment() {
5
+ return (typeof process !== 'undefined' && process.versions != null && process.versions.node != null);
6
+ }
7
+
8
+ function createTimerEventSource(name, interval) {
9
+ return {
10
+ name,
11
+ description: `Timer that fires every ${interval}ms`,
12
+ supportedEvents: [name],
13
+ subscribe(options, context) {
14
+ const handler = () => {
15
+ const payload = {
16
+ type: name,
17
+ data: { timestamp: Date.now() },
18
+ target: isBrowserEnvironment() && typeof document !== 'undefined' ? document.body : {},
19
+ };
20
+ options.handler(payload, context);
21
+ };
22
+ const timerId = setInterval(handler, interval);
23
+ return {
24
+ id: `${name}_${Date.now()}_${Math.random().toString(36).slice(2)}`,
25
+ source: name,
26
+ event: name,
27
+ unsubscribe: () => clearInterval(timerId),
28
+ };
29
+ },
30
+ supports(event) {
31
+ return event === name;
32
+ },
33
+ };
34
+ }
35
+ function createAdaptiveEventSource(name, options) {
36
+ return {
37
+ name,
38
+ description: options?.description ?? `Adaptive ${name} events`,
39
+ supportedEvents: [name],
40
+ subscribe(subscribeOptions, context) {
41
+ let unsubscribe;
42
+ if (isBrowserEnvironment()) {
43
+ const handler = (e) => {
44
+ const customEvent = e;
45
+ const payload = {
46
+ type: name,
47
+ data: customEvent.detail,
48
+ target: e.target instanceof Element ? e.target : null,
49
+ nativeEvent: e,
50
+ };
51
+ subscribeOptions.handler(payload, context);
52
+ };
53
+ document.addEventListener(name, handler);
54
+ unsubscribe = () => document.removeEventListener(name, handler);
55
+ }
56
+ else if (isNodeEnvironment()) {
57
+ unsubscribe = () => {
58
+ };
59
+ }
60
+ else {
61
+ unsubscribe = () => { };
62
+ }
63
+ return {
64
+ id: `${name}_${Date.now()}_${Math.random().toString(36).slice(2)}`,
65
+ source: name,
66
+ event: name,
67
+ unsubscribe,
68
+ };
69
+ },
70
+ supports(event) {
71
+ return event === name;
72
+ },
73
+ };
74
+ }
75
+ function isBrowserLikePayload(payload) {
76
+ return isBrowserEnvironment() && (payload.target == null || payload.target instanceof Element);
77
+ }
78
+ function isServerLikePayload(payload) {
79
+ return (isNodeEnvironment() &&
80
+ typeof payload.data === 'object' &&
81
+ payload.data !== null &&
82
+ 'request' in payload.data);
83
+ }
84
+
85
+ export { createAdaptiveEventSource, createTimerEventSource, isBrowserLikePayload, isServerLikePayload };
86
+ //# sourceMappingURL=universal-types.mjs.map
@@ -0,0 +1,47 @@
1
+ export type CleanupType = 'listener' | 'observer' | 'interval' | 'timeout' | 'custom';
2
+ export interface CleanupEntry {
3
+ type: CleanupType;
4
+ cleanup: () => void;
5
+ target?: EventTarget;
6
+ eventName?: string;
7
+ description?: string;
8
+ }
9
+ export interface CleanupStats {
10
+ elementsTracked: number;
11
+ listeners: number;
12
+ observers: number;
13
+ intervals: number;
14
+ timeouts: number;
15
+ custom: number;
16
+ global: number;
17
+ }
18
+ export declare class CleanupRegistry {
19
+ private elementCleanups;
20
+ private elementCount;
21
+ private typeCounts;
22
+ private globalCleanups;
23
+ private debugMode;
24
+ constructor(options?: {
25
+ debug?: boolean;
26
+ });
27
+ registerListener(element: Element, target: EventTarget, eventName: string, handler: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
28
+ registerObserver(element: Element, observer: MutationObserver): void;
29
+ registerInterval(element: Element, intervalId: ReturnType<typeof setInterval>): void;
30
+ registerTimeout(element: Element, timeoutId: ReturnType<typeof setTimeout>): void;
31
+ registerCustom(element: Element, cleanup: () => void, description?: string): void;
32
+ registerGlobal(cleanup: () => void, type?: CleanupType, description?: string): void;
33
+ private addCleanup;
34
+ cleanupElement(element: Element): number;
35
+ cleanupElementTree(element: Element): number;
36
+ cleanupGlobal(): number;
37
+ cleanupAll(): number;
38
+ hasCleanups(element: Element): boolean;
39
+ getCleanupCount(element: Element): number;
40
+ getStats(): CleanupStats;
41
+ setDebugMode(enabled: boolean): void;
42
+ }
43
+ export declare function createAutoCleanupRegistry(options?: {
44
+ debug?: boolean;
45
+ root?: Element;
46
+ }): CleanupRegistry;
47
+ //# sourceMappingURL=cleanup-registry.d.ts.map
@@ -0,0 +1,63 @@
1
+ import type { ExecutionContext, TypedExecutionContext, ValidationResult } from '../types/core';
2
+ import type { ASTNode } from '../types/base-types';
3
+ import { HookRegistry } from '../types/hooks';
4
+ import { ExpressionEvaluator } from '../core/expression-evaluator';
5
+ export interface RuntimeCommand {
6
+ name: string;
7
+ execute(context: ExecutionContext, ...args: unknown[]): Promise<unknown>;
8
+ validate?(input: unknown): ValidationResult<unknown>;
9
+ metadata?: {
10
+ description: string;
11
+ examples: string[];
12
+ syntax: string;
13
+ };
14
+ }
15
+ export interface CommandWithParseInput {
16
+ name: string;
17
+ parseInput?(raw: {
18
+ args: ASTNode[];
19
+ modifiers: Record<string, any>;
20
+ commandName?: string;
21
+ }, evaluator: ExpressionEvaluator, context: ExecutionContext): Promise<any>;
22
+ execute(input: any, context: TypedExecutionContext): Promise<unknown>;
23
+ validate?(input: unknown): ValidationResult<unknown>;
24
+ metadata?: any;
25
+ }
26
+ export declare class ContextBridge {
27
+ static toTyped(context: ExecutionContext): TypedExecutionContext;
28
+ static fromTyped(typedContext: TypedExecutionContext, originalContext: ExecutionContext): ExecutionContext;
29
+ }
30
+ export declare class CommandAdapterV2 implements RuntimeCommand {
31
+ private impl;
32
+ private expressionEvaluator;
33
+ private hookRegistry;
34
+ constructor(impl: CommandWithParseInput, sharedEvaluator?: ExpressionEvaluator, hookRegistry?: HookRegistry);
35
+ setHookRegistry(registry: HookRegistry): void;
36
+ private createHookContext;
37
+ get name(): string;
38
+ get metadata(): {
39
+ description: any;
40
+ examples: any;
41
+ syntax: any;
42
+ };
43
+ execute(context: ExecutionContext, ...args: unknown[]): Promise<unknown>;
44
+ validate(input: unknown): ValidationResult<unknown>;
45
+ }
46
+ export declare class CommandRegistryV2 {
47
+ private adapters;
48
+ private implementations;
49
+ private sharedEvaluator?;
50
+ private hookRegistry?;
51
+ constructor(sharedEvaluator?: ExpressionEvaluator, hookRegistry?: HookRegistry);
52
+ setHookRegistry(registry: HookRegistry): void;
53
+ getHookRegistry(): HookRegistry | undefined;
54
+ register(impl: any): void;
55
+ getAdapter(name: string): CommandAdapterV2 | undefined;
56
+ has(name: string): boolean;
57
+ getCommandNames(): string[];
58
+ getImplementation(name: string): CommandWithParseInput | undefined;
59
+ getAdapters(): Map<string, CommandAdapterV2>;
60
+ validateCommand(name: string, input: unknown): ValidationResult<unknown>;
61
+ }
62
+ export declare function createCommandRegistryV2(commands: CommandWithParseInput[], sharedEvaluator?: ExpressionEvaluator, hookRegistry?: HookRegistry): CommandRegistryV2;
63
+ //# sourceMappingURL=command-adapter.d.ts.map
@@ -0,0 +1,75 @@
1
+ export declare const isDeno: boolean;
2
+ export declare const isNode: string | false;
3
+ export declare const isBrowser: boolean;
4
+ export interface RuntimeInfo {
5
+ name: 'deno' | 'node' | 'browser' | 'unknown';
6
+ version: string;
7
+ hasDOM: boolean;
8
+ hasWebAPIs: boolean;
9
+ hasFileSystem: boolean;
10
+ hasNetworking: boolean;
11
+ typescript: boolean;
12
+ supportsESM: boolean;
13
+ supportsWorkers: boolean;
14
+ }
15
+ export declare function getRuntimeInfo(): RuntimeInfo;
16
+ export declare const logger: {
17
+ info: (message: string, ...args: unknown[]) => void;
18
+ warn: (message: string, ...args: unknown[]) => void;
19
+ error: (message: string, ...args: unknown[]) => void;
20
+ debug: (message: string, ...args: unknown[]) => void;
21
+ };
22
+ export declare const performance: {
23
+ now: () => number;
24
+ mark: (name: string) => void;
25
+ measure: (name: string, startMark?: string, endMark?: string) => void;
26
+ };
27
+ export declare class UniversalEventTarget {
28
+ private listeners;
29
+ addEventListener(type: string, listener: (event: any) => void): void;
30
+ removeEventListener(type: string, listener: (event: any) => void): void;
31
+ dispatchEvent(event: {
32
+ type: string;
33
+ [key: string]: any;
34
+ }): boolean;
35
+ }
36
+ export declare function getLLMRuntimeInfo(): {
37
+ runtime: "unknown" | "node" | "browser" | "deno";
38
+ version: string;
39
+ typescript: boolean;
40
+ capabilities: {
41
+ dom: boolean;
42
+ webapis: boolean;
43
+ filesystem: boolean;
44
+ networking: boolean;
45
+ workers: boolean;
46
+ esm: boolean;
47
+ };
48
+ features: {
49
+ dom?: boolean | undefined;
50
+ webapis?: boolean | undefined;
51
+ serviceWorkers?: boolean | undefined;
52
+ webAssembly?: boolean | undefined;
53
+ npm?: boolean | undefined;
54
+ packageJson?: boolean | undefined;
55
+ nodeModules?: boolean | undefined;
56
+ builtinModules?: boolean | undefined;
57
+ permissions?: string | undefined;
58
+ builtinTypescript?: boolean | undefined;
59
+ standardLibrary?: string | undefined;
60
+ jsr?: boolean | undefined;
61
+ denoDeploy?: boolean | undefined;
62
+ };
63
+ patterns: {
64
+ imports: string;
65
+ testing: string;
66
+ bundling: string;
67
+ };
68
+ };
69
+ export declare function importForEnvironment<T>(imports: {
70
+ deno?: () => Promise<T>;
71
+ node?: () => Promise<T>;
72
+ browser?: () => Promise<T>;
73
+ fallback?: () => Promise<T>;
74
+ }): Promise<T>;
75
+ //# sourceMappingURL=environment.d.ts.map
@@ -0,0 +1,78 @@
1
+ import type { ASTNode, ExecutionContext, CommandNode, EventHandlerNode } from '../types/base-types';
2
+ import type { ExecutionResult, ExecutionSignal, ControlFlowError } from '../types/result';
3
+ import type { RuntimeHooks } from '../types/hooks';
4
+ import { HookRegistry } from '../types/hooks';
5
+ import { BaseExpressionEvaluator } from '../core/base-expression-evaluator';
6
+ export declare function isControlFlowError(e: unknown): e is ControlFlowError;
7
+ import { CommandRegistryV2 as CommandRegistry } from './command-adapter';
8
+ import { CleanupRegistry } from './cleanup-registry';
9
+ import { RegistryIntegration, type RegistryIntegrationOptions } from '../registry/runtime-integration';
10
+ export declare function unwrapCommandResult(result: unknown): unknown | undefined;
11
+ export interface RuntimeBaseOptions {
12
+ registry: CommandRegistry;
13
+ enableAsyncCommands?: boolean;
14
+ commandTimeout?: number;
15
+ enableErrorReporting?: boolean;
16
+ enableResultPattern?: boolean;
17
+ expressionEvaluator: BaseExpressionEvaluator;
18
+ hooks?: RuntimeHooks;
19
+ enableAutoCleanup?: boolean;
20
+ registryIntegration?: RegistryIntegrationOptions | boolean;
21
+ }
22
+ export declare class RuntimeBase {
23
+ protected options: RuntimeBaseOptions;
24
+ protected registry: CommandRegistry;
25
+ protected expressionEvaluator: BaseExpressionEvaluator;
26
+ behaviorRegistry: Map<string, any>;
27
+ behaviorAPI: any;
28
+ protected globalVariables: Map<string, any>;
29
+ protected hookRegistry: HookRegistry;
30
+ protected cleanupRegistry: CleanupRegistry;
31
+ private autoCleanupObserver;
32
+ protected registryIntegration: RegistryIntegration | null;
33
+ constructor(options: RuntimeBaseOptions);
34
+ private setupAutoCleanup;
35
+ registerHooks(name: string, hooks: RuntimeHooks): void;
36
+ unregisterHooks(name: string): boolean;
37
+ getRegisteredHooks(): string[];
38
+ cleanup(element: Element): number;
39
+ cleanupTree(element: Element): number;
40
+ getCleanupStats(): ReturnType<CleanupRegistry['getStats']>;
41
+ destroy(): void;
42
+ execute(node: ASTNode, context: ExecutionContext): Promise<unknown>;
43
+ protected processCommand(node: CommandNode, context: ExecutionContext): Promise<unknown>;
44
+ protected toSignal(error: unknown): ExecutionSignal | null;
45
+ protected processCommandWithResult(node: CommandNode, context: ExecutionContext): Promise<ExecutionResult<unknown>>;
46
+ protected executeCommandSequenceWithResult(commands: ASTNode[], context: ExecutionContext): Promise<ExecutionResult<unknown>>;
47
+ protected evaluateExpression(node: ASTNode, context: ExecutionContext): Promise<unknown>;
48
+ protected evaluateExpressionWithResult(node: ASTNode, context: ExecutionContext): Promise<ExecutionResult<unknown>>;
49
+ protected executeCommandFromPattern(commandName: string, selector: string, context: ExecutionContext): Promise<unknown>;
50
+ protected executeProgram(node: any, context: ExecutionContext): Promise<unknown>;
51
+ protected executeBlock(node: {
52
+ commands?: ASTNode[];
53
+ }, context: ExecutionContext): Promise<void>;
54
+ protected executeCommandSequence(node: {
55
+ commands: ASTNode[];
56
+ }, context: ExecutionContext): Promise<unknown>;
57
+ protected executeObjectLiteral(node: {
58
+ properties: Array<{
59
+ key: ASTNode;
60
+ value: ASTNode;
61
+ }>;
62
+ }, context: ExecutionContext): Promise<Record<string, unknown>>;
63
+ protected enhanceContext(baseContext: ExecutionContext): ExecutionContext;
64
+ protected executeBehaviorDefinition(node: ASTNode & {
65
+ name: string;
66
+ parameters?: string[];
67
+ eventHandlers?: EventHandlerNode[];
68
+ initBlock?: ASTNode;
69
+ }, _context: ExecutionContext): Promise<void>;
70
+ protected installBehaviorOnElement(behaviorName: string, element: HTMLElement, parameters: Record<string, any>): Promise<void>;
71
+ protected executeEventHandler(node: EventHandlerNode, context: ExecutionContext): Promise<void>;
72
+ private static createEventHandler;
73
+ protected setupMutationObserver(targets: HTMLElement[], attr: string, commands: ASTNode[], context: ExecutionContext): void;
74
+ protected setupChangeObserver(watchTarget: ASTNode, commands: ASTNode[], context: ExecutionContext): Promise<void>;
75
+ protected queryElements(selector: string, context: ExecutionContext): HTMLElement[];
76
+ protected isElement(obj: unknown): obj is HTMLElement;
77
+ }
78
+ //# sourceMappingURL=runtime-base.d.ts.map
@@ -0,0 +1,18 @@
1
+ import { RuntimeBase } from './runtime-base';
2
+ import { CommandRegistryV2 } from './command-adapter';
3
+ import { BaseExpressionEvaluator } from '../core/base-expression-evaluator';
4
+ export interface RuntimeExperimentalOptions {
5
+ lazyLoad?: boolean;
6
+ expressionPreload?: 'core' | 'all' | 'common' | 'none';
7
+ expressionEvaluator?: BaseExpressionEvaluator;
8
+ registry?: CommandRegistryV2;
9
+ enableAsyncCommands?: boolean;
10
+ commandTimeout?: number;
11
+ enableErrorReporting?: boolean;
12
+ }
13
+ export declare class RuntimeExperimental extends RuntimeBase {
14
+ constructor(options?: RuntimeExperimentalOptions);
15
+ }
16
+ export declare function createRuntimeExperimental(options?: RuntimeExperimentalOptions): RuntimeExperimental;
17
+ export declare function createMinimalRuntime(commands: any[], options?: Omit<RuntimeExperimentalOptions, 'registry'>): RuntimeExperimental;
18
+ //# sourceMappingURL=runtime-experimental.d.ts.map
@@ -0,0 +1,30 @@
1
+ import { RuntimeBase } from './runtime-base';
2
+ import type { BaseExpressionEvaluator } from '../core/base-expression-evaluator';
3
+ import type { ParserInterface } from '../parser/parser-interface';
4
+ import type { ExecutionContext } from '../types/core';
5
+ export interface TreeShakeableRuntimeOptions {
6
+ expressionEvaluator: BaseExpressionEvaluator;
7
+ enableAsyncCommands?: boolean;
8
+ commandTimeout?: number;
9
+ enableErrorReporting?: boolean;
10
+ enableResultPattern?: boolean;
11
+ }
12
+ export interface RuntimeOptions {
13
+ commands: Array<() => any>;
14
+ expressions?: Record<string, any>[];
15
+ parser?: ParserInterface;
16
+ enableAsyncCommands?: boolean;
17
+ commandTimeout?: number;
18
+ enableErrorReporting?: boolean;
19
+ }
20
+ export interface LokaScriptRuntime {
21
+ runtime: RuntimeBase;
22
+ parser?: ParserInterface;
23
+ run(code: string, element?: Element): Promise<unknown>;
24
+ execute(ast: any, context: ExecutionContext): Promise<unknown>;
25
+ parse(code: string): any;
26
+ }
27
+ export declare function createTreeShakeableRuntime(commands: any[], options: TreeShakeableRuntimeOptions): RuntimeBase;
28
+ export declare function createRuntime(options: RuntimeOptions): LokaScriptRuntime;
29
+ export type { BaseExpressionEvaluator, ParserInterface };
30
+ //# sourceMappingURL=runtime-factory.d.ts.map
@@ -0,0 +1,19 @@
1
+ import { RuntimeBase } from './runtime-base';
2
+ import { CommandRegistryV2, type CommandWithParseInput } from './command-adapter';
3
+ export interface RuntimeOptions {
4
+ enableAsyncCommands?: boolean;
5
+ commandTimeout?: number;
6
+ enableErrorReporting?: boolean;
7
+ lazyLoad?: boolean;
8
+ expressionPreload?: 'core' | 'common' | 'all' | 'none';
9
+ registry?: CommandRegistryV2;
10
+ useEnhancedCommands?: boolean;
11
+ commands?: string[];
12
+ }
13
+ export declare class Runtime extends RuntimeBase {
14
+ constructor(options?: RuntimeOptions);
15
+ getRegistry(): CommandRegistryV2;
16
+ }
17
+ export declare function createRuntime(options?: RuntimeOptions): Runtime;
18
+ export declare function createMinimalRuntime(commands: CommandWithParseInput[], options?: Omit<RuntimeOptions, 'registry'>): Runtime;
19
+ //# sourceMappingURL=runtime.d.ts.map