@visulima/tui 1.0.0-alpha.1 → 1.0.0-alpha.11

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 (658) hide show
  1. package/CHANGELOG.md +170 -0
  2. package/LICENSE.md +2246 -9
  3. package/README.md +38 -10
  4. package/dist/components/accordion.d.ts +59 -0
  5. package/dist/components/accordion.js +1 -0
  6. package/dist/components/alert.d.ts +26 -0
  7. package/dist/components/alert.js +1 -0
  8. package/dist/components/animate-presence.d.ts +18 -0
  9. package/dist/components/animate-presence.js +1 -0
  10. package/dist/components/approval-prompt.d.ts +65 -0
  11. package/dist/components/approval-prompt.js +1 -0
  12. package/dist/components/area-chart.d.ts +66 -0
  13. package/dist/components/area-chart.js +1 -0
  14. package/dist/components/badge.d.ts +22 -0
  15. package/dist/components/badge.js +1 -0
  16. package/dist/components/bar-chart.d.ts +67 -0
  17. package/dist/components/bar-chart.js +1 -0
  18. package/dist/components/big-text.d.ts +81 -0
  19. package/dist/components/big-text.js +1 -0
  20. package/dist/components/blink-dot.d.ts +36 -0
  21. package/dist/components/blink-dot.js +1 -0
  22. package/dist/components/box.d.ts +61 -0
  23. package/dist/components/box.js +1 -0
  24. package/dist/components/breadcrumb.d.ts +33 -0
  25. package/dist/components/breadcrumb.js +1 -0
  26. package/dist/components/button.d.ts +45 -0
  27. package/dist/components/button.js +1 -0
  28. package/dist/components/calendar.d.ts +72 -0
  29. package/dist/components/calendar.js +1 -0
  30. package/dist/components/canvas.d.ts +44 -0
  31. package/dist/components/canvas.js +1 -0
  32. package/dist/components/card.d.ts +57 -0
  33. package/dist/components/card.js +1 -0
  34. package/dist/components/checkbox.d.ts +48 -0
  35. package/dist/components/checkbox.js +1 -0
  36. package/dist/components/code.d.ts +48 -0
  37. package/dist/components/code.js +2 -0
  38. package/dist/components/collapsible.d.ts +53 -0
  39. package/dist/components/collapsible.js +1 -0
  40. package/dist/components/command-block.d.ts +47 -0
  41. package/dist/components/command-block.js +4 -0
  42. package/dist/components/command-palette.d.ts +82 -0
  43. package/dist/components/command-palette.js +1 -0
  44. package/dist/components/confirm-dialog.d.ts +75 -0
  45. package/dist/components/confirm-dialog.js +1 -0
  46. package/dist/components/confirm-input.d.ts +38 -0
  47. package/dist/components/confirm-input.js +1 -0
  48. package/dist/components/console-overlay.d.ts +54 -0
  49. package/dist/components/console-overlay.js +1 -0
  50. package/dist/components/content-switcher.d.ts +57 -0
  51. package/dist/components/content-switcher.js +1 -0
  52. package/dist/components/controlled-scroll-view.d.ts +60 -0
  53. package/dist/components/controlled-scroll-view.js +1 -0
  54. package/dist/components/cursor.d.ts +52 -0
  55. package/dist/components/cursor.js +1 -0
  56. package/dist/components/date-picker.d.ts +65 -0
  57. package/dist/components/date-picker.js +1 -0
  58. package/dist/components/definition-list.d.ts +44 -0
  59. package/dist/components/definition-list.js +1 -0
  60. package/dist/components/dialog.d.ts +116 -0
  61. package/dist/components/dialog.js +1 -0
  62. package/dist/components/diff-view.d.ts +85 -0
  63. package/dist/components/diff-view.js +1 -0
  64. package/dist/components/divider.d.ts +49 -0
  65. package/dist/components/divider.js +1 -0
  66. package/dist/components/file-picker-entry.d.ts +104 -0
  67. package/dist/components/file-picker-entry.js +1 -0
  68. package/dist/components/form.d.ts +81 -0
  69. package/dist/components/form.js +1 -0
  70. package/dist/components/gauge.d.ts +87 -0
  71. package/dist/components/gauge.js +1 -0
  72. package/dist/components/gradient.d.ts +42 -0
  73. package/dist/components/gradient.js +1 -0
  74. package/dist/components/heading.d.ts +33 -0
  75. package/dist/components/heading.js +1 -0
  76. package/dist/components/heatmap.d.ts +62 -0
  77. package/dist/components/heatmap.js +1 -0
  78. package/dist/components/help.d.ts +52 -0
  79. package/dist/components/help.js +1 -0
  80. package/dist/components/histogram.d.ts +62 -0
  81. package/dist/components/histogram.js +1 -0
  82. package/dist/components/kbd.d.ts +31 -0
  83. package/dist/components/kbd.js +1 -0
  84. package/dist/components/line-chart.d.ts +109 -0
  85. package/dist/components/line-chart.js +1 -0
  86. package/dist/components/link.d.ts +38 -0
  87. package/dist/components/link.js +1 -0
  88. package/dist/components/loading-indicator.d.ts +29 -0
  89. package/dist/components/loading-indicator.js +1 -0
  90. package/dist/components/markdown.d.ts +40 -0
  91. package/dist/components/markdown.js +1 -0
  92. package/dist/components/masked-input.d.ts +50 -0
  93. package/dist/components/masked-input.js +1 -0
  94. package/dist/components/menu.d.ts +78 -0
  95. package/dist/components/menu.js +1 -0
  96. package/dist/components/message-bubble.d.ts +43 -0
  97. package/dist/components/message-bubble.js +1 -0
  98. package/dist/components/model-badge.d.ts +39 -0
  99. package/dist/components/model-badge.js +1 -0
  100. package/dist/components/multi-select.d.ts +65 -0
  101. package/dist/components/multi-select.js +1 -0
  102. package/dist/components/newline.d.ts +15 -0
  103. package/dist/components/newline.js +2 -0
  104. package/dist/components/operation-tree.d.ts +49 -0
  105. package/dist/components/operation-tree.js +1 -0
  106. package/dist/components/option-list.d.ts +47 -0
  107. package/dist/components/option-list.js +1 -0
  108. package/dist/components/ordered-list.d.ts +24 -0
  109. package/dist/components/ordered-list.js +1 -0
  110. package/dist/components/paginator.d.ts +69 -0
  111. package/dist/components/paginator.js +1 -0
  112. package/dist/components/paragraph.d.ts +38 -0
  113. package/dist/components/paragraph.js +1 -0
  114. package/dist/components/placeholder.d.ts +55 -0
  115. package/dist/components/placeholder.js +1 -0
  116. package/dist/components/progress-bar.d.ts +56 -0
  117. package/dist/components/progress-bar.js +1 -0
  118. package/dist/components/radio-group.d.ts +74 -0
  119. package/dist/components/radio-group.js +1 -0
  120. package/dist/components/scatter-plot.d.ts +35 -0
  121. package/dist/components/scatter-plot.js +1 -0
  122. package/dist/components/scroll-bar-box.d.ts +36 -0
  123. package/dist/components/scroll-bar-box.js +1 -0
  124. package/dist/components/scroll-bar.d.ts +24 -0
  125. package/dist/components/scroll-bar.js +1 -0
  126. package/dist/components/scroll-list.d.ts +19 -0
  127. package/dist/components/scroll-list.js +1 -0
  128. package/dist/components/scroll-view.d.ts +9 -0
  129. package/dist/components/scroll-view.js +1 -0
  130. package/dist/components/search-input.d.ts +55 -0
  131. package/dist/components/search-input.js +1 -0
  132. package/dist/components/select-input-indicator.d.ts +32 -0
  133. package/dist/components/select-input-indicator.js +1 -0
  134. package/dist/components/select-input-item.d.ts +41 -0
  135. package/dist/components/select-input-item.js +1 -0
  136. package/dist/components/select-input.d.ts +110 -0
  137. package/dist/components/select-input.js +1 -0
  138. package/dist/components/shimmer-text.d.ts +47 -0
  139. package/dist/components/shimmer-text.js +1 -0
  140. package/dist/components/slider.d.ts +103 -0
  141. package/dist/components/slider.js +1 -0
  142. package/dist/components/spacer.d.ts +8 -0
  143. package/dist/components/spacer.js +1 -0
  144. package/dist/components/sparkline.d.ts +35 -0
  145. package/dist/components/sparkline.js +1 -0
  146. package/dist/components/spinner.d.ts +17 -0
  147. package/dist/components/spinner.js +1 -0
  148. package/dist/components/static-render.d.ts +50 -0
  149. package/dist/components/static-render.js +1 -0
  150. package/dist/components/static.d.ts +29 -0
  151. package/dist/components/static.js +1 -0
  152. package/dist/components/status-line.d.ts +37 -0
  153. package/dist/components/status-line.js +1 -0
  154. package/dist/components/status-message.d.ts +21 -0
  155. package/dist/components/status-message.js +1 -0
  156. package/dist/components/stepper.d.ts +48 -0
  157. package/dist/components/stepper.js +1 -0
  158. package/dist/components/stopwatch.d.ts +49 -0
  159. package/dist/components/stopwatch.js +1 -0
  160. package/dist/components/streaming-text.d.ts +46 -0
  161. package/dist/components/streaming-text.js +1 -0
  162. package/dist/components/switch.d.ts +55 -0
  163. package/dist/components/switch.js +1 -0
  164. package/dist/components/tab.d.ts +19 -0
  165. package/dist/components/tab.js +1 -0
  166. package/dist/components/table.d.ts +119 -0
  167. package/dist/components/table.js +1 -0
  168. package/dist/components/tabs.d.ts +107 -0
  169. package/dist/components/tabs.js +1 -0
  170. package/dist/components/tag.d.ts +35 -0
  171. package/dist/components/tag.js +1 -0
  172. package/dist/components/text-input.d.ts +48 -0
  173. package/dist/components/text-input.js +1 -0
  174. package/dist/components/text.d.ts +79 -0
  175. package/dist/components/text.js +1 -0
  176. package/dist/components/textarea.d.ts +68 -0
  177. package/dist/components/textarea.js +2 -0
  178. package/dist/components/timer.d.ts +59 -0
  179. package/dist/components/timer.js +1 -0
  180. package/dist/components/toast.d.ts +49 -0
  181. package/dist/components/toast.js +1 -0
  182. package/dist/components/tooltip.d.ts +43 -0
  183. package/dist/components/tooltip.js +1 -0
  184. package/dist/components/transform.d.ts +21 -0
  185. package/dist/components/transform.js +1 -0
  186. package/dist/components/transition.d.ts +74 -0
  187. package/dist/components/transition.js +1 -0
  188. package/dist/components/tree-view-entry.d.ts +356 -0
  189. package/dist/components/tree-view-entry.js +1 -0
  190. package/dist/components/unordered-list.d.ts +30 -0
  191. package/dist/components/unordered-list.js +1 -0
  192. package/dist/core/index.d.ts +58 -5
  193. package/dist/core/index.js +1 -5
  194. package/dist/ink/hooks/use-animation.d.ts +37 -39
  195. package/dist/ink/hooks/use-animation.js +1 -0
  196. package/dist/ink/hooks/use-app.d.ts +36 -4
  197. package/dist/ink/hooks/use-app.js +1 -0
  198. package/dist/ink/hooks/use-box-metrics.d.ts +53 -48
  199. package/dist/ink/hooks/use-box-metrics.js +1 -0
  200. package/dist/ink/hooks/use-clipboard.d.ts +26 -25
  201. package/dist/ink/hooks/use-clipboard.js +1 -0
  202. package/dist/ink/hooks/use-color-blindness.d.ts +29 -29
  203. package/dist/ink/hooks/use-color-blindness.js +1 -0
  204. package/dist/ink/hooks/use-console-capture.d.ts +38 -38
  205. package/dist/ink/hooks/use-console-capture.js +1 -0
  206. package/dist/ink/hooks/use-cursor.d.ts +10 -9
  207. package/dist/ink/hooks/use-cursor.js +1 -0
  208. package/dist/ink/hooks/use-focus-manager.d.ts +52 -38
  209. package/dist/ink/hooks/use-focus-manager.js +1 -0
  210. package/dist/ink/hooks/use-focus.d.ts +29 -25
  211. package/dist/ink/hooks/use-focus.js +1 -0
  212. package/dist/ink/hooks/use-form.d.ts +68 -0
  213. package/dist/ink/hooks/use-form.js +1 -0
  214. package/dist/ink/hooks/use-hotkey.d.ts +37 -0
  215. package/dist/ink/hooks/use-hotkey.js +1 -0
  216. package/dist/ink/hooks/use-input.d.ts +142 -142
  217. package/dist/ink/hooks/use-input.js +2 -0
  218. package/dist/ink/hooks/use-interval.d.ts +25 -0
  219. package/dist/ink/hooks/use-interval.js +1 -0
  220. package/dist/ink/hooks/use-is-screen-reader-enabled.d.ts +4 -4
  221. package/dist/ink/hooks/use-is-screen-reader-enabled.js +1 -0
  222. package/dist/ink/hooks/use-key-bindings.d.ts +50 -52
  223. package/dist/ink/hooks/use-key-bindings.js +1 -0
  224. package/dist/ink/hooks/use-key-chord.d.ts +25 -0
  225. package/dist/ink/hooks/use-key-chord.js +1 -0
  226. package/dist/ink/hooks/use-linked-scroll.d.ts +44 -37
  227. package/dist/ink/hooks/use-linked-scroll.js +1 -0
  228. package/dist/ink/hooks/use-paste.d.ts +40 -40
  229. package/dist/ink/hooks/use-paste.js +1 -0
  230. package/dist/ink/hooks/use-persistent-state.d.ts +56 -0
  231. package/dist/ink/hooks/use-persistent-state.js +2 -0
  232. package/dist/ink/hooks/use-scroll-acceleration.d.ts +43 -43
  233. package/dist/ink/hooks/use-scroll-acceleration.js +1 -0
  234. package/dist/ink/hooks/use-scroll-input.d.ts +31 -31
  235. package/dist/ink/hooks/use-scroll-input.js +1 -0
  236. package/dist/ink/hooks/use-stderr.d.ts +14 -4
  237. package/dist/ink/hooks/use-stderr.js +1 -0
  238. package/dist/ink/hooks/use-stdin.d.ts +28 -5
  239. package/dist/ink/hooks/use-stdin.js +1 -0
  240. package/dist/ink/hooks/use-stdout.d.ts +14 -4
  241. package/dist/ink/hooks/use-stdout.js +1 -0
  242. package/dist/ink/hooks/use-stopwatch.d.ts +36 -37
  243. package/dist/ink/hooks/use-stopwatch.js +1 -0
  244. package/dist/ink/hooks/use-terminal-palette.d.ts +17 -16
  245. package/dist/ink/hooks/use-terminal-palette.js +1 -0
  246. package/dist/ink/hooks/use-text-buffer.d.ts +37 -37
  247. package/dist/ink/hooks/use-text-buffer.js +4 -0
  248. package/dist/ink/hooks/use-text-selection.d.ts +40 -41
  249. package/dist/ink/hooks/use-text-selection.js +1 -0
  250. package/dist/ink/hooks/use-timeout.d.ts +24 -0
  251. package/dist/ink/hooks/use-timeout.js +1 -0
  252. package/dist/ink/hooks/use-timer.d.ts +45 -46
  253. package/dist/ink/hooks/use-timer.js +1 -0
  254. package/dist/ink/hooks/use-window-size.d.ts +14 -14
  255. package/dist/ink/hooks/use-window-size.js +1 -0
  256. package/dist/ink/index.d.ts +396 -159
  257. package/dist/ink/index.js +1 -100
  258. package/dist/packem_chunks/devtools.js +3 -26
  259. package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-DqErf7XX.js +1 -0
  260. package/dist/packem_shared/Cell-BrXn3jxY.js +1 -0
  261. package/dist/packem_shared/ControlledScrollView-X_OTc-Cw.js +1 -0
  262. package/dist/packem_shared/DevTools-CsxLcAu2.js +1 -0
  263. package/dist/packem_shared/FilePicker-tYj_CIau.js +1 -0
  264. package/dist/packem_shared/FocusContext-Xy0cwJpO.js +1 -0
  265. package/dist/packem_shared/Fullscreen-CxLd1-Zu.js +1 -0
  266. package/dist/packem_shared/IMECompositionBuffer-C89PhiOu.js +1 -0
  267. package/dist/packem_shared/InputParser-rZKjY_7Y.js +2 -0
  268. package/dist/packem_shared/KEY-Bk8B-3h_.js +1 -0
  269. package/dist/packem_shared/LayoutNode-B8zej4dm.js +1 -0
  270. package/dist/packem_shared/MouseProvider-PnIUKURs.js +1 -0
  271. package/dist/packem_shared/NAMED_COLORS-B9fJsYdg.js +1 -0
  272. package/dist/packem_shared/Renderer-DJXooAsp.js +1 -0
  273. package/dist/packem_shared/ResizeObserverEntry-Dq0dk8Kq.js +1 -0
  274. package/dist/packem_shared/ScrollBar-U_37hlIT.js +1 -0
  275. package/dist/packem_shared/ScrollBarBox-DwiCxilX.js +1 -0
  276. package/dist/packem_shared/ScrollList-Dxgv-mhZ.js +1 -0
  277. package/dist/packem_shared/ScrollView-Dq2v5zJS.js +1 -0
  278. package/dist/packem_shared/Static-DLynr5pn.js +1 -0
  279. package/dist/packem_shared/TreeNodeMap-CspqSCpb.js +1 -0
  280. package/dist/packem_shared/TreeView-GkPr_VYn.js +1 -0
  281. package/dist/packem_shared/TuiApp-DrjI_i-R.js +1 -0
  282. package/dist/packem_shared/TuiContext-BoJvG3NN.js +3 -0
  283. package/dist/packem_shared/accessibility-context-DDyHTwmA.js +1 -0
  284. package/dist/packem_shared/animation-context-DW3p-vpk.js +1 -0
  285. package/dist/packem_shared/ansi-parser-B6uXaq65.js +1 -0
  286. package/dist/packem_shared/ansi-tokenizer-DqX9nJuk.js +1 -0
  287. package/dist/packem_shared/app-context-BVpKlG1z.js +1 -0
  288. package/dist/packem_shared/background-context-rjOaWFki.js +1 -0
  289. package/dist/packem_shared/braille-BBjIoaN0.js +1 -0
  290. package/dist/packem_shared/buffer.d-EJkZr8uH.d.ts +39 -0
  291. package/dist/packem_shared/clipboard.d-D6lZTQ21.d.ts +23 -0
  292. package/dist/packem_shared/color-matrix.d-DSXLsB64.d.ts +50 -0
  293. package/dist/packem_shared/colorize-DbTZMrJO.js +1 -0
  294. package/dist/packem_shared/comparePoints-C85EsmNz.js +1 -0
  295. package/dist/packem_shared/controlled-scroll-view-CikQ90_V.js +1 -0
  296. package/dist/packem_shared/createInlineLoop-DRNZ7jqH.js +2 -0
  297. package/dist/packem_shared/createScreen-CrLrxA6t.js +3 -0
  298. package/dist/packem_shared/cursor-context-CFviBqPX.js +1 -0
  299. package/dist/packem_shared/cursor-helpers.d-BIvqz0TZ.d.ts +5 -0
  300. package/dist/packem_shared/dom-4y__5fWB.js +1 -0
  301. package/dist/packem_shared/dom.d-ksOQhC2W.d.ts +400 -0
  302. package/dist/packem_shared/focus-context-CsT69klR.js +1 -0
  303. package/dist/packem_shared/format-time-C7Q-hQZq.js +1 -0
  304. package/dist/packem_shared/getPathToRoot-B2tKmx3i.js +1 -0
  305. package/dist/packem_shared/getScrollHeight-BTEY8ewu.js +1 -0
  306. package/dist/packem_shared/input-utils-fAxzSlNh.js +1 -0
  307. package/dist/packem_shared/input.d-Bfq7oc06.d.ts +90 -0
  308. package/dist/packem_shared/isIntersecting-B3KbKTmu.js +1 -0
  309. package/dist/packem_shared/isOsc52Supported-DKK7Uee6.js +1 -0
  310. package/dist/packem_shared/isTerminalPaletteQuerySupported-Dn2hFAZ_.js +1 -0
  311. package/dist/packem_shared/kittyFlags-C3rZLbcK.js +1 -0
  312. package/dist/packem_shared/layout-P24eyWyL.js +2 -0
  313. package/dist/packem_shared/line-chart-kf7uhR0K.js +1 -0
  314. package/dist/packem_shared/measure-text-DDjHT1jD.js +3 -0
  315. package/dist/packem_shared/measureElement-CRKlFSvD.js +1 -0
  316. package/dist/packem_shared/mouse-context-DaARgUu1.js +1 -0
  317. package/dist/packem_shared/parseSgrMouse-Ccj70ijb.js +1 -0
  318. package/dist/packem_shared/processLayout-Dmgf0LO6.js +1 -0
  319. package/dist/packem_shared/reconciler-BuOP-TZ6.js +1 -0
  320. package/dist/packem_shared/reconciler-DIfG72R9.js +1 -0
  321. package/dist/packem_shared/render-BOqty71z.js +26 -0
  322. package/dist/packem_shared/render-F9Hk9p1a.js +1 -0
  323. package/dist/packem_shared/render.d-CVGLTvTq.d.ts +398 -0
  324. package/dist/packem_shared/renderToString-BDk2FZEN.js +4 -0
  325. package/dist/packem_shared/renderToString-BbQiRHrd.js +2 -0
  326. package/dist/packem_shared/renderTreeToBuffer-CZilzyhN.js +2 -0
  327. package/dist/packem_shared/renderer-gqplqpkQ.js +17 -0
  328. package/dist/packem_shared/scroll-view.d-DtpsgHLg.d.ts +119 -0
  329. package/dist/packem_shared/selection.d-CHKA1ogp.d.ts +62 -0
  330. package/dist/packem_shared/setEnableStyledLineCache-D2gZbwFM.js +1 -0
  331. package/dist/packem_shared/squashTextNodesWithMap-Cpqmc45i.js +1 -0
  332. package/dist/packem_shared/stderr-context-BzEaUICS.js +1 -0
  333. package/dist/packem_shared/stdin-context-BTaaFagk.js +1 -0
  334. package/dist/packem_shared/stdout-context-BnblEPez.js +1 -0
  335. package/dist/packem_shared/styles.d-C1g4Iwzr.d.ts +368 -0
  336. package/dist/packem_shared/terminal-palette.d-D2SQjfn-.d.ts +19 -0
  337. package/dist/packem_shared/text-width-BU2eeTWn.js +2 -0
  338. package/dist/packem_shared/token-to-elements-BAZpNZsu.js +1 -0
  339. package/dist/packem_shared/treeViewTheme-1RIZyB4M.js +1 -0
  340. package/dist/packem_shared/useElementDimensions-qJ_WXFZ9.js +1 -0
  341. package/dist/packem_shared/useMouseAction-2dRfU1vE.js +1 -0
  342. package/dist/packem_shared/useMouseContext-C746G7kY.js +1 -0
  343. package/dist/packem_shared/useMousePosition-BTWfV4JK.js +1 -0
  344. package/dist/packem_shared/useOnMouseClick-nY8xLZmt.js +1 -0
  345. package/dist/packem_shared/useOnMouseHover-D3DczIol.js +1 -0
  346. package/dist/packem_shared/useOnMouseState-cRK8QvzD.js +1 -0
  347. package/dist/packem_shared/useTreeView-BoMMeRPq.js +1 -0
  348. package/dist/packem_shared/useTreeViewState-CRPCUWrb.js +1 -0
  349. package/dist/packem_shared/utils-CoviI5Vm.js +1 -0
  350. package/dist/packem_shared/variant-config-BJqpNo7H.js +1 -0
  351. package/dist/packem_shared/variant-config.d-D5NnrrQK.d.ts +2 -0
  352. package/dist/packem_shared/waitFor-Dj5zfL5s.js +4 -0
  353. package/dist/packem_shared/wrapOrTruncateStyledLine-BZ00SM8i.js +3 -0
  354. package/dist/react/index.d.ts +519 -8
  355. package/dist/react/index.js +1 -9
  356. package/dist/testing/index.d.ts +278 -135
  357. package/dist/testing/index.js +1 -260
  358. package/index.js +691 -539
  359. package/package.json +563 -33
  360. package/dist/core/app.d.ts +0 -50
  361. package/dist/core/cell.d.ts +0 -33
  362. package/dist/core/inline.d.ts +0 -22
  363. package/dist/core/input.d.ts +0 -18
  364. package/dist/core/native-binding.d.ts +0 -22
  365. package/dist/ink/ansi-to-cell.d.ts +0 -5
  366. package/dist/ink/ansi-tokenizer.d.ts +0 -38
  367. package/dist/ink/clipboard.d.ts +0 -29
  368. package/dist/ink/color-matrix.d.ts +0 -49
  369. package/dist/ink/color-utils.d.ts +0 -30
  370. package/dist/ink/colorize.d.ts +0 -4
  371. package/dist/ink/components/AccessibilityContext.d.ts +0 -4
  372. package/dist/ink/components/Alert.d.ts +0 -30
  373. package/dist/ink/components/AnimationContext.d.ts +0 -10
  374. package/dist/ink/components/App.d.ts +0 -19
  375. package/dist/ink/components/AppContext.d.ts +0 -38
  376. package/dist/ink/components/BackgroundContext.d.ts +0 -5
  377. package/dist/ink/components/Badge.d.ts +0 -27
  378. package/dist/ink/components/BigText.d.ts +0 -71
  379. package/dist/ink/components/Box.d.ts +0 -58
  380. package/dist/ink/components/Code.d.ts +0 -46
  381. package/dist/ink/components/ConfirmInput.d.ts +0 -40
  382. package/dist/ink/components/ConsoleOverlay.d.ts +0 -52
  383. package/dist/ink/components/Cursor.d.ts +0 -43
  384. package/dist/ink/components/CursorContext.d.ts +0 -12
  385. package/dist/ink/components/Dialog.d.ts +0 -93
  386. package/dist/ink/components/DiffView.d.ts +0 -71
  387. package/dist/ink/components/ErrorBoundary.d.ts +0 -17
  388. package/dist/ink/components/ErrorOverview.d.ts +0 -6
  389. package/dist/ink/components/FocusContext.d.ts +0 -17
  390. package/dist/ink/components/Gradient.d.ts +0 -38
  391. package/dist/ink/components/Help.d.ts +0 -49
  392. package/dist/ink/components/Link.d.ts +0 -34
  393. package/dist/ink/components/Markdown.d.ts +0 -34
  394. package/dist/ink/components/MultiSelect.d.ts +0 -63
  395. package/dist/ink/components/Newline.d.ts +0 -12
  396. package/dist/ink/components/OrderedList.d.ts +0 -30
  397. package/dist/ink/components/Paginator.d.ts +0 -75
  398. package/dist/ink/components/ProgressBar.d.ts +0 -51
  399. package/dist/ink/components/SelectInput.d.ts +0 -96
  400. package/dist/ink/components/SelectInputIndicator.d.ts +0 -36
  401. package/dist/ink/components/SelectInputItem.d.ts +0 -43
  402. package/dist/ink/components/Slider.d.ts +0 -92
  403. package/dist/ink/components/Spacer.d.ts +0 -7
  404. package/dist/ink/components/Spinner.d.ts +0 -42
  405. package/dist/ink/components/Static.d.ts +0 -24
  406. package/dist/ink/components/StaticRender.d.ts +0 -28
  407. package/dist/ink/components/StatusMessage.d.ts +0 -26
  408. package/dist/ink/components/StderrContext.d.ts +0 -16
  409. package/dist/ink/components/StdinContext.d.ts +0 -29
  410. package/dist/ink/components/StdoutContext.d.ts +0 -16
  411. package/dist/ink/components/Stopwatch.d.ts +0 -44
  412. package/dist/ink/components/Tab.d.ts +0 -25
  413. package/dist/ink/components/Table.d.ts +0 -80
  414. package/dist/ink/components/Tabs.d.ts +0 -97
  415. package/dist/ink/components/Text.d.ts +0 -63
  416. package/dist/ink/components/TextInput.d.ts +0 -48
  417. package/dist/ink/components/Textarea.d.ts +0 -62
  418. package/dist/ink/components/Timer.d.ts +0 -52
  419. package/dist/ink/components/Transform.d.ts +0 -16
  420. package/dist/ink/components/UnorderedList.d.ts +0 -35
  421. package/dist/ink/components/file-picker/FilePicker.d.ts +0 -75
  422. package/dist/ink/components/file-picker/index.d.ts +0 -3
  423. package/dist/ink/components/file-picker/types.d.ts +0 -38
  424. package/dist/ink/components/file-picker/use-file-system.d.ts +0 -16
  425. package/dist/ink/components/scroll/ControlledScrollView.d.ts +0 -43
  426. package/dist/ink/components/scroll/ScrollBar.d.ts +0 -20
  427. package/dist/ink/components/scroll/ScrollBarBox.d.ts +0 -15
  428. package/dist/ink/components/scroll/ScrollList.d.ts +0 -12
  429. package/dist/ink/components/scroll/ScrollView.d.ts +0 -98
  430. package/dist/ink/components/scroll/index.d.ts +0 -10
  431. package/dist/ink/components/scroll/use-state-ref.d.ts +0 -8
  432. package/dist/ink/components/tree-view/TreeView.d.ts +0 -89
  433. package/dist/ink/components/tree-view/TreeViewNode.d.ts +0 -29
  434. package/dist/ink/components/tree-view/index.d.ts +0 -11
  435. package/dist/ink/components/tree-view/theme.d.ts +0 -24
  436. package/dist/ink/components/tree-view/tree-node-map.d.ts +0 -72
  437. package/dist/ink/components/tree-view/types.d.ts +0 -55
  438. package/dist/ink/components/tree-view/use-tree-view-state.d.ts +0 -135
  439. package/dist/ink/components/tree-view/use-tree-view.d.ts +0 -26
  440. package/dist/ink/components/variant-config.d.ts +0 -10
  441. package/dist/ink/cursor-helpers.d.ts +0 -38
  442. package/dist/ink/data-limited-lru-map.d.ts +0 -21
  443. package/dist/ink/devtools-window-polyfill.d.ts +0 -1
  444. package/dist/ink/devtools.d.ts +0 -1
  445. package/dist/ink/dom.d.ts +0 -213
  446. package/dist/ink/get-max-width.d.ts +0 -3
  447. package/dist/ink/highlighter.d.ts +0 -28
  448. package/dist/ink/ime-utils.d.ts +0 -25
  449. package/dist/ink/ink.d.ts +0 -189
  450. package/dist/ink/input-parser.d.ts +0 -10
  451. package/dist/ink/input-utils.d.ts +0 -16
  452. package/dist/ink/instances.d.ts +0 -3
  453. package/dist/ink/kitty-keyboard.d.ts +0 -23
  454. package/dist/ink/layout.d.ts +0 -26
  455. package/dist/ink/log-update-native.d.ts +0 -14
  456. package/dist/ink/log-update.d.ts +0 -21
  457. package/dist/ink/measure-element.d.ts +0 -147
  458. package/dist/ink/measure-text.d.ts +0 -56
  459. package/dist/ink/mouse/Fullscreen.d.ts +0 -8
  460. package/dist/ink/mouse/MouseProvider.d.ts +0 -11
  461. package/dist/ink/mouse/ansi-parser.d.ts +0 -37
  462. package/dist/ink/mouse/constants.d.ts +0 -59
  463. package/dist/ink/mouse/index.d.ts +0 -20
  464. package/dist/ink/mouse/is-intersecting.d.ts +0 -18
  465. package/dist/ink/mouse/mouse-context.d.ts +0 -36
  466. package/dist/ink/mouse/use-element-position.d.ts +0 -29
  467. package/dist/ink/mouse/use-mouse-action.d.ts +0 -7
  468. package/dist/ink/mouse/use-mouse-position.d.ts +0 -7
  469. package/dist/ink/mouse/use-mouse.d.ts +0 -7
  470. package/dist/ink/mouse/use-on-mouse-click.d.ts +0 -14
  471. package/dist/ink/mouse/use-on-mouse-hover.d.ts +0 -8
  472. package/dist/ink/mouse/use-on-mouse-state.d.ts +0 -11
  473. package/dist/ink/output.d.ts +0 -74
  474. package/dist/ink/parse-keypress.d.ts +0 -22
  475. package/dist/ink/reconciler.d.ts +0 -3
  476. package/dist/ink/region.d.ts +0 -99
  477. package/dist/ink/render-background.d.ts +0 -4
  478. package/dist/ink/render-border.d.ts +0 -4
  479. package/dist/ink/render-node-to-output.d.ts +0 -38
  480. package/dist/ink/render-scrollbar.d.ts +0 -9
  481. package/dist/ink/render-sticky.d.ts +0 -44
  482. package/dist/ink/render-to-string.d.ts +0 -37
  483. package/dist/ink/render.d.ts +0 -191
  484. package/dist/ink/renderer.d.ts +0 -17
  485. package/dist/ink/resize-observer.d.ts +0 -44
  486. package/dist/ink/sanitize-ansi.d.ts +0 -2
  487. package/dist/ink/scroll.d.ts +0 -23
  488. package/dist/ink/selection.d.ts +0 -70
  489. package/dist/ink/squash-text-nodes.d.ts +0 -18
  490. package/dist/ink/style-flags.d.ts +0 -17
  491. package/dist/ink/styled-line-factory.d.ts +0 -25
  492. package/dist/ink/styled-line-serializer.d.ts +0 -18
  493. package/dist/ink/styled-line.d.ts +0 -109
  494. package/dist/ink/styles.d.ts +0 -369
  495. package/dist/ink/terminal-palette.d.ts +0 -25
  496. package/dist/ink/text-wrap.d.ts +0 -10
  497. package/dist/ink/token-to-elements.d.ts +0 -22
  498. package/dist/ink/utils/format-time.d.ts +0 -4
  499. package/dist/ink/utils.d.ts +0 -9
  500. package/dist/ink/wrap-text.d.ts +0 -3
  501. package/dist/ink/write-synchronized.d.ts +0 -4
  502. package/dist/packem_shared/AccessibilityContext-BLelHhNU.js +0 -7
  503. package/dist/packem_shared/Alert-Dr3s_LD9.js +0 -17
  504. package/dist/packem_shared/AnimationContext-BcJg8Jr6.js +0 -15
  505. package/dist/packem_shared/AppContext-CP0U6H7O.js +0 -11
  506. package/dist/packem_shared/BackgroundContext-BAUaxfOb.js +0 -5
  507. package/dist/packem_shared/Badge-Dk7EGGM6.js +0 -13
  508. package/dist/packem_shared/BigText-CjMdY63X.js +0 -24
  509. package/dist/packem_shared/Box-D_pSJ9Jp.js +0 -73
  510. package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-BsMy5Ewl.js +0 -81
  511. package/dist/packem_shared/Cell-DCg1kJY-.js +0 -48
  512. package/dist/packem_shared/Code-DjQvPBD9.js +0 -53
  513. package/dist/packem_shared/ConfirmInput-85Y4kRQW.js +0 -44
  514. package/dist/packem_shared/ConsoleOverlay-DBNa4vtj.js +0 -57
  515. package/dist/packem_shared/ControlledScrollView-BlOaxcsN.js +0 -286
  516. package/dist/packem_shared/ControlledScrollView-DfAhcufF.js +0 -5
  517. package/dist/packem_shared/Cursor-DiW7YoSK.js +0 -18
  518. package/dist/packem_shared/CursorContext-JxRzlqAx.js +0 -9
  519. package/dist/packem_shared/DevTools-aMPIsaHx.js +0 -61
  520. package/dist/packem_shared/Dialog-DsSNAVgC.js +0 -71
  521. package/dist/packem_shared/DiffView-hqaw-2S6.js +0 -329
  522. package/dist/packem_shared/FilePicker-DNwFxRhq.js +0 -254
  523. package/dist/packem_shared/FocusContext-CWkYtgcm.js +0 -26
  524. package/dist/packem_shared/FocusContext-D5wFxSRz.js +0 -153
  525. package/dist/packem_shared/Fullscreen-DrElAE1o.js +0 -11
  526. package/dist/packem_shared/Gradient-Ql5P0GUd.js +0 -136
  527. package/dist/packem_shared/Help-6wanGG38.js +0 -112
  528. package/dist/packem_shared/IMECompositionBuffer-Dl3S0KnF.js +0 -55
  529. package/dist/packem_shared/InputParser-BKHpWfvN.js +0 -156
  530. package/dist/packem_shared/LayoutNode-Cjnsodiy.js +0 -131
  531. package/dist/packem_shared/Link-COcKYfGT.js +0 -66
  532. package/dist/packem_shared/Markdown-y1ISztof.js +0 -212
  533. package/dist/packem_shared/MouseProvider-Y9TSSEGl.js +0 -136
  534. package/dist/packem_shared/MultiSelect-ChoLUcDI.js +0 -129
  535. package/dist/packem_shared/NAMED_COLORS-a4QBvb5r.js +0 -262
  536. package/dist/packem_shared/Newline-DBtYEg8x.js +0 -7
  537. package/dist/packem_shared/OrderedList-Cp7pXr6m.js +0 -26
  538. package/dist/packem_shared/Paginator-D1AuD-kj.js +0 -104
  539. package/dist/packem_shared/ProgressBar-DOfpVagn.js +0 -22
  540. package/dist/packem_shared/Renderer-zZ5O3vxc.js +0 -31
  541. package/dist/packem_shared/ResizeObserverEntry-Br4seLeQ.js +0 -102
  542. package/dist/packem_shared/ScrollBar-EWAs2Uc7.js +0 -106
  543. package/dist/packem_shared/ScrollBarBox-DTNNlh7R.js +0 -72
  544. package/dist/packem_shared/ScrollList-DCeIFL8M.js +0 -227
  545. package/dist/packem_shared/ScrollView-v3MCNIyX.js +0 -196
  546. package/dist/packem_shared/SelectInput-BN2TMyxp.js +0 -260
  547. package/dist/packem_shared/SelectInputIndicator-DkRMoH_b.js +0 -9
  548. package/dist/packem_shared/SelectInputItem-BF9LQgKu.js +0 -8
  549. package/dist/packem_shared/Slider-BWD7xZX6.js +0 -116
  550. package/dist/packem_shared/Spacer-Bs4ER-HK.js +0 -8
  551. package/dist/packem_shared/Spinner-BuI-kN4p.js +0 -1799
  552. package/dist/packem_shared/Static-DpTd6Eed.js +0 -22
  553. package/dist/packem_shared/Static-xmD9giJj.js +0 -18
  554. package/dist/packem_shared/StaticRender-tYwH6QXl.js +0 -33
  555. package/dist/packem_shared/StatusMessage-BtSYxzwb.js +0 -14
  556. package/dist/packem_shared/StderrContext-Bj4Mf7v7.js +0 -17
  557. package/dist/packem_shared/StdinContext-Bq_GNJ3z.js +0 -38
  558. package/dist/packem_shared/StdoutContext-CgjWeCdO.js +0 -17
  559. package/dist/packem_shared/Stopwatch-DjtTCyHn.js +0 -23
  560. package/dist/packem_shared/Tab-C6r5q4hR.js +0 -7
  561. package/dist/packem_shared/Table-D-rSVlzb.js +0 -82
  562. package/dist/packem_shared/Tabs-BXpZwLWo.js +0 -146
  563. package/dist/packem_shared/Text-DvAUdZcK.js +0 -65
  564. package/dist/packem_shared/TextInput-C79WEQ5U.js +0 -137
  565. package/dist/packem_shared/Textarea-Dj06R6Zd.js +0 -272
  566. package/dist/packem_shared/Timer-wi9zuh4n.js +0 -22
  567. package/dist/packem_shared/Transform-BHxY_dAM.js +0 -14
  568. package/dist/packem_shared/TreeNodeMap-CtJUvBnd.js +0 -155
  569. package/dist/packem_shared/TreeView-C2062dtj.js +0 -148
  570. package/dist/packem_shared/TuiApp-DfxOnXqi.js +0 -120
  571. package/dist/packem_shared/TuiContext-CqEjMyXd.js +0 -415
  572. package/dist/packem_shared/UnorderedList-DhnadWjX.js +0 -33
  573. package/dist/packem_shared/ansi-parser-0BdVTKho.js +0 -41
  574. package/dist/packem_shared/ansi-tokenizer-LHq2LUWA.js +0 -307
  575. package/dist/packem_shared/boxes-oi3WUbyR.js +0 -92
  576. package/dist/packem_shared/colorize-88_Vk8cn.js +0 -48
  577. package/dist/packem_shared/comparePoints-CGMDnd3_.js +0 -287
  578. package/dist/packem_shared/createInlineLoop-BxMmcq9D.js +0 -93
  579. package/dist/packem_shared/createLinkedScrollGroup-Djw4Ceo0.js +0 -44
  580. package/dist/packem_shared/dom-DvzhsAez.js +0 -225
  581. package/dist/packem_shared/format-time-BGmnDukX.js +0 -12
  582. package/dist/packem_shared/getPathToRoot-a1wbwxfL.js +0 -4
  583. package/dist/packem_shared/getScrollHeight-BubfU_df.js +0 -63
  584. package/dist/packem_shared/input-utils-ViAEXa0Z.js +0 -19
  585. package/dist/packem_shared/isIntersecting-fEXHJN5R.js +0 -10
  586. package/dist/packem_shared/isOsc52Supported-G0k4sXJx.js +0 -36
  587. package/dist/packem_shared/isTerminalPaletteQuerySupported-EeiwMKbr.js +0 -93
  588. package/dist/packem_shared/kittyFlags-bNNf_9kX.js +0 -26
  589. package/dist/packem_shared/measure-element-Reza_yfC.js +0 -396
  590. package/dist/packem_shared/measure-text-DItZYotK.js +0 -1189
  591. package/dist/packem_shared/measureElement-CTgFCmKd.js +0 -4
  592. package/dist/packem_shared/mouse-context-BUHWKEIe.js +0 -6
  593. package/dist/packem_shared/parseSgrMouse-BHVBPP9G.js +0 -1
  594. package/dist/packem_shared/processLayout-BQ9kXfd3.js +0 -2
  595. package/dist/packem_shared/reconciler-BXf6miSS.js +0 -211
  596. package/dist/packem_shared/reconciler-gfmqURLy.js +0 -680
  597. package/dist/packem_shared/render-BAwdjfki.js +0 -2806
  598. package/dist/packem_shared/render-Bpjhf0lD.js +0 -195
  599. package/dist/packem_shared/renderToString-Cfg55DRD.js +0 -62
  600. package/dist/packem_shared/renderToString-ClIaXgrC.js +0 -86
  601. package/dist/packem_shared/renderTreeToBuffer-D3mo7M7m.js +0 -308
  602. package/dist/packem_shared/renderer-B3wROkeg.js +0 -1431
  603. package/dist/packem_shared/setEnableStyledLineCache-BpskngSJ.js +0 -2
  604. package/dist/packem_shared/squashTextNodesWithMap-iqm6OMMT.js +0 -100
  605. package/dist/packem_shared/text-width-DhuarWcB.js +0 -42
  606. package/dist/packem_shared/token-to-elements-BRFl_rzw.js +0 -249
  607. package/dist/packem_shared/treeViewTheme-BpSw9TMf.js +0 -52
  608. package/dist/packem_shared/useAnimation-kj31sA-T.js +0 -62
  609. package/dist/packem_shared/useApp-DPQlRzi5.js +0 -6
  610. package/dist/packem_shared/useBoxMetrics-rBjKc-g4.js +0 -54
  611. package/dist/packem_shared/useClipboard-B_9-adw1.js +0 -23
  612. package/dist/packem_shared/useColorBlindness-D_sTIhcb.js +0 -30
  613. package/dist/packem_shared/useConsoleCapture-Dvt7G1W1.js +0 -61
  614. package/dist/packem_shared/useCursor-BIJzc8k9.js +0 -19
  615. package/dist/packem_shared/useElementDimensions-CAoKitVD.js +0 -67
  616. package/dist/packem_shared/useFocus-CNl5QHHf.js +0 -37
  617. package/dist/packem_shared/useFocusManager-BPYaUuKQ.js +0 -16
  618. package/dist/packem_shared/useInput-Cfp5zB2s.js +0 -594
  619. package/dist/packem_shared/useIsScreenReaderEnabled-CnGKCe0f.js +0 -9
  620. package/dist/packem_shared/useKeyBindings-B78l1E1n.js +0 -66
  621. package/dist/packem_shared/useMouseAction-C5gZ2nj7.js +0 -29
  622. package/dist/packem_shared/useMouseContext-D-rFy60Q.js +0 -12
  623. package/dist/packem_shared/useMousePosition-BHBJ-kBk.js +0 -25
  624. package/dist/packem_shared/useOnMouseClick--ZIyBOBO.js +0 -35
  625. package/dist/packem_shared/useOnMouseHover-26diuXUC.js +0 -32
  626. package/dist/packem_shared/useOnMouseState-NO_Kda_C.js +0 -13
  627. package/dist/packem_shared/usePaste-Ct8J4AGR.js +0 -35
  628. package/dist/packem_shared/useScrollAcceleration-R9LfrPVG.js +0 -73
  629. package/dist/packem_shared/useScrollInput-D3CpBq_a.js +0 -72
  630. package/dist/packem_shared/useStderr-CAOVUh4E.js +0 -6
  631. package/dist/packem_shared/useStdin-X-O0kd-n.js +0 -7
  632. package/dist/packem_shared/useStdout-DyF6DSH0.js +0 -6
  633. package/dist/packem_shared/useStopwatch-qC4Beai4.js +0 -33
  634. package/dist/packem_shared/useTerminalPalette-BaWO2c4Q.js +0 -38
  635. package/dist/packem_shared/useTextBuffer-C8fEe9Ly.js +0 -398
  636. package/dist/packem_shared/useTextSelection-mXtxgsPK.js +0 -50
  637. package/dist/packem_shared/useTimer-CPQ7j827.js +0 -46
  638. package/dist/packem_shared/useTreeView-BT57P3Kx.js +0 -101
  639. package/dist/packem_shared/useTreeViewState-BpS_KZ-K.js +0 -502
  640. package/dist/packem_shared/useWindowSize-ugEmGZJm.js +0 -20
  641. package/dist/packem_shared/utils-BgdlrbOH.js +0 -140
  642. package/dist/packem_shared/variant-config-DSZoX5TM.js +0 -8
  643. package/dist/packem_shared/wrapOrTruncateStyledLine-DN3Nogoc.js +0 -147
  644. package/dist/react/devtools.d.ts +0 -27
  645. package/dist/react/focus.d.ts +0 -39
  646. package/dist/react/hooks.d.ts +0 -238
  647. package/dist/react/layout.d.ts +0 -35
  648. package/dist/react/react.d.ts +0 -57
  649. package/dist/react/reconciler.d.ts +0 -4
  650. package/dist/react/render-to-string.d.ts +0 -21
  651. package/dist/react/renderer.d.ts +0 -2
  652. package/dist/react/scene.d.ts +0 -3
  653. package/dist/react/static.d.ts +0 -39
  654. package/dist/react/styles.d.ts +0 -83
  655. package/dist/react/text-width.d.ts +0 -20
  656. package/dist/testing/keys.d.ts +0 -89
  657. package/dist/testing/screen.d.ts +0 -35
  658. package/dist/testing/wait-for.d.ts +0 -21
package/index.js CHANGED
@@ -4,582 +4,734 @@
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
6
  import { createRequire } from 'node:module'
7
- const require = createRequire(import.meta.url)
8
- const __dirname = new URL('.', import.meta.url).pathname
7
+ const require = createRequire(import.meta.url);
8
+ const __dirname = new URL(".", import.meta.url).pathname;
9
9
 
10
- const { readFileSync } = require('node:fs')
11
- let nativeBinding = null
12
- const loadErrors = []
10
+ const { readFileSync } = require("node:fs");
11
+ let nativeBinding = null;
12
+ const loadErrors = [];
13
13
 
14
14
  const isMusl = () => {
15
- let musl = false
16
- if (process.platform === 'linux') {
17
- musl = isMuslFromFilesystem()
18
- if (musl === null) {
19
- musl = isMuslFromReport()
20
- }
21
- if (musl === null) {
22
- musl = isMuslFromChildProcess()
15
+ let musl = false;
16
+ if (process.platform === "linux") {
17
+ musl = isMuslFromFilesystem();
18
+ if (musl === null) {
19
+ musl = isMuslFromReport();
20
+ }
21
+ if (musl === null) {
22
+ musl = isMuslFromChildProcess();
23
+ }
23
24
  }
24
- }
25
- return musl
26
- }
25
+ return musl;
26
+ };
27
27
 
28
- const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-')
28
+ const isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
29
29
 
30
30
  const isMuslFromFilesystem = () => {
31
- try {
32
- return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl')
33
- } catch {
34
- return null
35
- }
36
- }
31
+ try {
32
+ return readFileSync("/usr/bin/ldd", "utf-8").includes("musl");
33
+ } catch {
34
+ return null;
35
+ }
36
+ };
37
37
 
38
38
  const isMuslFromReport = () => {
39
- let report = null
40
- if (typeof process.report?.getReport === 'function') {
41
- process.report.excludeNetwork = true
42
- report = process.report.getReport()
43
- }
44
- if (!report) {
45
- return null
46
- }
47
- if (report.header && report.header.glibcVersionRuntime) {
48
- return false
49
- }
50
- if (Array.isArray(report.sharedObjects)) {
51
- if (report.sharedObjects.some(isFileMusl)) {
52
- return true
39
+ let report = null;
40
+ if (typeof process.report?.getReport === "function") {
41
+ process.report.excludeNetwork = true;
42
+ report = process.report.getReport();
53
43
  }
54
- }
55
- return false
56
- }
57
-
58
- const isMuslFromChildProcess = () => {
59
- try {
60
- return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl')
61
- } catch (e) {
62
- // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
63
- return false
64
- }
65
- }
66
-
67
- function requireNative() {
68
- if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
69
- try {
70
- return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
71
- } catch (err) {
72
- loadErrors.push(err)
44
+ if (!report) {
45
+ return null;
73
46
  }
74
- } else if (process.platform === 'android') {
75
- if (process.arch === 'arm64') {
76
- try {
77
- return require('./tui-native.android-arm64.node')
78
- } catch (e) {
79
- loadErrors.push(e)
80
- }
81
- try {
82
- const binding = require('@visulima/tui-binding-android-arm64')
83
- const bindingPackageVersion = require('@visulima/tui-binding-android-arm64/package.json').version
84
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
85
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
86
- }
87
- return binding
88
- } catch (e) {
89
- loadErrors.push(e)
90
- }
91
- } else if (process.arch === 'arm') {
92
- try {
93
- return require('./tui-native.android-arm-eabi.node')
94
- } catch (e) {
95
- loadErrors.push(e)
96
- }
97
- try {
98
- const binding = require('@visulima/tui-binding-android-arm-eabi')
99
- const bindingPackageVersion = require('@visulima/tui-binding-android-arm-eabi/package.json').version
100
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
101
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
102
- }
103
- return binding
104
- } catch (e) {
105
- loadErrors.push(e)
106
- }
107
- } else {
108
- loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
47
+ if (report.header && report.header.glibcVersionRuntime) {
48
+ return false;
109
49
  }
110
- } else if (process.platform === 'win32') {
111
- if (process.arch === 'x64') {
112
- if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') {
113
- try {
114
- return require('./tui-native.win32-x64-gnu.node')
115
- } catch (e) {
116
- loadErrors.push(e)
117
- }
118
- try {
119
- const binding = require('@visulima/tui-binding-win32-x64-gnu')
120
- const bindingPackageVersion = require('@visulima/tui-binding-win32-x64-gnu/package.json').version
121
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
122
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
123
- }
124
- return binding
125
- } catch (e) {
126
- loadErrors.push(e)
127
- }
128
- } else {
129
- try {
130
- return require('./tui-native.win32-x64-msvc.node')
131
- } catch (e) {
132
- loadErrors.push(e)
133
- }
134
- try {
135
- const binding = require('@visulima/tui-binding-win32-x64-msvc')
136
- const bindingPackageVersion = require('@visulima/tui-binding-win32-x64-msvc/package.json').version
137
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
138
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
50
+ if (Array.isArray(report.sharedObjects)) {
51
+ if (report.sharedObjects.some(isFileMusl)) {
52
+ return true;
139
53
  }
140
- return binding
141
- } catch (e) {
142
- loadErrors.push(e)
143
- }
144
- }
145
- } else if (process.arch === 'ia32') {
146
- try {
147
- return require('./tui-native.win32-ia32-msvc.node')
148
- } catch (e) {
149
- loadErrors.push(e)
150
- }
151
- try {
152
- const binding = require('@visulima/tui-binding-win32-ia32-msvc')
153
- const bindingPackageVersion = require('@visulima/tui-binding-win32-ia32-msvc/package.json').version
154
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
155
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
156
- }
157
- return binding
158
- } catch (e) {
159
- loadErrors.push(e)
160
- }
161
- } else if (process.arch === 'arm64') {
162
- try {
163
- return require('./tui-native.win32-arm64-msvc.node')
164
- } catch (e) {
165
- loadErrors.push(e)
166
- }
167
- try {
168
- const binding = require('@visulima/tui-binding-win32-arm64-msvc')
169
- const bindingPackageVersion = require('@visulima/tui-binding-win32-arm64-msvc/package.json').version
170
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
171
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
172
- }
173
- return binding
174
- } catch (e) {
175
- loadErrors.push(e)
176
- }
177
- } else {
178
- loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
179
- }
180
- } else if (process.platform === 'darwin') {
181
- try {
182
- return require('./tui-native.darwin-universal.node')
183
- } catch (e) {
184
- loadErrors.push(e)
185
54
  }
55
+ return false;
56
+ };
57
+
58
+ const isMuslFromChildProcess = () => {
186
59
  try {
187
- const binding = require('@visulima/tui-binding-darwin-universal')
188
- const bindingPackageVersion = require('@visulima/tui-binding-darwin-universal/package.json').version
189
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
190
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
191
- }
192
- return binding
60
+ return require("child_process").execSync("ldd --version", { encoding: "utf8" }).includes("musl");
193
61
  } catch (e) {
194
- loadErrors.push(e)
195
- }
196
- if (process.arch === 'x64') {
197
- try {
198
- return require('./tui-native.darwin-x64.node')
199
- } catch (e) {
200
- loadErrors.push(e)
201
- }
202
- try {
203
- const binding = require('@visulima/tui-binding-darwin-x64')
204
- const bindingPackageVersion = require('@visulima/tui-binding-darwin-x64/package.json').version
205
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
206
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
207
- }
208
- return binding
209
- } catch (e) {
210
- loadErrors.push(e)
211
- }
212
- } else if (process.arch === 'arm64') {
213
- try {
214
- return require('./tui-native.darwin-arm64.node')
215
- } catch (e) {
216
- loadErrors.push(e)
217
- }
218
- try {
219
- const binding = require('@visulima/tui-binding-darwin-arm64')
220
- const bindingPackageVersion = require('@visulima/tui-binding-darwin-arm64/package.json').version
221
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
222
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
223
- }
224
- return binding
225
- } catch (e) {
226
- loadErrors.push(e)
227
- }
228
- } else {
229
- loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
230
- }
231
- } else if (process.platform === 'freebsd') {
232
- if (process.arch === 'x64') {
233
- try {
234
- return require('./tui-native.freebsd-x64.node')
235
- } catch (e) {
236
- loadErrors.push(e)
237
- }
238
- try {
239
- const binding = require('@visulima/tui-binding-freebsd-x64')
240
- const bindingPackageVersion = require('@visulima/tui-binding-freebsd-x64/package.json').version
241
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
242
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
243
- }
244
- return binding
245
- } catch (e) {
246
- loadErrors.push(e)
247
- }
248
- } else if (process.arch === 'arm64') {
249
- try {
250
- return require('./tui-native.freebsd-arm64.node')
251
- } catch (e) {
252
- loadErrors.push(e)
253
- }
254
- try {
255
- const binding = require('@visulima/tui-binding-freebsd-arm64')
256
- const bindingPackageVersion = require('@visulima/tui-binding-freebsd-arm64/package.json').version
257
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
258
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
259
- }
260
- return binding
261
- } catch (e) {
262
- loadErrors.push(e)
263
- }
264
- } else {
265
- loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
62
+ // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
63
+ return false;
266
64
  }
267
- } else if (process.platform === 'linux') {
268
- if (process.arch === 'x64') {
269
- if (isMusl()) {
270
- try {
271
- return require('./tui-native.linux-x64-musl.node')
272
- } catch (e) {
273
- loadErrors.push(e)
274
- }
275
- try {
276
- const binding = require('@visulima/tui-binding-linux-x64-musl')
277
- const bindingPackageVersion = require('@visulima/tui-binding-linux-x64-musl/package.json').version
278
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
279
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
280
- }
281
- return binding
282
- } catch (e) {
283
- loadErrors.push(e)
284
- }
285
- } else {
286
- try {
287
- return require('./tui-native.linux-x64-gnu.node')
288
- } catch (e) {
289
- loadErrors.push(e)
290
- }
291
- try {
292
- const binding = require('@visulima/tui-binding-linux-x64-gnu')
293
- const bindingPackageVersion = require('@visulima/tui-binding-linux-x64-gnu/package.json').version
294
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
295
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
296
- }
297
- return binding
298
- } catch (e) {
299
- loadErrors.push(e)
300
- }
301
- }
302
- } else if (process.arch === 'arm64') {
303
- if (isMusl()) {
304
- try {
305
- return require('./tui-native.linux-arm64-musl.node')
306
- } catch (e) {
307
- loadErrors.push(e)
308
- }
309
- try {
310
- const binding = require('@visulima/tui-binding-linux-arm64-musl')
311
- const bindingPackageVersion = require('@visulima/tui-binding-linux-arm64-musl/package.json').version
312
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
313
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
314
- }
315
- return binding
316
- } catch (e) {
317
- loadErrors.push(e)
318
- }
319
- } else {
320
- try {
321
- return require('./tui-native.linux-arm64-gnu.node')
322
- } catch (e) {
323
- loadErrors.push(e)
324
- }
325
- try {
326
- const binding = require('@visulima/tui-binding-linux-arm64-gnu')
327
- const bindingPackageVersion = require('@visulima/tui-binding-linux-arm64-gnu/package.json').version
328
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
329
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
330
- }
331
- return binding
332
- } catch (e) {
333
- loadErrors.push(e)
334
- }
335
- }
336
- } else if (process.arch === 'arm') {
337
- if (isMusl()) {
338
- try {
339
- return require('./tui-native.linux-arm-musleabihf.node')
340
- } catch (e) {
341
- loadErrors.push(e)
342
- }
343
- try {
344
- const binding = require('@visulima/tui-binding-linux-arm-musleabihf')
345
- const bindingPackageVersion = require('@visulima/tui-binding-linux-arm-musleabihf/package.json').version
346
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
347
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
348
- }
349
- return binding
350
- } catch (e) {
351
- loadErrors.push(e)
352
- }
353
- } else {
354
- try {
355
- return require('./tui-native.linux-arm-gnueabihf.node')
356
- } catch (e) {
357
- loadErrors.push(e)
358
- }
359
- try {
360
- const binding = require('@visulima/tui-binding-linux-arm-gnueabihf')
361
- const bindingPackageVersion = require('@visulima/tui-binding-linux-arm-gnueabihf/package.json').version
362
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
363
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
364
- }
365
- return binding
366
- } catch (e) {
367
- loadErrors.push(e)
368
- }
369
- }
370
- } else if (process.arch === 'loong64') {
371
- if (isMusl()) {
372
- try {
373
- return require('./tui-native.linux-loong64-musl.node')
374
- } catch (e) {
375
- loadErrors.push(e)
376
- }
377
- try {
378
- const binding = require('@visulima/tui-binding-linux-loong64-musl')
379
- const bindingPackageVersion = require('@visulima/tui-binding-linux-loong64-musl/package.json').version
380
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
381
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
382
- }
383
- return binding
384
- } catch (e) {
385
- loadErrors.push(e)
386
- }
387
- } else {
388
- try {
389
- return require('./tui-native.linux-loong64-gnu.node')
390
- } catch (e) {
391
- loadErrors.push(e)
392
- }
393
- try {
394
- const binding = require('@visulima/tui-binding-linux-loong64-gnu')
395
- const bindingPackageVersion = require('@visulima/tui-binding-linux-loong64-gnu/package.json').version
396
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
397
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
398
- }
399
- return binding
400
- } catch (e) {
401
- loadErrors.push(e)
402
- }
403
- }
404
- } else if (process.arch === 'riscv64') {
405
- if (isMusl()) {
406
- try {
407
- return require('./tui-native.linux-riscv64-musl.node')
408
- } catch (e) {
409
- loadErrors.push(e)
410
- }
65
+ };
66
+
67
+ function requireNative() {
68
+ if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
411
69
  try {
412
- const binding = require('@visulima/tui-binding-linux-riscv64-musl')
413
- const bindingPackageVersion = require('@visulima/tui-binding-linux-riscv64-musl/package.json').version
414
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
415
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
416
- }
417
- return binding
418
- } catch (e) {
419
- loadErrors.push(e)
70
+ return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
71
+ } catch (err) {
72
+ loadErrors.push(err);
73
+ }
74
+ } else if (process.platform === "android") {
75
+ if (process.arch === "arm64") {
76
+ try {
77
+ return require("./tui-native.android-arm64.node");
78
+ } catch (e) {
79
+ loadErrors.push(e);
80
+ }
81
+ try {
82
+ const binding = require("@visulima/tui-binding-android-arm64");
83
+ const bindingPackageVersion = require("@visulima/tui-binding-android-arm64/package.json").version;
84
+ if (
85
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
86
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
87
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
88
+ ) {
89
+ throw new Error(
90
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
91
+ );
92
+ }
93
+ return binding;
94
+ } catch (e) {
95
+ loadErrors.push(e);
96
+ }
97
+ } else if (process.arch === "arm") {
98
+ try {
99
+ return require("./tui-native.android-arm-eabi.node");
100
+ } catch (e) {
101
+ loadErrors.push(e);
102
+ }
103
+ try {
104
+ const binding = require("@visulima/tui-binding-android-arm-eabi");
105
+ const bindingPackageVersion = require("@visulima/tui-binding-android-arm-eabi/package.json").version;
106
+ if (
107
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
108
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
109
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
110
+ ) {
111
+ throw new Error(
112
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
113
+ );
114
+ }
115
+ return binding;
116
+ } catch (e) {
117
+ loadErrors.push(e);
118
+ }
119
+ } else {
120
+ loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`));
121
+ }
122
+ } else if (process.platform === "win32") {
123
+ if (process.arch === "x64") {
124
+ if (process.config?.variables?.shlib_suffix === "dll.a" || process.config?.variables?.node_target_type === "shared_library") {
125
+ try {
126
+ return require("./tui-native.win32-x64-gnu.node");
127
+ } catch (e) {
128
+ loadErrors.push(e);
129
+ }
130
+ try {
131
+ const binding = require("@visulima/tui-binding-win32-x64-gnu");
132
+ const bindingPackageVersion = require("@visulima/tui-binding-win32-x64-gnu/package.json").version;
133
+ if (
134
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
135
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
136
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
137
+ ) {
138
+ throw new Error(
139
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
140
+ );
141
+ }
142
+ return binding;
143
+ } catch (e) {
144
+ loadErrors.push(e);
145
+ }
146
+ } else {
147
+ try {
148
+ return require("./tui-native.win32-x64-msvc.node");
149
+ } catch (e) {
150
+ loadErrors.push(e);
151
+ }
152
+ try {
153
+ const binding = require("@visulima/tui-binding-win32-x64-msvc");
154
+ const bindingPackageVersion = require("@visulima/tui-binding-win32-x64-msvc/package.json").version;
155
+ if (
156
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
157
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
158
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
159
+ ) {
160
+ throw new Error(
161
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
162
+ );
163
+ }
164
+ return binding;
165
+ } catch (e) {
166
+ loadErrors.push(e);
167
+ }
168
+ }
169
+ } else if (process.arch === "ia32") {
170
+ try {
171
+ return require("./tui-native.win32-ia32-msvc.node");
172
+ } catch (e) {
173
+ loadErrors.push(e);
174
+ }
175
+ try {
176
+ const binding = require("@visulima/tui-binding-win32-ia32-msvc");
177
+ const bindingPackageVersion = require("@visulima/tui-binding-win32-ia32-msvc/package.json").version;
178
+ if (
179
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
180
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
181
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
182
+ ) {
183
+ throw new Error(
184
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
185
+ );
186
+ }
187
+ return binding;
188
+ } catch (e) {
189
+ loadErrors.push(e);
190
+ }
191
+ } else if (process.arch === "arm64") {
192
+ try {
193
+ return require("./tui-native.win32-arm64-msvc.node");
194
+ } catch (e) {
195
+ loadErrors.push(e);
196
+ }
197
+ try {
198
+ const binding = require("@visulima/tui-binding-win32-arm64-msvc");
199
+ const bindingPackageVersion = require("@visulima/tui-binding-win32-arm64-msvc/package.json").version;
200
+ if (
201
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
202
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
203
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
204
+ ) {
205
+ throw new Error(
206
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
207
+ );
208
+ }
209
+ return binding;
210
+ } catch (e) {
211
+ loadErrors.push(e);
212
+ }
213
+ } else {
214
+ loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));
420
215
  }
421
- } else {
216
+ } else if (process.platform === "darwin") {
422
217
  try {
423
- return require('./tui-native.linux-riscv64-gnu.node')
218
+ return require("./tui-native.darwin-universal.node");
424
219
  } catch (e) {
425
- loadErrors.push(e)
220
+ loadErrors.push(e);
426
221
  }
427
222
  try {
428
- const binding = require('@visulima/tui-binding-linux-riscv64-gnu')
429
- const bindingPackageVersion = require('@visulima/tui-binding-linux-riscv64-gnu/package.json').version
430
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
431
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
432
- }
433
- return binding
223
+ const binding = require("@visulima/tui-binding-darwin-universal");
224
+ const bindingPackageVersion = require("@visulima/tui-binding-darwin-universal/package.json").version;
225
+ if (bindingPackageVersion !== "1.0.0-alpha.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
226
+ throw new Error(
227
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
228
+ );
229
+ }
230
+ return binding;
434
231
  } catch (e) {
435
- loadErrors.push(e)
436
- }
437
- }
438
- } else if (process.arch === 'ppc64') {
439
- try {
440
- return require('./tui-native.linux-ppc64-gnu.node')
441
- } catch (e) {
442
- loadErrors.push(e)
443
- }
444
- try {
445
- const binding = require('@visulima/tui-binding-linux-ppc64-gnu')
446
- const bindingPackageVersion = require('@visulima/tui-binding-linux-ppc64-gnu/package.json').version
447
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
448
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
449
- }
450
- return binding
451
- } catch (e) {
452
- loadErrors.push(e)
453
- }
454
- } else if (process.arch === 's390x') {
455
- try {
456
- return require('./tui-native.linux-s390x-gnu.node')
457
- } catch (e) {
458
- loadErrors.push(e)
459
- }
460
- try {
461
- const binding = require('@visulima/tui-binding-linux-s390x-gnu')
462
- const bindingPackageVersion = require('@visulima/tui-binding-linux-s390x-gnu/package.json').version
463
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
464
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
465
- }
466
- return binding
467
- } catch (e) {
468
- loadErrors.push(e)
469
- }
470
- } else {
471
- loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
472
- }
473
- } else if (process.platform === 'openharmony') {
474
- if (process.arch === 'arm64') {
475
- try {
476
- return require('./tui-native.openharmony-arm64.node')
477
- } catch (e) {
478
- loadErrors.push(e)
479
- }
480
- try {
481
- const binding = require('@visulima/tui-binding-openharmony-arm64')
482
- const bindingPackageVersion = require('@visulima/tui-binding-openharmony-arm64/package.json').version
483
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
484
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
485
- }
486
- return binding
487
- } catch (e) {
488
- loadErrors.push(e)
489
- }
490
- } else if (process.arch === 'x64') {
491
- try {
492
- return require('./tui-native.openharmony-x64.node')
493
- } catch (e) {
494
- loadErrors.push(e)
495
- }
496
- try {
497
- const binding = require('@visulima/tui-binding-openharmony-x64')
498
- const bindingPackageVersion = require('@visulima/tui-binding-openharmony-x64/package.json').version
499
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
500
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
501
- }
502
- return binding
503
- } catch (e) {
504
- loadErrors.push(e)
505
- }
506
- } else if (process.arch === 'arm') {
507
- try {
508
- return require('./tui-native.openharmony-arm.node')
509
- } catch (e) {
510
- loadErrors.push(e)
511
- }
512
- try {
513
- const binding = require('@visulima/tui-binding-openharmony-arm')
514
- const bindingPackageVersion = require('@visulima/tui-binding-openharmony-arm/package.json').version
515
- if (bindingPackageVersion !== '0.0.1' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
516
- throw new Error(`Native binding package version mismatch, expected 0.0.1 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
232
+ loadErrors.push(e);
233
+ }
234
+ if (process.arch === "x64") {
235
+ try {
236
+ return require("./tui-native.darwin-x64.node");
237
+ } catch (e) {
238
+ loadErrors.push(e);
239
+ }
240
+ try {
241
+ const binding = require("@visulima/tui-binding-darwin-x64");
242
+ const bindingPackageVersion = require("@visulima/tui-binding-darwin-x64/package.json").version;
243
+ if (
244
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
245
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
246
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
247
+ ) {
248
+ throw new Error(
249
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
250
+ );
251
+ }
252
+ return binding;
253
+ } catch (e) {
254
+ loadErrors.push(e);
255
+ }
256
+ } else if (process.arch === "arm64") {
257
+ try {
258
+ return require("./tui-native.darwin-arm64.node");
259
+ } catch (e) {
260
+ loadErrors.push(e);
261
+ }
262
+ try {
263
+ const binding = require("@visulima/tui-binding-darwin-arm64");
264
+ const bindingPackageVersion = require("@visulima/tui-binding-darwin-arm64/package.json").version;
265
+ if (
266
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
267
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
268
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
269
+ ) {
270
+ throw new Error(
271
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
272
+ );
273
+ }
274
+ return binding;
275
+ } catch (e) {
276
+ loadErrors.push(e);
277
+ }
278
+ } else {
279
+ loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`));
280
+ }
281
+ } else if (process.platform === "freebsd") {
282
+ if (process.arch === "x64") {
283
+ try {
284
+ return require("./tui-native.freebsd-x64.node");
285
+ } catch (e) {
286
+ loadErrors.push(e);
287
+ }
288
+ try {
289
+ const binding = require("@visulima/tui-binding-freebsd-x64");
290
+ const bindingPackageVersion = require("@visulima/tui-binding-freebsd-x64/package.json").version;
291
+ if (
292
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
293
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
294
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
295
+ ) {
296
+ throw new Error(
297
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
298
+ );
299
+ }
300
+ return binding;
301
+ } catch (e) {
302
+ loadErrors.push(e);
303
+ }
304
+ } else if (process.arch === "arm64") {
305
+ try {
306
+ return require("./tui-native.freebsd-arm64.node");
307
+ } catch (e) {
308
+ loadErrors.push(e);
309
+ }
310
+ try {
311
+ const binding = require("@visulima/tui-binding-freebsd-arm64");
312
+ const bindingPackageVersion = require("@visulima/tui-binding-freebsd-arm64/package.json").version;
313
+ if (
314
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
315
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
316
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
317
+ ) {
318
+ throw new Error(
319
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
320
+ );
321
+ }
322
+ return binding;
323
+ } catch (e) {
324
+ loadErrors.push(e);
325
+ }
326
+ } else {
327
+ loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
328
+ }
329
+ } else if (process.platform === "linux") {
330
+ if (process.arch === "x64") {
331
+ if (isMusl()) {
332
+ try {
333
+ return require("./tui-native.linux-x64-musl.node");
334
+ } catch (e) {
335
+ loadErrors.push(e);
336
+ }
337
+ try {
338
+ const binding = require("@visulima/tui-binding-linux-x64-musl");
339
+ const bindingPackageVersion = require("@visulima/tui-binding-linux-x64-musl/package.json").version;
340
+ if (
341
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
342
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
343
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
344
+ ) {
345
+ throw new Error(
346
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
347
+ );
348
+ }
349
+ return binding;
350
+ } catch (e) {
351
+ loadErrors.push(e);
352
+ }
353
+ } else {
354
+ try {
355
+ return require("./tui-native.linux-x64-gnu.node");
356
+ } catch (e) {
357
+ loadErrors.push(e);
358
+ }
359
+ try {
360
+ const binding = require("@visulima/tui-binding-linux-x64-gnu");
361
+ const bindingPackageVersion = require("@visulima/tui-binding-linux-x64-gnu/package.json").version;
362
+ if (
363
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
364
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
365
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
366
+ ) {
367
+ throw new Error(
368
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
369
+ );
370
+ }
371
+ return binding;
372
+ } catch (e) {
373
+ loadErrors.push(e);
374
+ }
375
+ }
376
+ } else if (process.arch === "arm64") {
377
+ if (isMusl()) {
378
+ try {
379
+ return require("./tui-native.linux-arm64-musl.node");
380
+ } catch (e) {
381
+ loadErrors.push(e);
382
+ }
383
+ try {
384
+ const binding = require("@visulima/tui-binding-linux-arm64-musl");
385
+ const bindingPackageVersion = require("@visulima/tui-binding-linux-arm64-musl/package.json").version;
386
+ if (
387
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
388
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
389
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
390
+ ) {
391
+ throw new Error(
392
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
393
+ );
394
+ }
395
+ return binding;
396
+ } catch (e) {
397
+ loadErrors.push(e);
398
+ }
399
+ } else {
400
+ try {
401
+ return require("./tui-native.linux-arm64-gnu.node");
402
+ } catch (e) {
403
+ loadErrors.push(e);
404
+ }
405
+ try {
406
+ const binding = require("@visulima/tui-binding-linux-arm64-gnu");
407
+ const bindingPackageVersion = require("@visulima/tui-binding-linux-arm64-gnu/package.json").version;
408
+ if (
409
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
410
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
411
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
412
+ ) {
413
+ throw new Error(
414
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
415
+ );
416
+ }
417
+ return binding;
418
+ } catch (e) {
419
+ loadErrors.push(e);
420
+ }
421
+ }
422
+ } else if (process.arch === "arm") {
423
+ if (isMusl()) {
424
+ try {
425
+ return require("./tui-native.linux-arm-musleabihf.node");
426
+ } catch (e) {
427
+ loadErrors.push(e);
428
+ }
429
+ try {
430
+ const binding = require("@visulima/tui-binding-linux-arm-musleabihf");
431
+ const bindingPackageVersion = require("@visulima/tui-binding-linux-arm-musleabihf/package.json").version;
432
+ if (
433
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
434
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
435
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
436
+ ) {
437
+ throw new Error(
438
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
439
+ );
440
+ }
441
+ return binding;
442
+ } catch (e) {
443
+ loadErrors.push(e);
444
+ }
445
+ } else {
446
+ try {
447
+ return require("./tui-native.linux-arm-gnueabihf.node");
448
+ } catch (e) {
449
+ loadErrors.push(e);
450
+ }
451
+ try {
452
+ const binding = require("@visulima/tui-binding-linux-arm-gnueabihf");
453
+ const bindingPackageVersion = require("@visulima/tui-binding-linux-arm-gnueabihf/package.json").version;
454
+ if (
455
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
456
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
457
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
458
+ ) {
459
+ throw new Error(
460
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
461
+ );
462
+ }
463
+ return binding;
464
+ } catch (e) {
465
+ loadErrors.push(e);
466
+ }
467
+ }
468
+ } else if (process.arch === "loong64") {
469
+ if (isMusl()) {
470
+ try {
471
+ return require("./tui-native.linux-loong64-musl.node");
472
+ } catch (e) {
473
+ loadErrors.push(e);
474
+ }
475
+ try {
476
+ const binding = require("@visulima/tui-binding-linux-loong64-musl");
477
+ const bindingPackageVersion = require("@visulima/tui-binding-linux-loong64-musl/package.json").version;
478
+ if (
479
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
480
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
481
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
482
+ ) {
483
+ throw new Error(
484
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
485
+ );
486
+ }
487
+ return binding;
488
+ } catch (e) {
489
+ loadErrors.push(e);
490
+ }
491
+ } else {
492
+ try {
493
+ return require("./tui-native.linux-loong64-gnu.node");
494
+ } catch (e) {
495
+ loadErrors.push(e);
496
+ }
497
+ try {
498
+ const binding = require("@visulima/tui-binding-linux-loong64-gnu");
499
+ const bindingPackageVersion = require("@visulima/tui-binding-linux-loong64-gnu/package.json").version;
500
+ if (
501
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
502
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
503
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
504
+ ) {
505
+ throw new Error(
506
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
507
+ );
508
+ }
509
+ return binding;
510
+ } catch (e) {
511
+ loadErrors.push(e);
512
+ }
513
+ }
514
+ } else if (process.arch === "riscv64") {
515
+ if (isMusl()) {
516
+ try {
517
+ return require("./tui-native.linux-riscv64-musl.node");
518
+ } catch (e) {
519
+ loadErrors.push(e);
520
+ }
521
+ try {
522
+ const binding = require("@visulima/tui-binding-linux-riscv64-musl");
523
+ const bindingPackageVersion = require("@visulima/tui-binding-linux-riscv64-musl/package.json").version;
524
+ if (
525
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
526
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
527
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
528
+ ) {
529
+ throw new Error(
530
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
531
+ );
532
+ }
533
+ return binding;
534
+ } catch (e) {
535
+ loadErrors.push(e);
536
+ }
537
+ } else {
538
+ try {
539
+ return require("./tui-native.linux-riscv64-gnu.node");
540
+ } catch (e) {
541
+ loadErrors.push(e);
542
+ }
543
+ try {
544
+ const binding = require("@visulima/tui-binding-linux-riscv64-gnu");
545
+ const bindingPackageVersion = require("@visulima/tui-binding-linux-riscv64-gnu/package.json").version;
546
+ if (
547
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
548
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
549
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
550
+ ) {
551
+ throw new Error(
552
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
553
+ );
554
+ }
555
+ return binding;
556
+ } catch (e) {
557
+ loadErrors.push(e);
558
+ }
559
+ }
560
+ } else if (process.arch === "ppc64") {
561
+ try {
562
+ return require("./tui-native.linux-ppc64-gnu.node");
563
+ } catch (e) {
564
+ loadErrors.push(e);
565
+ }
566
+ try {
567
+ const binding = require("@visulima/tui-binding-linux-ppc64-gnu");
568
+ const bindingPackageVersion = require("@visulima/tui-binding-linux-ppc64-gnu/package.json").version;
569
+ if (
570
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
571
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
572
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
573
+ ) {
574
+ throw new Error(
575
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
576
+ );
577
+ }
578
+ return binding;
579
+ } catch (e) {
580
+ loadErrors.push(e);
581
+ }
582
+ } else if (process.arch === "s390x") {
583
+ try {
584
+ return require("./tui-native.linux-s390x-gnu.node");
585
+ } catch (e) {
586
+ loadErrors.push(e);
587
+ }
588
+ try {
589
+ const binding = require("@visulima/tui-binding-linux-s390x-gnu");
590
+ const bindingPackageVersion = require("@visulima/tui-binding-linux-s390x-gnu/package.json").version;
591
+ if (
592
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
593
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
594
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
595
+ ) {
596
+ throw new Error(
597
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
598
+ );
599
+ }
600
+ return binding;
601
+ } catch (e) {
602
+ loadErrors.push(e);
603
+ }
604
+ } else {
605
+ loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));
606
+ }
607
+ } else if (process.platform === "openharmony") {
608
+ if (process.arch === "arm64") {
609
+ try {
610
+ return require("./tui-native.openharmony-arm64.node");
611
+ } catch (e) {
612
+ loadErrors.push(e);
613
+ }
614
+ try {
615
+ const binding = require("@visulima/tui-binding-openharmony-arm64");
616
+ const bindingPackageVersion = require("@visulima/tui-binding-openharmony-arm64/package.json").version;
617
+ if (
618
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
619
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
620
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
621
+ ) {
622
+ throw new Error(
623
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
624
+ );
625
+ }
626
+ return binding;
627
+ } catch (e) {
628
+ loadErrors.push(e);
629
+ }
630
+ } else if (process.arch === "x64") {
631
+ try {
632
+ return require("./tui-native.openharmony-x64.node");
633
+ } catch (e) {
634
+ loadErrors.push(e);
635
+ }
636
+ try {
637
+ const binding = require("@visulima/tui-binding-openharmony-x64");
638
+ const bindingPackageVersion = require("@visulima/tui-binding-openharmony-x64/package.json").version;
639
+ if (
640
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
641
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
642
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
643
+ ) {
644
+ throw new Error(
645
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
646
+ );
647
+ }
648
+ return binding;
649
+ } catch (e) {
650
+ loadErrors.push(e);
651
+ }
652
+ } else if (process.arch === "arm") {
653
+ try {
654
+ return require("./tui-native.openharmony-arm.node");
655
+ } catch (e) {
656
+ loadErrors.push(e);
657
+ }
658
+ try {
659
+ const binding = require("@visulima/tui-binding-openharmony-arm");
660
+ const bindingPackageVersion = require("@visulima/tui-binding-openharmony-arm/package.json").version;
661
+ if (
662
+ bindingPackageVersion !== "1.0.0-alpha.2" &&
663
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
664
+ process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
665
+ ) {
666
+ throw new Error(
667
+ `Native binding package version mismatch, expected 1.0.0-alpha.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
668
+ );
669
+ }
670
+ return binding;
671
+ } catch (e) {
672
+ loadErrors.push(e);
673
+ }
674
+ } else {
675
+ loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
517
676
  }
518
- return binding
519
- } catch (e) {
520
- loadErrors.push(e)
521
- }
522
677
  } else {
523
- loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`))
678
+ loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
524
679
  }
525
- } else {
526
- loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
527
- }
528
680
  }
529
681
 
530
- nativeBinding = requireNative()
682
+ nativeBinding = requireNative();
531
683
 
532
684
  if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
533
- let wasiBinding = null
534
- let wasiBindingError = null
535
- try {
536
- wasiBinding = require('./tui-native.wasi.cjs')
537
- nativeBinding = wasiBinding
538
- } catch (err) {
539
- if (process.env.NAPI_RS_FORCE_WASI) {
540
- wasiBindingError = err
541
- }
542
- }
543
- if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
685
+ let wasiBinding = null;
686
+ let wasiBindingError = null;
544
687
  try {
545
- wasiBinding = require('@visulima/tui-binding-wasm32-wasi')
546
- nativeBinding = wasiBinding
688
+ wasiBinding = require("./tui-native.wasi.cjs");
689
+ nativeBinding = wasiBinding;
547
690
  } catch (err) {
548
- if (process.env.NAPI_RS_FORCE_WASI) {
549
- if (!wasiBindingError) {
550
- wasiBindingError = err
551
- } else {
552
- wasiBindingError.cause = err
691
+ if (process.env.NAPI_RS_FORCE_WASI) {
692
+ wasiBindingError = err;
693
+ }
694
+ }
695
+ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
696
+ try {
697
+ wasiBinding = require("@visulima/tui-binding-wasm32-wasi");
698
+ nativeBinding = wasiBinding;
699
+ } catch (err) {
700
+ if (process.env.NAPI_RS_FORCE_WASI) {
701
+ if (!wasiBindingError) {
702
+ wasiBindingError = err;
703
+ } else {
704
+ wasiBindingError.cause = err;
705
+ }
706
+ loadErrors.push(err);
707
+ }
553
708
  }
554
- loadErrors.push(err)
555
- }
556
709
  }
557
- }
558
- if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) {
559
- const error = new Error('WASI binding not found and NAPI_RS_FORCE_WASI is set to error')
560
- error.cause = wasiBindingError
561
- throw error
562
- }
710
+ if (process.env.NAPI_RS_FORCE_WASI === "error" && !wasiBinding) {
711
+ const error = new Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
712
+ error.cause = wasiBindingError;
713
+ throw error;
714
+ }
563
715
  }
564
716
 
565
717
  if (!nativeBinding) {
566
- if (loadErrors.length > 0) {
567
- throw new Error(
568
- `Cannot find native binding. ` +
569
- `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
570
- 'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
571
- {
572
- cause: loadErrors.reduce((err, cur) => {
573
- cur.cause = err
574
- return cur
575
- }),
576
- },
577
- )
578
- }
579
- throw new Error(`Failed to load native binding`)
718
+ if (loadErrors.length > 0) {
719
+ throw new Error(
720
+ `Cannot find native binding. ` +
721
+ `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
722
+ "Please try `npm i` again after removing both package-lock.json and node_modules directory.",
723
+ {
724
+ cause: loadErrors.reduce((err, cur) => {
725
+ cur.cause = err;
726
+ return cur;
727
+ }),
728
+ },
729
+ );
730
+ }
731
+ throw new Error(`Failed to load native binding`);
580
732
  }
581
733
 
582
- const { Renderer, TerminalGuard, terminalSize } = nativeBinding
583
- export { Renderer }
584
- export { TerminalGuard }
585
- export { terminalSize }
734
+ const { Renderer, TerminalGuard, terminalSize } = nativeBinding;
735
+ export { Renderer };
736
+ export { TerminalGuard };
737
+ export { terminalSize };