@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,409 @@
1
+ function parseLite(code) {
2
+ const trimmed = code.trim();
3
+ const onMatch = trimmed.match(/^on\s+(\w+)(?:\s+from\s+([^\s]+))?\s+(.+)$/i);
4
+ if (onMatch) {
5
+ return {
6
+ event: onMatch[1],
7
+ filter: onMatch[2],
8
+ commands: parseCommands(onMatch[3]),
9
+ };
10
+ }
11
+ const everyMatch = trimmed.match(/^every\s+(\d+)(ms|s)?\s+(.+)$/i);
12
+ if (everyMatch) {
13
+ const ms = everyMatch[2] === 's' ? parseInt(everyMatch[1]) * 1000 : parseInt(everyMatch[1]);
14
+ return {
15
+ event: `interval:${ms}`,
16
+ commands: parseCommands(everyMatch[3]),
17
+ };
18
+ }
19
+ const initMatch = trimmed.match(/^init\s+(.+)$/i);
20
+ if (initMatch) {
21
+ return {
22
+ event: 'init',
23
+ commands: parseCommands(initMatch[1]),
24
+ };
25
+ }
26
+ return parseCommands(trimmed);
27
+ }
28
+ function parseCommands(code) {
29
+ const parts = code.split(/\s+(?:then|and)\s+/i);
30
+ return parts.map(parseCommand).filter(Boolean);
31
+ }
32
+ function parseCommand(code) {
33
+ const trimmed = code.trim();
34
+ if (!trimmed)
35
+ return null;
36
+ let match = trimmed.match(/^toggle\s+(\.\w+|\w+)(?:\s+on\s+(.+))?$/i);
37
+ if (match) {
38
+ return { name: 'toggle', args: [match[1]], target: match[2] };
39
+ }
40
+ match = trimmed.match(/^add\s+(\.\w+|\w+)(?:\s+to\s+(.+))?$/i);
41
+ if (match) {
42
+ return { name: 'add', args: [match[1]], target: match[2] };
43
+ }
44
+ match = trimmed.match(/^remove\s+(\.\w+)(?:\s+from\s+(.+))?$/i);
45
+ if (match) {
46
+ return { name: 'remove', args: [match[1]], target: match[2] };
47
+ }
48
+ match = trimmed.match(/^remove\s+(.+)$/i);
49
+ if (match) {
50
+ return { name: 'remove', args: [], target: match[1] };
51
+ }
52
+ match = trimmed.match(/^put\s+(?:"([^"]+)"|'([^']+)'|(\S+))\s+(into|before|after)\s+(.+)$/i);
53
+ if (match) {
54
+ const content = match[1] || match[2] || match[3];
55
+ return { name: 'put', args: [content], modifier: match[4], target: match[5] };
56
+ }
57
+ match = trimmed.match(/^set\s+(.+?)\s+to\s+(.+)$/i);
58
+ if (match) {
59
+ return { name: 'set', args: [match[1], match[2]] };
60
+ }
61
+ match = trimmed.match(/^log\s+(.+)$/i);
62
+ if (match) {
63
+ return { name: 'log', args: [match[1]] };
64
+ }
65
+ match = trimmed.match(/^send\s+(\w+)(?:\s+to\s+(.+))?$/i);
66
+ if (match) {
67
+ return { name: 'send', args: [match[1]], target: match[2] };
68
+ }
69
+ match = trimmed.match(/^wait\s+(\d+)(ms|s)?$/i);
70
+ if (match) {
71
+ const ms = match[2] === 's' ? parseInt(match[1]) * 1000 : parseInt(match[1]);
72
+ return { name: 'wait', args: [ms.toString()] };
73
+ }
74
+ match = trimmed.match(/^(if|unless)\s+(.+?)\s+(toggle|add|remove|put|set|log|send|wait)\s+(.+)$/i);
75
+ if (match) {
76
+ const innerCmd = parseCommand(`${match[3]} ${match[4]}`);
77
+ if (innerCmd) {
78
+ innerCmd.modifier = match[1].toLowerCase();
79
+ innerCmd.args.unshift(match[2]);
80
+ return innerCmd;
81
+ }
82
+ }
83
+ match = trimmed.match(/^(show|hide)(?:\s+(.+))?$/i);
84
+ if (match) {
85
+ const target = match[2];
86
+ return match[1].toLowerCase() === 'show'
87
+ ? { name: 'remove', args: ['.hidden'], target }
88
+ : { name: 'add', args: ['.hidden'], target };
89
+ }
90
+ const parts = trimmed.split(/\s+/);
91
+ if (parts.length > 0) {
92
+ return { name: parts[0], args: parts.slice(1) };
93
+ }
94
+ return null;
95
+ }
96
+ function resolveTarget(target, me) {
97
+ if (!target)
98
+ return me;
99
+ const t = target.trim();
100
+ if (t === 'me')
101
+ return me;
102
+ if (t === 'body')
103
+ return document.body;
104
+ if (t.startsWith('#') || t.startsWith('.') || t.startsWith('[')) {
105
+ const elements = document.querySelectorAll(t);
106
+ return elements.length === 1 ? elements[0] : Array.from(elements);
107
+ }
108
+ if (/^\w+$/.test(t) && document.getElementById(t)) {
109
+ return document.getElementById(t);
110
+ }
111
+ return me;
112
+ }
113
+ function getClassName(arg) {
114
+ return arg.startsWith('.') ? arg.slice(1) : arg;
115
+ }
116
+ async function executeCommand(cmd, me, locals) {
117
+ const target = resolveTarget(cmd.target, me);
118
+ const elements = Array.isArray(target) ? target : target ? [target] : [me];
119
+ switch (cmd.name) {
120
+ case 'toggle': {
121
+ const className = getClassName(cmd.args[0]);
122
+ for (const el of elements) {
123
+ el.classList.toggle(className);
124
+ }
125
+ return elements.length === 1 ? elements[0] : elements;
126
+ }
127
+ case 'add': {
128
+ const className = getClassName(cmd.args[0]);
129
+ for (const el of elements) {
130
+ el.classList.add(className);
131
+ }
132
+ return elements.length === 1 ? elements[0] : elements;
133
+ }
134
+ case 'remove': {
135
+ if (cmd.args[0]) {
136
+ const className = getClassName(cmd.args[0]);
137
+ for (const el of elements) {
138
+ el.classList.remove(className);
139
+ }
140
+ }
141
+ else {
142
+ for (const el of elements) {
143
+ el.remove();
144
+ }
145
+ }
146
+ return null;
147
+ }
148
+ case 'put': {
149
+ const content = evaluateValue(cmd.args[0], me, locals);
150
+ for (const el of elements) {
151
+ switch (cmd.modifier?.toLowerCase()) {
152
+ case 'into':
153
+ el.innerHTML = String(content);
154
+ break;
155
+ case 'before':
156
+ el.insertAdjacentHTML('beforebegin', String(content));
157
+ break;
158
+ case 'after':
159
+ el.insertAdjacentHTML('afterend', String(content));
160
+ break;
161
+ default:
162
+ el.innerHTML = String(content);
163
+ }
164
+ }
165
+ return elements.length === 1 ? elements[0] : elements;
166
+ }
167
+ case 'set': {
168
+ const [targetExpr, valueExpr] = cmd.args;
169
+ const value = evaluateValue(valueExpr, me, locals);
170
+ if (targetExpr.startsWith(':')) {
171
+ locals.set(targetExpr.slice(1), value);
172
+ return value;
173
+ }
174
+ const propMatch = targetExpr.match(/^(.+?)(?:'s|\.)\s*(\w+)$/);
175
+ if (propMatch) {
176
+ const obj = resolveTarget(propMatch[1], me);
177
+ if (obj) {
178
+ obj[propMatch[2]] = value;
179
+ return obj;
180
+ }
181
+ }
182
+ return value;
183
+ }
184
+ case 'log': {
185
+ const value = evaluateValue(cmd.args.join(' '), me, locals);
186
+ console.log(value);
187
+ return value;
188
+ }
189
+ case 'send': {
190
+ const eventName = cmd.args[0];
191
+ const event = new CustomEvent(eventName, { bubbles: true });
192
+ for (const el of elements) {
193
+ el.dispatchEvent(event);
194
+ }
195
+ return event;
196
+ }
197
+ case 'wait': {
198
+ const ms = parseInt(cmd.args[0]) || 0;
199
+ await new Promise(resolve => setTimeout(resolve, ms));
200
+ return ms;
201
+ }
202
+ default:
203
+ console.warn(`Unknown command: ${cmd.name}`);
204
+ return null;
205
+ }
206
+ }
207
+ function evaluateValue(expr, me, locals) {
208
+ if (!expr)
209
+ return undefined;
210
+ const e = expr.trim();
211
+ if ((e.startsWith('"') && e.endsWith('"')) || (e.startsWith("'") && e.endsWith("'"))) {
212
+ return e.slice(1, -1);
213
+ }
214
+ if (/^-?\d+(\.\d+)?$/.test(e)) {
215
+ return parseFloat(e);
216
+ }
217
+ if (e === 'true')
218
+ return true;
219
+ if (e === 'false')
220
+ return false;
221
+ if (e === 'null')
222
+ return null;
223
+ if (e.startsWith(':')) {
224
+ return locals.get(e.slice(1));
225
+ }
226
+ if (e === 'me')
227
+ return me;
228
+ if (e === 'my')
229
+ return me;
230
+ if (e === 'body')
231
+ return document.body;
232
+ const propMatch = e.match(/^(me|my)\.(\w+)$/);
233
+ if (propMatch) {
234
+ return me[propMatch[2]];
235
+ }
236
+ return e;
237
+ }
238
+ async function executeParsed(parsed, me, locals = new Map()) {
239
+ if (Array.isArray(parsed)) {
240
+ let result;
241
+ for (const cmd of parsed) {
242
+ if (cmd.modifier === 'if' || cmd.modifier === 'unless') {
243
+ const condition = evaluateCondition(cmd.args[0], me, locals);
244
+ const shouldRun = cmd.modifier === 'if' ? condition : !condition;
245
+ if (!shouldRun)
246
+ continue;
247
+ cmd.args.shift();
248
+ }
249
+ result = await executeCommand(cmd, me, locals);
250
+ }
251
+ return result;
252
+ }
253
+ const handler = parsed;
254
+ const targetEl = handler.filter ? document.querySelector(handler.filter) : me;
255
+ const eventName = handler.event;
256
+ if (eventName.startsWith('interval:')) {
257
+ const ms = parseInt(eventName.split(':')[1]);
258
+ setInterval(async () => {
259
+ const handlerLocals = new Map(locals);
260
+ for (const cmd of handler.commands) {
261
+ await executeCommand(cmd, me, handlerLocals);
262
+ }
263
+ }, ms);
264
+ return me;
265
+ }
266
+ if (eventName === 'init') {
267
+ const handlerLocals = new Map(locals);
268
+ for (const cmd of handler.commands) {
269
+ await executeCommand(cmd, me, handlerLocals);
270
+ }
271
+ return me;
272
+ }
273
+ if (targetEl) {
274
+ targetEl.addEventListener(eventName, async (event) => {
275
+ const handlerLocals = new Map(locals);
276
+ handlerLocals.set('event', event);
277
+ for (const cmd of handler.commands) {
278
+ await executeCommand(cmd, me, handlerLocals);
279
+ }
280
+ });
281
+ }
282
+ return me;
283
+ }
284
+ function evaluateCondition(expr, me, locals) {
285
+ const e = expr.trim();
286
+ const hasMatch = e.match(/^(me|my)\s+has\s+\.(\w+)$/i);
287
+ if (hasMatch) {
288
+ return me.classList.contains(hasMatch[2]);
289
+ }
290
+ const propMatch = e.match(/^(me|my)\.(\w+)$/i);
291
+ if (propMatch) {
292
+ return Boolean(me[propMatch[2]]);
293
+ }
294
+ if (e.startsWith(':')) {
295
+ return Boolean(locals.get(e.slice(1)));
296
+ }
297
+ const value = evaluateValue(e, me, locals);
298
+ return Boolean(value);
299
+ }
300
+ function processElements(root = document) {
301
+ const elements = root.querySelectorAll('[_]');
302
+ for (const el of elements) {
303
+ const code = el.getAttribute('_');
304
+ if (code) {
305
+ try {
306
+ const parsed = parseLite(code);
307
+ executeParsed(parsed, el);
308
+ }
309
+ catch (err) {
310
+ console.error('HyperFixi Lite error:', err, 'Code:', code);
311
+ }
312
+ }
313
+ }
314
+ }
315
+ const api = {
316
+ version: '1.0.0-lite',
317
+ parse: parseLite,
318
+ execute: async (code, element) => {
319
+ const me = element || document.body;
320
+ const parsed = parseLite(code);
321
+ return executeParsed(parsed, me);
322
+ },
323
+ init: processElements,
324
+ process: processElements,
325
+ commands: ['add', 'remove', 'toggle', 'put', 'set', 'log', 'send', 'wait'],
326
+ };
327
+ if (typeof window !== 'undefined') {
328
+ window.hyperfixi = api;
329
+ if (document.readyState === 'loading') {
330
+ document.addEventListener('DOMContentLoaded', () => processElements());
331
+ }
332
+ else {
333
+ processElements();
334
+ }
335
+ }
336
+
337
+ class RegexParserImpl {
338
+ constructor() {
339
+ this.name = 'regex';
340
+ this.supportedCommands = [
341
+ 'add',
342
+ 'remove',
343
+ 'toggle',
344
+ 'put',
345
+ 'set',
346
+ 'log',
347
+ 'send',
348
+ 'wait',
349
+ ];
350
+ }
351
+ parse(code) {
352
+ const result = api.parse(code);
353
+ if ('event' in result) {
354
+ return {
355
+ type: 'eventHandler',
356
+ event: result.event,
357
+ filter: result.filter,
358
+ commands: result.commands.map(cmd => this.convertCommand(cmd)),
359
+ };
360
+ }
361
+ if (Array.isArray(result)) {
362
+ if (result.length === 1) {
363
+ return this.convertCommand(result[0]);
364
+ }
365
+ return {
366
+ type: 'sequence',
367
+ commands: result.map(cmd => this.convertCommand(cmd)),
368
+ };
369
+ }
370
+ return this.convertCommand(result);
371
+ }
372
+ convertCommand(cmd) {
373
+ return {
374
+ type: 'command',
375
+ name: cmd.name,
376
+ args: cmd.args.map(arg => ({
377
+ type: 'literal',
378
+ value: arg,
379
+ })),
380
+ ...(cmd.target && {
381
+ target: {
382
+ type: 'selector',
383
+ value: cmd.target,
384
+ },
385
+ }),
386
+ };
387
+ }
388
+ parseCommands(code) {
389
+ const result = this.parse(code);
390
+ if (result.type === 'sequence' && 'commands' in result) {
391
+ return result.commands;
392
+ }
393
+ return [result];
394
+ }
395
+ supports(syntax) {
396
+ const firstWord = syntax.trim().split(/\s+/)[0]?.toLowerCase();
397
+ if (firstWord === 'on' || firstWord === 'every' || firstWord === 'init') {
398
+ return true;
399
+ }
400
+ return this.supportedCommands.includes(firstWord);
401
+ }
402
+ }
403
+ const regexParser = new RegexParserImpl();
404
+ function createRegexParser() {
405
+ return new RegexParserImpl();
406
+ }
407
+
408
+ export { createRegexParser, regexParser };
409
+ //# sourceMappingURL=regex-parser.mjs.map
@@ -0,0 +1,3 @@
1
+ import type { ASTNode, ExecutionContext } from '../types/core';
2
+ export declare function evaluateAST(node: ASTNode, context: ExecutionContext): Promise<any>;
3
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1,61 @@
1
+ import type { CommandNode } from '../types/core';
2
+ export type SemanticValueType = 'literal' | 'selector' | 'reference' | 'property-path' | 'expression';
3
+ export interface SemanticValue {
4
+ readonly type: SemanticValueType;
5
+ readonly value: string;
6
+ readonly raw?: string;
7
+ }
8
+ export type SemanticRole = 'patient' | 'destination' | 'source' | 'event' | 'condition' | 'quantity' | 'duration' | 'method' | 'responseType' | 'style' | 'loopType';
9
+ export interface SemanticAnalysisResult {
10
+ readonly confidence: number;
11
+ readonly command?: {
12
+ readonly name: string;
13
+ readonly roles: ReadonlyMap<SemanticRole, SemanticValue>;
14
+ };
15
+ readonly errors?: string[];
16
+ readonly tokensConsumed?: number;
17
+ }
18
+ export interface SemanticAnalyzer {
19
+ analyze(input: string, language: string): SemanticAnalysisResult;
20
+ supportsLanguage(language: string): boolean;
21
+ supportedLanguages(): string[];
22
+ }
23
+ export declare const DEFAULT_CONFIDENCE_THRESHOLD = 0.5;
24
+ export declare const HIGH_CONFIDENCE_THRESHOLD = 0.8;
25
+ export interface SemanticIntegrationOptions {
26
+ analyzer: SemanticAnalyzer;
27
+ language: string;
28
+ confidenceThreshold?: number;
29
+ debug?: boolean;
30
+ }
31
+ export interface SemanticParseAttempt {
32
+ success: boolean;
33
+ node?: CommandNode;
34
+ confidence: number;
35
+ tokensConsumed?: number;
36
+ errors?: string[];
37
+ }
38
+ export declare class SemanticIntegrationAdapter {
39
+ private readonly analyzer;
40
+ private readonly language;
41
+ private readonly confidenceThreshold;
42
+ private readonly debugEnabled;
43
+ constructor(options: SemanticIntegrationOptions);
44
+ isAvailable(): boolean;
45
+ private static readonly SKIP_SEMANTIC_COMMANDS;
46
+ private shouldSkipSemantic;
47
+ trySemanticParse(input: string): SemanticParseAttempt;
48
+ private buildCommandNode;
49
+ private buildRepeatCommandNode;
50
+ private buildSetCommandNode;
51
+ private createPropertyNode;
52
+ private buildIfCommandNode;
53
+ private semanticValueToExpression;
54
+ private parseExpressionString;
55
+ getLanguage(): string;
56
+ getConfidenceThreshold(): number;
57
+ }
58
+ export declare function createSemanticIntegration(options: SemanticIntegrationOptions): SemanticIntegrationAdapter;
59
+ export declare function shouldUseSemanticResult(result: SemanticAnalysisResult, threshold?: number): boolean;
60
+ export declare function languageBenefitsFromSemantic(language: string): boolean;
61
+ //# sourceMappingURL=semantic-integration.d.ts.map
@@ -0,0 +1,35 @@
1
+ import type { ASTNode, Token } from '../types/core';
2
+ import type { TokenType } from './tokenizer';
3
+ export interface ParserInterface {
4
+ isAtEnd(): boolean;
5
+ check(value: string): boolean;
6
+ checkTokenType(type: TokenType): boolean;
7
+ advance(): Token;
8
+ peek(): Token;
9
+ parsePrimary(): ASTNode;
10
+ parseExpression(): ASTNode;
11
+ isCommand(name: string): boolean;
12
+ }
13
+ export interface ParseUntilOptions {
14
+ additionalTerminators?: string[];
15
+ allowExpressions?: boolean;
16
+ stopAtCommands?: boolean;
17
+ stopWhen?: (parser: ParserInterface) => boolean;
18
+ }
19
+ export declare class TokenConsumer {
20
+ private parser;
21
+ constructor(parser: ParserInterface);
22
+ parseArgsUntilTerminator(options?: ParseUntilOptions): ASTNode[];
23
+ private shouldStopParsing;
24
+ consumeOptionalThe(): boolean;
25
+ consumeOptionalArticle(): 'a' | 'an' | null;
26
+ parsePrepositionTarget(preposition: string, parseExpression?: boolean): {
27
+ preposition: string;
28
+ target: ASTNode;
29
+ } | null;
30
+ parseOptionalModifiers(prepositions: Record<string, boolean>): Record<string, ASTNode>;
31
+ isAtCommandSeparator(): boolean;
32
+ consumeOptionalSeparator(): 'then' | 'and' | null;
33
+ tryParseKeywordPhrase(keywords: string[]): string | null;
34
+ }
35
+ //# sourceMappingURL=token-consumer.d.ts.map
@@ -0,0 +1,77 @@
1
+ import type { Token } from '../types/core';
2
+ export declare function isCommand(token: Token): boolean;
3
+ export declare function isKeyword(token: Token): boolean;
4
+ export declare function isEvent(token: Token): boolean;
5
+ export declare function isContextVar(token: Token): boolean;
6
+ export declare function isLogicalOperator(token: Token): boolean;
7
+ export declare function isComparisonOperator(token: Token): boolean;
8
+ export declare function isIdentifierLike(token: Token): boolean;
9
+ export declare function isSelector(token: Token): boolean;
10
+ export declare function isBasicSelector(token: Token): boolean;
11
+ export declare function isLiteral(token: Token): boolean;
12
+ export declare function isOperator(token: Token): boolean;
13
+ export declare function isReference(token: Token): boolean;
14
+ export declare function isTimeExpression(token: Token): boolean;
15
+ export declare function isSymbol(token: Token): boolean;
16
+ export declare function isComment(token: Token): boolean;
17
+ export declare function isIdentifier(token: Token): boolean;
18
+ export declare function isString(token: Token): boolean;
19
+ export declare function isNumber(token: Token): boolean;
20
+ export declare function isBoolean(token: Token): boolean;
21
+ export declare function isTemplateLiteral(token: Token): boolean;
22
+ export declare function isQueryReference(token: Token): boolean;
23
+ export declare function isIdSelector(token: Token): boolean;
24
+ export declare function isClassSelector(token: Token): boolean;
25
+ export declare function isCssSelector(token: Token): boolean;
26
+ export declare function isGlobalVar(token: Token): boolean;
27
+ export declare function isBasicOperator(token: Token): boolean;
28
+ export declare function hasValue(token: Token, value: string): boolean;
29
+ export declare function hasValueIn(token: Token, values: readonly string[]): boolean;
30
+ export declare function isOperatorValue(token: Token, value: string): boolean;
31
+ export declare function isPossessive(token: Token): boolean;
32
+ export declare function isDot(token: Token): boolean;
33
+ export declare function isOptionalChain(token: Token): boolean;
34
+ export declare function isOpenBracket(token: Token): boolean;
35
+ export declare function isOpenParen(token: Token): boolean;
36
+ export declare function canStartExpression(token: Token): boolean;
37
+ export declare function isCommandTerminator(token: Token): boolean;
38
+ export declare const TokenPredicates: {
39
+ isCommand: typeof isCommand;
40
+ isKeyword: typeof isKeyword;
41
+ isEvent: typeof isEvent;
42
+ isContextVar: typeof isContextVar;
43
+ isLogicalOperator: typeof isLogicalOperator;
44
+ isComparisonOperator: typeof isComparisonOperator;
45
+ isIdentifierLike: typeof isIdentifierLike;
46
+ isSelector: typeof isSelector;
47
+ isBasicSelector: typeof isBasicSelector;
48
+ isLiteral: typeof isLiteral;
49
+ isOperator: typeof isOperator;
50
+ isReference: typeof isReference;
51
+ isTimeExpression: typeof isTimeExpression;
52
+ isSymbol: typeof isSymbol;
53
+ isComment: typeof isComment;
54
+ isIdentifier: typeof isIdentifier;
55
+ isString: typeof isString;
56
+ isNumber: typeof isNumber;
57
+ isBoolean: typeof isBoolean;
58
+ isTemplateLiteral: typeof isTemplateLiteral;
59
+ isQueryReference: typeof isQueryReference;
60
+ isIdSelector: typeof isIdSelector;
61
+ isClassSelector: typeof isClassSelector;
62
+ isCssSelector: typeof isCssSelector;
63
+ isGlobalVar: typeof isGlobalVar;
64
+ isBasicOperator: typeof isBasicOperator;
65
+ hasValue: typeof hasValue;
66
+ hasValueIn: typeof hasValueIn;
67
+ isOperatorValue: typeof isOperatorValue;
68
+ isPossessive: typeof isPossessive;
69
+ isDot: typeof isDot;
70
+ isOptionalChain: typeof isOptionalChain;
71
+ isOpenBracket: typeof isOpenBracket;
72
+ isOpenParen: typeof isOpenParen;
73
+ canStartExpression: typeof canStartExpression;
74
+ isCommandTerminator: typeof isCommandTerminator;
75
+ };
76
+ export default TokenPredicates;
77
+ //# sourceMappingURL=token-predicates.d.ts.map
@@ -0,0 +1,57 @@
1
+ import type { Token } from '../types/core';
2
+ export type { Token } from '../types/core';
3
+ export declare enum TokenKind {
4
+ IDENTIFIER = "identifier",
5
+ STRING = "string",
6
+ NUMBER = "number",
7
+ SELECTOR = "selector",
8
+ OPERATOR = "operator",
9
+ TIME = "time",
10
+ TEMPLATE = "template",
11
+ COMMENT = "comment",
12
+ SYMBOL = "symbol",
13
+ UNKNOWN = "unknown"
14
+ }
15
+ export declare function getTokenKind(tokenType: TokenType): TokenKind;
16
+ export declare enum TokenType {
17
+ KEYWORD = "keyword",
18
+ COMMAND = "command",
19
+ EXPRESSION = "expression",
20
+ STRING = "string",
21
+ NUMBER = "number",
22
+ BOOLEAN = "boolean",
23
+ TEMPLATE_LITERAL = "template_literal",
24
+ CSS_SELECTOR = "css_selector",
25
+ ID_SELECTOR = "id_selector",
26
+ CLASS_SELECTOR = "class_selector",
27
+ QUERY_REFERENCE = "query_reference",
28
+ CONTEXT_VAR = "context_var",
29
+ GLOBAL_VAR = "global_var",
30
+ EVENT = "event",
31
+ OPERATOR = "operator",
32
+ LOGICAL_OPERATOR = "logical_operator",
33
+ COMPARISON_OPERATOR = "comparison_operator",
34
+ TIME_EXPRESSION = "time_expression",
35
+ OBJECT_LITERAL = "object_literal",
36
+ ARRAY_LITERAL = "array_literal",
37
+ SYMBOL = "symbol",
38
+ COMMENT = "comment",
39
+ IDENTIFIER = "identifier",
40
+ UNKNOWN = "unknown"
41
+ }
42
+ export declare function enableDeferredClassification(): void;
43
+ export declare function disableDeferredClassification(): void;
44
+ export declare function isDeferredClassificationEnabled(): boolean;
45
+ export declare function enableDualOutput(): void;
46
+ export declare function disableDualOutput(): void;
47
+ export declare function isDualOutputEnabled(): boolean;
48
+ export interface Tokenizer {
49
+ input: string;
50
+ position: number;
51
+ line: number;
52
+ column: number;
53
+ tokens: Token[];
54
+ }
55
+ export declare function createTokenizer(): Tokenizer;
56
+ export declare function tokenize(input: string): Token[];
57
+ //# sourceMappingURL=tokenizer.d.ts.map