@math.gl/sql 0.0.0-stage → 5.0.0-beta.12

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 (353) hide show
  1. package/LICENSE +249 -0
  2. package/README.md +26 -2
  3. package/THIRD-PARTY-NOTICES.md +5 -0
  4. package/dist/arrow/aggregates.d.ts +46 -0
  5. package/dist/arrow/aggregates.d.ts.map +1 -0
  6. package/dist/arrow/aggregates.js +289 -0
  7. package/dist/arrow/aggregates.js.map +1 -0
  8. package/dist/arrow/buffers.d.ts +30 -0
  9. package/dist/arrow/buffers.d.ts.map +1 -0
  10. package/dist/arrow/buffers.js +177 -0
  11. package/dist/arrow/buffers.js.map +1 -0
  12. package/dist/arrow/cast.d.ts +19 -0
  13. package/dist/arrow/cast.d.ts.map +1 -0
  14. package/dist/arrow/cast.js +138 -0
  15. package/dist/arrow/cast.js.map +1 -0
  16. package/dist/arrow/compiler.d.ts +10 -0
  17. package/dist/arrow/compiler.d.ts.map +1 -0
  18. package/dist/arrow/compiler.js +1538 -0
  19. package/dist/arrow/compiler.js.map +1 -0
  20. package/dist/arrow/float16.d.ts +7 -0
  21. package/dist/arrow/float16.d.ts.map +1 -0
  22. package/dist/arrow/float16.js +26 -0
  23. package/dist/arrow/float16.js.map +1 -0
  24. package/dist/arrow/index.cjs +3321 -0
  25. package/dist/arrow/index.cjs.map +6 -0
  26. package/dist/arrow/index.d.ts +5 -0
  27. package/dist/arrow/index.d.ts.map +1 -0
  28. package/dist/arrow/index.js +7 -0
  29. package/dist/arrow/index.js.map +1 -0
  30. package/dist/arrow/like.d.ts +3 -0
  31. package/dist/arrow/like.d.ts.map +1 -0
  32. package/dist/arrow/like.js +75 -0
  33. package/dist/arrow/like.js.map +1 -0
  34. package/dist/arrow/list-values.d.ts +14 -0
  35. package/dist/arrow/list-values.d.ts.map +1 -0
  36. package/dist/arrow/list-values.js +201 -0
  37. package/dist/arrow/list-values.js.map +1 -0
  38. package/dist/arrow/predicate.d.ts +7 -0
  39. package/dist/arrow/predicate.d.ts.map +1 -0
  40. package/dist/arrow/predicate.js +10 -0
  41. package/dist/arrow/predicate.js.map +1 -0
  42. package/dist/arrow/query-arrow-aggregate-snapshots.d.ts +24 -0
  43. package/dist/arrow/query-arrow-aggregate-snapshots.d.ts.map +1 -0
  44. package/dist/arrow/query-arrow-aggregate-snapshots.js +64 -0
  45. package/dist/arrow/query-arrow-aggregate-snapshots.js.map +1 -0
  46. package/dist/arrow/query-arrow-sql.d.ts +8 -0
  47. package/dist/arrow/query-arrow-sql.d.ts.map +1 -0
  48. package/dist/arrow/query-arrow-sql.js +223 -0
  49. package/dist/arrow/query-arrow-sql.js.map +1 -0
  50. package/dist/arrow/query-arrow-table.d.ts +36 -0
  51. package/dist/arrow/query-arrow-table.d.ts.map +1 -0
  52. package/dist/arrow/query-arrow-table.js +208 -0
  53. package/dist/arrow/query-arrow-table.js.map +1 -0
  54. package/dist/arrow/query-worker-entry.d.ts +2 -0
  55. package/dist/arrow/query-worker-entry.d.ts.map +1 -0
  56. package/dist/arrow/query-worker-entry.js +7 -0
  57. package/dist/arrow/query-worker-entry.js.map +1 -0
  58. package/dist/arrow/query-worker.d.ts +65 -0
  59. package/dist/arrow/query-worker.d.ts.map +1 -0
  60. package/dist/arrow/query-worker.js +135 -0
  61. package/dist/arrow/query-worker.js.map +1 -0
  62. package/dist/arrow/registry.d.ts +4 -0
  63. package/dist/arrow/registry.d.ts.map +1 -0
  64. package/dist/arrow/registry.js +66 -0
  65. package/dist/arrow/registry.js.map +1 -0
  66. package/dist/arrow/relational-query.d.ts +36 -0
  67. package/dist/arrow/relational-query.d.ts.map +1 -0
  68. package/dist/arrow/relational-query.js +174 -0
  69. package/dist/arrow/relational-query.js.map +1 -0
  70. package/dist/arrow/replace-arrow-columns.d.ts +8 -0
  71. package/dist/arrow/replace-arrow-columns.d.ts.map +1 -0
  72. package/dist/arrow/replace-arrow-columns.js +63 -0
  73. package/dist/arrow/replace-arrow-columns.js.map +1 -0
  74. package/dist/arrow/signature.d.ts +6 -0
  75. package/dist/arrow/signature.d.ts.map +1 -0
  76. package/dist/arrow/signature.js +51 -0
  77. package/dist/arrow/signature.js.map +1 -0
  78. package/dist/arrow/temporal-cast.d.ts +9 -0
  79. package/dist/arrow/temporal-cast.d.ts.map +1 -0
  80. package/dist/arrow/temporal-cast.js +60 -0
  81. package/dist/arrow/temporal-cast.js.map +1 -0
  82. package/dist/arrow/types.d.ts +62 -0
  83. package/dist/arrow/types.d.ts.map +1 -0
  84. package/dist/arrow/types.js +5 -0
  85. package/dist/arrow/types.js.map +1 -0
  86. package/dist/arrow/unnest-arrow-column.d.ts +22 -0
  87. package/dist/arrow/unnest-arrow-column.d.ts.map +1 -0
  88. package/dist/arrow/unnest-arrow-column.js +112 -0
  89. package/dist/arrow/unnest-arrow-column.js.map +1 -0
  90. package/dist/arrow/worker-entry.d.ts +2 -0
  91. package/dist/arrow/worker-entry.d.ts.map +1 -0
  92. package/dist/arrow/worker-entry.js +9 -0
  93. package/dist/arrow/worker-entry.js.map +1 -0
  94. package/dist/arrow/worker.cjs +4074 -0
  95. package/dist/arrow/worker.cjs.map +6 -0
  96. package/dist/arrow/worker.d.ts +58 -0
  97. package/dist/arrow/worker.d.ts.map +1 -0
  98. package/dist/arrow/worker.js +84 -0
  99. package/dist/arrow/worker.js.map +1 -0
  100. package/dist/color-functions/index.cjs +382 -0
  101. package/dist/color-functions/index.cjs.map +6 -0
  102. package/dist/color-functions/index.d.ts +26 -0
  103. package/dist/color-functions/index.d.ts.map +1 -0
  104. package/dist/color-functions/index.js +306 -0
  105. package/dist/color-functions/index.js.map +1 -0
  106. package/dist/diagnostic-log.d.ts +8 -0
  107. package/dist/diagnostic-log.d.ts.map +1 -0
  108. package/dist/diagnostic-log.js +15 -0
  109. package/dist/diagnostic-log.js.map +1 -0
  110. package/dist/expressions/ast.d.ts +12 -0
  111. package/dist/expressions/ast.d.ts.map +1 -0
  112. package/dist/expressions/ast.js +114 -0
  113. package/dist/expressions/ast.js.map +1 -0
  114. package/dist/expressions/columnar-predicate.d.ts +56 -0
  115. package/dist/expressions/columnar-predicate.d.ts.map +1 -0
  116. package/dist/expressions/columnar-predicate.js +176 -0
  117. package/dist/expressions/columnar-predicate.js.map +1 -0
  118. package/dist/expressions/evaluation-error.d.ts +14 -0
  119. package/dist/expressions/evaluation-error.d.ts.map +1 -0
  120. package/dist/expressions/evaluation-error.js +26 -0
  121. package/dist/expressions/evaluation-error.js.map +1 -0
  122. package/dist/expressions/expression-eval.d.ts +105 -0
  123. package/dist/expressions/expression-eval.d.ts.map +1 -0
  124. package/dist/expressions/expression-eval.js +330 -0
  125. package/dist/expressions/expression-eval.js.map +1 -0
  126. package/dist/expressions/function-libraries.d.ts +63 -0
  127. package/dist/expressions/function-libraries.d.ts.map +1 -0
  128. package/dist/expressions/function-libraries.js +69 -0
  129. package/dist/expressions/function-libraries.js.map +1 -0
  130. package/dist/expressions/function-registry.d.ts +93 -0
  131. package/dist/expressions/function-registry.d.ts.map +1 -0
  132. package/dist/expressions/function-registry.js +139 -0
  133. package/dist/expressions/function-registry.js.map +1 -0
  134. package/dist/expressions/get.d.ts +9 -0
  135. package/dist/expressions/get.d.ts.map +1 -0
  136. package/dist/expressions/get.js +32 -0
  137. package/dist/expressions/get.js.map +1 -0
  138. package/dist/expressions/index.cjs +1888 -0
  139. package/dist/expressions/index.cjs.map +6 -0
  140. package/dist/expressions/index.d.ts +13 -0
  141. package/dist/expressions/index.d.ts.map +1 -0
  142. package/dist/expressions/index.js +14 -0
  143. package/dist/expressions/index.js.map +1 -0
  144. package/dist/expressions/numeric-functions.d.ts +277 -0
  145. package/dist/expressions/numeric-functions.d.ts.map +1 -0
  146. package/dist/expressions/numeric-functions.js +52 -0
  147. package/dist/expressions/numeric-functions.js.map +1 -0
  148. package/dist/expressions/parse-expression-string.d.ts +21 -0
  149. package/dist/expressions/parse-expression-string.d.ts.map +1 -0
  150. package/dist/expressions/parse-expression-string.js +61 -0
  151. package/dist/expressions/parse-expression-string.js.map +1 -0
  152. package/dist/expressions/predicate-expression.d.ts +7 -0
  153. package/dist/expressions/predicate-expression.d.ts.map +1 -0
  154. package/dist/expressions/predicate-expression.js +112 -0
  155. package/dist/expressions/predicate-expression.js.map +1 -0
  156. package/dist/expressions/scalar-type.d.ts +6 -0
  157. package/dist/expressions/scalar-type.d.ts.map +1 -0
  158. package/dist/expressions/scalar-type.js +23 -0
  159. package/dist/expressions/scalar-type.js.map +1 -0
  160. package/dist/expressions/vendor/jsep/runtime.d.ts +3 -0
  161. package/dist/expressions/vendor/jsep/runtime.d.ts.map +1 -0
  162. package/dist/expressions/vendor/jsep/runtime.js +972 -0
  163. package/dist/expressions/vendor/jsep/runtime.js.map +1 -0
  164. package/dist/expressions/vendor/jsep/types.d.ts +148 -0
  165. package/dist/expressions/vendor/jsep/types.d.ts.map +1 -0
  166. package/dist/expressions/vendor/jsep/types.js +6 -0
  167. package/dist/expressions/vendor/jsep/types.js.map +1 -0
  168. package/dist/index.cjs +5294 -0
  169. package/dist/index.cjs.map +6 -0
  170. package/dist/index.d.ts +11 -0
  171. package/dist/index.d.ts.map +1 -0
  172. package/dist/index.js +11 -0
  173. package/dist/index.js.map +1 -0
  174. package/dist/math-functions/index.cjs +444 -0
  175. package/dist/math-functions/index.cjs.map +6 -0
  176. package/dist/math-functions/index.d.ts +44 -0
  177. package/dist/math-functions/index.d.ts.map +1 -0
  178. package/dist/math-functions/index.js +182 -0
  179. package/dist/math-functions/index.js.map +1 -0
  180. package/dist/parser/bind-sql-predicate.d.ts +4 -0
  181. package/dist/parser/bind-sql-predicate.d.ts.map +1 -0
  182. package/dist/parser/bind-sql-predicate.js +11 -0
  183. package/dist/parser/bind-sql-predicate.js.map +1 -0
  184. package/dist/parser/index.cjs +1807 -0
  185. package/dist/parser/index.cjs.map +6 -0
  186. package/dist/parser/index.d.ts +12 -0
  187. package/dist/parser/index.d.ts.map +1 -0
  188. package/dist/parser/index.js +11 -0
  189. package/dist/parser/index.js.map +1 -0
  190. package/dist/parser/parameter-snapshots.d.ts +21 -0
  191. package/dist/parser/parameter-snapshots.d.ts.map +1 -0
  192. package/dist/parser/parameter-snapshots.js +85 -0
  193. package/dist/parser/parameter-snapshots.js.map +1 -0
  194. package/dist/parser/parse-sql-expression.d.ts +50 -0
  195. package/dist/parser/parse-sql-expression.d.ts.map +1 -0
  196. package/dist/parser/parse-sql-expression.js +501 -0
  197. package/dist/parser/parse-sql-expression.js.map +1 -0
  198. package/dist/parser/parse-sql-predicate.d.ts +13 -0
  199. package/dist/parser/parse-sql-predicate.d.ts.map +1 -0
  200. package/dist/parser/parse-sql-predicate.js +365 -0
  201. package/dist/parser/parse-sql-predicate.js.map +1 -0
  202. package/dist/parser/parse-sql-query.d.ts +9 -0
  203. package/dist/parser/parse-sql-query.d.ts.map +1 -0
  204. package/dist/parser/parse-sql-query.js +81 -0
  205. package/dist/parser/parse-sql-query.js.map +1 -0
  206. package/dist/parser/parse-sql-select.d.ts +57 -0
  207. package/dist/parser/parse-sql-select.d.ts.map +1 -0
  208. package/dist/parser/parse-sql-select.js +247 -0
  209. package/dist/parser/parse-sql-select.js.map +1 -0
  210. package/dist/parser/parse-sql-statement.d.ts +54 -0
  211. package/dist/parser/parse-sql-statement.d.ts.map +1 -0
  212. package/dist/parser/parse-sql-statement.js +207 -0
  213. package/dist/parser/parse-sql-statement.js.map +1 -0
  214. package/dist/parser/query-types.d.ts +56 -0
  215. package/dist/parser/query-types.d.ts.map +1 -0
  216. package/dist/parser/query-types.js +5 -0
  217. package/dist/parser/query-types.js.map +1 -0
  218. package/dist/parser/sql-parameters.d.ts +29 -0
  219. package/dist/parser/sql-parameters.d.ts.map +1 -0
  220. package/dist/parser/sql-parameters.js +110 -0
  221. package/dist/parser/sql-parameters.js.map +1 -0
  222. package/dist/parser/sql-parse-error.d.ts +13 -0
  223. package/dist/parser/sql-parse-error.d.ts.map +1 -0
  224. package/dist/parser/sql-parse-error.js +20 -0
  225. package/dist/parser/sql-parse-error.js.map +1 -0
  226. package/dist/parser/sql-predicate-schema.d.ts +164 -0
  227. package/dist/parser/sql-predicate-schema.d.ts.map +1 -0
  228. package/dist/parser/sql-predicate-schema.js +249 -0
  229. package/dist/parser/sql-predicate-schema.js.map +1 -0
  230. package/dist/parser/sql-predicate-types.d.ts +48 -0
  231. package/dist/parser/sql-predicate-types.d.ts.map +1 -0
  232. package/dist/parser/sql-predicate-types.js +9 -0
  233. package/dist/parser/sql-predicate-types.js.map +1 -0
  234. package/dist/parser/sql-predicate.d.ts +6 -0
  235. package/dist/parser/sql-predicate.d.ts.map +1 -0
  236. package/dist/parser/sql-predicate.js +8 -0
  237. package/dist/parser/sql-predicate.js.map +1 -0
  238. package/dist/scales/arrow-domains.d.ts +22 -0
  239. package/dist/scales/arrow-domains.d.ts.map +1 -0
  240. package/dist/scales/arrow-domains.js +166 -0
  241. package/dist/scales/arrow-domains.js.map +1 -0
  242. package/dist/scales/arrow-scales.d.ts +44 -0
  243. package/dist/scales/arrow-scales.d.ts.map +1 -0
  244. package/dist/scales/arrow-scales.js +255 -0
  245. package/dist/scales/arrow-scales.js.map +1 -0
  246. package/dist/scales/compile-scale.d.ts +2 -0
  247. package/dist/scales/compile-scale.d.ts.map +1 -0
  248. package/dist/scales/compile-scale.js +5 -0
  249. package/dist/scales/compile-scale.js.map +1 -0
  250. package/dist/scales/conformance.cjs +180 -0
  251. package/dist/scales/conformance.cjs.map +6 -0
  252. package/dist/scales/conformance.d.ts +26 -0
  253. package/dist/scales/conformance.d.ts.map +1 -0
  254. package/dist/scales/conformance.js +164 -0
  255. package/dist/scales/conformance.js.map +1 -0
  256. package/dist/scales/hdr-colors.d.ts +2 -0
  257. package/dist/scales/hdr-colors.d.ts.map +1 -0
  258. package/dist/scales/hdr-colors.js +5 -0
  259. package/dist/scales/hdr-colors.js.map +1 -0
  260. package/dist/scales/index.cjs +4334 -0
  261. package/dist/scales/index.cjs.map +6 -0
  262. package/dist/scales/index.d.ts +10 -0
  263. package/dist/scales/index.d.ts.map +1 -0
  264. package/dist/scales/index.js +11 -0
  265. package/dist/scales/index.js.map +1 -0
  266. package/dist/scales/palettes.d.ts +2 -0
  267. package/dist/scales/palettes.d.ts.map +1 -0
  268. package/dist/scales/palettes.js +5 -0
  269. package/dist/scales/palettes.js.map +1 -0
  270. package/dist/scales/parse-sql-scale.d.ts +27 -0
  271. package/dist/scales/parse-sql-scale.d.ts.map +1 -0
  272. package/dist/scales/parse-sql-scale.js +257 -0
  273. package/dist/scales/parse-sql-scale.js.map +1 -0
  274. package/dist/scales/quantile-sketch.d.ts +2 -0
  275. package/dist/scales/quantile-sketch.d.ts.map +1 -0
  276. package/dist/scales/quantile-sketch.js +5 -0
  277. package/dist/scales/quantile-sketch.js.map +1 -0
  278. package/dist/scales/scale-types.d.ts +2 -0
  279. package/dist/scales/scale-types.d.ts.map +1 -0
  280. package/dist/scales/scale-types.js +5 -0
  281. package/dist/scales/scale-types.js.map +1 -0
  282. package/dist/scales/streaming-domains.d.ts +18 -0
  283. package/dist/scales/streaming-domains.d.ts.map +1 -0
  284. package/dist/scales/streaming-domains.js +115 -0
  285. package/dist/scales/streaming-domains.js.map +1 -0
  286. package/package.json +92 -4
  287. package/src/arrow/aggregates.ts +386 -0
  288. package/src/arrow/buffers.ts +177 -0
  289. package/src/arrow/cast.ts +160 -0
  290. package/src/arrow/compiler.ts +1778 -0
  291. package/src/arrow/float16.ts +25 -0
  292. package/src/arrow/index.ts +22 -0
  293. package/src/arrow/like.ts +72 -0
  294. package/src/arrow/list-values.ts +221 -0
  295. package/src/arrow/predicate.ts +19 -0
  296. package/src/arrow/query-arrow-aggregate-snapshots.ts +107 -0
  297. package/src/arrow/query-arrow-sql.ts +255 -0
  298. package/src/arrow/query-arrow-table.ts +298 -0
  299. package/src/arrow/query-worker-entry.ts +8 -0
  300. package/src/arrow/query-worker.ts +194 -0
  301. package/src/arrow/registry.ts +87 -0
  302. package/src/arrow/relational-query.ts +247 -0
  303. package/src/arrow/replace-arrow-columns.ts +71 -0
  304. package/src/arrow/signature.ts +50 -0
  305. package/src/arrow/temporal-cast.ts +66 -0
  306. package/src/arrow/types.ts +76 -0
  307. package/src/arrow/unnest-arrow-column.ts +145 -0
  308. package/src/arrow/worker-entry.ts +10 -0
  309. package/src/arrow/worker.ts +143 -0
  310. package/src/color-functions/index.ts +405 -0
  311. package/src/diagnostic-log.ts +20 -0
  312. package/src/expressions/ast.ts +143 -0
  313. package/src/expressions/columnar-predicate.ts +293 -0
  314. package/src/expressions/evaluation-error.ts +29 -0
  315. package/src/expressions/expression-eval.ts +489 -0
  316. package/src/expressions/function-libraries.ts +126 -0
  317. package/src/expressions/function-registry.ts +171 -0
  318. package/src/expressions/get.ts +37 -0
  319. package/src/expressions/index.ts +40 -0
  320. package/src/expressions/numeric-functions.ts +99 -0
  321. package/src/expressions/parse-expression-string.ts +80 -0
  322. package/src/expressions/predicate-expression.ts +128 -0
  323. package/src/expressions/scalar-type.ts +39 -0
  324. package/src/expressions/vendor/jsep/LICENSE.txt +23 -0
  325. package/src/expressions/vendor/jsep/runtime.ts +949 -0
  326. package/src/expressions/vendor/jsep/types.ts +191 -0
  327. package/src/index.ts +54 -0
  328. package/src/math-functions/index.ts +235 -0
  329. package/src/parser/bind-sql-predicate.ts +21 -0
  330. package/src/parser/index.ts +43 -0
  331. package/src/parser/parameter-snapshots.ts +103 -0
  332. package/src/parser/parse-sql-expression.ts +500 -0
  333. package/src/parser/parse-sql-predicate.ts +454 -0
  334. package/src/parser/parse-sql-query.ts +90 -0
  335. package/src/parser/parse-sql-select.ts +272 -0
  336. package/src/parser/parse-sql-statement.ts +260 -0
  337. package/src/parser/query-types.ts +71 -0
  338. package/src/parser/sql-parameters.ts +174 -0
  339. package/src/parser/sql-parse-error.ts +33 -0
  340. package/src/parser/sql-predicate-schema.ts +279 -0
  341. package/src/parser/sql-predicate-types.ts +91 -0
  342. package/src/parser/sql-predicate.ts +28 -0
  343. package/src/scales/arrow-domains.ts +190 -0
  344. package/src/scales/arrow-scales.ts +363 -0
  345. package/src/scales/compile-scale.ts +5 -0
  346. package/src/scales/conformance.ts +186 -0
  347. package/src/scales/hdr-colors.ts +5 -0
  348. package/src/scales/index.ts +37 -0
  349. package/src/scales/palettes.ts +5 -0
  350. package/src/scales/parse-sql-scale.ts +300 -0
  351. package/src/scales/quantile-sketch.ts +5 -0
  352. package/src/scales/scale-types.ts +5 -0
  353. package/src/scales/streaming-domains.ts +139 -0
@@ -0,0 +1,330 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) 2013 Stephen Oney
4
+ // SPDX-FileCopyrightText: Copyright (c) 2023 Don McCurdy
5
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
6
+ // SPDX-FileComment: Sources include jsep and expression-eval under MIT. Original source credits retained below.
7
+ /**
8
+ * Sources:
9
+ * - Copyright (c) 2013 Stephen Oney, http://jsep.from.so/, MIT License
10
+ * - Copyright (c) 2023 Don McCurdy, https://github.com/donmccurdy/expression-eval, MIT License
11
+ */
12
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return, @typescript-eslint/restrict-plus-operands */
13
+ import { reportDiagnosticError } from "../diagnostic-log.js";
14
+ import jsepRuntime from "./vendor/jsep/runtime.js";
15
+ import { mergeFunctionLibraries } from "./function-libraries.js";
16
+ const jsep = jsepRuntime;
17
+ const DEFAULT_PRECEDENCE = {
18
+ '||': 1,
19
+ '&&': 2,
20
+ '|': 3,
21
+ '^': 4,
22
+ '&': 5,
23
+ '==': 6,
24
+ '!=': 6,
25
+ '===': 6,
26
+ '!==': 6,
27
+ '<': 7,
28
+ '>': 7,
29
+ '<=': 7,
30
+ '>=': 7,
31
+ '<<': 8,
32
+ '>>': 8,
33
+ '>>>': 8,
34
+ '+': 9,
35
+ '-': 9,
36
+ '*': 10,
37
+ '/': 10,
38
+ '%': 10
39
+ };
40
+ const binops = {
41
+ '||': (a, b) => a || b,
42
+ '&&': (a, b) => a && b,
43
+ '|': (a, b) => a | b,
44
+ '^': (a, b) => a ^ b,
45
+ '&': (a, b) => a & b,
46
+ '==': (a, b) => {
47
+ // biome-ignore lint/suspicious/noDoubleEquals: this operator implements JavaScript loose equality.
48
+ return a == b;
49
+ },
50
+ '!=': (a, b) => {
51
+ // biome-ignore lint/suspicious/noDoubleEquals: this operator implements JavaScript loose inequality.
52
+ return a != b;
53
+ },
54
+ '===': (a, b) => a === b,
55
+ '!==': (a, b) => a !== b,
56
+ '<': (a, b) => a < b,
57
+ '>': (a, b) => a > b,
58
+ '<=': (a, b) => a <= b,
59
+ '>=': (a, b) => a >= b,
60
+ '<<': (a, b) => a << b,
61
+ '>>': (a, b) => a >> b,
62
+ '>>>': (a, b) => a >>> b,
63
+ '+': (a, b) => {
64
+ // @ts-expect-error Addition intentionally supports JS coercion semantics.
65
+ return a + b;
66
+ },
67
+ '-': (a, b) => a - b,
68
+ '*': (a, b) => a * b,
69
+ '/': (a, b) => a / b,
70
+ '%': (a, b) => a % b
71
+ };
72
+ const unops = {
73
+ '-': (a) => -a,
74
+ '+': (a) => {
75
+ // eslint-disable-next-line no-implicit-coercion
76
+ return +a;
77
+ },
78
+ '~': (a) => ~a,
79
+ '!': (a) => !a
80
+ };
81
+ function evaluateArray(list, context) {
82
+ return list.map(value => evaluate(value, context));
83
+ }
84
+ /** Evaluates each expression in an array concurrently. */
85
+ async function evaluateArrayAsync(list, context) {
86
+ return await Promise.all(list.map(value => evaluateExpressionAsync(value, context)));
87
+ }
88
+ /** Resolves a member expression and preserves its receiver for method calls. */
89
+ function evaluateMember(node, context) {
90
+ const object = evaluate(node.object, context);
91
+ const key = node.computed
92
+ ? evaluate(node.property, context)
93
+ : node.property.name;
94
+ if (/^__proto__|prototype|constructor$/.test(key)) {
95
+ throw new Error(`Access to member "${key}" disallowed.`);
96
+ }
97
+ return [object, object?.[key]];
98
+ }
99
+ /** Asynchronously resolves a member expression and its receiver. */
100
+ async function evaluateMemberAsync(node, context) {
101
+ const object = (await evaluateExpressionAsync(node.object, context));
102
+ const key = node.computed
103
+ ? (await evaluateExpressionAsync(node.property, context))
104
+ : node.property.name;
105
+ if (/^__proto__|prototype|constructor$/.test(key)) {
106
+ throw new Error(`Access to member "${key}" disallowed.`);
107
+ }
108
+ return [object, object?.[key]];
109
+ }
110
+ /** Evaluates one expression node synchronously. */
111
+ // eslint-disable-next-line complexity
112
+ function evaluateExpression(node, context, options) {
113
+ const expression = node;
114
+ const mergedContext = mergeFunctionLibraries(context, options);
115
+ switch (expression.type) {
116
+ case 'ArrayExpression':
117
+ return evaluateArray(expression.elements, mergedContext);
118
+ case 'LogicalExpression':
119
+ case 'BinaryExpression':
120
+ if (expression.operator === '||') {
121
+ return (evaluate(expression.left, mergedContext) || evaluate(expression.right, mergedContext));
122
+ }
123
+ if (expression.operator === '&&') {
124
+ return (evaluate(expression.left, mergedContext) && evaluate(expression.right, mergedContext));
125
+ }
126
+ return binops[expression.operator](evaluate(expression.left, mergedContext), evaluate(expression.right, mergedContext));
127
+ case 'CallExpression': {
128
+ let caller;
129
+ let fn;
130
+ if (expression.callee.type === 'MemberExpression') {
131
+ const member = evaluateMember(expression.callee, mergedContext);
132
+ caller = member[0];
133
+ fn = member[1];
134
+ }
135
+ else {
136
+ fn = evaluate(expression.callee, mergedContext);
137
+ }
138
+ if (typeof fn !== 'function') {
139
+ return undefined;
140
+ }
141
+ return fn.apply(caller, evaluateArray(expression.arguments, mergedContext));
142
+ }
143
+ case 'ConditionalExpression':
144
+ return evaluate(expression.test, mergedContext)
145
+ ? evaluate(expression.consequent, mergedContext)
146
+ : evaluate(expression.alternate, mergedContext);
147
+ case 'Identifier':
148
+ return mergedContext[expression.name];
149
+ case 'Literal':
150
+ return expression.value;
151
+ case 'MemberExpression':
152
+ return evaluateMember(expression, mergedContext)[1];
153
+ case 'ThisExpression':
154
+ return mergedContext;
155
+ case 'UnaryExpression':
156
+ return unops[expression.operator](evaluate(expression.argument, mergedContext));
157
+ default:
158
+ return undefined;
159
+ }
160
+ }
161
+ /** Evaluates a nested expression using an already-merged context. */
162
+ function evaluate(node, context) {
163
+ return evaluateExpression(node, context);
164
+ }
165
+ /**
166
+ * Evaluates a parsed expression asynchronously.
167
+ *
168
+ * @param node - Expression AST to evaluate.
169
+ * @param context - Named values and functions available to the expression.
170
+ * @param options - Function libraries to add to the context.
171
+ * @returns The resolved expression value.
172
+ *
173
+ * @remarks
174
+ * Function calls are awaited, including calls nested inside arrays, member
175
+ * expressions, conditionals, unary expressions, and binary expressions.
176
+ */
177
+ // eslint-disable-next-line complexity
178
+ async function evaluateExpressionAsync(node, context, options) {
179
+ const expression = node;
180
+ const mergedContext = mergeFunctionLibraries(context, options);
181
+ switch (expression.type) {
182
+ case 'ArrayExpression':
183
+ return await evaluateArrayAsync(expression.elements, mergedContext);
184
+ case 'LogicalExpression':
185
+ case 'BinaryExpression':
186
+ if (expression.operator === '||') {
187
+ return ((await evaluateExpressionAsync(expression.left, mergedContext)) ||
188
+ (await evaluateExpressionAsync(expression.right, mergedContext)));
189
+ }
190
+ if (expression.operator === '&&') {
191
+ return ((await evaluateExpressionAsync(expression.left, mergedContext)) &&
192
+ (await evaluateExpressionAsync(expression.right, mergedContext)));
193
+ }
194
+ return binops[expression.operator](await evaluateExpressionAsync(expression.left, mergedContext), await evaluateExpressionAsync(expression.right, mergedContext));
195
+ case 'CallExpression': {
196
+ let caller;
197
+ let fn;
198
+ if (expression.callee.type === 'MemberExpression') {
199
+ const member = await evaluateMemberAsync(expression.callee, mergedContext);
200
+ caller = member[0];
201
+ fn = member[1];
202
+ }
203
+ else {
204
+ fn = (await evaluateExpressionAsync(expression.callee, mergedContext));
205
+ }
206
+ if (typeof fn !== 'function') {
207
+ return undefined;
208
+ }
209
+ return await fn.apply(caller, await evaluateArrayAsync(expression.arguments, mergedContext));
210
+ }
211
+ case 'ConditionalExpression':
212
+ return (await evaluateExpressionAsync(expression.test, mergedContext))
213
+ ? await evaluateExpressionAsync(expression.consequent, mergedContext)
214
+ : await evaluateExpressionAsync(expression.alternate, mergedContext);
215
+ case 'Identifier':
216
+ return mergedContext[expression.name];
217
+ case 'Literal':
218
+ return expression.value;
219
+ case 'MemberExpression':
220
+ return (await evaluateMemberAsync(expression, mergedContext))[1];
221
+ case 'ThisExpression':
222
+ return mergedContext;
223
+ case 'UnaryExpression':
224
+ return unops[expression.operator](await evaluateExpressionAsync(expression.argument, mergedContext));
225
+ default:
226
+ return undefined;
227
+ }
228
+ }
229
+ /**
230
+ * Compiles an expression into a reusable synchronous evaluator.
231
+ *
232
+ * @param expression - Expression source or a previously parsed AST.
233
+ * @param options - Function libraries to add to each evaluation context.
234
+ * @returns A function that evaluates the expression against a context.
235
+ */
236
+ export function compile(expression, options) {
237
+ const ast = parse(expression, options);
238
+ return (context) => evaluateWithDiagnostics(ast, context, options);
239
+ }
240
+ /**
241
+ * Compiles an expression into a reusable asynchronous evaluator.
242
+ *
243
+ * @param expression - Expression source or a previously parsed AST.
244
+ * @param options - Function libraries to add to each evaluation context.
245
+ * @returns A function that asynchronously evaluates the expression.
246
+ */
247
+ export function compileAsync(expression, options) {
248
+ const ast = parse(expression, options);
249
+ return (context) => evaluateAsync(ast, context, options);
250
+ }
251
+ /**
252
+ * Registers a custom unary operator with the parser and evaluator.
253
+ *
254
+ * @param operator - Operator token to register.
255
+ * @param fn - Evaluator implementation for the operator.
256
+ *
257
+ * @remarks
258
+ * Registration changes module-global parser state and affects subsequent
259
+ * calls to {@link parse}.
260
+ */
261
+ export function addUnaryOp(operator, fn) {
262
+ jsep.addUnaryOp(operator);
263
+ unops[operator] = fn;
264
+ }
265
+ /**
266
+ * Registers a custom binary operator with the parser and evaluator.
267
+ *
268
+ * @param operator - Operator token to register.
269
+ * @param precedenceOrFn - Parser precedence, or the evaluator implementation
270
+ * when using the default precedence for a built-in operator.
271
+ * @param fn - Evaluator implementation when an explicit precedence is given.
272
+ *
273
+ * @remarks
274
+ * Registration changes module-global parser state and affects subsequent
275
+ * calls to {@link parse}. New operators should provide explicit precedence.
276
+ */
277
+ export function addBinaryOp(operator, precedenceOrFn, fn) {
278
+ if (fn) {
279
+ jsep.addBinaryOp(operator, precedenceOrFn);
280
+ binops[operator] = fn;
281
+ return;
282
+ }
283
+ jsep.addBinaryOp(operator, DEFAULT_PRECEDENCE[operator] || 1);
284
+ binops[operator] = precedenceOrFn;
285
+ }
286
+ /**
287
+ * Parses expression source into a JSEP abstract syntax tree.
288
+ *
289
+ * @param expression - Expression source or an existing AST.
290
+ * @returns A parsed AST, or the supplied AST unchanged.
291
+ * @throws If the expression string is not valid JSEP syntax.
292
+ */
293
+ export function parse(expression, options) {
294
+ try {
295
+ return typeof expression === 'string' ? jsep(expression) : expression;
296
+ }
297
+ catch (error) {
298
+ reportDiagnosticError(options?.log, error);
299
+ throw error;
300
+ }
301
+ }
302
+ /**
303
+ * Evaluates a parsed expression synchronously.
304
+ *
305
+ * @param node - Expression AST to evaluate.
306
+ * @param context - Named values and functions available to the expression.
307
+ * @param options - Function libraries to add to the context.
308
+ * @returns The expression value.
309
+ */
310
+ function evaluateWithDiagnostics(node, context, options) {
311
+ try {
312
+ return evaluateExpression(node, context, options);
313
+ }
314
+ catch (error) {
315
+ reportDiagnosticError(options?.log, error);
316
+ throw error;
317
+ }
318
+ }
319
+ export { evaluateWithDiagnostics as evaluate };
320
+ /** Evaluates an expression asynchronously and reports errors to the supplied logger. */
321
+ export async function evaluateAsync(node, context, options) {
322
+ try {
323
+ return await evaluateExpressionAsync(node, context, options);
324
+ }
325
+ catch (error) {
326
+ reportDiagnosticError(options?.log, error);
327
+ throw error;
328
+ }
329
+ }
330
+ //# sourceMappingURL=expression-eval.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expression-eval.js","sourceRoot":"","sources":["../../src/expressions/expression-eval.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,0DAA0D;AAC1D,yDAAyD;AACzD,4DAA4D;AAC5D,gHAAgH;AAEhH;;;;GAIG;A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AAa,CACjC,IAA0B,EAC1B,OAA0B,EAC1B,OAAqC;IAErC,IAAI,CAAC;QACH,OAAO,MAAM,uBAAuB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,qBAAqB,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;QAC3C,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,63 @@
1
+ import type { DiagnosticLog } from "../diagnostic-log.js";
2
+ import type { ExpressionFunctionRegistry } from "./function-registry.js";
3
+ /**
4
+ * A function that can be exposed to evaluated expressions.
5
+ *
6
+ * @param args - Arguments supplied by a call expression.
7
+ * @returns The value made available to the expression.
8
+ */
9
+ export type ExpressionFunction = (...args: any[]) => any;
10
+ /**
11
+ * A named collection of functions that can be supplied to an expression
12
+ * evaluator through {@link ExpressionEvaluationOptions}.
13
+ */
14
+ export type ExpressionFunctionLibrary = Record<string, ExpressionFunction>;
15
+ /**
16
+ * Options shared by the synchronous and asynchronous expression evaluators.
17
+ */
18
+ export type ExpressionEvaluationOptions = {
19
+ /** Logs evaluation or compilation errors when supplied. */
20
+ log?: DiagnosticLog;
21
+ /**
22
+ * Instance-scoped registry of named functions available to the expression.
23
+ */
24
+ registry?: ExpressionFunctionRegistry;
25
+ /**
26
+ * Function libraries to add to the evaluation context.
27
+ *
28
+ * Libraries are merged from left to right. Functions in later libraries
29
+ * replace functions with the same name in earlier libraries. Values in the
30
+ * expression context replace functions with the same name in any library.
31
+ */
32
+ libraries?: ExpressionFunctionLibrary[];
33
+ };
34
+ /**
35
+ * General-purpose mathematical functions for expression evaluation.
36
+ *
37
+ * Includes JavaScript `Math` functions and math.gl helpers such as `clamp`,
38
+ * `lerp`, `normalizeAngle`, `safeMod`, `toDegrees`, and `toRadians`.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const evaluate = compile("clamp(sin(angle), 0, 1)", {
43
+ * libraries: [BASIC_MATH_FUNCTION_LIBRARY]
44
+ * });
45
+ * evaluate({angle: Math.PI / 2});
46
+ * ```
47
+ */
48
+ export declare const BASIC_MATH_FUNCTION_LIBRARY: ExpressionFunctionLibrary;
49
+ /**
50
+ /**
51
+ * Adds configured function libraries to an expression context.
52
+ *
53
+ * @param context - Values available to the expression.
54
+ * @param options - Function libraries to merge into the context.
55
+ * @returns The original context when no libraries are supplied, or a new
56
+ * context containing the libraries and context values.
57
+ *
58
+ * @remarks
59
+ * Libraries are merged from left to right, then overlaid with `context`.
60
+ * Registry functions have the lowest precedence. The input objects are not modified.
61
+ */
62
+ export declare function mergeFunctionLibraries(context: Record<string, unknown>, options?: ExpressionEvaluationOptions): Record<string, unknown>;
63
+ //# sourceMappingURL=function-libraries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"function-libraries.d.ts","sourceRoot":"","sources":["../../src/expressions/function-libraries.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,aAAa,EAAC,6BAA0B;AAWrD,OAAO,KAAK,EAAC,0BAA0B,EAAC,+BAA4B;AAEpE;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAEzD;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC,2DAA2D;IAC3D,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,0BAA0B,CAAC;IAEtC;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,yBAAyB,EAAE,CAAC;CACzC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,2BAA2B,EAAE,yBA2BzC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,CAAC,EAAE,2BAA2B,GACpC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAazB"}
@@ -0,0 +1,69 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return */
5
+ import { clamp, degrees, lerp, normalizeAngle, radians, safeMod, toDegrees, toRadians } from '@math.gl/core';
6
+ /**
7
+ * General-purpose mathematical functions for expression evaluation.
8
+ *
9
+ * Includes JavaScript `Math` functions and math.gl helpers such as `clamp`,
10
+ * `lerp`, `normalizeAngle`, `safeMod`, `toDegrees`, and `toRadians`.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const evaluate = compile("clamp(sin(angle), 0, 1)", {
15
+ * libraries: [BASIC_MATH_FUNCTION_LIBRARY]
16
+ * });
17
+ * evaluate({angle: Math.PI / 2});
18
+ * ```
19
+ */
20
+ export const BASIC_MATH_FUNCTION_LIBRARY = {
21
+ abs: Math.abs,
22
+ acos: Math.acos,
23
+ asin: Math.asin,
24
+ atan: Math.atan,
25
+ ceil: Math.ceil,
26
+ clamp,
27
+ cos: Math.cos,
28
+ degrees,
29
+ exp: Math.exp,
30
+ floor: Math.floor,
31
+ lerp,
32
+ log: Math.log,
33
+ max: Math.max,
34
+ min: Math.min,
35
+ normalizeAngle,
36
+ pow: Math.pow,
37
+ radians,
38
+ round: Math.round,
39
+ safeMod,
40
+ sign: Math.sign,
41
+ sin: Math.sin,
42
+ sqrt: Math.sqrt,
43
+ tan: Math.tan,
44
+ toDegrees,
45
+ toRadians,
46
+ trunc: Math.trunc
47
+ };
48
+ /**
49
+ /**
50
+ * Adds configured function libraries to an expression context.
51
+ *
52
+ * @param context - Values available to the expression.
53
+ * @param options - Function libraries to merge into the context.
54
+ * @returns The original context when no libraries are supplied, or a new
55
+ * context containing the libraries and context values.
56
+ *
57
+ * @remarks
58
+ * Libraries are merged from left to right, then overlaid with `context`.
59
+ * Registry functions have the lowest precedence. The input objects are not modified.
60
+ */
61
+ export function mergeFunctionLibraries(context, options) {
62
+ if (!options?.libraries?.length) {
63
+ if (!options?.registry) {
64
+ return context;
65
+ }
66
+ }
67
+ return Object.assign({}, options.registry?.getFunctionTable(), ...(options.libraries || []), context);
68
+ }
69
+ //# sourceMappingURL=function-libraries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"function-libraries.js","sourceRoot":"","sources":["../../src/expressions/function-libraries.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAC5D,4FAA4F;AAG5F,OAAO,EACL,KAAK,EACL,OAAO,EACP,IAAI,EACJ,cAAc,EACd,OAAO,EACP,OAAO,EACP,SAAS,EACT,SAAS,EACV,MAAM,eAAe,CAAC;AAsCvB;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAA8B;IACpE,GAAG,EAAE,IAAI,CAAC,GAAG;IACb,IAAI,EAAE,IAAI,CAAC,IAAI;IACf,IAAI,EAAE,IAAI,CAAC,IAAI;IACf,IAAI,EAAE,IAAI,CAAC,IAAI;IACf,IAAI,EAAE,IAAI,CAAC,IAAI;IACf,KAAK;IACL,GAAG,EAAE,IAAI,CAAC,GAAG;IACb,OAAO;IACP,GAAG,EAAE,IAAI,CAAC,GAAG;IACb,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,IAAI;IACJ,GAAG,EAAE,IAAI,CAAC,GAAG;IACb,GAAG,EAAE,IAAI,CAAC,GAAG;IACb,GAAG,EAAE,IAAI,CAAC,GAAG;IACb,cAAc;IACd,GAAG,EAAE,IAAI,CAAC,GAAG;IACb,OAAO;IACP,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,OAAO;IACP,IAAI,EAAE,IAAI,CAAC,IAAI;IACf,GAAG,EAAE,IAAI,CAAC,GAAG;IACb,IAAI,EAAE,IAAI,CAAC,IAAI;IACf,GAAG,EAAE,IAAI,CAAC,GAAG;IACb,SAAS;IACT,SAAS;IACT,KAAK,EAAE,IAAI,CAAC,KAAK;CAClB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,sBAAsB,CACpC,OAAgC,EAChC,OAAqC;IAErC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QAChC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;YACvB,OAAO,OAAO,CAAC;QACjB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAClB,EAAE,EACF,OAAO,CAAC,QAAQ,EAAE,gBAAgB,EAAE,EACpC,GAAG,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,EAC5B,OAAO,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,93 @@
1
+ import type { ExpressionFunction, ExpressionFunctionLibrary } from "./function-libraries.js";
2
+ /**
3
+ * Options for registering functions with an {@link ExpressionFunctionRegistry}.
4
+ */
5
+ export type FunctionRegistrationOptions = {
6
+ /**
7
+ * Replace an existing function with the same name.
8
+ *
9
+ * @defaultValue false
10
+ */
11
+ replace?: boolean;
12
+ };
13
+ /**
14
+ * An isolated collection of named functions available to expression evaluators.
15
+ *
16
+ * @remarks
17
+ * Registries are instance scoped. Registering a function does not affect other
18
+ * registries or evaluators that do not receive the registry.
19
+ *
20
+ * Function names must be valid JavaScript-style identifiers so they can be
21
+ * called directly from JSEP expressions.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const registry = new ExpressionFunctionRegistry()
26
+ * .registerFunction('double', (value) => value * 2)
27
+ * .registerFunctions(BASIC_MATH_FUNCTION_LIBRARY);
28
+ *
29
+ * const evaluate = compile('double(round(value))', {registry});
30
+ * evaluate({value: 2.4});
31
+ * ```
32
+ */
33
+ export declare class ExpressionFunctionRegistry {
34
+ private readonly functions;
35
+ /**
36
+ * Creates a function registry.
37
+ *
38
+ * @param functionTables - Function tables to register in order.
39
+ * @throws If a table contains an invalid or duplicate function name.
40
+ */
41
+ constructor(functionTables?: readonly ExpressionFunctionLibrary[]);
42
+ /**
43
+ * Registers one named function.
44
+ *
45
+ * @param name - Identifier used to call the function from an expression.
46
+ * @param fn - JavaScript function invoked with evaluated expression arguments.
47
+ * @param options - Duplicate registration behavior.
48
+ * @returns This registry.
49
+ * @throws If the name is invalid, the value is not a function, or the name is
50
+ * already registered and replacement was not requested.
51
+ */
52
+ registerFunction(name: string, fn: ExpressionFunction, options?: FunctionRegistrationOptions): this;
53
+ /**
54
+ * Registers all entries in a function table.
55
+ *
56
+ * @param functionTable - Map from expression identifiers to JavaScript functions.
57
+ * @param options - Duplicate registration behavior.
58
+ * @returns This registry.
59
+ * @throws If any entry is invalid or conflicts with an existing registration.
60
+ *
61
+ * @remarks
62
+ * Validation is atomic: no entries are registered when any entry is invalid.
63
+ */
64
+ registerFunctions(functionTable: ExpressionFunctionLibrary, options?: FunctionRegistrationOptions): this;
65
+ /**
66
+ * Removes a registered function.
67
+ *
68
+ * @param name - Function name to remove.
69
+ * @returns `true` when a function was removed.
70
+ */
71
+ unregisterFunction(name: string): boolean;
72
+ /**
73
+ * Tests whether a function is registered.
74
+ *
75
+ * @param name - Function name to inspect.
76
+ * @returns `true` when the registry contains the name.
77
+ */
78
+ hasFunction(name: string): boolean;
79
+ /**
80
+ * Returns a registered function.
81
+ *
82
+ * @param name - Function name to retrieve.
83
+ * @returns The registered function, or `undefined`.
84
+ */
85
+ getFunction(name: string): ExpressionFunction | undefined;
86
+ /**
87
+ * Returns an immutable snapshot of all registered functions.
88
+ *
89
+ * @returns A frozen function table.
90
+ */
91
+ getFunctionTable(): Readonly<ExpressionFunctionLibrary>;
92
+ }
93
+ //# sourceMappingURL=function-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"function-registry.d.ts","sourceRoot":"","sources":["../../src/expressions/function-registry.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,kBAAkB,EAAE,yBAAyB,EAAC,gCAA6B;AAaxF;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,0BAA0B;IACrC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoD;IAE9E;;;;;OAKG;gBACS,cAAc,GAAE,SAAS,yBAAyB,EAAO;IAMrE;;;;;;;;;OASG;IACH,gBAAgB,CACd,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,kBAAkB,EACtB,OAAO,GAAE,2BAAgC,GACxC,IAAI;IASP;;;;;;;;;;OAUG;IACH,iBAAiB,CACf,aAAa,EAAE,yBAAyB,EACxC,OAAO,GAAE,2BAAgC,GACxC,IAAI;IAkBP;;;;;OAKG;IACH,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAOzC;;;;;OAKG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIlC;;;;;OAKG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAIzD;;;;OAIG;IACH,gBAAgB,IAAI,QAAQ,CAAC,yBAAyB,CAAC;CAGxD"}