toiljs 0.0.4 → 0.0.5

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 (359) hide show
  1. package/.idea/prettier.xml +1 -0
  2. package/as-pect.config.js +1 -1
  3. package/build/backend/.tsbuildinfo +1 -1
  4. package/build/backend/index.js +1 -2
  5. package/build/cli/.tsbuildinfo +1 -1
  6. package/build/cli/configure.d.ts +15 -0
  7. package/build/cli/configure.js +201 -0
  8. package/build/cli/create.d.ts +4 -0
  9. package/build/cli/create.js +168 -57
  10. package/build/cli/features.d.ts +23 -0
  11. package/build/cli/features.js +85 -0
  12. package/build/cli/index.js +42 -2
  13. package/build/cli/proc.d.ts +1 -0
  14. package/build/cli/proc.js +11 -0
  15. package/build/cli/ui.js +1 -2
  16. package/build/cli/validate.d.ts +4 -0
  17. package/build/cli/validate.js +19 -0
  18. package/build/client/.tsbuildinfo +1 -1
  19. package/build/client/Link.d.ts +8 -0
  20. package/build/client/Link.js +44 -0
  21. package/build/client/NavLink.d.ts +14 -0
  22. package/build/client/NavLink.js +37 -0
  23. package/build/client/Router.d.ts +7 -0
  24. package/build/client/Router.js +55 -0
  25. package/build/client/error-boundary.d.ts +16 -0
  26. package/build/client/error-boundary.js +19 -0
  27. package/build/client/head.d.ts +26 -0
  28. package/build/client/head.js +87 -0
  29. package/build/client/hooks.d.ts +17 -0
  30. package/build/client/hooks.js +48 -0
  31. package/build/client/index.d.ts +14 -2
  32. package/build/client/index.js +8 -1
  33. package/build/client/lazy.d.ts +16 -0
  34. package/build/client/lazy.js +53 -0
  35. package/build/client/match.js +7 -0
  36. package/build/client/mount.d.ts +2 -0
  37. package/build/client/mount.js +13 -0
  38. package/build/client/navigation.d.ts +13 -0
  39. package/build/client/navigation.js +97 -0
  40. package/build/client/params-context.d.ts +2 -0
  41. package/build/client/params-context.js +2 -0
  42. package/build/client/prefetch.d.ts +11 -0
  43. package/build/client/prefetch.js +100 -0
  44. package/build/client/scroll.d.ts +8 -0
  45. package/build/client/scroll.js +36 -0
  46. package/build/client/types.d.ts +27 -0
  47. package/build/client/types.js +1 -0
  48. package/build/compiler/.tsbuildinfo +1 -1
  49. package/build/compiler/config.d.ts +2 -0
  50. package/build/compiler/config.js +4 -1
  51. package/build/compiler/docs.d.ts +10 -0
  52. package/build/compiler/docs.js +59 -0
  53. package/build/compiler/generate.js +134 -16
  54. package/build/compiler/index.d.ts +4 -2
  55. package/build/compiler/index.js +4 -3
  56. package/build/compiler/plugin.js +2 -1
  57. package/build/compiler/routes.js +5 -1
  58. package/build/compiler/vite.d.ts +1 -1
  59. package/build/compiler/vite.js +17 -1
  60. package/build/io/.tsbuildinfo +1 -1
  61. package/build/io/BinaryWriter.js +2 -2
  62. package/eslint.config.js +1 -1
  63. package/examples/basic/.toil/docs/cli.md +3 -0
  64. package/examples/basic/.toil/docs/client.md +3 -0
  65. package/examples/basic/.toil/docs/index.md +3 -0
  66. package/examples/basic/.toil/docs/routing.md +3 -0
  67. package/examples/basic/.toil/docs/server.md +3 -0
  68. package/examples/basic/.toil/docs/styling.md +3 -0
  69. package/examples/basic/.toil/entry.tsx +3 -8
  70. package/examples/basic/.toil/globals.ts +6 -0
  71. package/examples/basic/.toil/index.html +16 -12
  72. package/examples/basic/.toil/public/images/.gitkeep +1 -0
  73. package/examples/basic/.toil/public/images/logo.svg +37 -0
  74. package/examples/basic/.toil/public/robots.txt +2 -0
  75. package/examples/basic/.toil/routes.ts +9 -7
  76. package/examples/basic/build/client/assets/404-Bq0jNTUo.js +1 -0
  77. package/examples/basic/build/client/assets/_...slug_-CXKf6qnB.js +1 -0
  78. package/examples/basic/build/client/assets/_id_-BadAyQnb.js +1 -0
  79. package/examples/basic/build/client/assets/about-BOhoEcEO.js +1 -0
  80. package/examples/basic/build/client/assets/get-started-BIXpcjkT.js +9 -0
  81. package/examples/basic/build/client/assets/index-BmqcTaBB.js +1 -0
  82. package/examples/basic/build/client/assets/io-DEVjjaJj.js +1 -0
  83. package/examples/basic/build/client/assets/layout-DJegirdz.js +1 -0
  84. package/examples/basic/build/client/assets/react-DEQrz1q7.js +9 -0
  85. package/examples/basic/build/client/assets/rolldown-runtime-KL5VtC6j.js +1 -0
  86. package/examples/basic/build/client/assets/routes-BYWn6TxK.js +1 -0
  87. package/examples/basic/build/client/css/style.css +2 -0
  88. package/examples/basic/build/client/images/.gitkeep +1 -0
  89. package/examples/basic/build/client/images/logo.svg +37 -0
  90. package/examples/basic/build/client/index.html +17 -0
  91. package/examples/basic/build/client/robots.txt +2 -0
  92. package/examples/basic/client/404.tsx +2 -5
  93. package/examples/basic/client/components/.gitkeep +1 -0
  94. package/examples/basic/client/components/Footer.tsx +8 -0
  95. package/examples/basic/client/layout.tsx +39 -26
  96. package/examples/basic/client/public/images/.gitkeep +1 -0
  97. package/examples/basic/client/public/images/logo.svg +37 -0
  98. package/examples/basic/client/public/index.html +15 -0
  99. package/examples/basic/client/public/robots.txt +2 -0
  100. package/examples/basic/client/routes/about.tsx +1 -3
  101. package/examples/basic/client/routes/blog/[id].tsx +2 -4
  102. package/examples/basic/client/routes/docs/[...slug].tsx +3 -6
  103. package/examples/basic/client/routes/get-started.tsx +84 -0
  104. package/examples/basic/client/routes/index.tsx +74 -7
  105. package/examples/basic/client/routes/io.tsx +3 -7
  106. package/examples/basic/client/styles/main.css +461 -0
  107. package/examples/basic/client/toil.tsx +7 -0
  108. package/examples/basic/node_modules/.bin/toilinit +16 -0
  109. package/examples/basic/node_modules/.bin/toilinit.cmd +17 -0
  110. package/examples/basic/node_modules/.bin/toilinit.ps1 +28 -0
  111. package/examples/basic/node_modules/.bin/toilscript +16 -0
  112. package/examples/basic/node_modules/.bin/toilscript.cmd +17 -0
  113. package/examples/basic/node_modules/.bin/toilscript.ps1 +28 -0
  114. package/examples/basic/node_modules/.bin/wasm-as +16 -0
  115. package/examples/basic/node_modules/.bin/wasm-as.cmd +17 -0
  116. package/examples/basic/node_modules/.bin/wasm-as.ps1 +28 -0
  117. package/examples/basic/node_modules/.bin/wasm-ctor-eval +16 -0
  118. package/examples/basic/node_modules/.bin/wasm-ctor-eval.cmd +17 -0
  119. package/examples/basic/node_modules/.bin/wasm-ctor-eval.ps1 +28 -0
  120. package/examples/basic/node_modules/.bin/wasm-dis +16 -0
  121. package/examples/basic/node_modules/.bin/wasm-dis.cmd +17 -0
  122. package/examples/basic/node_modules/.bin/wasm-dis.ps1 +28 -0
  123. package/examples/basic/node_modules/.bin/wasm-merge +16 -0
  124. package/examples/basic/node_modules/.bin/wasm-merge.cmd +17 -0
  125. package/examples/basic/node_modules/.bin/wasm-merge.ps1 +28 -0
  126. package/examples/basic/node_modules/.bin/wasm-metadce +16 -0
  127. package/examples/basic/node_modules/.bin/wasm-metadce.cmd +17 -0
  128. package/examples/basic/node_modules/.bin/wasm-metadce.ps1 +28 -0
  129. package/examples/basic/node_modules/.bin/wasm-opt +16 -0
  130. package/examples/basic/node_modules/.bin/wasm-opt.cmd +17 -0
  131. package/examples/basic/node_modules/.bin/wasm-opt.ps1 +28 -0
  132. package/examples/basic/node_modules/.bin/wasm-reduce +16 -0
  133. package/examples/basic/node_modules/.bin/wasm-reduce.cmd +17 -0
  134. package/examples/basic/node_modules/.bin/wasm-reduce.ps1 +28 -0
  135. package/examples/basic/node_modules/.bin/wasm-shell +16 -0
  136. package/examples/basic/node_modules/.bin/wasm-shell.cmd +17 -0
  137. package/examples/basic/node_modules/.bin/wasm-shell.ps1 +28 -0
  138. package/examples/basic/node_modules/.bin/wasm2js +16 -0
  139. package/examples/basic/node_modules/.bin/wasm2js.cmd +17 -0
  140. package/examples/basic/node_modules/.bin/wasm2js.ps1 +28 -0
  141. package/examples/basic/node_modules/.package-lock.json +49 -1
  142. package/examples/basic/node_modules/.vite/deps/_metadata.json +9 -9
  143. package/examples/basic/node_modules/binaryen/LICENSE +201 -0
  144. package/examples/basic/node_modules/binaryen/README.md +1362 -0
  145. package/examples/basic/node_modules/binaryen/bin/package.json +3 -0
  146. package/examples/basic/node_modules/binaryen/bin/wasm-as +0 -0
  147. package/examples/basic/node_modules/binaryen/bin/wasm-ctor-eval +0 -0
  148. package/examples/basic/node_modules/binaryen/bin/wasm-dis +0 -0
  149. package/examples/basic/node_modules/binaryen/bin/wasm-merge +0 -0
  150. package/examples/basic/node_modules/binaryen/bin/wasm-metadce +0 -0
  151. package/examples/basic/node_modules/binaryen/bin/wasm-opt +0 -0
  152. package/examples/basic/node_modules/binaryen/bin/wasm-reduce +0 -0
  153. package/examples/basic/node_modules/binaryen/bin/wasm-shell +0 -0
  154. package/examples/basic/node_modules/binaryen/bin/wasm2js +0 -0
  155. package/examples/basic/node_modules/binaryen/index.d.ts +2371 -0
  156. package/examples/basic/node_modules/binaryen/index.js +30552 -0
  157. package/examples/basic/node_modules/binaryen/package.json +50 -0
  158. package/examples/basic/node_modules/long/LICENSE +202 -0
  159. package/examples/basic/node_modules/long/README.md +286 -0
  160. package/examples/basic/node_modules/long/index.d.ts +2 -0
  161. package/examples/basic/node_modules/long/index.js +1581 -0
  162. package/examples/basic/node_modules/long/package.json +58 -0
  163. package/examples/basic/node_modules/long/types.d.ts +474 -0
  164. package/examples/basic/node_modules/long/umd/index.d.ts +3 -0
  165. package/examples/basic/node_modules/long/umd/index.js +1622 -0
  166. package/examples/basic/node_modules/long/umd/package.json +3 -0
  167. package/examples/basic/node_modules/long/umd/types.d.ts +474 -0
  168. package/examples/basic/node_modules/toilscript/LICENSE +201 -0
  169. package/examples/basic/node_modules/toilscript/NOTICE +94 -0
  170. package/examples/basic/node_modules/toilscript/README.md +66 -0
  171. package/examples/basic/node_modules/toilscript/bin/toilinit.js +468 -0
  172. package/examples/basic/node_modules/toilscript/bin/toilscript.js +35 -0
  173. package/examples/basic/node_modules/toilscript/dist/cli.d.ts +4 -0
  174. package/examples/basic/node_modules/toilscript/dist/cli.generated.d.ts +10027 -0
  175. package/examples/basic/node_modules/toilscript/dist/cli.js +24474 -0
  176. package/examples/basic/node_modules/toilscript/dist/cli.js.map +7 -0
  177. package/examples/basic/node_modules/toilscript/dist/importmap.json +9 -0
  178. package/examples/basic/node_modules/toilscript/dist/toilscript.d.ts +4 -0
  179. package/examples/basic/node_modules/toilscript/dist/toilscript.generated.d.ts +11242 -0
  180. package/examples/basic/node_modules/toilscript/dist/toilscript.js +337 -0
  181. package/examples/basic/node_modules/toilscript/dist/toilscript.js.map +7 -0
  182. package/examples/basic/node_modules/toilscript/dist/transform.cjs +1 -0
  183. package/examples/basic/node_modules/toilscript/dist/transform.d.ts +1 -0
  184. package/examples/basic/node_modules/toilscript/dist/transform.js +1 -0
  185. package/examples/basic/node_modules/toilscript/dist/web.js +22 -0
  186. package/examples/basic/node_modules/toilscript/lib/binaryen.d.ts +2 -0
  187. package/examples/basic/node_modules/toilscript/lib/binaryen.js +2 -0
  188. package/examples/basic/node_modules/toilscript/package.json +115 -0
  189. package/examples/basic/node_modules/toilscript/std/README.md +6 -0
  190. package/examples/basic/node_modules/toilscript/std/assembly/array.ts +550 -0
  191. package/examples/basic/node_modules/toilscript/std/assembly/arraybuffer.ts +77 -0
  192. package/examples/basic/node_modules/toilscript/std/assembly/atomics.ts +127 -0
  193. package/examples/basic/node_modules/toilscript/std/assembly/bindings/asyncify.ts +16 -0
  194. package/examples/basic/node_modules/toilscript/std/assembly/bindings/dom.ts +291 -0
  195. package/examples/basic/node_modules/toilscript/std/assembly/bindings/node.ts +6 -0
  196. package/examples/basic/node_modules/toilscript/std/assembly/bitflags.ts +53 -0
  197. package/examples/basic/node_modules/toilscript/std/assembly/builtins.ts +2650 -0
  198. package/examples/basic/node_modules/toilscript/std/assembly/byteslice.ts +177 -0
  199. package/examples/basic/node_modules/toilscript/std/assembly/compat.ts +2 -0
  200. package/examples/basic/node_modules/toilscript/std/assembly/console.ts +42 -0
  201. package/examples/basic/node_modules/toilscript/std/assembly/crypto.ts +9 -0
  202. package/examples/basic/node_modules/toilscript/std/assembly/dataview.ts +181 -0
  203. package/examples/basic/node_modules/toilscript/std/assembly/date.ts +375 -0
  204. package/examples/basic/node_modules/toilscript/std/assembly/diagnostics.ts +11 -0
  205. package/examples/basic/node_modules/toilscript/std/assembly/encoding.ts +151 -0
  206. package/examples/basic/node_modules/toilscript/std/assembly/endian.ts +45 -0
  207. package/examples/basic/node_modules/toilscript/std/assembly/error.ts +44 -0
  208. package/examples/basic/node_modules/toilscript/std/assembly/fixedarray.ts +173 -0
  209. package/examples/basic/node_modules/toilscript/std/assembly/fixedmap.ts +326 -0
  210. package/examples/basic/node_modules/toilscript/std/assembly/fixedset.ts +275 -0
  211. package/examples/basic/node_modules/toilscript/std/assembly/function.ts +42 -0
  212. package/examples/basic/node_modules/toilscript/std/assembly/index.d.ts +2892 -0
  213. package/examples/basic/node_modules/toilscript/std/assembly/iterator.ts +35 -0
  214. package/examples/basic/node_modules/toilscript/std/assembly/map.ts +269 -0
  215. package/examples/basic/node_modules/toilscript/std/assembly/math.ts +3289 -0
  216. package/examples/basic/node_modules/toilscript/std/assembly/memory.ts +123 -0
  217. package/examples/basic/node_modules/toilscript/std/assembly/number.ts +388 -0
  218. package/examples/basic/node_modules/toilscript/std/assembly/object.ts +36 -0
  219. package/examples/basic/node_modules/toilscript/std/assembly/performance.ts +9 -0
  220. package/examples/basic/node_modules/toilscript/std/assembly/pointer.ts +80 -0
  221. package/examples/basic/node_modules/toilscript/std/assembly/polyfills.ts +27 -0
  222. package/examples/basic/node_modules/toilscript/std/assembly/process.ts +50 -0
  223. package/examples/basic/node_modules/toilscript/std/assembly/reference.ts +48 -0
  224. package/examples/basic/node_modules/toilscript/std/assembly/regexp.ts +12 -0
  225. package/examples/basic/node_modules/toilscript/std/assembly/rt/README.md +83 -0
  226. package/examples/basic/node_modules/toilscript/std/assembly/rt/common.ts +81 -0
  227. package/examples/basic/node_modules/toilscript/std/assembly/rt/index-incremental.ts +2 -0
  228. package/examples/basic/node_modules/toilscript/std/assembly/rt/index-memory.ts +1 -0
  229. package/examples/basic/node_modules/toilscript/std/assembly/rt/index-minimal.ts +2 -0
  230. package/examples/basic/node_modules/toilscript/std/assembly/rt/index-stub.ts +1 -0
  231. package/examples/basic/node_modules/toilscript/std/assembly/rt/index.d.ts +37 -0
  232. package/examples/basic/node_modules/toilscript/std/assembly/rt/itcms.ts +419 -0
  233. package/examples/basic/node_modules/toilscript/std/assembly/rt/memory-runtime.ts +94 -0
  234. package/examples/basic/node_modules/toilscript/std/assembly/rt/rtrace.ts +15 -0
  235. package/examples/basic/node_modules/toilscript/std/assembly/rt/stub.ts +133 -0
  236. package/examples/basic/node_modules/toilscript/std/assembly/rt/tcms.ts +254 -0
  237. package/examples/basic/node_modules/toilscript/std/assembly/rt/tlsf.ts +592 -0
  238. package/examples/basic/node_modules/toilscript/std/assembly/rt.ts +90 -0
  239. package/examples/basic/node_modules/toilscript/std/assembly/set.ts +225 -0
  240. package/examples/basic/node_modules/toilscript/std/assembly/shared/feature.ts +68 -0
  241. package/examples/basic/node_modules/toilscript/std/assembly/shared/runtime.ts +13 -0
  242. package/examples/basic/node_modules/toilscript/std/assembly/shared/target.ts +11 -0
  243. package/examples/basic/node_modules/toilscript/std/assembly/shared/tsconfig.json +11 -0
  244. package/examples/basic/node_modules/toilscript/std/assembly/shared/typeinfo.ts +72 -0
  245. package/examples/basic/node_modules/toilscript/std/assembly/staticarray.ts +423 -0
  246. package/examples/basic/node_modules/toilscript/std/assembly/string.ts +850 -0
  247. package/examples/basic/node_modules/toilscript/std/assembly/symbol.ts +114 -0
  248. package/examples/basic/node_modules/toilscript/std/assembly/table.ts +16 -0
  249. package/examples/basic/node_modules/toilscript/std/assembly/toilscript.ts +16 -0
  250. package/examples/basic/node_modules/toilscript/std/assembly/tsconfig.json +6 -0
  251. package/examples/basic/node_modules/toilscript/std/assembly/typedarray.ts +1954 -0
  252. package/examples/basic/node_modules/toilscript/std/assembly/uri.ts +17 -0
  253. package/examples/basic/node_modules/toilscript/std/assembly/util/bytes.ts +107 -0
  254. package/examples/basic/node_modules/toilscript/std/assembly/util/casemap.ts +497 -0
  255. package/examples/basic/node_modules/toilscript/std/assembly/util/error.ts +58 -0
  256. package/examples/basic/node_modules/toilscript/std/assembly/util/hash.ts +117 -0
  257. package/examples/basic/node_modules/toilscript/std/assembly/util/math.ts +1922 -0
  258. package/examples/basic/node_modules/toilscript/std/assembly/util/memory.ts +290 -0
  259. package/examples/basic/node_modules/toilscript/std/assembly/util/number.ts +873 -0
  260. package/examples/basic/node_modules/toilscript/std/assembly/util/sort.ts +313 -0
  261. package/examples/basic/node_modules/toilscript/std/assembly/util/string.ts +1202 -0
  262. package/examples/basic/node_modules/toilscript/std/assembly/util/uri.ts +275 -0
  263. package/examples/basic/node_modules/toilscript/std/assembly/vector.ts +4 -0
  264. package/examples/basic/node_modules/toilscript/std/assembly.json +16 -0
  265. package/examples/basic/node_modules/toilscript/std/portable/index.d.ts +461 -0
  266. package/examples/basic/node_modules/toilscript/std/portable/index.js +416 -0
  267. package/examples/basic/node_modules/toilscript/std/portable.json +11 -0
  268. package/examples/basic/node_modules/toilscript/std/types/assembly/index.d.ts +1 -0
  269. package/examples/basic/node_modules/toilscript/std/types/assembly/package.json +3 -0
  270. package/examples/basic/node_modules/toilscript/std/types/portable/index.d.ts +1 -0
  271. package/examples/basic/node_modules/toilscript/std/types/portable/package.json +3 -0
  272. package/examples/basic/node_modules/toilscript/tsconfig-base.json +13 -0
  273. package/examples/basic/node_modules/toilscript/util/README.md +23 -0
  274. package/examples/basic/node_modules/toilscript/util/browser/fs.js +1 -0
  275. package/examples/basic/node_modules/toilscript/util/browser/module.js +5 -0
  276. package/examples/basic/node_modules/toilscript/util/browser/path.js +520 -0
  277. package/examples/basic/node_modules/toilscript/util/browser/process.js +59 -0
  278. package/examples/basic/node_modules/toilscript/util/browser/url.js +23 -0
  279. package/examples/basic/node_modules/toilscript/util/cpu.d.ts +9 -0
  280. package/examples/basic/node_modules/toilscript/util/cpu.js +42 -0
  281. package/examples/basic/node_modules/toilscript/util/find.d.ts +6 -0
  282. package/examples/basic/node_modules/toilscript/util/find.js +20 -0
  283. package/examples/basic/node_modules/toilscript/util/node.d.ts +21 -0
  284. package/examples/basic/node_modules/toilscript/util/node.js +34 -0
  285. package/examples/basic/node_modules/toilscript/util/options.d.ts +70 -0
  286. package/examples/basic/node_modules/toilscript/util/options.js +262 -0
  287. package/examples/basic/node_modules/toilscript/util/terminal.d.ts +52 -0
  288. package/examples/basic/node_modules/toilscript/util/terminal.js +35 -0
  289. package/examples/basic/node_modules/toilscript/util/text.d.ts +26 -0
  290. package/examples/basic/node_modules/toilscript/util/text.js +114 -0
  291. package/examples/basic/node_modules/toilscript/util/tsconfig.json +9 -0
  292. package/examples/basic/node_modules/toilscript/util/web.d.ts +11 -0
  293. package/examples/basic/node_modules/toilscript/util/web.js +33 -0
  294. package/examples/basic/package-lock.json +50 -1
  295. package/examples/basic/package.json +5 -2
  296. package/examples/basic/server/index.ts +3 -0
  297. package/examples/basic/server/main.ts +6 -0
  298. package/examples/basic/server/tsconfig.json +7 -0
  299. package/examples/basic/toil-env.d.ts +20 -1
  300. package/examples/basic/toil.config.ts +2 -5
  301. package/examples/basic/toilconfig.json +30 -0
  302. package/package.json +1 -1
  303. package/presets/eslint.js +2 -7
  304. package/presets/no-uint8array-tostring.js +4 -5
  305. package/presets/prettier.json +8 -1
  306. package/src/backend/index.ts +11 -18
  307. package/src/cli/configure.ts +272 -0
  308. package/src/cli/create.ts +227 -69
  309. package/src/cli/features.ts +128 -0
  310. package/src/cli/index.ts +44 -3
  311. package/src/cli/proc.ts +20 -0
  312. package/src/cli/ui.ts +4 -6
  313. package/src/cli/validate.ts +31 -0
  314. package/src/client/Link.tsx +99 -0
  315. package/src/client/NavLink.tsx +86 -0
  316. package/src/client/Router.tsx +95 -0
  317. package/src/client/error-boundary.tsx +43 -0
  318. package/src/client/head.ts +140 -0
  319. package/src/client/hooks.ts +115 -0
  320. package/src/client/index.ts +35 -5
  321. package/src/client/lazy.ts +93 -0
  322. package/src/client/match.ts +11 -3
  323. package/src/client/mount.tsx +28 -0
  324. package/src/client/navigation.ts +142 -0
  325. package/src/client/params-context.ts +10 -0
  326. package/src/client/prefetch.ts +130 -0
  327. package/src/client/scroll.ts +53 -0
  328. package/src/client/types.ts +36 -0
  329. package/src/compiler/config.ts +15 -8
  330. package/src/compiler/docs.ts +87 -0
  331. package/src/compiler/generate.ts +164 -23
  332. package/src/compiler/index.ts +6 -4
  333. package/src/compiler/plugin.ts +3 -1
  334. package/src/compiler/routes.ts +13 -7
  335. package/src/compiler/vite.ts +28 -5
  336. package/src/io/BinaryReader.ts +1 -5
  337. package/src/io/BinaryWriter.ts +3 -3
  338. package/src/server/index.ts +3 -4
  339. package/src/server/tsconfig.json +4 -0
  340. package/test/configure.test.ts +90 -0
  341. package/test/features.test.ts +111 -0
  342. package/test/head.test.ts +35 -0
  343. package/test/io.test.ts +8 -0
  344. package/test/navlink.test.ts +28 -0
  345. package/test/routes.test.ts +15 -0
  346. package/test/validate.test.ts +42 -0
  347. package/vitest.config.ts +1 -1
  348. package/examples/basic/dist/assets/404-D1bS2aH_.js +0 -1
  349. package/examples/basic/dist/assets/_...slug_-wR3shlWn.js +0 -1
  350. package/examples/basic/dist/assets/_id_-EWYvHfi2.js +0 -1
  351. package/examples/basic/dist/assets/about-Ddvj1tjF.js +0 -1
  352. package/examples/basic/dist/assets/index-CdG0me90.js +0 -1
  353. package/examples/basic/dist/assets/io-CODNJU57.js +0 -1
  354. package/examples/basic/dist/assets/layout-C15ZTPYI.js +0 -1
  355. package/examples/basic/dist/assets/react-JbAfoxYe.js +0 -9
  356. package/examples/basic/dist/assets/rolldown-runtime-1VNLd2iN.js +0 -1
  357. package/examples/basic/dist/assets/routes-GoydenoY.js +0 -1
  358. package/examples/basic/dist/index.html +0 -12
  359. package/src/client/runtime.tsx +0 -190
@@ -0,0 +1,2371 @@
1
+ declare module binaryen {
2
+
3
+ type Type = number;
4
+ type PackedType = number;
5
+ type HeapType = number;
6
+
7
+ const none: Type;
8
+
9
+ const i32: Type;
10
+ const i64: Type;
11
+ const f32: Type;
12
+ const f64: Type;
13
+ const v128: Type;
14
+
15
+ const funcref: Type;
16
+ const externref: Type;
17
+ const anyref: Type;
18
+ const eqref: Type;
19
+ const i31ref: Type;
20
+ const structref: Type;
21
+ const arrayref: Type;
22
+ const stringref: Type;
23
+
24
+ const nullref: Type;
25
+ const nullexternref: Type;
26
+ const nullfuncref: Type;
27
+
28
+ const unreachable: Type;
29
+ const auto: Type;
30
+
31
+ const notPacked: PackedType;
32
+ const i8: PackedType;
33
+ const i16: PackedType;
34
+
35
+ const ext: HeapType;
36
+ const func: HeapType;
37
+ const any: HeapType;
38
+ const eq: HeapType;
39
+ const i31: HeapType;
40
+ const struct: HeapType;
41
+ const array: HeapType;
42
+ const string: HeapType;
43
+ const none: HeapType;
44
+ const noext: HeapType;
45
+ const nofunc: HeapType;
46
+
47
+ function createType(types: Type[]): Type;
48
+ function expandType(type: Type): Type[];
49
+ function getTypeFromHeapType(heapType: HeapType, nullable: boolean): Type;
50
+ function getHeapType(type: Type): HeapType;
51
+
52
+ const enum ExpressionIds {
53
+ Invalid,
54
+ Nop,
55
+ Block,
56
+ If,
57
+ Loop,
58
+ Break,
59
+ Switch,
60
+ Call,
61
+ CallIndirect,
62
+ LocalGet,
63
+ LocalSet,
64
+ GlobalGet,
65
+ GlobalSet,
66
+ Load,
67
+ Store,
68
+ AtomicRMW,
69
+ AtomicCmpxchg,
70
+ AtomicWait,
71
+ AtomicNotify,
72
+ AtomicFence,
73
+ SIMDExtract,
74
+ SIMDReplace,
75
+ SIMDShuffle,
76
+ SIMDTernary,
77
+ SIMDShift,
78
+ SIMDLoad,
79
+ SIMDLoadStoreLane,
80
+ MemoryInit,
81
+ DataDrop,
82
+ MemoryCopy,
83
+ MemoryFill,
84
+ Const,
85
+ Unary,
86
+ Binary,
87
+ Select,
88
+ Drop,
89
+ Return,
90
+ MemorySize,
91
+ MemoryGrow,
92
+ Unreachable,
93
+ Pop,
94
+ RefNull,
95
+ RefIsNull,
96
+ RefFunc,
97
+ RefEq,
98
+ TableGet,
99
+ TableSet,
100
+ TableSize,
101
+ TableGrow,
102
+ TableFill,
103
+ TableCopy,
104
+ Try,
105
+ TryTable,
106
+ Throw,
107
+ Rethrow,
108
+ ThrowRef,
109
+ TupleMake,
110
+ TupleExtract,
111
+ RefI31,
112
+ I31Get,
113
+ CallRef,
114
+ RefTest,
115
+ RefCast,
116
+ BrOn,
117
+ StructNew,
118
+ StructGet,
119
+ StructSet,
120
+ ArrayNew,
121
+ ArrayNewData,
122
+ ArrayNewElem,
123
+ ArrayNewFixed,
124
+ ArrayGet,
125
+ ArraySet,
126
+ ArrayLen,
127
+ ArrayCopy,
128
+ ArrayFill,
129
+ ArrayInitData,
130
+ ArrayInitElem,
131
+ RefAs,
132
+ StringNew,
133
+ StringConst,
134
+ StringMeasure,
135
+ StringEncode,
136
+ StringConcat,
137
+ StringEq,
138
+ StringWTF16Get,
139
+ StringSliceWTF,
140
+ Resume
141
+ }
142
+
143
+ const InvalidId: ExpressionIds;
144
+ const NopId: ExpressionIds;
145
+ const BlockId: ExpressionIds;
146
+ const IfId: ExpressionIds;
147
+ const LoopId: ExpressionIds;
148
+ const BreakId: ExpressionIds;
149
+ const SwitchId: ExpressionIds;
150
+ const CallId: ExpressionIds;
151
+ const CallIndirectId: ExpressionIds;
152
+ const LocalGetId: ExpressionIds;
153
+ const LocalSetId: ExpressionIds;
154
+ const GlobalGetId: ExpressionIds;
155
+ const GlobalSetId: ExpressionIds;
156
+ const LoadId: ExpressionIds;
157
+ const StoreId: ExpressionIds;
158
+ const AtomicRMWId: ExpressionIds;
159
+ const AtomicCmpxchgId: ExpressionIds;
160
+ const AtomicWaitId: ExpressionIds;
161
+ const AtomicNotifyId: ExpressionIds;
162
+ const AtomicFenceId: ExpressionIds;
163
+ const SIMDExtractId: ExpressionIds;
164
+ const SIMDReplaceId: ExpressionIds;
165
+ const SIMDShuffleId: ExpressionIds;
166
+ const SIMDTernaryId: ExpressionIds;
167
+ const SIMDShiftId: ExpressionIds;
168
+ const SIMDLoadId: ExpressionIds;
169
+ const SIMDLoadStoreLaneId: ExpressionIds;
170
+ const MemoryInitId: ExpressionIds;
171
+ const DataDropId: ExpressionIds;
172
+ const MemoryCopyId: ExpressionIds;
173
+ const MemoryFillId: ExpressionIds;
174
+ const ConstId: ExpressionIds;
175
+ const UnaryId: ExpressionIds;
176
+ const BinaryId: ExpressionIds;
177
+ const SelectId: ExpressionIds;
178
+ const DropId: ExpressionIds;
179
+ const ReturnId: ExpressionIds;
180
+ const MemorySizeId: ExpressionIds;
181
+ const MemoryGrowId: ExpressionIds;
182
+ const UnreachableId: ExpressionIds;
183
+ const PopId: ExpressionIds;
184
+ const RefNullId: ExpressionIds;
185
+ const RefIsNullId: ExpressionIds;
186
+ const RefFuncId: ExpressionIds;
187
+ const RefEqId: ExpressionIds;
188
+ const TableGetId: ExpressionIds;
189
+ const TableSetId: ExpressionIds;
190
+ const TableSizeId: ExpressionIds;
191
+ const TableGrowId: ExpressionIds;
192
+ const TableFillId: ExpressionIds;
193
+ const TableCopyId: ExpressionIds;
194
+ const TryId: ExpressionIds;
195
+ const TryTableId: ExpressionIds;
196
+ const ThrowId: ExpressionIds;
197
+ const RethrowId: ExpressionIds;
198
+ const ThrowRefId: ExpressionIds;
199
+ const TupleMakeId: ExpressionIds;
200
+ const TupleExtractId: ExpressionIds;
201
+ const RefI31Id: ExpressionIds;
202
+ const I31GetId: ExpressionIds;
203
+ const CallRefId: ExpressionIds;
204
+ const RefTestId: ExpressionIds;
205
+ const RefCastId: ExpressionIds;
206
+ const BrOnId: ExpressionIds;
207
+ const StructNewId: ExpressionIds;
208
+ const StructGetId: ExpressionIds;
209
+ const StructSetId: ExpressionIds;
210
+ const ArrayNewId: ExpressionIds;
211
+ const ArrayNewDataId: ExpressionIds;
212
+ const ArrayNewElemId: ExpressionIds;
213
+ const ArrayNewFixedId: ExpressionIds;
214
+ const ArrayGetId: ExpressionIds;
215
+ const ArraySetId: ExpressionIds;
216
+ const ArrayLenId: ExpressionIds;
217
+ const ArrayCopyId: ExpressionIds;
218
+ const ArrayFillId: ExpressionIds;
219
+ const ArrayInitDataId: ExpressionIds;
220
+ const ArrayInitElemId: ExpressionIds;
221
+ const RefAsId: ExpressionIds;
222
+ const StringNewId: ExpressionIds;
223
+ const StringConstId: ExpressionIds;
224
+ const StringMeasureId: ExpressionIds;
225
+ const StringEncodeId: ExpressionIds;
226
+ const StringConcatId: ExpressionIds;
227
+ const StringEqId: ExpressionIds;
228
+ const StringWTF16GetId: ExpressionIds;
229
+ const StringSliceWTFId: ExpressionIds;
230
+ const ResumeId: ExpressionIds;
231
+
232
+ const enum ExternalKinds {
233
+ Function,
234
+ Table,
235
+ Memory,
236
+ Global,
237
+ Tag
238
+ }
239
+
240
+ const ExternalFunction: ExternalKinds;
241
+ const ExternalTable: ExternalKinds;
242
+ const ExternalMemory: ExternalKinds;
243
+ const ExternalGlobal: ExternalKinds;
244
+ const ExternalTag: ExternalKinds;
245
+
246
+ type MemoryOrder = number;
247
+
248
+ declare const MemoryOrder: {
249
+ readonly unordered: MemoryOrder;
250
+ readonly seqcst: MemoryOrder;
251
+ readonly acqrel: MemoryOrder;
252
+ };
253
+
254
+ enum Features {
255
+ MVP,
256
+ Atomics,
257
+ MutableGlobals,
258
+ NontrappingFPToInt,
259
+ SIMD128,
260
+ BulkMemory,
261
+ SignExt,
262
+ ExceptionHandling,
263
+ TailCall,
264
+ ReferenceTypes,
265
+ Multivalue,
266
+ GC,
267
+ Memory64,
268
+ RelaxedSIMD,
269
+ ExtendedConst,
270
+ Strings,
271
+ MultiMemory,
272
+ StackSwitching,
273
+ SharedEverything,
274
+ FP16,
275
+ BulkMemoryOpt,
276
+ CallIndirectOverlong,
277
+ RelaxedAtomics,
278
+ Multibyte,
279
+ CustomPageSizes,
280
+ All
281
+ }
282
+
283
+ const enum Operations {
284
+ ClzInt32,
285
+ CtzInt32,
286
+ PopcntInt32,
287
+ NegFloat32,
288
+ AbsFloat32,
289
+ CeilFloat32,
290
+ FloorFloat32,
291
+ TruncFloat32,
292
+ NearestFloat32,
293
+ SqrtFloat32,
294
+ EqZInt32,
295
+ ClzInt64,
296
+ CtzInt64,
297
+ PopcntInt64,
298
+ NegFloat64,
299
+ AbsFloat64,
300
+ CeilFloat64,
301
+ FloorFloat64,
302
+ TruncFloat64,
303
+ NearestFloat64,
304
+ SqrtFloat64,
305
+ EqZInt64,
306
+ ExtendSInt32,
307
+ ExtendUInt32,
308
+ WrapInt64,
309
+ TruncSFloat32ToInt32,
310
+ TruncSFloat32ToInt64,
311
+ TruncUFloat32ToInt32,
312
+ TruncUFloat32ToInt64,
313
+ TruncSFloat64ToInt32,
314
+ TruncSFloat64ToInt64,
315
+ TruncUFloat64ToInt32,
316
+ TruncUFloat64ToInt64,
317
+ ReinterpretFloat32,
318
+ ReinterpretFloat64,
319
+ ConvertSInt32ToFloat32,
320
+ ConvertSInt32ToFloat64,
321
+ ConvertUInt32ToFloat32,
322
+ ConvertUInt32ToFloat64,
323
+ ConvertSInt64ToFloat32,
324
+ ConvertSInt64ToFloat64,
325
+ ConvertUInt64ToFloat32,
326
+ ConvertUInt64ToFloat64,
327
+ PromoteFloat32,
328
+ DemoteFloat64,
329
+ ReinterpretInt32,
330
+ ReinterpretInt64,
331
+ ExtendS8Int32,
332
+ ExtendS16Int32,
333
+ ExtendS8Int64,
334
+ ExtendS16Int64,
335
+ ExtendS32Int64,
336
+ AddInt32,
337
+ SubInt32,
338
+ MulInt32,
339
+ DivSInt32,
340
+ DivUInt32,
341
+ RemSInt32,
342
+ RemUInt32,
343
+ AndInt32,
344
+ OrInt32,
345
+ XorInt32,
346
+ ShlInt32,
347
+ ShrUInt32,
348
+ ShrSInt32,
349
+ RotLInt32,
350
+ RotRInt32,
351
+ EqInt32,
352
+ NeInt32,
353
+ LtSInt32,
354
+ LtUInt32,
355
+ LeSInt32,
356
+ LeUInt32,
357
+ GtSInt32,
358
+ GtUInt32,
359
+ GeSInt32,
360
+ GeUInt32,
361
+ AddInt64,
362
+ SubInt64,
363
+ MulInt64,
364
+ DivSInt64,
365
+ DivUInt64,
366
+ RemSInt64,
367
+ RemUInt64,
368
+ AndInt64,
369
+ OrInt64,
370
+ XorInt64,
371
+ ShlInt64,
372
+ ShrUInt64,
373
+ ShrSInt64,
374
+ RotLInt64,
375
+ RotRInt64,
376
+ EqInt64,
377
+ NeInt64,
378
+ LtSInt64,
379
+ LtUInt64,
380
+ LeSInt64,
381
+ LeUInt64,
382
+ GtSInt64,
383
+ GtUInt64,
384
+ GeSInt64,
385
+ GeUInt64,
386
+ AddFloat32,
387
+ SubFloat32,
388
+ MulFloat32,
389
+ DivFloat32,
390
+ CopySignFloat32,
391
+ MinFloat32,
392
+ MaxFloat32,
393
+ EqFloat32,
394
+ NeFloat32,
395
+ LtFloat32,
396
+ LeFloat32,
397
+ GtFloat32,
398
+ GeFloat32,
399
+ AddFloat64,
400
+ SubFloat64,
401
+ MulFloat64,
402
+ DivFloat64,
403
+ CopySignFloat64,
404
+ MinFloat64,
405
+ MaxFloat64,
406
+ EqFloat64,
407
+ NeFloat64,
408
+ LtFloat64,
409
+ LeFloat64,
410
+ GtFloat64,
411
+ GeFloat64,
412
+ AtomicRMWAdd,
413
+ AtomicRMWSub,
414
+ AtomicRMWAnd,
415
+ AtomicRMWOr,
416
+ AtomicRMWXor,
417
+ AtomicRMWXchg,
418
+ TruncSatSFloat32ToInt32,
419
+ TruncSatSFloat32ToInt64,
420
+ TruncSatUFloat32ToInt32,
421
+ TruncSatUFloat32ToInt64,
422
+ TruncSatSFloat64ToInt32,
423
+ TruncSatSFloat64ToInt64,
424
+ TruncSatUFloat64ToInt32,
425
+ TruncSatUFloat64ToInt64,
426
+ SplatVecI8x16,
427
+ ExtractLaneSVecI8x16,
428
+ ExtractLaneUVecI8x16,
429
+ ReplaceLaneVecI8x16,
430
+ SplatVecI16x8,
431
+ ExtractLaneSVecI16x8,
432
+ ExtractLaneUVecI16x8,
433
+ ReplaceLaneVecI16x8,
434
+ SplatVecI32x4,
435
+ ExtractLaneVecI32x4,
436
+ ReplaceLaneVecI32x4,
437
+ SplatVecI64x2,
438
+ ExtractLaneVecI64x2,
439
+ ReplaceLaneVecI64x2,
440
+ SplatVecF32x4,
441
+ ExtractLaneVecF32x4,
442
+ ReplaceLaneVecF32x4,
443
+ SplatVecF64x2,
444
+ ExtractLaneVecF64x2,
445
+ ReplaceLaneVecF64x2,
446
+ EqVecI8x16,
447
+ NeVecI8x16,
448
+ LtSVecI8x16,
449
+ LtUVecI8x16,
450
+ GtSVecI8x16,
451
+ GtUVecI8x16,
452
+ LeSVecI8x16,
453
+ LeUVecI8x16,
454
+ GeSVecI8x16,
455
+ GeUVecI8x16,
456
+ EqVecI16x8,
457
+ NeVecI16x8,
458
+ LtSVecI16x8,
459
+ LtUVecI16x8,
460
+ GtSVecI16x8,
461
+ GtUVecI16x8,
462
+ LeSVecI16x8,
463
+ LeUVecI16x8,
464
+ GeSVecI16x8,
465
+ GeUVecI16x8,
466
+ EqVecI32x4,
467
+ NeVecI32x4,
468
+ LtSVecI32x4,
469
+ LtUVecI32x4,
470
+ GtSVecI32x4,
471
+ GtUVecI32x4,
472
+ LeSVecI32x4,
473
+ LeUVecI32x4,
474
+ GeSVecI32x4,
475
+ GeUVecI32x4,
476
+ EqVecI64x2,
477
+ NeVecI64x2,
478
+ LtSVecI64x2,
479
+ GtSVecI64x2,
480
+ LeSVecI64x2,
481
+ GeSVecI64x2,
482
+ EqVecF32x4,
483
+ NeVecF32x4,
484
+ LtVecF32x4,
485
+ GtVecF32x4,
486
+ LeVecF32x4,
487
+ GeVecF32x4,
488
+ EqVecF64x2,
489
+ NeVecF64x2,
490
+ LtVecF64x2,
491
+ GtVecF64x2,
492
+ LeVecF64x2,
493
+ GeVecF64x2,
494
+ NotVec128,
495
+ AndVec128,
496
+ OrVec128,
497
+ XorVec128,
498
+ AndNotVec128,
499
+ BitselectVec128,
500
+ RelaxedMaddVecF32x4,
501
+ RelaxedNmaddVecF32x4,
502
+ RelaxedMaddVecF64x2,
503
+ RelaxedNmaddVecF64x2,
504
+ LaneselectI8x16,
505
+ LaneselectI16x8,
506
+ LaneselectI32x4,
507
+ LaneselectI64x2,
508
+ DotI8x16I7x16AddSToVecI32x4,
509
+ AnyTrueVec128,
510
+ PopcntVecI8x16,
511
+ AbsVecI8x16,
512
+ NegVecI8x16,
513
+ AllTrueVecI8x16,
514
+ BitmaskVecI8x16,
515
+ ShlVecI8x16,
516
+ ShrSVecI8x16,
517
+ ShrUVecI8x16,
518
+ AddVecI8x16,
519
+ AddSatSVecI8x16,
520
+ AddSatUVecI8x16,
521
+ SubVecI8x16,
522
+ SubSatSVecI8x16,
523
+ SubSatUVecI8x16,
524
+ MinSVecI8x16,
525
+ MinUVecI8x16,
526
+ MaxSVecI8x16,
527
+ MaxUVecI8x16,
528
+ AvgrUVecI8x16,
529
+ AbsVecI16x8,
530
+ NegVecI16x8,
531
+ AllTrueVecI16x8,
532
+ BitmaskVecI16x8,
533
+ ShlVecI16x8,
534
+ ShrSVecI16x8,
535
+ ShrUVecI16x8,
536
+ AddVecI16x8,
537
+ AddSatSVecI16x8,
538
+ AddSatUVecI16x8,
539
+ SubVecI16x8,
540
+ SubSatSVecI16x8,
541
+ SubSatUVecI16x8,
542
+ MulVecI16x8,
543
+ MinSVecI16x8,
544
+ MinUVecI16x8,
545
+ MaxSVecI16x8,
546
+ MaxUVecI16x8,
547
+ AvgrUVecI16x8,
548
+ Q15MulrSatSVecI16x8,
549
+ ExtMulLowSVecI16x8,
550
+ ExtMulHighSVecI16x8,
551
+ ExtMulLowUVecI16x8,
552
+ ExtMulHighUVecI16x8,
553
+ AbsVecI32x4,
554
+ NegVecI32x4,
555
+ AllTrueVecI32x4,
556
+ BitmaskVecI32x4,
557
+ ShlVecI32x4,
558
+ ShrSVecI32x4,
559
+ ShrUVecI32x4,
560
+ AddVecI32x4,
561
+ SubVecI32x4,
562
+ MulVecI32x4,
563
+ MinSVecI32x4,
564
+ MinUVecI32x4,
565
+ MaxSVecI32x4,
566
+ MaxUVecI32x4,
567
+ DotSVecI16x8ToVecI32x4,
568
+ ExtMulLowSVecI32x4,
569
+ ExtMulHighSVecI32x4,
570
+ ExtMulLowUVecI32x4,
571
+ ExtMulHighUVecI32x4,
572
+ AbsVecI64x2,
573
+ NegVecI64x2,
574
+ AllTrueVecI64x2,
575
+ BitmaskVecI64x2,
576
+ ShlVecI64x2,
577
+ ShrSVecI64x2,
578
+ ShrUVecI64x2,
579
+ AddVecI64x2,
580
+ SubVecI64x2,
581
+ MulVecI64x2,
582
+ ExtMulLowSVecI64x2,
583
+ ExtMulHighSVecI64x2,
584
+ ExtMulLowUVecI64x2,
585
+ ExtMulHighUVecI64x2,
586
+ AbsVecF32x4,
587
+ NegVecF32x4,
588
+ SqrtVecF32x4,
589
+ AddVecF32x4,
590
+ SubVecF32x4,
591
+ MulVecF32x4,
592
+ DivVecF32x4,
593
+ MinVecF32x4,
594
+ MaxVecF32x4,
595
+ PMinVecF32x4,
596
+ PMaxVecF32x4,
597
+ CeilVecF32x4,
598
+ FloorVecF32x4,
599
+ TruncVecF32x4,
600
+ NearestVecF32x4,
601
+ AbsVecF64x2,
602
+ NegVecF64x2,
603
+ SqrtVecF64x2,
604
+ AddVecF64x2,
605
+ SubVecF64x2,
606
+ MulVecF64x2,
607
+ DivVecF64x2,
608
+ MinVecF64x2,
609
+ MaxVecF64x2,
610
+ PMinVecF64x2,
611
+ PMaxVecF64x2,
612
+ CeilVecF64x2,
613
+ FloorVecF64x2,
614
+ TruncVecF64x2,
615
+ NearestVecF64x2,
616
+ ExtAddPairwiseSVecI8x16ToI16x8,
617
+ ExtAddPairwiseUVecI8x16ToI16x8,
618
+ ExtAddPairwiseSVecI16x8ToI32x4,
619
+ ExtAddPairwiseUVecI16x8ToI32x4,
620
+ TruncSatSVecF32x4ToVecI32x4,
621
+ TruncSatUVecF32x4ToVecI32x4,
622
+ ConvertSVecI32x4ToVecF32x4,
623
+ ConvertUVecI32x4ToVecF32x4,
624
+ Load8SplatVec128,
625
+ Load16SplatVec128,
626
+ Load32SplatVec128,
627
+ Load64SplatVec128,
628
+ Load8x8SVec128,
629
+ Load8x8UVec128,
630
+ Load16x4SVec128,
631
+ Load16x4UVec128,
632
+ Load32x2SVec128,
633
+ Load32x2UVec128,
634
+ Load32ZeroVec128,
635
+ Load64ZeroVec128,
636
+ Load8LaneVec128,
637
+ Load16LaneVec128,
638
+ Load32LaneVec128,
639
+ Load64LaneVec128,
640
+ Store8LaneVec128,
641
+ Store16LaneVec128,
642
+ Store32LaneVec128,
643
+ Store64LaneVec128,
644
+ NarrowSVecI16x8ToVecI8x16,
645
+ NarrowUVecI16x8ToVecI8x16,
646
+ NarrowSVecI32x4ToVecI16x8,
647
+ NarrowUVecI32x4ToVecI16x8,
648
+ ExtendLowSVecI8x16ToVecI16x8,
649
+ ExtendHighSVecI8x16ToVecI16x8,
650
+ ExtendLowUVecI8x16ToVecI16x8,
651
+ ExtendHighUVecI8x16ToVecI16x8,
652
+ ExtendLowSVecI16x8ToVecI32x4,
653
+ ExtendHighSVecI16x8ToVecI32x4,
654
+ ExtendLowUVecI16x8ToVecI32x4,
655
+ ExtendHighUVecI16x8ToVecI32x4,
656
+ ExtendLowSVecI32x4ToVecI64x2,
657
+ ExtendHighSVecI32x4ToVecI64x2,
658
+ ExtendLowUVecI32x4ToVecI64x2,
659
+ ExtendHighUVecI32x4ToVecI64x2,
660
+ ConvertLowSVecI32x4ToVecF64x2,
661
+ ConvertLowUVecI32x4ToVecF64x2,
662
+ TruncSatZeroSVecF64x2ToVecI32x4,
663
+ TruncSatZeroUVecF64x2ToVecI32x4,
664
+ DemoteZeroVecF64x2ToVecF32x4,
665
+ PromoteLowVecF32x4ToVecF64x2,
666
+ RelaxedTruncSVecF32x4ToVecI32x4,
667
+ RelaxedTruncUVecF32x4ToVecI32x4,
668
+ RelaxedTruncZeroSVecF64x2ToVecI32x4,
669
+ RelaxedTruncZeroUVecF64x2ToVecI32x4,
670
+ SwizzleVecI8x16,
671
+ RelaxedSwizzleVecI8x16,
672
+ RelaxedMinVecF32x4,
673
+ RelaxedMaxVecF32x4,
674
+ RelaxedMinVecF64x2,
675
+ RelaxedMaxVecF64x2,
676
+ RelaxedQ15MulrSVecI16x8,
677
+ DotI8x16I7x16SToVecI16x8,
678
+ RefAsNonNull,
679
+ RefAsExternInternalize,
680
+ RefAsExternExternalize,
681
+ RefAsAnyConvertExtern,
682
+ RefAsExternConvertAny,
683
+ BrOnNull,
684
+ BrOnNonNull,
685
+ BrOnCast,
686
+ BrOnCastFail,
687
+ StringNewLossyUTF8Array,
688
+ StringNewWTF16Array,
689
+ StringNewFromCodePoint,
690
+ StringMeasureUTF8,
691
+ StringMeasureWTF16,
692
+ StringEncodeLossyUTF8Array,
693
+ StringEncodeWTF16Array,
694
+ StringEqEqual,
695
+ StringEqCompare
696
+ }
697
+
698
+ const ClzInt32: Operations;
699
+ const CtzInt32: Operations;
700
+ const PopcntInt32: Operations;
701
+ const NegFloat32: Operations;
702
+ const AbsFloat32: Operations;
703
+ const CeilFloat32: Operations;
704
+ const FloorFloat32: Operations;
705
+ const TruncFloat32: Operations;
706
+ const NearestFloat32: Operations;
707
+ const SqrtFloat32: Operations;
708
+ const EqZInt32: Operations;
709
+ const ClzInt64: Operations;
710
+ const CtzInt64: Operations;
711
+ const PopcntInt64: Operations;
712
+ const NegFloat64: Operations;
713
+ const AbsFloat64: Operations;
714
+ const CeilFloat64: Operations;
715
+ const FloorFloat64: Operations;
716
+ const TruncFloat64: Operations;
717
+ const NearestFloat64: Operations;
718
+ const SqrtFloat64: Operations;
719
+ const EqZInt64: Operations;
720
+ const ExtendSInt32: Operations;
721
+ const ExtendUInt32: Operations;
722
+ const WrapInt64: Operations;
723
+ const TruncSFloat32ToInt32: Operations;
724
+ const TruncSFloat32ToInt64: Operations;
725
+ const TruncUFloat32ToInt32: Operations;
726
+ const TruncUFloat32ToInt64: Operations;
727
+ const TruncSFloat64ToInt32: Operations;
728
+ const TruncSFloat64ToInt64: Operations;
729
+ const TruncUFloat64ToInt32: Operations;
730
+ const TruncUFloat64ToInt64: Operations;
731
+ const ReinterpretFloat32: Operations;
732
+ const ReinterpretFloat64: Operations;
733
+ const ConvertSInt32ToFloat32: Operations;
734
+ const ConvertSInt32ToFloat64: Operations;
735
+ const ConvertUInt32ToFloat32: Operations;
736
+ const ConvertUInt32ToFloat64: Operations;
737
+ const ConvertSInt64ToFloat32: Operations;
738
+ const ConvertSInt64ToFloat64: Operations;
739
+ const ConvertUInt64ToFloat32: Operations;
740
+ const ConvertUInt64ToFloat64: Operations;
741
+ const PromoteFloat32: Operations;
742
+ const DemoteFloat64: Operations;
743
+ const ReinterpretInt32: Operations;
744
+ const ReinterpretInt64: Operations;
745
+ const ExtendS8Int32: Operations;
746
+ const ExtendS16Int32: Operations;
747
+ const ExtendS8Int64: Operations;
748
+ const ExtendS16Int64: Operations;
749
+ const ExtendS32Int64: Operations;
750
+ const AddInt32: Operations;
751
+ const SubInt32: Operations;
752
+ const MulInt32: Operations;
753
+ const DivSInt32: Operations;
754
+ const DivUInt32: Operations;
755
+ const RemSInt32: Operations;
756
+ const RemUInt32: Operations;
757
+ const AndInt32: Operations;
758
+ const OrInt32: Operations;
759
+ const XorInt32: Operations;
760
+ const ShlInt32: Operations;
761
+ const ShrUInt32: Operations;
762
+ const ShrSInt32: Operations;
763
+ const RotLInt32: Operations;
764
+ const RotRInt32: Operations;
765
+ const EqInt32: Operations;
766
+ const NeInt32: Operations;
767
+ const LtSInt32: Operations;
768
+ const LtUInt32: Operations;
769
+ const LeSInt32: Operations;
770
+ const LeUInt32: Operations;
771
+ const GtSInt32: Operations;
772
+ const GtUInt32: Operations;
773
+ const GeSInt32: Operations;
774
+ const GeUInt32: Operations;
775
+ const AddInt64: Operations;
776
+ const SubInt64: Operations;
777
+ const MulInt64: Operations;
778
+ const DivSInt64: Operations;
779
+ const DivUInt64: Operations;
780
+ const RemSInt64: Operations;
781
+ const RemUInt64: Operations;
782
+ const AndInt64: Operations;
783
+ const OrInt64: Operations;
784
+ const XorInt64: Operations;
785
+ const ShlInt64: Operations;
786
+ const ShrUInt64: Operations;
787
+ const ShrSInt64: Operations;
788
+ const RotLInt64: Operations;
789
+ const RotRInt64: Operations;
790
+ const EqInt64: Operations;
791
+ const NeInt64: Operations;
792
+ const LtSInt64: Operations;
793
+ const LtUInt64: Operations;
794
+ const LeSInt64: Operations;
795
+ const LeUInt64: Operations;
796
+ const GtSInt64: Operations;
797
+ const GtUInt64: Operations;
798
+ const GeSInt64: Operations;
799
+ const GeUInt64: Operations;
800
+ const AddFloat32: Operations;
801
+ const SubFloat32: Operations;
802
+ const MulFloat32: Operations;
803
+ const DivFloat32: Operations;
804
+ const CopySignFloat32: Operations;
805
+ const MinFloat32: Operations;
806
+ const MaxFloat32: Operations;
807
+ const EqFloat32: Operations;
808
+ const NeFloat32: Operations;
809
+ const LtFloat32: Operations;
810
+ const LeFloat32: Operations;
811
+ const GtFloat32: Operations;
812
+ const GeFloat32: Operations;
813
+ const AddFloat64: Operations;
814
+ const SubFloat64: Operations;
815
+ const MulFloat64: Operations;
816
+ const DivFloat64: Operations;
817
+ const CopySignFloat64: Operations;
818
+ const MinFloat64: Operations;
819
+ const MaxFloat64: Operations;
820
+ const EqFloat64: Operations;
821
+ const NeFloat64: Operations;
822
+ const LtFloat64: Operations;
823
+ const LeFloat64: Operations;
824
+ const GtFloat64: Operations;
825
+ const GeFloat64: Operations;
826
+ const AtomicRMWAdd: Operations;
827
+ const AtomicRMWSub: Operations;
828
+ const AtomicRMWAnd: Operations;
829
+ const AtomicRMWOr: Operations;
830
+ const AtomicRMWXor: Operations;
831
+ const AtomicRMWXchg: Operations;
832
+ const TruncSatSFloat32ToInt32: Operations;
833
+ const TruncSatSFloat32ToInt64: Operations;
834
+ const TruncSatUFloat32ToInt32: Operations;
835
+ const TruncSatUFloat32ToInt64: Operations;
836
+ const TruncSatSFloat64ToInt32: Operations;
837
+ const TruncSatSFloat64ToInt64: Operations;
838
+ const TruncSatUFloat64ToInt32: Operations;
839
+ const TruncSatUFloat64ToInt64: Operations;
840
+ const SplatVecI8x16: Operations;
841
+ const ExtractLaneSVecI8x16: Operations;
842
+ const ExtractLaneUVecI8x16: Operations;
843
+ const ReplaceLaneVecI8x16: Operations;
844
+ const SplatVecI16x8: Operations;
845
+ const ExtractLaneSVecI16x8: Operations;
846
+ const ExtractLaneUVecI16x8: Operations;
847
+ const ReplaceLaneVecI16x8: Operations;
848
+ const SplatVecI32x4: Operations;
849
+ const ExtractLaneVecI32x4: Operations;
850
+ const ReplaceLaneVecI32x4: Operations;
851
+ const SplatVecI64x2: Operations;
852
+ const ExtractLaneVecI64x2: Operations;
853
+ const ReplaceLaneVecI64x2: Operations;
854
+ const SplatVecF32x4: Operations;
855
+ const ExtractLaneVecF32x4: Operations;
856
+ const ReplaceLaneVecF32x4: Operations;
857
+ const SplatVecF64x2: Operations;
858
+ const ExtractLaneVecF64x2: Operations;
859
+ const ReplaceLaneVecF64x2: Operations;
860
+ const EqVecI8x16: Operations;
861
+ const NeVecI8x16: Operations;
862
+ const LtSVecI8x16: Operations;
863
+ const LtUVecI8x16: Operations;
864
+ const GtSVecI8x16: Operations;
865
+ const GtUVecI8x16: Operations;
866
+ const LeSVecI8x16: Operations;
867
+ const LeUVecI8x16: Operations;
868
+ const GeSVecI8x16: Operations;
869
+ const GeUVecI8x16: Operations;
870
+ const EqVecI16x8: Operations;
871
+ const NeVecI16x8: Operations;
872
+ const LtSVecI16x8: Operations;
873
+ const LtUVecI16x8: Operations;
874
+ const GtSVecI16x8: Operations;
875
+ const GtUVecI16x8: Operations;
876
+ const LeSVecI16x8: Operations;
877
+ const LeUVecI16x8: Operations;
878
+ const GeSVecI16x8: Operations;
879
+ const GeUVecI16x8: Operations;
880
+ const EqVecI32x4: Operations;
881
+ const NeVecI32x4: Operations;
882
+ const LtSVecI32x4: Operations;
883
+ const LtUVecI32x4: Operations;
884
+ const GtSVecI32x4: Operations;
885
+ const GtUVecI32x4: Operations;
886
+ const LeSVecI32x4: Operations;
887
+ const LeUVecI32x4: Operations;
888
+ const GeSVecI32x4: Operations;
889
+ const GeUVecI32x4: Operations;
890
+ const EqVecI64x2: Operations;
891
+ const NeVecI64x2: Operations;
892
+ const LtSVecI64x2: Operations;
893
+ const GtSVecI64x2: Operations;
894
+ const LeSVecI64x2: Operations;
895
+ const GeSVecI64x2: Operations;
896
+ const EqVecF32x4: Operations;
897
+ const NeVecF32x4: Operations;
898
+ const LtVecF32x4: Operations;
899
+ const GtVecF32x4: Operations;
900
+ const LeVecF32x4: Operations;
901
+ const GeVecF32x4: Operations;
902
+ const EqVecF64x2: Operations;
903
+ const NeVecF64x2: Operations;
904
+ const LtVecF64x2: Operations;
905
+ const GtVecF64x2: Operations;
906
+ const LeVecF64x2: Operations;
907
+ const GeVecF64x2: Operations;
908
+ const NotVec128: Operations;
909
+ const AndVec128: Operations;
910
+ const OrVec128: Operations;
911
+ const XorVec128: Operations;
912
+ const AndNotVec128: Operations;
913
+ const BitselectVec128: Operations;
914
+ const RelaxedMaddVecF32x4: Operations;
915
+ const RelaxedNmaddVecF32x4: Operations;
916
+ const RelaxedMaddVecF64x2: Operations;
917
+ const RelaxedNmaddVecF64x2: Operations;
918
+ const LaneselectI8x16: Operations;
919
+ const LaneselectI16x8: Operations;
920
+ const LaneselectI32x4: Operations;
921
+ const LaneselectI64x2: Operations;
922
+ const DotI8x16I7x16AddSToVecI32x4: Operations;
923
+ const AnyTrueVec128: Operations;
924
+ const PopcntVecI8x16: Operations;
925
+ const AbsVecI8x16: Operations;
926
+ const NegVecI8x16: Operations;
927
+ const AllTrueVecI8x16: Operations;
928
+ const BitmaskVecI8x16: Operations;
929
+ const ShlVecI8x16: Operations;
930
+ const ShrSVecI8x16: Operations;
931
+ const ShrUVecI8x16: Operations;
932
+ const AddVecI8x16: Operations;
933
+ const AddSatSVecI8x16: Operations;
934
+ const AddSatUVecI8x16: Operations;
935
+ const SubVecI8x16: Operations;
936
+ const SubSatSVecI8x16: Operations;
937
+ const SubSatUVecI8x16: Operations;
938
+ const MinSVecI8x16: Operations;
939
+ const MinUVecI8x16: Operations;
940
+ const MaxSVecI8x16: Operations;
941
+ const MaxUVecI8x16: Operations;
942
+ const AvgrUVecI8x16: Operations;
943
+ const AbsVecI16x8: Operations;
944
+ const NegVecI16x8: Operations;
945
+ const AllTrueVecI16x8: Operations;
946
+ const BitmaskVecI16x8: Operations;
947
+ const ShlVecI16x8: Operations;
948
+ const ShrSVecI16x8: Operations;
949
+ const ShrUVecI16x8: Operations;
950
+ const AddVecI16x8: Operations;
951
+ const AddSatSVecI16x8: Operations;
952
+ const AddSatUVecI16x8: Operations;
953
+ const SubVecI16x8: Operations;
954
+ const SubSatSVecI16x8: Operations;
955
+ const SubSatUVecI16x8: Operations;
956
+ const MulVecI16x8: Operations;
957
+ const MinSVecI16x8: Operations;
958
+ const MinUVecI16x8: Operations;
959
+ const MaxSVecI16x8: Operations;
960
+ const MaxUVecI16x8: Operations;
961
+ const AvgrUVecI16x8: Operations;
962
+ const Q15MulrSatSVecI16x8: Operations;
963
+ const ExtMulLowSVecI16x8: Operations;
964
+ const ExtMulHighSVecI16x8: Operations;
965
+ const ExtMulLowUVecI16x8: Operations;
966
+ const ExtMulHighUVecI16x8: Operations;
967
+ const AbsVecI32x4: Operations;
968
+ const NegVecI32x4: Operations;
969
+ const AllTrueVecI32x4: Operations;
970
+ const BitmaskVecI32x4: Operations;
971
+ const ShlVecI32x4: Operations;
972
+ const ShrSVecI32x4: Operations;
973
+ const ShrUVecI32x4: Operations;
974
+ const AddVecI32x4: Operations;
975
+ const SubVecI32x4: Operations;
976
+ const MulVecI32x4: Operations;
977
+ const MinSVecI32x4: Operations;
978
+ const MinUVecI32x4: Operations;
979
+ const MaxSVecI32x4: Operations;
980
+ const MaxUVecI32x4: Operations;
981
+ const DotSVecI16x8ToVecI32x4: Operations;
982
+ const ExtMulLowSVecI32x4: Operations;
983
+ const ExtMulHighSVecI32x4: Operations;
984
+ const ExtMulLowUVecI32x4: Operations;
985
+ const ExtMulHighUVecI32x4: Operations;
986
+ const AbsVecI64x2: Operations;
987
+ const NegVecI64x2: Operations;
988
+ const AllTrueVecI64x2: Operations;
989
+ const BitmaskVecI64x2: Operations;
990
+ const ShlVecI64x2: Operations;
991
+ const ShrSVecI64x2: Operations;
992
+ const ShrUVecI64x2: Operations;
993
+ const AddVecI64x2: Operations;
994
+ const SubVecI64x2: Operations;
995
+ const MulVecI64x2: Operations;
996
+ const ExtMulLowSVecI64x2: Operations;
997
+ const ExtMulHighSVecI64x2: Operations;
998
+ const ExtMulLowUVecI64x2: Operations;
999
+ const ExtMulHighUVecI64x2: Operations;
1000
+ const AbsVecF32x4: Operations;
1001
+ const NegVecF32x4: Operations;
1002
+ const SqrtVecF32x4: Operations;
1003
+ const AddVecF32x4: Operations;
1004
+ const SubVecF32x4: Operations;
1005
+ const MulVecF32x4: Operations;
1006
+ const DivVecF32x4: Operations;
1007
+ const MinVecF32x4: Operations;
1008
+ const MaxVecF32x4: Operations;
1009
+ const PMinVecF32x4: Operations;
1010
+ const PMaxVecF32x4: Operations;
1011
+ const CeilVecF32x4: Operations;
1012
+ const FloorVecF32x4: Operations;
1013
+ const TruncVecF32x4: Operations;
1014
+ const NearestVecF32x4: Operations;
1015
+ const AbsVecF64x2: Operations;
1016
+ const NegVecF64x2: Operations;
1017
+ const SqrtVecF64x2: Operations;
1018
+ const AddVecF64x2: Operations;
1019
+ const SubVecF64x2: Operations;
1020
+ const MulVecF64x2: Operations;
1021
+ const DivVecF64x2: Operations;
1022
+ const MinVecF64x2: Operations;
1023
+ const MaxVecF64x2: Operations;
1024
+ const PMinVecF64x2: Operations;
1025
+ const PMaxVecF64x2: Operations;
1026
+ const CeilVecF64x2: Operations;
1027
+ const FloorVecF64x2: Operations;
1028
+ const TruncVecF64x2: Operations;
1029
+ const NearestVecF64x2: Operations;
1030
+ const ExtAddPairwiseSVecI8x16ToI16x8: Operations;
1031
+ const ExtAddPairwiseUVecI8x16ToI16x8: Operations;
1032
+ const ExtAddPairwiseSVecI16x8ToI32x4: Operations;
1033
+ const ExtAddPairwiseUVecI16x8ToI32x4: Operations;
1034
+ const TruncSatSVecF32x4ToVecI32x4: Operations;
1035
+ const TruncSatUVecF32x4ToVecI32x4: Operations;
1036
+ const ConvertSVecI32x4ToVecF32x4: Operations;
1037
+ const ConvertUVecI32x4ToVecF32x4: Operations;
1038
+ const Load8SplatVec128: Operations;
1039
+ const Load16SplatVec128: Operations;
1040
+ const Load32SplatVec128: Operations;
1041
+ const Load64SplatVec128: Operations;
1042
+ const Load8x8SVec128: Operations;
1043
+ const Load8x8UVec128: Operations;
1044
+ const Load16x4SVec128: Operations;
1045
+ const Load16x4UVec128: Operations;
1046
+ const Load32x2SVec128: Operations;
1047
+ const Load32x2UVec128: Operations;
1048
+ const Load32ZeroVec128: Operations;
1049
+ const Load64ZeroVec128: Operations;
1050
+ const Load8LaneVec128: Operations;
1051
+ const Load16LaneVec128: Operations;
1052
+ const Load32LaneVec128: Operations;
1053
+ const Load64LaneVec128: Operations;
1054
+ const Store8LaneVec128: Operations;
1055
+ const Store16LaneVec128: Operations;
1056
+ const Store32LaneVec128: Operations;
1057
+ const Store64LaneVec128: Operations;
1058
+ const NarrowSVecI16x8ToVecI8x16: Operations;
1059
+ const NarrowUVecI16x8ToVecI8x16: Operations;
1060
+ const NarrowSVecI32x4ToVecI16x8: Operations;
1061
+ const NarrowUVecI32x4ToVecI16x8: Operations;
1062
+ const ExtendLowSVecI8x16ToVecI16x8: Operations;
1063
+ const ExtendHighSVecI8x16ToVecI16x8: Operations;
1064
+ const ExtendLowUVecI8x16ToVecI16x8: Operations;
1065
+ const ExtendHighUVecI8x16ToVecI16x8: Operations;
1066
+ const ExtendLowSVecI16x8ToVecI32x4: Operations;
1067
+ const ExtendHighSVecI16x8ToVecI32x4: Operations;
1068
+ const ExtendLowUVecI16x8ToVecI32x4: Operations;
1069
+ const ExtendHighUVecI16x8ToVecI32x4: Operations;
1070
+ const ExtendLowSVecI32x4ToVecI64x2: Operations;
1071
+ const ExtendHighSVecI32x4ToVecI64x2: Operations;
1072
+ const ExtendLowUVecI32x4ToVecI64x2: Operations;
1073
+ const ExtendHighUVecI32x4ToVecI64x2: Operations;
1074
+ const ConvertLowSVecI32x4ToVecF64x2: Operations;
1075
+ const ConvertLowUVecI32x4ToVecF64x2: Operations;
1076
+ const TruncSatZeroSVecF64x2ToVecI32x4: Operations;
1077
+ const TruncSatZeroUVecF64x2ToVecI32x4: Operations;
1078
+ const DemoteZeroVecF64x2ToVecF32x4: Operations;
1079
+ const PromoteLowVecF32x4ToVecF64x2: Operations;
1080
+ const RelaxedTruncSVecF32x4ToVecI32x4: Operations;
1081
+ const RelaxedTruncUVecF32x4ToVecI32x4: Operations;
1082
+ const RelaxedTruncZeroSVecF64x2ToVecI32x4: Operations;
1083
+ const RelaxedTruncZeroUVecF64x2ToVecI32x4: Operations;
1084
+ const SwizzleVecI8x16: Operations;
1085
+ const RelaxedSwizzleVecI8x16: Operations;
1086
+ const RelaxedMinVecF32x4: Operations;
1087
+ const RelaxedMaxVecF32x4: Operations;
1088
+ const RelaxedMinVecF64x2: Operations;
1089
+ const RelaxedMaxVecF64x2: Operations;
1090
+ const RelaxedQ15MulrSVecI16x8: Operations;
1091
+ const DotI8x16I7x16SToVecI16x8: Operations;
1092
+ const RefAsNonNull: Operations;
1093
+ const RefAsExternInternalize: Operations;
1094
+ const RefAsExternExternalize: Operations;
1095
+ const BrOnNull: Operations;
1096
+ const BrOnNonNull: Operations;
1097
+ const BrOnCast: Operations;
1098
+ const BrOnCastFail: Operations;
1099
+ const StringNewLossyUTF8Array: Operations;
1100
+ const StringNewWTF16Array: Operations;
1101
+ const StringNewFromCodePoint: Operations;
1102
+ const StringMeasureUTF8: Operations;
1103
+ const StringMeasureWTF16: Operations;
1104
+ const StringEncodeLossyUTF8Array: Operations;
1105
+ const StringEncodeWTF16Array: Operations;
1106
+ const StringEqEqual: Operations;
1107
+ const StringEqCompare: Operations;
1108
+
1109
+ const enum ExpressionRunnerFlags {
1110
+ Default,
1111
+ PreserveSideeffects
1112
+ }
1113
+
1114
+ type ElementSegmentRef = number;
1115
+ type RelooperBlockRef = number;
1116
+ type DataSegmentRef = number;
1117
+ type ExpressionRef = number;
1118
+ type FunctionRef = number;
1119
+ type GlobalRef = number;
1120
+ type ExportRef = number;
1121
+ type TableRef = number;
1122
+ type TagRef = number;
1123
+
1124
+ class Module {
1125
+ constructor();
1126
+ readonly ptr: number;
1127
+ block(label: string | null, children: ExpressionRef[], resultType?: Type): ExpressionRef;
1128
+ if(condition: ExpressionRef, ifTrue: ExpressionRef, ifFalse?: ExpressionRef): ExpressionRef;
1129
+ loop(label: string | null, body: ExpressionRef): ExpressionRef;
1130
+ br(label: string, condition?: ExpressionRef, value?: ExpressionRef): ExpressionRef;
1131
+ br_if(label: string, condition?: ExpressionRef, value?: ExpressionRef): ExpressionRef;
1132
+ br_on_null(label: string, value: ExpressionRef): ExpressionRef;
1133
+ br_on_non_null(label: string, value: ExpressionRef): ExpressionRef;
1134
+ br_on_cast(label: string, value: ExpressionRef, castType: Type): ExpressionRef;
1135
+ br_on_cast_fail(label: string, value: ExpressionRef, castType: Type): ExpressionRef;
1136
+ switch(labels: string[], defaultLabel: string, condition: ExpressionRef, value?: ExpressionRef): ExpressionRef;
1137
+ call(name: string, operands: ExpressionRef[], returnType: Type): ExpressionRef;
1138
+ return_call(name: string, operands: ExpressionRef[], returnType: Type): ExpressionRef;
1139
+ call_indirect(table: string, target: ExpressionRef, operands: ExpressionRef[], params: Type, results: Type): ExpressionRef;
1140
+ return_call_indirect(table: string, target: ExpressionRef, operands: ExpressionRef[], params: Type, results: Type): ExpressionRef;
1141
+ local: {
1142
+ get(index: number, type: Type): ExpressionRef;
1143
+ set(index: number, value: ExpressionRef): ExpressionRef;
1144
+ tee(index: number, value: ExpressionRef, type: Type): ExpressionRef;
1145
+ };
1146
+ global: {
1147
+ get(name: string, type: Type): ExpressionRef;
1148
+ set(name: string, value: ExpressionRef): ExpressionRef;
1149
+ };
1150
+ table: {
1151
+ get(name: string, index: ExpressionRef, type: Type): ExpressionRef;
1152
+ set(name: string, index: ExpressionRef, value: ExpressionRef): ExpressionRef;
1153
+ size(name: string): ExpressionRef;
1154
+ grow(name: string, value: ExpressionRef, delta: ExpressionRef): ExpressionRef;
1155
+ // TODO: init, fill, copy
1156
+ };
1157
+ memory: {
1158
+ size(name?: string, memory64?: boolean): ExpressionRef;
1159
+ grow(value: ExpressionRef, name?: string, memory64?: boolean): ExpressionRef;
1160
+ init(segment: string, dest: ExpressionRef, offset: ExpressionRef, size: ExpressionRef, name?: string): ExpressionRef;
1161
+ copy(dest: ExpressionRef, source: ExpressionRef, size: ExpressionRef, destName?: string, sourceName?: string): ExpressionRef;
1162
+ fill(dest: ExpressionRef, value: ExpressionRef, size: ExpressionRef, name?: string): ExpressionRef;
1163
+ atomic: {
1164
+ notify(ptr: ExpressionRef, notifyCount: ExpressionRef, name?: string): ExpressionRef;
1165
+ wait32(ptr: ExpressionRef, expected: ExpressionRef, timeout: ExpressionRef, name?: string): ExpressionRef;
1166
+ wait64(ptr: ExpressionRef, expected: ExpressionRef, timeout: ExpressionRef, name?: string): ExpressionRef;
1167
+ }
1168
+ };
1169
+ data: {
1170
+ drop(segment: string): ExpressionRef;
1171
+ };
1172
+ i32: {
1173
+ load(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1174
+ load8_s(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1175
+ load8_u(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1176
+ load16_s(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1177
+ load16_u(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1178
+ store(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef, name?: string): ExpressionRef;
1179
+ store8(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef, name?: string): ExpressionRef;
1180
+ store16(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef, name?: string): ExpressionRef;
1181
+ const(value: number): ExpressionRef;
1182
+ clz(value: ExpressionRef): ExpressionRef;
1183
+ ctz(value: ExpressionRef): ExpressionRef;
1184
+ popcnt(value: ExpressionRef): ExpressionRef;
1185
+ eqz(value: ExpressionRef): ExpressionRef;
1186
+ trunc_s: {
1187
+ f32(value: ExpressionRef): ExpressionRef;
1188
+ f64(value: ExpressionRef): ExpressionRef;
1189
+ };
1190
+ trunc_u: {
1191
+ f32(value: ExpressionRef): ExpressionRef;
1192
+ f64(value: ExpressionRef): ExpressionRef;
1193
+ };
1194
+ trunc_s_sat: {
1195
+ f32(value: ExpressionRef): ExpressionRef;
1196
+ f64(value: ExpressionRef): ExpressionRef;
1197
+ };
1198
+ trunc_u_sat: {
1199
+ f32(value: ExpressionRef): ExpressionRef;
1200
+ f64(value: ExpressionRef): ExpressionRef;
1201
+ };
1202
+ reinterpret(value: ExpressionRef): ExpressionRef;
1203
+ extend8_s(value: ExpressionRef): ExpressionRef;
1204
+ extend16_s(value: ExpressionRef): ExpressionRef;
1205
+ wrap(value: ExpressionRef): ExpressionRef;
1206
+ add(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1207
+ sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1208
+ mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1209
+ div_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1210
+ div_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1211
+ rem_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1212
+ rem_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1213
+ and(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1214
+ or(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1215
+ xor(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1216
+ shl(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1217
+ shr_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1218
+ shr_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1219
+ rotl(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1220
+ rotr(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1221
+ eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1222
+ ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1223
+ lt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1224
+ lt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1225
+ le_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1226
+ le_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1227
+ gt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1228
+ gt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1229
+ ge_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1230
+ ge_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1231
+ atomic: {
1232
+ load(offset: number, ptr: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1233
+ load8_u(offset: number, ptr: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1234
+ load16_u(offset: number, ptr: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1235
+ store(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1236
+ store8(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1237
+ store16(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1238
+ rmw: {
1239
+ add(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1240
+ sub(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1241
+ and(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1242
+ or(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1243
+ xor(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1244
+ xchg(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1245
+ cmpxchg(offset: number, ptr: ExpressionRef, expected: ExpressionRef, replacement: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1246
+ },
1247
+ rmw8_u: {
1248
+ add(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1249
+ sub(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1250
+ and(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1251
+ or(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1252
+ xor(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1253
+ xchg(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1254
+ cmpxchg(offset: number, ptr: ExpressionRef, expected: ExpressionRef, replacement: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1255
+ },
1256
+ rmw16_u: {
1257
+ add(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1258
+ sub(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1259
+ and(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1260
+ or(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1261
+ xor(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1262
+ xchg(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1263
+ cmpxchg(offset: number, ptr: ExpressionRef, expected: ExpressionRef, replacement: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1264
+ },
1265
+ },
1266
+ pop(): ExpressionRef;
1267
+ };
1268
+ i64: {
1269
+ load(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1270
+ load8_s(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1271
+ load8_u(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1272
+ load16_s(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1273
+ load16_u(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1274
+ load32_s(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1275
+ load32_u(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1276
+ store(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef, name?: string): ExpressionRef;
1277
+ store8(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef, name?: string): ExpressionRef;
1278
+ store16(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef, name?: string): ExpressionRef;
1279
+ store32(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef, name?: string): ExpressionRef;
1280
+ const(lowOrBigInt: number | bigint, high?: number): ExpressionRef;
1281
+ clz(value: ExpressionRef): ExpressionRef;
1282
+ ctz(value: ExpressionRef): ExpressionRef;
1283
+ popcnt(value: ExpressionRef): ExpressionRef;
1284
+ eqz(value: ExpressionRef): ExpressionRef;
1285
+ trunc_s: {
1286
+ f32(value: ExpressionRef): ExpressionRef;
1287
+ f64(value: ExpressionRef): ExpressionRef;
1288
+ };
1289
+ trunc_u: {
1290
+ f32(value: ExpressionRef): ExpressionRef;
1291
+ f64(value: ExpressionRef): ExpressionRef;
1292
+ };
1293
+ trunc_s_sat: {
1294
+ f32(value: ExpressionRef): ExpressionRef;
1295
+ f64(value: ExpressionRef): ExpressionRef;
1296
+ };
1297
+ trunc_u_sat: {
1298
+ f32(value: ExpressionRef): ExpressionRef;
1299
+ f64(value: ExpressionRef): ExpressionRef;
1300
+ };
1301
+ reinterpret(value: ExpressionRef): ExpressionRef;
1302
+ extend8_s(value: ExpressionRef): ExpressionRef;
1303
+ extend16_s(value: ExpressionRef): ExpressionRef;
1304
+ extend32_s(value: ExpressionRef): ExpressionRef;
1305
+ extend_s(value: ExpressionRef): ExpressionRef;
1306
+ extend_u(value: ExpressionRef): ExpressionRef;
1307
+ add(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1308
+ sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1309
+ mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1310
+ div_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1311
+ div_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1312
+ rem_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1313
+ rem_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1314
+ and(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1315
+ or(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1316
+ xor(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1317
+ shl(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1318
+ shr_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1319
+ shr_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1320
+ rotl(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1321
+ rotr(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1322
+ eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1323
+ ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1324
+ lt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1325
+ lt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1326
+ le_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1327
+ le_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1328
+ gt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1329
+ gt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1330
+ ge_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1331
+ ge_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1332
+ atomic: {
1333
+ load(offset: number, ptr: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1334
+ load8_u(offset: number, ptr: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1335
+ load16_u(offset: number, ptr: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1336
+ load32_u(offset: number, ptr: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1337
+ store(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1338
+ store8(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1339
+ store16(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1340
+ store32(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1341
+ rmw: {
1342
+ add(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1343
+ sub(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1344
+ and(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1345
+ or(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1346
+ xor(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1347
+ xchg(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1348
+ cmpxchg(offset: number, ptr: ExpressionRef, expected: ExpressionRef, replacement: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1349
+ },
1350
+ rmw8_u: {
1351
+ add(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1352
+ sub(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1353
+ and(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1354
+ or(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1355
+ xor(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1356
+ xchg(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1357
+ cmpxchg(offset: number, ptr: ExpressionRef, expected: ExpressionRef, replacement: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1358
+ },
1359
+ rmw16_u: {
1360
+ add(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1361
+ sub(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1362
+ and(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1363
+ or(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1364
+ xor(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1365
+ xchg(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1366
+ cmpxchg(offset: number, ptr: ExpressionRef, expected: ExpressionRef, replacement: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1367
+ },
1368
+ rmw32_u: {
1369
+ add(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1370
+ sub(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1371
+ and(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1372
+ or(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1373
+ xor(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1374
+ xchg(offset: number, ptr: ExpressionRef, value: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1375
+ cmpxchg(offset: number, ptr: ExpressionRef, expected: ExpressionRef, replacement: ExpressionRef, name?: string, order?: MemoryOrder): ExpressionRef;
1376
+ },
1377
+ },
1378
+ pop(): ExpressionRef;
1379
+ };
1380
+ f32: {
1381
+ load(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1382
+ store(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef, name?: string): ExpressionRef;
1383
+ const(value: number): ExpressionRef;
1384
+ const_bits(value: number): ExpressionRef;
1385
+ neg(value: ExpressionRef): ExpressionRef;
1386
+ abs(value: ExpressionRef): ExpressionRef;
1387
+ ceil(value: ExpressionRef): ExpressionRef;
1388
+ floor(value: ExpressionRef): ExpressionRef;
1389
+ trunc(value: ExpressionRef): ExpressionRef;
1390
+ nearest(value: ExpressionRef): ExpressionRef;
1391
+ sqrt(value: ExpressionRef): ExpressionRef;
1392
+ reinterpret(value: ExpressionRef): ExpressionRef;
1393
+ convert_s: {
1394
+ i32(value: ExpressionRef): ExpressionRef;
1395
+ i64(value: ExpressionRef): ExpressionRef;
1396
+ };
1397
+ convert_u: {
1398
+ i32(value: ExpressionRef): ExpressionRef;
1399
+ i64(value: ExpressionRef): ExpressionRef;
1400
+ };
1401
+ demote(value: ExpressionRef): ExpressionRef;
1402
+ add(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1403
+ sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1404
+ mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1405
+ div(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1406
+ copysign(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1407
+ min(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1408
+ max(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1409
+ eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1410
+ ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1411
+ lt(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1412
+ le(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1413
+ gt(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1414
+ ge(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1415
+ pop(): ExpressionRef;
1416
+ };
1417
+ f64: {
1418
+ load(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1419
+ store(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef, name?: string): ExpressionRef;
1420
+ const(value: number): ExpressionRef;
1421
+ const_bits(lowOrBigInt: number | bigint, high?: number): ExpressionRef;
1422
+ neg(value: ExpressionRef): ExpressionRef;
1423
+ abs(value: ExpressionRef): ExpressionRef;
1424
+ ceil(value: ExpressionRef): ExpressionRef;
1425
+ floor(value: ExpressionRef): ExpressionRef;
1426
+ trunc(value: ExpressionRef): ExpressionRef;
1427
+ nearest(value: ExpressionRef): ExpressionRef;
1428
+ sqrt(value: ExpressionRef): ExpressionRef;
1429
+ reinterpret(value: ExpressionRef): ExpressionRef;
1430
+ convert_s: {
1431
+ i32(value: ExpressionRef): ExpressionRef;
1432
+ i64(value: ExpressionRef): ExpressionRef;
1433
+ };
1434
+ convert_u: {
1435
+ i32(value: ExpressionRef): ExpressionRef;
1436
+ i64(value: ExpressionRef): ExpressionRef;
1437
+ };
1438
+ promote(value: ExpressionRef): ExpressionRef;
1439
+ add(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1440
+ sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1441
+ mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1442
+ div(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1443
+ copysign(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1444
+ min(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1445
+ max(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1446
+ eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1447
+ ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1448
+ lt(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1449
+ le(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1450
+ gt(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1451
+ ge(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1452
+ pop(): ExpressionRef;
1453
+ };
1454
+ v128: {
1455
+ load(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1456
+ load8_splat(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1457
+ load16_splat(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1458
+ load32_splat(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1459
+ load64_splat(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1460
+ load8x8_s(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1461
+ load8x8_u(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1462
+ load16x4_s(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1463
+ load16x4_u(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1464
+ load32x2_s(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1465
+ load32x2_u(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1466
+ load32_zero(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1467
+ load64_zero(offset: number, align: number, ptr: ExpressionRef, name?: string): ExpressionRef;
1468
+ load8_lane(offset: number, align: number, index: number, ptr: ExpressionRef, vec: ExpressionRef, name?: string): ExpressionRef;
1469
+ load16_lane(offset: number, align: number, index: number, ptr: ExpressionRef, vec: ExpressionRef, name?: string): ExpressionRef;
1470
+ load32_lane(offset: number, align: number, index: number, ptr: ExpressionRef, vec: ExpressionRef, name?: string): ExpressionRef;
1471
+ load64_lane(offset: number, align: number, index: number, ptr: ExpressionRef, vec: ExpressionRef, name?: string): ExpressionRef;
1472
+ store8_lane(offset: number, align: number, index: number, pt: ExpressionRef, vec: ExpressionRef, name?: string): ExpressionRef;
1473
+ store16_lane(offset: number, align: number, index: number, pt: ExpressionRef, vec: ExpressionRef, name?: string): ExpressionRef;
1474
+ store32_lane(offset: number, align: number, index: number, pt: ExpressionRef, vec: ExpressionRef, name?: string): ExpressionRef;
1475
+ store64_lane(offset: number, align: number, index: number, pt: ExpressionRef, vec: ExpressionRef, name?: string): ExpressionRef;
1476
+ store(offset: number, align: number, ptr: ExpressionRef, value: ExpressionRef, name?: string): ExpressionRef;
1477
+ const(value: ArrayLike<number>): ExpressionRef;
1478
+ not(value: ExpressionRef): ExpressionRef;
1479
+ any_true(value: ExpressionRef): ExpressionRef;
1480
+ and(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1481
+ or(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1482
+ xor(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1483
+ andnot(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1484
+ bitselect(left: ExpressionRef, right: ExpressionRef, cond: ExpressionRef): ExpressionRef;
1485
+ pop(): ExpressionRef;
1486
+ };
1487
+ i8x16: {
1488
+ shuffle(left: ExpressionRef, right: ExpressionRef, mask: ArrayLike<number>): ExpressionRef;
1489
+ swizzle(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1490
+ splat(value: ExpressionRef): ExpressionRef;
1491
+ extract_lane_s(vec: ExpressionRef, index: ExpressionRef): ExpressionRef;
1492
+ extract_lane_u(vec: ExpressionRef, index: ExpressionRef): ExpressionRef;
1493
+ replace_lane(vec: ExpressionRef, index: ExpressionRef, value: ExpressionRef): ExpressionRef;
1494
+ eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1495
+ ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1496
+ lt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1497
+ lt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1498
+ gt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1499
+ gt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1500
+ le_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1501
+ le_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1502
+ ge_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1503
+ ge_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1504
+ abs(value: ExpressionRef): ExpressionRef;
1505
+ neg(value: ExpressionRef): ExpressionRef;
1506
+ all_true(value: ExpressionRef): ExpressionRef;
1507
+ bitmask(value: ExpressionRef): ExpressionRef;
1508
+ popcnt(value: ExpressionRef): ExpressionRef;
1509
+ shl(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef;
1510
+ shr_s(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef;
1511
+ shr_u(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef;
1512
+ add(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1513
+ add_saturate_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1514
+ add_saturate_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1515
+ sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1516
+ sub_saturate_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1517
+ sub_saturate_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1518
+ mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1519
+ min_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1520
+ min_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1521
+ max_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1522
+ max_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1523
+ avgr_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1524
+ narrow_i16x8_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1525
+ narrow_i16x8_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1526
+ };
1527
+ i16x8: {
1528
+ splat(value: ExpressionRef): ExpressionRef;
1529
+ extract_lane_s(vec: ExpressionRef, index: ExpressionRef): ExpressionRef;
1530
+ extract_lane_u(vec: ExpressionRef, index: ExpressionRef): ExpressionRef;
1531
+ replace_lane(vec: ExpressionRef, index: ExpressionRef, value: ExpressionRef): ExpressionRef;
1532
+ eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1533
+ ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1534
+ lt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1535
+ lt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1536
+ gt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1537
+ gt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1538
+ le_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1539
+ le_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1540
+ ge_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1541
+ ge_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1542
+ abs(value: ExpressionRef): ExpressionRef;
1543
+ neg(value: ExpressionRef): ExpressionRef;
1544
+ all_true(value: ExpressionRef): ExpressionRef;
1545
+ bitmask(value: ExpressionRef): ExpressionRef;
1546
+ shl(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef;
1547
+ shr_s(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef;
1548
+ shr_u(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef;
1549
+ add(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1550
+ add_saturate_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1551
+ add_saturate_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1552
+ sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1553
+ sub_saturate_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1554
+ sub_saturate_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1555
+ mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1556
+ min_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1557
+ min_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1558
+ max_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1559
+ max_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1560
+ avgr_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1561
+ q15mulr_sat_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1562
+ extmul_low_i8x16_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1563
+ extmul_high_i8x16_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1564
+ extmul_low_i8x16_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1565
+ extmul_high_i8x16_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1566
+ extadd_pairwise_i8x16_s(value: ExpressionRef): ExpressionRef;
1567
+ extadd_pairwise_i8x16_u(value: ExpressionRef): ExpressionRef;
1568
+ narrow_i32x4_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1569
+ narrow_i32x4_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1570
+ extend_low_i8x16_s(value: ExpressionRef): ExpressionRef;
1571
+ extend_high_i8x16_s(value: ExpressionRef): ExpressionRef;
1572
+ extend_low_i8x16_u(value: ExpressionRef): ExpressionRef;
1573
+ extend_high_i8x16_u(value: ExpressionRef): ExpressionRef;
1574
+ };
1575
+ i32x4: {
1576
+ splat(value: ExpressionRef): ExpressionRef;
1577
+ extract_lane(vec: ExpressionRef, index: ExpressionRef): ExpressionRef;
1578
+ replace_lane(vec: ExpressionRef, index: ExpressionRef, value: ExpressionRef): ExpressionRef;
1579
+ eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1580
+ ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1581
+ lt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1582
+ lt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1583
+ gt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1584
+ gt_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1585
+ le_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1586
+ le_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1587
+ ge_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1588
+ ge_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1589
+ abs(value: ExpressionRef): ExpressionRef;
1590
+ neg(value: ExpressionRef): ExpressionRef;
1591
+ all_true(value: ExpressionRef): ExpressionRef;
1592
+ bitmask(value: ExpressionRef): ExpressionRef;
1593
+ shl(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef;
1594
+ shr_s(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef;
1595
+ shr_u(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef;
1596
+ add(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1597
+ sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1598
+ mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1599
+ min_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1600
+ min_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1601
+ max_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1602
+ max_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1603
+ dot_i16x8_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1604
+ extmul_low_i16x8_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1605
+ extmul_high_i16x8_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1606
+ extmul_low_i16x8_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1607
+ extmul_high_i16x8_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1608
+ extadd_pairwise_i16x8_s(value: ExpressionRef): ExpressionRef;
1609
+ extadd_pairwise_i16x8_u(value: ExpressionRef): ExpressionRef;
1610
+ trunc_sat_f32x4_s(value: ExpressionRef): ExpressionRef;
1611
+ trunc_sat_f32x4_u(value: ExpressionRef): ExpressionRef;
1612
+ extend_low_i16x8_s(value: ExpressionRef): ExpressionRef;
1613
+ extend_high_i16x8_s(value: ExpressionRef): ExpressionRef;
1614
+ extend_low_i16x8_u(value: ExpressionRef): ExpressionRef;
1615
+ extend_high_i16x8_u(value: ExpressionRef): ExpressionRef;
1616
+ trunc_sat_f64x2_s_zero(value: ExpressionRef): ExpressionRef;
1617
+ trunc_sat_f64x2_u_zero(value: ExpressionRef): ExpressionRef;
1618
+ };
1619
+ i64x2: {
1620
+ splat(value: ExpressionRef): ExpressionRef;
1621
+ extract_lane(vec: ExpressionRef, index: ExpressionRef): ExpressionRef;
1622
+ replace_lane(vec: ExpressionRef, index: ExpressionRef, value: ExpressionRef): ExpressionRef;
1623
+ eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1624
+ ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1625
+ lt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1626
+ gt_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1627
+ le_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1628
+ ge_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1629
+ abs(value: ExpressionRef): ExpressionRef;
1630
+ neg(value: ExpressionRef): ExpressionRef;
1631
+ all_true(value: ExpressionRef): ExpressionRef;
1632
+ bitmask(value: ExpressionRef): ExpressionRef;
1633
+ shl(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef;
1634
+ shr_s(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef;
1635
+ shr_u(vec: ExpressionRef, shift: ExpressionRef): ExpressionRef;
1636
+ add(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1637
+ sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1638
+ mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1639
+ extmul_low_i32x4_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1640
+ extmul_high_i32x4_s(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1641
+ extmul_low_i32x4_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1642
+ extmul_high_i32x4_u(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1643
+ extend_low_i32x4_s(value: ExpressionRef): ExpressionRef;
1644
+ extend_high_i32x4_s(value: ExpressionRef): ExpressionRef;
1645
+ extend_low_i32x4_u(value: ExpressionRef): ExpressionRef;
1646
+ extend_high_i32x4_u(value: ExpressionRef): ExpressionRef;
1647
+ };
1648
+ f32x4: {
1649
+ splat(value: ExpressionRef): ExpressionRef;
1650
+ extract_lane(vec: ExpressionRef, index: ExpressionRef): ExpressionRef;
1651
+ replace_lane(vec: ExpressionRef, index: ExpressionRef, value: ExpressionRef): ExpressionRef;
1652
+ eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1653
+ ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1654
+ lt(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1655
+ gt(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1656
+ le(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1657
+ ge(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1658
+ abs(value: ExpressionRef): ExpressionRef;
1659
+ neg(value: ExpressionRef): ExpressionRef;
1660
+ sqrt(value: ExpressionRef): ExpressionRef;
1661
+ add(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1662
+ sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1663
+ mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1664
+ div(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1665
+ min(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1666
+ max(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1667
+ pmin(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1668
+ pmax(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1669
+ ceil(value: ExpressionRef): ExpressionRef;
1670
+ floor(value: ExpressionRef): ExpressionRef;
1671
+ trunc(value: ExpressionRef): ExpressionRef;
1672
+ nearest(value: ExpressionRef): ExpressionRef;
1673
+ convert_i32x4_s(value: ExpressionRef): ExpressionRef;
1674
+ convert_i32x4_u(value: ExpressionRef): ExpressionRef;
1675
+ demote_f64x2_zero(value: ExpressionRef): ExpressionRef;
1676
+ };
1677
+ f64x2: {
1678
+ splat(value: ExpressionRef): ExpressionRef;
1679
+ extract_lane(vec: ExpressionRef, index: ExpressionRef): ExpressionRef;
1680
+ replace_lane(vec: ExpressionRef, index: ExpressionRef, value: ExpressionRef): ExpressionRef;
1681
+ eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1682
+ ne(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1683
+ lt(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1684
+ gt(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1685
+ le(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1686
+ ge(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1687
+ abs(value: ExpressionRef): ExpressionRef;
1688
+ neg(value: ExpressionRef): ExpressionRef;
1689
+ sqrt(value: ExpressionRef): ExpressionRef;
1690
+ add(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1691
+ sub(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1692
+ mul(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1693
+ div(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1694
+ min(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1695
+ max(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1696
+ pmin(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1697
+ pmax(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1698
+ ceil(value: ExpressionRef): ExpressionRef;
1699
+ floor(value: ExpressionRef): ExpressionRef;
1700
+ trunc(value: ExpressionRef): ExpressionRef;
1701
+ nearest(value: ExpressionRef): ExpressionRef;
1702
+ convert_low_i32x4_s(value: ExpressionRef): ExpressionRef;
1703
+ convert_low_i32x4_u(value: ExpressionRef): ExpressionRef;
1704
+ promote_low_f32x4(value: ExpressionRef): ExpressionRef;
1705
+ };
1706
+ funcref: {
1707
+ pop(): ExpressionRef;
1708
+ };
1709
+ externref: {
1710
+ pop(): ExpressionRef;
1711
+ };
1712
+ anyref: {
1713
+ pop(): ExpressionRef;
1714
+ };
1715
+ eqref: {
1716
+ pop(): ExpressionRef;
1717
+ };
1718
+ i31ref: {
1719
+ pop(): ExpressionRef;
1720
+ };
1721
+ structref: {
1722
+ pop(): ExpressionRef;
1723
+ };
1724
+ arrayref: {
1725
+ pop(): ExpressionRef;
1726
+ };
1727
+ stringref: {
1728
+ pop(): ExpressionRef;
1729
+ };
1730
+ ref: {
1731
+ null(type: Type): ExpressionRef;
1732
+ is_null(value: ExpressionRef): ExpressionRef;
1733
+ as_non_null(value: ExpressionRef): ExpressionRef;
1734
+ func(name: string, type: Type): ExpressionRef;
1735
+ i31(value: ExpressionRef): ExpressionRef;
1736
+ eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1737
+ test(value: ExpressionRef, castType: Type): ExpressionRef;
1738
+ cast(value: ExpressionRef, castType: Type): ExpressionRef;
1739
+ };
1740
+ i31: {
1741
+ get_s(i31: ExpressionRef): ExpressionRef;
1742
+ get_u(i31: ExpressionRef): ExpressionRef;
1743
+ }
1744
+ atomic: {
1745
+ fence(): ExpressionRef;
1746
+ };
1747
+ tuple: {
1748
+ make(elements: ExportRef[]): ExpressionRef;
1749
+ extract(tuple: ExpressionRef, index: number): ExpressionRef;
1750
+ };
1751
+ struct: {
1752
+ new(operands: Type[], type: Type): ExpressionRef;
1753
+ new_default(type: Type): ExpressionRef;
1754
+ get(index: number, ref: ExpressionRef, type: Type, signed: boolean): ExpressionRef;
1755
+ set(index: number, ref: ExpressionRef, value: ExpressionRef): ExpressionRef;
1756
+ };
1757
+ array: {
1758
+ new(type: Type, size: ExpressionRef, init: ExpressionRef): ExpressionRef;
1759
+ new_default(type: Type, size: ExpressionRef): ExpressionRef;
1760
+ new_fixed(type: Type, values: ExpressionRef[]): ExpressionRef;
1761
+ new_data(type: Type, name: string, offset: ExpressionRef, size: ExpressionRef): ExpressionRef;
1762
+ new_elem(type: Type, name: string, offset: ExpressionRef, size: ExpressionRef): ExpressionRef;
1763
+ get(ref: ExpressionRef, index: ExpressionRef, type: Type, signed: boolean): ExpressionRef;
1764
+ set(ref: ExpressionRef, index: ExpressionRef, value: ExpressionRef): ExpressionRef;
1765
+ len(ref: ExpressionRef): ExpressionRef;
1766
+ fill(ref: ExpressionRef, index: ExpressionRef, value: ExpressionRef, size: ExpressionRef): ExpressionRef;
1767
+ copy(destRef: ExpressionRef, destIndex: ExpressionRef, srcRef: ExpressionRef, srcIndex: ExpressionRef, length: ExpressionRef): ExpressionRef;
1768
+ init_data(name: string, ref: ExpressionRef, index: ExpressionRef, offset: ExpressionRef, size: ExpressionRef): ExpressionRef;
1769
+ init_elem(name: string, ref: ExpressionRef, index: ExpressionRef, offset: ExpressionRef, size: ExpressionRef): ExpressionRef;
1770
+ };
1771
+ Function: {
1772
+ getName(func: FunctionRef): string;
1773
+ getParams(func: FunctionRef): Type;
1774
+ getResults(func: FunctionRef): Type;
1775
+ getNumVars(func: FunctionRef): number;
1776
+ getVar(func: FunctionRef, index: number): Type;
1777
+ getNumLocals(func: FunctionRef): number;
1778
+ hasLocalName(func: FunctionRef, index: number): boolean;
1779
+ getLocalName(func: FunctionRef, index: number): string;
1780
+ setLocalName(func: ExpressionRef, index: number, name: string): void;
1781
+ getBody(func: FunctionRef): ExpressionRef;
1782
+ setBody(func: FunctionRef, bodyExpr: ExpressionRef): void;
1783
+ };
1784
+ call_ref(target: ExpressionRef, operands: ExpressionRef[], type: Type): ExpressionRef;
1785
+ return_call_ref(target: ExpressionRef, operands: ExpressionRef[], type: Type): ExpressionRef;
1786
+ try(name: string, body: ExpressionRef, catchTags: string[], catchBodies: ExpressionRef[], delegateTarget?: string): ExpressionRef;
1787
+ throw(tag: string, operands: ExpressionRef[]): ExpressionRef;
1788
+ rethrow(target: string): ExpressionRef;
1789
+ select(condition: ExpressionRef, ifTrue: ExpressionRef, ifFalse: ExpressionRef): ExpressionRef;
1790
+ drop(value: ExpressionRef): ExpressionRef;
1791
+ return(value?: ExpressionRef): ExpressionRef;
1792
+ nop(): ExpressionRef;
1793
+ unreachable(): ExpressionRef;
1794
+ addFunction(name: string, params: Type, results: Type, vars: Type[], body: ExpressionRef): FunctionRef;
1795
+ getFunction(name: string): FunctionRef;
1796
+ removeFunction(name: string): void;
1797
+ getNumFunctions(): number;
1798
+ getFunctionByIndex(index: number): FunctionRef;
1799
+ addGlobal(name: string, type: Type, mutable: boolean, init: ExpressionRef): GlobalRef;
1800
+ getGlobal(name: string): GlobalRef;
1801
+ removeGlobal(name: string): void;
1802
+ addTable(name: string, initial: number, maximum: number): TableRef;
1803
+ getTable(name: string): TableRef;
1804
+ removeTable(name: string): void;
1805
+ addActiveElementSegment(table: string, name: string, funcNames: string[], offset: ExpressionRef): ElementSegmentRef;
1806
+ addPassiveElementSegment(name: string, funcNames: string[]): ElementSegmentRef;
1807
+ getElementSegment(name: string): ElementSegmentRef;
1808
+ getTableSegments(table: string): string[];
1809
+ removeElementSegment(name: string): void;
1810
+ addTag(name: string, params: Type, results: Type): TagRef;
1811
+ getTag(name: string): TagRef;
1812
+ removeTag(name: string): void;
1813
+ addFunctionImport(internalName: string, externalModuleName: string, externalBaseName: string, params: Type, results: Type): void;
1814
+ addTableImport(internalName: string, externalModuleName: string, externalBaseName: string): void;
1815
+ addMemoryImport(internalName: string, externalModuleName: string, externalBaseName: string, shared?: boolean): void;
1816
+ addGlobalImport(internalName: string, externalModuleName: string, externalBaseName: string, globalType: Type, mutable?: boolean): void;
1817
+ addTagImport(internalName: string, externalModuleName: string, externalBaseName: string, params: Type, results: Type): void;
1818
+ addFunctionExport(internalName: string, externalName: string): ExportRef;
1819
+ addTableExport(internalName: string, externalName: string): ExportRef;
1820
+ addMemoryExport(internalName: string, externalName: string): ExportRef;
1821
+ addGlobalExport(internalName: string, externalName: string): ExportRef;
1822
+ addTagExport(internalName: string, externalName: string): ExportRef;
1823
+ removeExport(externalName: string): void;
1824
+ getExport(externalName: string): ExportRef;
1825
+ getNumExports(): number;
1826
+ getExportByIndex(index: number): ExportRef;
1827
+ setMemory(initial: number, maximum: number, exportName?: string | null, segments?: MemorySegment[] | null, shared?: boolean, memory64?: boolean, internalName?: string): void;
1828
+ getMemorySegmentInfo(name: string): MemorySegmentInfo;
1829
+ getStart(): FunctionRef;
1830
+ setStart(start: FunctionRef): void;
1831
+ getFeatures(): Features;
1832
+ setFeatures(features: Features): void;
1833
+ setTypeName(heapType: HeapType, name: string): void;
1834
+ setFieldName(heapType: HeapType, index: number, name: string): void;
1835
+ addCustomSection(name: string, contents: Uint8Array): void;
1836
+ getNumGlobals(): number;
1837
+ getNumTables(): number;
1838
+ hasMemory(): boolean;
1839
+ getMemoryInfo(name?: string): MemoryInfo;
1840
+ getNumMemorySegments(): number;
1841
+ getNumElementSegments(): number;
1842
+ getGlobalByIndex(index: number): GlobalRef;
1843
+ getTableByIndex(index: number): TableRef;
1844
+ getElementSegmentByIndex(index: number): ElementSegmentRef;
1845
+ getDataSegment(name: string): DataSegmentRef;
1846
+ getDataSegmentByIndex(index: number): DataSegmentRef;
1847
+ emitText(): string;
1848
+ emitStackIR(): string;
1849
+ emitAsmjs(): string;
1850
+ validate(): number;
1851
+ optimize(): void;
1852
+ optimizeFunction(func: string | FunctionRef): void;
1853
+ runPasses(passes: string[]): void;
1854
+ runPassesOnFunction(func: string | FunctionRef, passes: string[]): void;
1855
+ dispose(): void;
1856
+ emitBinary(): Uint8Array;
1857
+ emitBinary(sourceMapUrl: string | null): { binary: Uint8Array; sourceMap: string | null; };
1858
+ interpret(): void;
1859
+ addDebugInfoFileName(filename: string): number;
1860
+ getDebugInfoFileName(index: number): string | null;
1861
+ setDebugLocation(func: FunctionRef, expr: ExpressionRef, fileIndex: number, lineNumber: number, columnNumber: number): void;
1862
+ copyExpression(expr: ExpressionRef): ExpressionRef;
1863
+ }
1864
+
1865
+ interface TypeBuilderField {
1866
+ type: Type;
1867
+ packedType: PackedType;
1868
+ mutable: boolean;
1869
+ }
1870
+
1871
+ class TypeBuilder {
1872
+ constructor(size: number);
1873
+ ptr: number;
1874
+ grow(count: number): void;
1875
+ getSize(): number;
1876
+ setSignatureType(index: number, paramTypes: Type, resultTypes: Type): void;
1877
+ setStructType(index: number, fields?: TypeBuilderField[]): void;
1878
+ setArrayType(index: number, elementType: Type, elementPackedType: Type, elementMutable: boolean): void;
1879
+ getTempHeapType(index: number): HeapType;
1880
+ getTempTupleType(types: Type[]): Type;
1881
+ getTempRefType(heapType: HeapType, nullable: boolean): Type;
1882
+ setSubType(index: number, superType: HeapType): void;
1883
+ setOpen(index: number): void;
1884
+ createRecGroup(index: number, length: number): void;
1885
+ buildAndDispose(): HeapType[];
1886
+ }
1887
+
1888
+ interface MemorySegment {
1889
+ offset: ExpressionRef;
1890
+ data: Uint8Array;
1891
+ passive?: boolean;
1892
+ }
1893
+
1894
+ interface TableElement {
1895
+ offset: ExpressionRef;
1896
+ names: string[];
1897
+ }
1898
+
1899
+ function wrapModule(ptr: number): Module;
1900
+
1901
+ function getExpressionId(expression: ExpressionRef): number;
1902
+ function getExpressionType(expression: ExpressionRef): Type;
1903
+ function getExpressionInfo(expression: ExpressionRef): ExpressionInfo;
1904
+
1905
+ interface MemorySegmentInfo {
1906
+ offset: ExpressionRef;
1907
+ data: Uint8Array;
1908
+ passive: boolean;
1909
+ }
1910
+
1911
+ interface MemoryInfo {
1912
+ module: string | null;
1913
+ base: string | null;
1914
+ shared: boolean;
1915
+ is64: boolean;
1916
+ initial: number;
1917
+ max?: number;
1918
+ }
1919
+
1920
+ interface ExpressionInfo {
1921
+ id: ExpressionIds;
1922
+ type: Type;
1923
+ }
1924
+
1925
+ interface BlockInfo extends ExpressionInfo {
1926
+ name: string;
1927
+ children: ExpressionRef[];
1928
+ }
1929
+
1930
+ interface IfInfo extends ExpressionInfo {
1931
+ condition: ExpressionRef;
1932
+ ifTrue: ExpressionRef;
1933
+ ifFalse: ExpressionRef;
1934
+ }
1935
+
1936
+ interface LoopInfo extends ExpressionInfo {
1937
+ name: string;
1938
+ body: ExpressionRef;
1939
+ }
1940
+
1941
+ interface BreakInfo extends ExpressionInfo {
1942
+ name: string;
1943
+ condition: ExpressionRef;
1944
+ value: ExpressionRef;
1945
+ }
1946
+
1947
+ interface SwitchInfo extends ExpressionInfo {
1948
+ names: string[];
1949
+ defaultName: string | null;
1950
+ condition: ExpressionRef;
1951
+ value: ExpressionRef;
1952
+ }
1953
+
1954
+ interface CallInfo extends ExpressionInfo {
1955
+ isReturn: boolean;
1956
+ target: string;
1957
+ operands: ExpressionRef[];
1958
+ }
1959
+
1960
+ interface CallIndirectInfo extends ExpressionInfo {
1961
+ isReturn: boolean;
1962
+ target: ExpressionRef;
1963
+ operands: ExpressionRef[];
1964
+ }
1965
+
1966
+ interface LocalGetInfo extends ExpressionInfo {
1967
+ index: number;
1968
+ }
1969
+
1970
+ interface LocalSetInfo extends ExpressionInfo {
1971
+ isTee: boolean;
1972
+ index: number;
1973
+ value: ExpressionRef;
1974
+ }
1975
+
1976
+ interface GlobalGetInfo extends ExpressionInfo {
1977
+ name: string;
1978
+ }
1979
+
1980
+ interface GlobalSetInfo extends ExpressionInfo {
1981
+ name: string;
1982
+ value: ExpressionRef;
1983
+ }
1984
+
1985
+ interface TableGetInfo extends ExpressionInfo {
1986
+ table: string;
1987
+ index: ExpressionRef;
1988
+ }
1989
+
1990
+ interface TableSetInfo extends ExpressionInfo {
1991
+ table: string;
1992
+ index: ExpressionRef;
1993
+ value: ExpressionRef;
1994
+ }
1995
+
1996
+ interface TableSizeInfo extends ExpressionInfo {
1997
+ table: string;
1998
+ }
1999
+
2000
+ interface TableGrowInfo extends ExpressionInfo {
2001
+ table: string;
2002
+ value: ExpressionRef;
2003
+ delta: ExpressionRef;
2004
+ }
2005
+
2006
+ interface LoadInfo extends ExpressionInfo {
2007
+ isAtomic: boolean;
2008
+ isSigned: boolean;
2009
+ offset: number;
2010
+ bytes: number;
2011
+ align: number;
2012
+ ptr: ExpressionRef;
2013
+ }
2014
+
2015
+ interface StoreInfo extends ExpressionInfo {
2016
+ isAtomic: boolean;
2017
+ offset: number;
2018
+ bytes: number;
2019
+ align: number;
2020
+ ptr: ExpressionRef;
2021
+ value: ExpressionRef;
2022
+ }
2023
+
2024
+ interface ConstInfo extends ExpressionInfo {
2025
+ value: number | { low: number, high: number } | Array<number>;
2026
+ }
2027
+
2028
+ interface UnaryInfo extends ExpressionInfo {
2029
+ op: Operations;
2030
+ value: ExpressionRef;
2031
+ }
2032
+
2033
+ interface BinaryInfo extends ExpressionInfo {
2034
+ op: Operations;
2035
+ left: ExpressionRef;
2036
+ right: ExpressionRef;
2037
+ }
2038
+
2039
+ interface SelectInfo extends ExpressionInfo {
2040
+ ifTrue: ExpressionRef;
2041
+ ifFalse: ExpressionRef;
2042
+ condition: ExpressionRef;
2043
+ }
2044
+
2045
+ interface DropInfo extends ExpressionInfo {
2046
+ value: ExpressionRef;
2047
+ }
2048
+
2049
+ interface ReturnInfo extends ExpressionInfo {
2050
+ value: ExpressionRef;
2051
+ }
2052
+
2053
+ interface NopInfo extends ExpressionInfo {
2054
+ }
2055
+
2056
+ interface UnreachableInfo extends ExpressionInfo {
2057
+ }
2058
+
2059
+ interface PopInfo extends ExpressionInfo {
2060
+ }
2061
+
2062
+ interface MemorySizeInfo extends ExpressionInfo {
2063
+ }
2064
+
2065
+ interface MemoryGrowInfo extends ExpressionInfo {
2066
+ delta: ExpressionRef;
2067
+ }
2068
+
2069
+ interface AtomicRMWInfo extends ExpressionInfo {
2070
+ op: Operations;
2071
+ bytes: number;
2072
+ offset: number;
2073
+ ptr: ExpressionRef;
2074
+ value: ExpressionRef;
2075
+ }
2076
+
2077
+ interface AtomicCmpxchgInfo extends ExpressionInfo {
2078
+ bytes: number;
2079
+ offset: number;
2080
+ ptr: ExpressionRef;
2081
+ expected: ExpressionRef;
2082
+ replacement: ExpressionRef;
2083
+ }
2084
+
2085
+ interface AtomicWaitInfo extends ExpressionInfo {
2086
+ ptr: ExpressionRef;
2087
+ expected: ExpressionRef;
2088
+ timeout: ExpressionRef;
2089
+ expectedType: Type;
2090
+ }
2091
+
2092
+ interface AtomicNotifyInfo extends ExpressionInfo {
2093
+ ptr: ExpressionRef;
2094
+ notifyCount: ExpressionRef;
2095
+ }
2096
+
2097
+ interface AtomicFenceInfo extends ExpressionInfo {
2098
+ order: number;
2099
+ }
2100
+
2101
+ interface SIMDExtractInfo extends ExpressionInfo {
2102
+ op: Operations;
2103
+ vec: ExpressionRef;
2104
+ index: ExpressionRef;
2105
+ }
2106
+
2107
+ interface SIMDReplaceInfo extends ExpressionInfo {
2108
+ op: Operations;
2109
+ vec: ExpressionRef;
2110
+ index: ExpressionRef;
2111
+ value: ExpressionRef;
2112
+ }
2113
+
2114
+ interface SIMDShuffleInfo extends ExpressionInfo {
2115
+ left: ExpressionRef;
2116
+ right: ExpressionRef;
2117
+ mask: number[];
2118
+ }
2119
+
2120
+ interface SIMDTernaryInfo extends ExpressionInfo {
2121
+ op: Operations;
2122
+ a: ExpressionRef;
2123
+ b: ExpressionRef;
2124
+ c: ExpressionRef;
2125
+ }
2126
+
2127
+ interface SIMDShiftInfo extends ExpressionInfo {
2128
+ op: Operations;
2129
+ vec: ExpressionRef;
2130
+ shift: ExpressionRef;
2131
+ }
2132
+
2133
+ interface SIMDLoadInfo extends ExpressionInfo {
2134
+ op: Operations;
2135
+ offset: number;
2136
+ align: number;
2137
+ ptr: ExpressionRef;
2138
+ }
2139
+
2140
+ interface SIMDLoadStoreLaneInfo extends ExpressionInfo {
2141
+ op: Operations;
2142
+ offset: number;
2143
+ align: number;
2144
+ index: number;
2145
+ ptr: ExpressionRef;
2146
+ vec: ExpressionRef;
2147
+ }
2148
+
2149
+ interface MemoryInitInfo extends ExpressionInfo {
2150
+ segment: string;
2151
+ dest: ExpressionRef;
2152
+ offset: ExpressionRef;
2153
+ size: ExpressionRef;
2154
+ }
2155
+
2156
+ interface DataDropInfo extends ExpressionInfo {
2157
+ segment: string;
2158
+ }
2159
+
2160
+ interface MemoryCopyInfo extends ExpressionInfo {
2161
+ dest: ExpressionRef;
2162
+ source: ExpressionRef;
2163
+ size: ExpressionRef;
2164
+ }
2165
+
2166
+ interface MemoryFillInfo extends ExpressionInfo {
2167
+ dest: ExpressionRef;
2168
+ value: ExpressionRef;
2169
+ size: ExpressionRef;
2170
+ }
2171
+
2172
+ interface RefNullInfo extends ExpressionInfo {
2173
+ }
2174
+
2175
+ interface RefIsInfo extends ExpressionInfo {
2176
+ op: Operations;
2177
+ value: ExpressionRef;
2178
+ }
2179
+
2180
+ interface RefAsInfo extends ExpressionInfo {
2181
+ op: Operations;
2182
+ value: ExpressionRef;
2183
+ }
2184
+
2185
+ interface RefFuncInfo extends ExpressionInfo {
2186
+ func: string;
2187
+ }
2188
+
2189
+ interface RefEqInfo extends ExpressionInfo {
2190
+ left: ExpressionRef;
2191
+ right: ExpressionRef;
2192
+ }
2193
+
2194
+ interface TryInfo extends ExpressionInfo {
2195
+ name: string;
2196
+ body: ExpressionRef;
2197
+ catchTags: string[];
2198
+ catchBodies: ExpressionRef[];
2199
+ hasCatchAll: boolean;
2200
+ delegateTarget: string;
2201
+ isDelegate: boolean;
2202
+ }
2203
+
2204
+ interface ThrowInfo extends ExpressionInfo {
2205
+ tag: string;
2206
+ operands: ExpressionRef[];
2207
+ }
2208
+
2209
+ interface RethrowInfo extends ExpressionInfo {
2210
+ target: string;
2211
+ }
2212
+
2213
+ interface TupleMakeInfo extends ExpressionInfo {
2214
+ operands: ExpressionRef[];
2215
+ }
2216
+
2217
+ interface TupleExtract extends ExpressionInfo {
2218
+ tuple: ExpressionRef;
2219
+ index: number;
2220
+ }
2221
+
2222
+ interface RefI31Info extends ExpressionInfo {
2223
+ value: ExpressionRef;
2224
+ }
2225
+
2226
+ interface I31GetInfo extends ExpressionInfo {
2227
+ i31: ExpressionRef;
2228
+ isSigned: boolean;
2229
+ }
2230
+
2231
+ function getFunctionInfo(func: FunctionRef): FunctionInfo;
2232
+
2233
+ interface FunctionInfo {
2234
+ name: string;
2235
+ module: string | null;
2236
+ base: string | null;
2237
+ type: Type;
2238
+ params: Type;
2239
+ results: Type;
2240
+ vars: Type[];
2241
+ body: ExpressionRef;
2242
+ }
2243
+
2244
+ function getGlobalInfo(global: GlobalRef): GlobalInfo;
2245
+
2246
+ interface GlobalInfo {
2247
+ name: string;
2248
+ module: string | null;
2249
+ base: string | null;
2250
+ type: Type;
2251
+ mutable: boolean;
2252
+ init: ExpressionRef;
2253
+ }
2254
+
2255
+ function getTableInfo(table: TableRef): TableInfo;
2256
+
2257
+ interface TableInfo {
2258
+ name: string;
2259
+ module: string | null;
2260
+ base: string | null;
2261
+ initial: number;
2262
+ max?: number;
2263
+ }
2264
+
2265
+ function getElementSegmentInfo(segment: ElementSegmentRef): ElementSegmentInfo;
2266
+
2267
+ interface ElementSegmentInfo {
2268
+ name: string,
2269
+ table: string,
2270
+ offset: number,
2271
+ data: string[]
2272
+ }
2273
+
2274
+ function getTagInfo(tag: TagRef): TagInfo;
2275
+
2276
+ interface TagInfo {
2277
+ name: string;
2278
+ module: string | null;
2279
+ base: string | null;
2280
+ params: Type;
2281
+ results: Type;
2282
+ }
2283
+
2284
+ function getExportInfo(export_: ExportRef): ExportInfo;
2285
+
2286
+ interface ExportInfo {
2287
+ kind: ExternalKinds;
2288
+ name: string;
2289
+ value: string;
2290
+ }
2291
+
2292
+ function getSideEffects(expr: ExpressionRef, features: Features): SideEffects;
2293
+
2294
+ const enum SideEffects {
2295
+ None,
2296
+ Branches,
2297
+ Calls,
2298
+ ReadsLocal,
2299
+ WritesLocal,
2300
+ ReadsGlobal,
2301
+ WritesGlobal,
2302
+ ReadsMemory,
2303
+ WritesMemory,
2304
+ ReadsTable,
2305
+ WritesTable,
2306
+ ImplicitTrap,
2307
+ IsAtomic,
2308
+ Throws,
2309
+ DanglingPop,
2310
+ TrapsNeverHappen,
2311
+ Any
2312
+ }
2313
+
2314
+ function emitText(expression: ExpressionRef | Module): string;
2315
+ function readBinary(data: Uint8Array): Module;
2316
+ function readBinaryWithFeatures(data: Uint8Array, features: Features): Module;
2317
+ function parseText(text: string): Module;
2318
+ function getOptimizeLevel(): number;
2319
+ function setOptimizeLevel(level: number): number;
2320
+ function getShrinkLevel(): number;
2321
+ function setShrinkLevel(level: number): number;
2322
+ function getDebugInfo(): boolean;
2323
+ function setDebugInfo(on: boolean): void;
2324
+ function getTrapsNeverHappen(): boolean;
2325
+ function setTrapsNeverHappen(on: boolean): void;
2326
+ function getClosedWorld(): boolean;
2327
+ function setClosedWorld(on: boolean): void;
2328
+ function getLowMemoryUnused(): boolean;
2329
+ function setLowMemoryUnused(on: boolean): void;
2330
+ function getZeroFilledMemory(): boolean;
2331
+ function setZeroFilledMemory(on: boolean): void;
2332
+ function getFastMath(): boolean;
2333
+ function setFastMath(on: boolean): void;
2334
+ function getGenerateStackIR(): boolean;
2335
+ function setGenerateStackIR(on: boolean): void;
2336
+ function getOptimizeStackIR(): boolean;
2337
+ function setOptimizeStackIR(on: boolean): void;
2338
+ function getPassArgument(key: string): string | null;
2339
+ function setPassArgument(key: string, value: string | null): void;
2340
+ function clearPassArguments(): void;
2341
+ function hasPassToSkip(pass: string): boolean;
2342
+ function addPassToSkip(pass: string): void;
2343
+ function clearPassesToSkip(): void;
2344
+ function getAlwaysInlineMaxSize(): number;
2345
+ function setAlwaysInlineMaxSize(size: number): void;
2346
+ function getFlexibleInlineMaxSize(): number;
2347
+ function setFlexibleInlineMaxSize(size: number): void;
2348
+ function getOneCallerInlineMaxSize(): number;
2349
+ function setOneCallerInlineMaxSize(size: number): void;
2350
+ function getAllowInliningFunctionsWithLoops(): boolean;
2351
+ function setAllowInliningFunctionsWithLoops(on: boolean): void;
2352
+ function exit(status: number): void;
2353
+
2354
+ class Relooper {
2355
+ constructor(module: Module);
2356
+ addBlock(expression: ExpressionRef): RelooperBlockRef;
2357
+ addBranch(from: RelooperBlockRef, to: RelooperBlockRef, condition: ExpressionRef, code: ExpressionRef): void;
2358
+ addBlockWithSwitch(code: ExpressionRef, condition: ExpressionRef): RelooperBlockRef;
2359
+ addBranchForSwitch(from: RelooperBlockRef, to: RelooperBlockRef, indexes: number[], code: ExpressionRef): void;
2360
+ renderAndDispose(entry: RelooperBlockRef, labelHelper: number): ExpressionRef;
2361
+ }
2362
+
2363
+ class ExpressionRunner {
2364
+ constructor(module: Module, flags: ExpressionRunnerFlags, maxDepth: number, maxLoopIterations: number);
2365
+ setLocalValue(index: number, valueExpr: ExpressionRef): boolean;
2366
+ setGlobalValue(name: string, valueExpr: ExpressionRef): boolean;
2367
+ runAndDispose(expr: ExpressionRef): ExpressionRef;
2368
+ }
2369
+ }
2370
+
2371
+ export default binaryen;