@moldable-ai/ui 0.2.19 → 0.2.21

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 (464) hide show
  1. package/dist/catalog/catalog-coverage.d.ts +15 -0
  2. package/dist/catalog/catalog-coverage.d.ts.map +1 -0
  3. package/dist/catalog/catalog-coverage.js +44 -0
  4. package/dist/catalog/catalog-manifest.d.ts +6 -0
  5. package/dist/catalog/catalog-manifest.d.ts.map +1 -0
  6. package/dist/catalog/catalog-manifest.js +117 -0
  7. package/dist/catalog/catalog-types.d.ts +64 -0
  8. package/dist/catalog/catalog-types.d.ts.map +1 -0
  9. package/dist/catalog/catalog-types.js +20 -0
  10. package/dist/catalog/component-catalog.d.ts +14 -0
  11. package/dist/catalog/component-catalog.d.ts.map +1 -0
  12. package/dist/catalog/component-catalog.js +49 -0
  13. package/dist/catalog/core-catalog-exclusions.d.ts +8 -0
  14. package/dist/catalog/core-catalog-exclusions.d.ts.map +1 -0
  15. package/dist/catalog/core-catalog-exclusions.js +151 -0
  16. package/dist/catalog/core-catalog.d.ts +2 -0
  17. package/dist/catalog/core-catalog.d.ts.map +1 -0
  18. package/dist/catalog/core-catalog.js +19 -0
  19. package/dist/catalog/core-collection-stories.d.ts +3 -0
  20. package/dist/catalog/core-collection-stories.d.ts.map +1 -0
  21. package/dist/catalog/core-collection-stories.js +42 -0
  22. package/dist/catalog/core-control-stories.d.ts +3 -0
  23. package/dist/catalog/core-control-stories.d.ts.map +1 -0
  24. package/dist/catalog/core-control-stories.js +94 -0
  25. package/dist/catalog/core-feedback-stories.d.ts +3 -0
  26. package/dist/catalog/core-feedback-stories.d.ts.map +1 -0
  27. package/dist/catalog/core-feedback-stories.js +50 -0
  28. package/dist/catalog/core-foundation-stories.d.ts +3 -0
  29. package/dist/catalog/core-foundation-stories.d.ts.map +1 -0
  30. package/dist/catalog/core-foundation-stories.js +53 -0
  31. package/dist/catalog/core-navigation-stories.d.ts +3 -0
  32. package/dist/catalog/core-navigation-stories.d.ts.map +1 -0
  33. package/dist/catalog/core-navigation-stories.js +25 -0
  34. package/dist/catalog/core-overlay-stories.d.ts +3 -0
  35. package/dist/catalog/core-overlay-stories.d.ts.map +1 -0
  36. package/dist/catalog/core-overlay-stories.js +20 -0
  37. package/dist/catalog/index.d.ts +7 -0
  38. package/dist/catalog/index.d.ts.map +1 -0
  39. package/dist/catalog/index.js +6 -0
  40. package/dist/components/app-error-boundary.d.ts +1 -0
  41. package/dist/components/app-error-boundary.d.ts.map +1 -1
  42. package/dist/components/app-error-boundary.js +13 -0
  43. package/dist/components/chat/chat-image-lightbox.d.ts +9 -0
  44. package/dist/components/chat/chat-image-lightbox.d.ts.map +1 -0
  45. package/dist/components/chat/chat-image-lightbox.js +9 -0
  46. package/dist/components/chat/chat-message.d.ts +19 -1
  47. package/dist/components/chat/chat-message.d.ts.map +1 -1
  48. package/dist/components/chat/chat-message.js +66 -16
  49. package/dist/components/chat/chat-messages.d.ts +5 -2
  50. package/dist/components/chat/chat-messages.d.ts.map +1 -1
  51. package/dist/components/chat/chat-messages.js +61 -6
  52. package/dist/components/chat/chat-panel.d.ts +49 -6
  53. package/dist/components/chat/chat-panel.d.ts.map +1 -1
  54. package/dist/components/chat/chat-panel.js +196 -163
  55. package/dist/components/chat/conversation-history.d.ts +39 -5
  56. package/dist/components/chat/conversation-history.d.ts.map +1 -1
  57. package/dist/components/chat/conversation-history.js +192 -26
  58. package/dist/components/chat/index.d.ts +2 -2
  59. package/dist/components/chat/index.d.ts.map +1 -1
  60. package/dist/components/chat/index.js +1 -1
  61. package/dist/components/chat/tool-handlers.d.ts.map +1 -1
  62. package/dist/components/chat/tool-handlers.js +40 -2
  63. package/dist/components/chat/vertical-scroll-fade.d.ts +6 -0
  64. package/dist/components/chat/vertical-scroll-fade.d.ts.map +1 -0
  65. package/dist/components/chat/vertical-scroll-fade.js +12 -0
  66. package/dist/components/native-capabilities/bluetooth-panel-helpers.d.ts +9 -0
  67. package/dist/components/native-capabilities/bluetooth-panel-helpers.d.ts.map +1 -0
  68. package/dist/components/native-capabilities/bluetooth-panel-helpers.js +37 -0
  69. package/dist/components/native-capabilities/bluetooth-panel.d.ts +56 -0
  70. package/dist/components/native-capabilities/bluetooth-panel.d.ts.map +1 -0
  71. package/dist/components/native-capabilities/bluetooth-panel.js +470 -0
  72. package/dist/components/native-capabilities/camera-preview.d.ts +39 -0
  73. package/dist/components/native-capabilities/camera-preview.d.ts.map +1 -0
  74. package/dist/components/native-capabilities/camera-preview.js +228 -0
  75. package/dist/components/native-capabilities/capability-badge.d.ts +23 -0
  76. package/dist/components/native-capabilities/capability-badge.d.ts.map +1 -0
  77. package/dist/components/native-capabilities/capability-badge.js +39 -0
  78. package/dist/components/native-capabilities/capability-matrix.d.ts +14 -0
  79. package/dist/components/native-capabilities/capability-matrix.d.ts.map +1 -0
  80. package/dist/components/native-capabilities/capability-matrix.js +97 -0
  81. package/dist/components/native-capabilities/clipboard-button.d.ts +26 -0
  82. package/dist/components/native-capabilities/clipboard-button.d.ts.map +1 -0
  83. package/dist/components/native-capabilities/clipboard-button.js +99 -0
  84. package/dist/components/native-capabilities/device-io-controls.d.ts +4 -0
  85. package/dist/components/native-capabilities/device-io-controls.d.ts.map +1 -0
  86. package/dist/components/native-capabilities/device-io-controls.js +28 -0
  87. package/dist/components/native-capabilities/device-list.d.ts +20 -0
  88. package/dist/components/native-capabilities/device-list.d.ts.map +1 -0
  89. package/dist/components/native-capabilities/device-list.js +14 -0
  90. package/dist/components/native-capabilities/display-map.d.ts +23 -0
  91. package/dist/components/native-capabilities/display-map.d.ts.map +1 -0
  92. package/dist/components/native-capabilities/display-map.js +114 -0
  93. package/dist/components/native-capabilities/haptic-button.d.ts +26 -0
  94. package/dist/components/native-capabilities/haptic-button.d.ts.map +1 -0
  95. package/dist/components/native-capabilities/haptic-button.js +94 -0
  96. package/dist/components/native-capabilities/hid-panel.d.ts +40 -0
  97. package/dist/components/native-capabilities/hid-panel.d.ts.map +1 -0
  98. package/dist/components/native-capabilities/hid-panel.js +373 -0
  99. package/dist/components/native-capabilities/index.d.ts +27 -0
  100. package/dist/components/native-capabilities/index.d.ts.map +1 -0
  101. package/dist/components/native-capabilities/index.js +26 -0
  102. package/dist/components/native-capabilities/live-indicator.d.ts +15 -0
  103. package/dist/components/native-capabilities/live-indicator.d.ts.map +1 -0
  104. package/dist/components/native-capabilities/live-indicator.js +26 -0
  105. package/dist/components/native-capabilities/local-auth-button.d.ts +33 -0
  106. package/dist/components/native-capabilities/local-auth-button.d.ts.map +1 -0
  107. package/dist/components/native-capabilities/local-auth-button.js +115 -0
  108. package/dist/components/native-capabilities/location-panel.d.ts +29 -0
  109. package/dist/components/native-capabilities/location-panel.d.ts.map +1 -0
  110. package/dist/components/native-capabilities/location-panel.js +146 -0
  111. package/dist/components/native-capabilities/microphone-meter.d.ts +35 -0
  112. package/dist/components/native-capabilities/microphone-meter.d.ts.map +1 -0
  113. package/dist/components/native-capabilities/microphone-meter.js +244 -0
  114. package/dist/components/native-capabilities/midi-monitor.d.ts +54 -0
  115. package/dist/components/native-capabilities/midi-monitor.d.ts.map +1 -0
  116. package/dist/components/native-capabilities/midi-monitor.js +534 -0
  117. package/dist/components/native-capabilities/native-capability-panel.d.ts +11 -0
  118. package/dist/components/native-capabilities/native-capability-panel.d.ts.map +1 -0
  119. package/dist/components/native-capabilities/native-capability-panel.js +28 -0
  120. package/dist/components/native-capabilities/notification-panel.d.ts +24 -0
  121. package/dist/components/native-capabilities/notification-panel.d.ts.map +1 -0
  122. package/dist/components/native-capabilities/notification-panel.js +124 -0
  123. package/dist/components/native-capabilities/power-blocker-controller.d.ts +19 -0
  124. package/dist/components/native-capabilities/power-blocker-controller.d.ts.map +1 -0
  125. package/dist/components/native-capabilities/power-blocker-controller.js +83 -0
  126. package/dist/components/native-capabilities/power-panel.d.ts +67 -0
  127. package/dist/components/native-capabilities/power-panel.d.ts.map +1 -0
  128. package/dist/components/native-capabilities/power-panel.js +309 -0
  129. package/dist/components/native-capabilities/readout.d.ts +10 -0
  130. package/dist/components/native-capabilities/readout.d.ts.map +1 -0
  131. package/dist/components/native-capabilities/readout.js +11 -0
  132. package/dist/components/native-capabilities/screen-share-preview.d.ts +36 -0
  133. package/dist/components/native-capabilities/screen-share-preview.d.ts.map +1 -0
  134. package/dist/components/native-capabilities/screen-share-preview.js +191 -0
  135. package/dist/components/native-capabilities/secure-storage-panel.d.ts +36 -0
  136. package/dist/components/native-capabilities/secure-storage-panel.d.ts.map +1 -0
  137. package/dist/components/native-capabilities/secure-storage-panel.js +193 -0
  138. package/dist/components/native-capabilities/serial-console.d.ts +64 -0
  139. package/dist/components/native-capabilities/serial-console.d.ts.map +1 -0
  140. package/dist/components/native-capabilities/serial-console.js +399 -0
  141. package/dist/components/native-capabilities/shortcut-recorder.d.ts +35 -0
  142. package/dist/components/native-capabilities/shortcut-recorder.d.ts.map +1 -0
  143. package/dist/components/native-capabilities/shortcut-recorder.js +217 -0
  144. package/dist/components/native-capabilities/stream-log.d.ts +35 -0
  145. package/dist/components/native-capabilities/stream-log.d.ts.map +1 -0
  146. package/dist/components/native-capabilities/stream-log.js +65 -0
  147. package/dist/components/native-capabilities/system-audio-monitor.d.ts +34 -0
  148. package/dist/components/native-capabilities/system-audio-monitor.d.ts.map +1 -0
  149. package/dist/components/native-capabilities/system-audio-monitor.js +275 -0
  150. package/dist/components/native-capabilities/usb-panel.d.ts +54 -0
  151. package/dist/components/native-capabilities/usb-panel.d.ts.map +1 -0
  152. package/dist/components/native-capabilities/usb-panel.js +363 -0
  153. package/dist/components/native-capabilities/use-capability.d.ts +20 -0
  154. package/dist/components/native-capabilities/use-capability.d.ts.map +1 -0
  155. package/dist/components/native-capabilities/use-capability.js +61 -0
  156. package/dist/components/ui/alert-dialog.d.ts +7 -3
  157. package/dist/components/ui/alert-dialog.d.ts.map +1 -1
  158. package/dist/components/ui/alert-dialog.js +9 -5
  159. package/dist/components/ui/alert.d.ts +19 -3
  160. package/dist/components/ui/alert.d.ts.map +1 -1
  161. package/dist/components/ui/alert.js +25 -8
  162. package/dist/components/ui/app-frame.d.ts +28 -0
  163. package/dist/components/ui/app-frame.d.ts.map +1 -0
  164. package/dist/components/ui/app-frame.js +95 -0
  165. package/dist/components/ui/button-group.d.ts +1 -1
  166. package/dist/components/ui/button.js +1 -1
  167. package/dist/components/ui/collapsible.d.ts +9 -1
  168. package/dist/components/ui/collapsible.d.ts.map +1 -1
  169. package/dist/components/ui/collapsible.js +13 -2
  170. package/dist/components/ui/collection-navigation.d.ts +8 -0
  171. package/dist/components/ui/collection-navigation.d.ts.map +1 -0
  172. package/dist/components/ui/collection-navigation.js +19 -0
  173. package/dist/components/ui/color-well.d.ts +13 -0
  174. package/dist/components/ui/color-well.d.ts.map +1 -0
  175. package/dist/components/ui/color-well.js +30 -0
  176. package/dist/components/ui/command.d.ts +5 -1
  177. package/dist/components/ui/command.d.ts.map +1 -1
  178. package/dist/components/ui/command.js +13 -1
  179. package/dist/components/ui/confirm-dialog.d.ts +19 -0
  180. package/dist/components/ui/confirm-dialog.d.ts.map +1 -0
  181. package/dist/components/ui/confirm-dialog.js +45 -0
  182. package/dist/components/ui/date-field.d.ts +19 -0
  183. package/dist/components/ui/date-field.d.ts.map +1 -0
  184. package/dist/components/ui/date-field.js +54 -0
  185. package/dist/components/ui/date-picker.d.ts +24 -0
  186. package/dist/components/ui/date-picker.d.ts.map +1 -0
  187. package/dist/components/ui/date-picker.js +92 -0
  188. package/dist/components/ui/dialog.d.ts +4 -2
  189. package/dist/components/ui/dialog.d.ts.map +1 -1
  190. package/dist/components/ui/dialog.js +8 -5
  191. package/dist/components/ui/edge-fade.d.ts +11 -0
  192. package/dist/components/ui/edge-fade.d.ts.map +1 -0
  193. package/dist/components/ui/edge-fade.js +41 -0
  194. package/dist/components/ui/empty.d.ts +7 -2
  195. package/dist/components/ui/empty.d.ts.map +1 -1
  196. package/dist/components/ui/empty.js +20 -7
  197. package/dist/components/ui/field.d.ts +1 -1
  198. package/dist/components/ui/grid.d.ts +24 -0
  199. package/dist/components/ui/grid.d.ts.map +1 -0
  200. package/dist/components/ui/grid.js +258 -0
  201. package/dist/components/ui/icon-button.d.ts +15 -0
  202. package/dist/components/ui/icon-button.d.ts.map +1 -0
  203. package/dist/components/ui/icon-button.js +15 -0
  204. package/dist/components/ui/index.d.ts +23 -0
  205. package/dist/components/ui/index.d.ts.map +1 -1
  206. package/dist/components/ui/index.js +23 -0
  207. package/dist/components/ui/input-group.d.ts +1 -1
  208. package/dist/components/ui/inspector.d.ts +15 -0
  209. package/dist/components/ui/inspector.d.ts.map +1 -0
  210. package/dist/components/ui/inspector.js +26 -0
  211. package/dist/components/ui/kbd.d.ts +1 -1
  212. package/dist/components/ui/list.d.ts +28 -0
  213. package/dist/components/ui/list.d.ts.map +1 -0
  214. package/dist/components/ui/list.js +235 -0
  215. package/dist/components/ui/material.d.ts +34 -0
  216. package/dist/components/ui/material.d.ts.map +1 -0
  217. package/dist/components/ui/material.js +34 -0
  218. package/dist/components/ui/message-scroller-controller.d.ts +162 -0
  219. package/dist/components/ui/message-scroller-controller.d.ts.map +1 -0
  220. package/dist/components/ui/message-scroller-controller.js +888 -0
  221. package/dist/components/ui/message-scroller-layout-stability.d.ts +33 -0
  222. package/dist/components/ui/message-scroller-layout-stability.d.ts.map +1 -0
  223. package/dist/components/ui/message-scroller-layout-stability.js +153 -0
  224. package/dist/components/ui/message-scroller-policy.d.ts +74 -0
  225. package/dist/components/ui/message-scroller-policy.d.ts.map +1 -0
  226. package/dist/components/ui/message-scroller-policy.js +129 -0
  227. package/dist/components/ui/message-scroller-primitive.d.ts +55 -0
  228. package/dist/components/ui/message-scroller-primitive.d.ts.map +1 -0
  229. package/dist/components/ui/message-scroller-primitive.js +226 -0
  230. package/dist/components/ui/message-scroller.d.ts +11 -0
  231. package/dist/components/ui/message-scroller.d.ts.map +1 -0
  232. package/dist/components/ui/message-scroller.js +25 -0
  233. package/dist/components/ui/navigation-button-group.d.ts +16 -0
  234. package/dist/components/ui/navigation-button-group.d.ts.map +1 -0
  235. package/dist/components/ui/navigation-button-group.js +9 -0
  236. package/dist/components/ui/notification-dot.d.ts +4 -0
  237. package/dist/components/ui/notification-dot.d.ts.map +1 -0
  238. package/dist/components/ui/notification-dot.js +7 -0
  239. package/dist/components/ui/number-input.d.ts +16 -0
  240. package/dist/components/ui/number-input.d.ts.map +1 -0
  241. package/dist/components/ui/number-input.js +56 -0
  242. package/dist/components/ui/panel.d.ts +18 -0
  243. package/dist/components/ui/panel.d.ts.map +1 -0
  244. package/dist/components/ui/panel.js +40 -0
  245. package/dist/components/ui/popover.d.ts +9 -2
  246. package/dist/components/ui/popover.d.ts.map +1 -1
  247. package/dist/components/ui/popover.js +14 -4
  248. package/dist/components/ui/scroll-area.d.ts +8 -2
  249. package/dist/components/ui/scroll-area.d.ts.map +1 -1
  250. package/dist/components/ui/scroll-area.js +6 -3
  251. package/dist/components/ui/search-field.d.ts +19 -0
  252. package/dist/components/ui/search-field.d.ts.map +1 -0
  253. package/dist/components/ui/search-field.js +64 -0
  254. package/dist/components/ui/segmented-control.d.ts +21 -0
  255. package/dist/components/ui/segmented-control.d.ts.map +1 -0
  256. package/dist/components/ui/segmented-control.js +62 -0
  257. package/dist/components/ui/sheet.d.ts +4 -2
  258. package/dist/components/ui/sheet.d.ts.map +1 -1
  259. package/dist/components/ui/sheet.js +12 -9
  260. package/dist/components/ui/sidebar.js +1 -1
  261. package/dist/components/ui/sonner.d.ts +4 -3
  262. package/dist/components/ui/sonner.d.ts.map +1 -1
  263. package/dist/components/ui/sonner.js +7 -6
  264. package/dist/components/ui/split-view.d.ts +11 -0
  265. package/dist/components/ui/split-view.d.ts.map +1 -0
  266. package/dist/components/ui/split-view.js +13 -0
  267. package/dist/components/ui/status.d.ts +13 -0
  268. package/dist/components/ui/status.d.ts.map +1 -0
  269. package/dist/components/ui/status.js +36 -0
  270. package/dist/components/ui/table.d.ts +11 -2
  271. package/dist/components/ui/table.d.ts.map +1 -1
  272. package/dist/components/ui/table.js +33 -6
  273. package/dist/components/ui/text.d.ts +17 -0
  274. package/dist/components/ui/text.d.ts.map +1 -0
  275. package/dist/components/ui/text.js +55 -0
  276. package/dist/components/ui/toggle.d.ts +12 -4
  277. package/dist/components/ui/toggle.d.ts.map +1 -1
  278. package/dist/components/ui/toggle.js +13 -2
  279. package/dist/components/ui/toolbar.d.ts +27 -0
  280. package/dist/components/ui/toolbar.d.ts.map +1 -0
  281. package/dist/components/ui/toolbar.js +71 -0
  282. package/dist/components/ui/tooltip.d.ts +8 -3
  283. package/dist/components/ui/tooltip.d.ts.map +1 -1
  284. package/dist/components/ui/tooltip.js +11 -6
  285. package/dist/index.d.ts +2 -2
  286. package/dist/index.d.ts.map +1 -1
  287. package/dist/index.js +4 -4
  288. package/dist/lib/frame-lifecycle.d.ts +29 -0
  289. package/dist/lib/frame-lifecycle.d.ts.map +1 -1
  290. package/dist/lib/frame-lifecycle.js +85 -0
  291. package/dist/lib/native-capabilities/access.d.ts +13 -0
  292. package/dist/lib/native-capabilities/access.d.ts.map +1 -0
  293. package/dist/lib/native-capabilities/access.js +53 -0
  294. package/dist/lib/native-capabilities/bluetooth-access.d.ts +14 -0
  295. package/dist/lib/native-capabilities/bluetooth-access.d.ts.map +1 -0
  296. package/dist/lib/native-capabilities/bluetooth-access.js +43 -0
  297. package/dist/lib/native-capabilities/bluetooth-connection.d.ts +19 -0
  298. package/dist/lib/native-capabilities/bluetooth-connection.d.ts.map +1 -0
  299. package/dist/lib/native-capabilities/bluetooth-connection.js +88 -0
  300. package/dist/lib/native-capabilities/bluetooth-gatt.d.ts +7 -0
  301. package/dist/lib/native-capabilities/bluetooth-gatt.d.ts.map +1 -0
  302. package/dist/lib/native-capabilities/bluetooth-gatt.js +77 -0
  303. package/dist/lib/native-capabilities/bluetooth-internal.d.ts +10 -0
  304. package/dist/lib/native-capabilities/bluetooth-internal.d.ts.map +1 -0
  305. package/dist/lib/native-capabilities/bluetooth-internal.js +105 -0
  306. package/dist/lib/native-capabilities/bluetooth-native-fallback.d.ts +33 -0
  307. package/dist/lib/native-capabilities/bluetooth-native-fallback.d.ts.map +1 -0
  308. package/dist/lib/native-capabilities/bluetooth-native-fallback.js +214 -0
  309. package/dist/lib/native-capabilities/bluetooth-types.d.ts +85 -0
  310. package/dist/lib/native-capabilities/bluetooth-types.d.ts.map +1 -0
  311. package/dist/lib/native-capabilities/bluetooth-types.js +2 -0
  312. package/dist/lib/native-capabilities/bluetooth.d.ts +7 -0
  313. package/dist/lib/native-capabilities/bluetooth.d.ts.map +1 -0
  314. package/dist/lib/native-capabilities/bluetooth.js +4 -0
  315. package/dist/lib/native-capabilities/bridge.d.ts +23 -0
  316. package/dist/lib/native-capabilities/bridge.d.ts.map +1 -0
  317. package/dist/lib/native-capabilities/bridge.js +266 -0
  318. package/dist/lib/native-capabilities/capabilities.d.ts +7 -0
  319. package/dist/lib/native-capabilities/capabilities.d.ts.map +1 -0
  320. package/dist/lib/native-capabilities/capabilities.js +95 -0
  321. package/dist/lib/native-capabilities/clipboard.d.ts +11 -0
  322. package/dist/lib/native-capabilities/clipboard.d.ts.map +1 -0
  323. package/dist/lib/native-capabilities/clipboard.js +58 -0
  324. package/dist/lib/native-capabilities/device-io-errors.d.ts +11 -0
  325. package/dist/lib/native-capabilities/device-io-errors.d.ts.map +1 -0
  326. package/dist/lib/native-capabilities/device-io-errors.js +82 -0
  327. package/dist/lib/native-capabilities/displays.d.ts +38 -0
  328. package/dist/lib/native-capabilities/displays.d.ts.map +1 -0
  329. package/dist/lib/native-capabilities/displays.js +12 -0
  330. package/dist/lib/native-capabilities/global-shortcuts.d.ts +86 -0
  331. package/dist/lib/native-capabilities/global-shortcuts.d.ts.map +1 -0
  332. package/dist/lib/native-capabilities/global-shortcuts.js +351 -0
  333. package/dist/lib/native-capabilities/haptics.d.ts +25 -0
  334. package/dist/lib/native-capabilities/haptics.d.ts.map +1 -0
  335. package/dist/lib/native-capabilities/haptics.js +18 -0
  336. package/dist/lib/native-capabilities/hid-native.d.ts +26 -0
  337. package/dist/lib/native-capabilities/hid-native.d.ts.map +1 -0
  338. package/dist/lib/native-capabilities/hid-native.js +229 -0
  339. package/dist/lib/native-capabilities/hid.d.ts +52 -0
  340. package/dist/lib/native-capabilities/hid.d.ts.map +1 -0
  341. package/dist/lib/native-capabilities/hid.js +163 -0
  342. package/dist/lib/native-capabilities/index.d.ts +40 -0
  343. package/dist/lib/native-capabilities/index.d.ts.map +1 -0
  344. package/dist/lib/native-capabilities/index.js +21 -0
  345. package/dist/lib/native-capabilities/local-authentication.d.ts +32 -0
  346. package/dist/lib/native-capabilities/local-authentication.d.ts.map +1 -0
  347. package/dist/lib/native-capabilities/local-authentication.js +46 -0
  348. package/dist/lib/native-capabilities/location.d.ts +49 -0
  349. package/dist/lib/native-capabilities/location.d.ts.map +1 -0
  350. package/dist/lib/native-capabilities/location.js +114 -0
  351. package/dist/lib/native-capabilities/media-permissions.d.ts +28 -0
  352. package/dist/lib/native-capabilities/media-permissions.d.ts.map +1 -0
  353. package/dist/lib/native-capabilities/media-permissions.js +37 -0
  354. package/dist/lib/native-capabilities/media.d.ts +17 -0
  355. package/dist/lib/native-capabilities/media.d.ts.map +1 -0
  356. package/dist/lib/native-capabilities/media.js +104 -0
  357. package/dist/lib/native-capabilities/midi-access.d.ts +13 -0
  358. package/dist/lib/native-capabilities/midi-access.d.ts.map +1 -0
  359. package/dist/lib/native-capabilities/midi-access.js +68 -0
  360. package/dist/lib/native-capabilities/midi-internal.d.ts +12 -0
  361. package/dist/lib/native-capabilities/midi-internal.d.ts.map +1 -0
  362. package/dist/lib/native-capabilities/midi-internal.js +88 -0
  363. package/dist/lib/native-capabilities/midi-native-fallback.d.ts +27 -0
  364. package/dist/lib/native-capabilities/midi-native-fallback.d.ts.map +1 -0
  365. package/dist/lib/native-capabilities/midi-native-fallback.js +127 -0
  366. package/dist/lib/native-capabilities/midi-ports.d.ts +6 -0
  367. package/dist/lib/native-capabilities/midi-ports.d.ts.map +1 -0
  368. package/dist/lib/native-capabilities/midi-ports.js +115 -0
  369. package/dist/lib/native-capabilities/midi-types.d.ts +25 -0
  370. package/dist/lib/native-capabilities/midi-types.d.ts.map +1 -0
  371. package/dist/lib/native-capabilities/midi-types.js +1 -0
  372. package/dist/lib/native-capabilities/midi.d.ts +6 -0
  373. package/dist/lib/native-capabilities/midi.d.ts.map +1 -0
  374. package/dist/lib/native-capabilities/midi.js +3 -0
  375. package/dist/lib/native-capabilities/native-device-io.d.ts +28 -0
  376. package/dist/lib/native-capabilities/native-device-io.d.ts.map +1 -0
  377. package/dist/lib/native-capabilities/native-device-io.js +91 -0
  378. package/dist/lib/native-capabilities/native-device-lifecycle.d.ts +13 -0
  379. package/dist/lib/native-capabilities/native-device-lifecycle.d.ts.map +1 -0
  380. package/dist/lib/native-capabilities/native-device-lifecycle.js +40 -0
  381. package/dist/lib/native-capabilities/notifications.d.ts +38 -0
  382. package/dist/lib/native-capabilities/notifications.d.ts.map +1 -0
  383. package/dist/lib/native-capabilities/notifications.js +50 -0
  384. package/dist/lib/native-capabilities/power-session.d.ts +113 -0
  385. package/dist/lib/native-capabilities/power-session.d.ts.map +1 -0
  386. package/dist/lib/native-capabilities/power-session.js +264 -0
  387. package/dist/lib/native-capabilities/secure-storage.d.ts +36 -0
  388. package/dist/lib/native-capabilities/secure-storage.d.ts.map +1 -0
  389. package/dist/lib/native-capabilities/secure-storage.js +64 -0
  390. package/dist/lib/native-capabilities/serial-native.d.ts +23 -0
  391. package/dist/lib/native-capabilities/serial-native.d.ts.map +1 -0
  392. package/dist/lib/native-capabilities/serial-native.js +181 -0
  393. package/dist/lib/native-capabilities/serial.d.ts +76 -0
  394. package/dist/lib/native-capabilities/serial.d.ts.map +1 -0
  395. package/dist/lib/native-capabilities/serial.js +215 -0
  396. package/dist/lib/native-capabilities/system-audio.d.ts +127 -0
  397. package/dist/lib/native-capabilities/system-audio.d.ts.map +1 -0
  398. package/dist/lib/native-capabilities/system-audio.js +330 -0
  399. package/dist/lib/native-capabilities/types.d.ts +62 -0
  400. package/dist/lib/native-capabilities/types.d.ts.map +1 -0
  401. package/dist/lib/native-capabilities/types.js +27 -0
  402. package/dist/lib/native-capabilities/usb-native.d.ts +39 -0
  403. package/dist/lib/native-capabilities/usb-native.d.ts.map +1 -0
  404. package/dist/lib/native-capabilities/usb-native.js +217 -0
  405. package/dist/lib/native-capabilities/usb.d.ts +85 -0
  406. package/dist/lib/native-capabilities/usb.d.ts.map +1 -0
  407. package/dist/lib/native-capabilities/usb.js +225 -0
  408. package/dist/lib/theme.d.ts.map +1 -1
  409. package/dist/lib/theme.js +2 -1
  410. package/docs/README.md +39 -0
  411. package/docs/accessibility.md +32 -0
  412. package/docs/adaptive-materials.md +79 -0
  413. package/docs/app-anatomy.md +74 -0
  414. package/docs/component-catalog.md +82 -0
  415. package/docs/component-guide-template.md +37 -0
  416. package/docs/design-tokens.md +185 -0
  417. package/docs/foundations.md +58 -0
  418. package/docs/native-integration.md +33 -0
  419. package/docs/standalone-app-windows.md +136 -0
  420. package/package.json +8 -3
  421. package/src/components/ui/alert-dialog.md +31 -0
  422. package/src/components/ui/alert.md +77 -0
  423. package/src/components/ui/app-frame.md +38 -0
  424. package/src/components/ui/badge.md +57 -0
  425. package/src/components/ui/button.md +76 -0
  426. package/src/components/ui/collapsible.md +52 -0
  427. package/src/components/ui/color-well.md +11 -0
  428. package/src/components/ui/combobox.md +42 -0
  429. package/src/components/ui/command.md +54 -0
  430. package/src/components/ui/date-field.md +32 -0
  431. package/src/components/ui/date-picker.md +55 -0
  432. package/src/components/ui/dialog.md +40 -0
  433. package/src/components/ui/edge-fade.md +7 -0
  434. package/src/components/ui/empty.md +87 -0
  435. package/src/components/ui/field.md +77 -0
  436. package/src/components/ui/grid.md +109 -0
  437. package/src/components/ui/icon-button.md +36 -0
  438. package/src/components/ui/inspector.md +11 -0
  439. package/src/components/ui/item.md +87 -0
  440. package/src/components/ui/list.md +140 -0
  441. package/src/components/ui/material.md +51 -0
  442. package/src/components/ui/navigation-button-group.md +46 -0
  443. package/src/components/ui/notification-dot.md +7 -0
  444. package/src/components/ui/number-input.md +19 -0
  445. package/src/components/ui/panel.md +11 -0
  446. package/src/components/ui/popover.md +31 -0
  447. package/src/components/ui/resizable.md +66 -0
  448. package/src/components/ui/scroll-area.md +72 -0
  449. package/src/components/ui/search-field.md +33 -0
  450. package/src/components/ui/segmented-control.md +36 -0
  451. package/src/components/ui/sheet.md +30 -0
  452. package/src/components/ui/sidebar.md +113 -0
  453. package/src/components/ui/sonner.md +37 -0
  454. package/src/components/ui/split-view.md +15 -0
  455. package/src/components/ui/status.md +12 -0
  456. package/src/components/ui/table.md +37 -0
  457. package/src/components/ui/tabs.md +66 -0
  458. package/src/components/ui/text.md +17 -0
  459. package/src/components/ui/toggle-button.md +48 -0
  460. package/src/components/ui/toggle-group.md +80 -0
  461. package/src/components/ui/toggle.md +73 -0
  462. package/src/components/ui/toolbar.md +26 -0
  463. package/src/components/ui/tooltip.md +31 -0
  464. package/src/styles/index.css +704 -3
@@ -0,0 +1,229 @@
1
+ import { NativeCapabilityBridgeError } from './bridge';
2
+ import { bytesFromNativeDeviceResult, bytesWrittenFromNativeDeviceResult, closeMoldableNativeDevice, executeMoldableNativeDeviceOperation, openMoldableNativeDevice, } from './native-device-io';
3
+ import { NativeDeviceLifecycle, isNativeDeviceDisconnect, } from './native-device-lifecycle';
4
+ export class NativeMoldableHidDevice extends EventTarget {
5
+ descriptor;
6
+ vendorId;
7
+ productId;
8
+ productName;
9
+ handle;
10
+ closing;
11
+ inputPump;
12
+ lifecycle = new NativeDeviceLifecycle();
13
+ constructor(descriptor) {
14
+ super();
15
+ this.descriptor = descriptor;
16
+ this.vendorId = descriptor.vendorId ?? 0;
17
+ this.productId = descriptor.productId ?? 0;
18
+ this.productName = descriptor.label;
19
+ }
20
+ get opened() {
21
+ return this.lifecycle.opened;
22
+ }
23
+ async open() {
24
+ if (this.closing)
25
+ await this.closing;
26
+ if (this.handle && this.lifecycle.disconnected)
27
+ await this.close();
28
+ if (this.opened)
29
+ return;
30
+ const result = await openMoldableNativeDevice('hid', this.descriptor.selector, {});
31
+ if (result.kind !== 'hid')
32
+ throw new Error('Native device kind mismatch.');
33
+ this.handle = result.handle;
34
+ this.lifecycle.didOpen();
35
+ this.startInputPump();
36
+ }
37
+ async close() {
38
+ if (this.closing)
39
+ return this.closing;
40
+ if (!this.handle)
41
+ return;
42
+ const handle = this.handle;
43
+ this.inputPump?.abort();
44
+ this.inputPump = undefined;
45
+ const closing = closeMoldableNativeDevice('hid', handle)
46
+ .then(() => {
47
+ if (this.handle === handle) {
48
+ this.handle = undefined;
49
+ this.lifecycle.didClose();
50
+ }
51
+ })
52
+ .catch((error) => {
53
+ if (this.handle === handle && !this.lifecycle.disconnected) {
54
+ this.startInputPump();
55
+ }
56
+ throw error;
57
+ })
58
+ .finally(() => {
59
+ if (this.closing === closing)
60
+ this.closing = undefined;
61
+ });
62
+ this.closing = closing;
63
+ return closing;
64
+ }
65
+ async forget() {
66
+ await this.close();
67
+ }
68
+ async sendReport(reportId, data) {
69
+ assertReportId(reportId);
70
+ const payload = asBytes(data);
71
+ const bytes = new Uint8Array(payload.byteLength + 1);
72
+ bytes[0] = reportId;
73
+ bytes.set(payload, 1);
74
+ const result = await this.execute({
75
+ action: 'write',
76
+ endpoint: null,
77
+ data: [...bytes],
78
+ timeoutMs: 10_000,
79
+ bulk: false,
80
+ });
81
+ if (bytesWrittenFromNativeDeviceResult(result) !== bytes.byteLength) {
82
+ throw new NativeCapabilityBridgeError({
83
+ code: 'host_error',
84
+ message: 'The HID device accepted only part of the output report.',
85
+ retryable: true,
86
+ });
87
+ }
88
+ }
89
+ async sendFeatureReport(reportId, data) {
90
+ assertReportId(reportId);
91
+ await this.execute({
92
+ action: 'hidSendFeature',
93
+ reportId,
94
+ data: [...asBytes(data)],
95
+ });
96
+ }
97
+ async receiveFeatureReport(reportId) {
98
+ assertReportId(reportId);
99
+ const result = await this.execute({
100
+ action: 'hidReceiveFeature',
101
+ reportId,
102
+ length: 4096,
103
+ });
104
+ const bytes = bytesFromNativeDeviceResult(result);
105
+ return new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
106
+ }
107
+ listen(listener, signal) {
108
+ if (signal?.aborted)
109
+ return () => undefined;
110
+ let active = true;
111
+ const handleReport = (event) => {
112
+ listener(event);
113
+ };
114
+ const stop = () => {
115
+ if (!active)
116
+ return;
117
+ active = false;
118
+ this.removeEventListener('inputreport', handleReport);
119
+ signal?.removeEventListener('abort', stop);
120
+ };
121
+ this.addEventListener('inputreport', handleReport);
122
+ signal?.addEventListener('abort', stop, { once: true });
123
+ return stop;
124
+ }
125
+ startInputPump() {
126
+ if (!this.handle || this.inputPump || this.lifecycle.disconnected)
127
+ return;
128
+ const controller = new AbortController();
129
+ this.inputPump = controller;
130
+ void this.readLoop(controller.signal).finally(() => {
131
+ if (this.inputPump === controller)
132
+ this.inputPump = undefined;
133
+ });
134
+ }
135
+ async readLoop(signal) {
136
+ while (!signal.aborted && this.handle) {
137
+ try {
138
+ const result = await this.execute({
139
+ action: 'hidReadInput',
140
+ length: 4096,
141
+ timeoutMs: 500,
142
+ }, signal);
143
+ if (result.kind !== 'hidInput' ||
144
+ !Number.isInteger(result.reportId) ||
145
+ Number(result.reportId) < 0 ||
146
+ Number(result.reportId) > 255) {
147
+ throw new NativeCapabilityBridgeError({
148
+ code: 'invalid_response',
149
+ message: 'Moldable returned an invalid HID input report.',
150
+ details: result,
151
+ });
152
+ }
153
+ const bytes = bytesFromNativeDeviceResult({
154
+ kind: 'data',
155
+ data: result.data,
156
+ });
157
+ if (bytes.length === 0)
158
+ continue;
159
+ const event = new Event('inputreport');
160
+ Object.defineProperties(event, {
161
+ device: { value: this },
162
+ reportId: { value: Number(result.reportId) },
163
+ data: {
164
+ value: new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength),
165
+ },
166
+ });
167
+ this.dispatchEvent(event);
168
+ }
169
+ catch (error) {
170
+ if (signal.aborted || !this.handle)
171
+ return;
172
+ if (error instanceof NativeCapabilityBridgeError &&
173
+ error.code === 'timeout') {
174
+ continue;
175
+ }
176
+ if (isNativeDeviceDisconnect(error)) {
177
+ this.lifecycle.didDisconnect(this, error);
178
+ }
179
+ else {
180
+ const event = new Event('error');
181
+ Object.defineProperty(event, 'error', { value: error });
182
+ this.dispatchEvent(event);
183
+ }
184
+ return;
185
+ }
186
+ }
187
+ }
188
+ async execute(operation, signal) {
189
+ if (!this.handle) {
190
+ throw new NativeCapabilityBridgeError({
191
+ code: 'invalid_request',
192
+ message: 'HID device is not open.',
193
+ });
194
+ }
195
+ if (this.lifecycle.disconnected) {
196
+ throw new NativeCapabilityBridgeError({
197
+ code: 'unavailable',
198
+ message: 'HID device is disconnected.',
199
+ retryable: true,
200
+ });
201
+ }
202
+ try {
203
+ return await executeMoldableNativeDeviceOperation('hid', this.handle, operation, { signal });
204
+ }
205
+ catch (error) {
206
+ if (isNativeDeviceDisconnect(error)) {
207
+ this.lifecycle.didDisconnect(this, error);
208
+ }
209
+ throw error;
210
+ }
211
+ }
212
+ }
213
+ export function isNativeMoldableHidDevice(device) {
214
+ return device instanceof NativeMoldableHidDevice;
215
+ }
216
+ function asBytes(data) {
217
+ return data instanceof ArrayBuffer
218
+ ? new Uint8Array(data)
219
+ : new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
220
+ }
221
+ function assertReportId(reportId) {
222
+ if (!Number.isInteger(reportId) || reportId < 0 || reportId > 0xff) {
223
+ throw new NativeCapabilityBridgeError({
224
+ code: 'invalid_request',
225
+ message: 'HID reportId must be an integer between 0 and 255.',
226
+ retryable: false,
227
+ });
228
+ }
229
+ }
@@ -0,0 +1,52 @@
1
+ export interface MoldableHidOperationOptions {
2
+ signal?: AbortSignal;
3
+ }
4
+ export interface MoldableHidDeviceFilter {
5
+ vendorId?: number;
6
+ productId?: number;
7
+ usagePage?: number;
8
+ usage?: number;
9
+ }
10
+ export interface MoldableHidInputReportEvent extends Event {
11
+ readonly data: DataView;
12
+ readonly device: MoldableHidDevice;
13
+ readonly reportId: number;
14
+ }
15
+ /** Structural subset of the standard HIDDevice interface used by the helpers. */
16
+ export interface MoldableHidDevice extends EventTarget {
17
+ readonly opened: boolean;
18
+ readonly vendorId: number;
19
+ readonly productId: number;
20
+ readonly productName: string;
21
+ open(): Promise<void>;
22
+ close(): Promise<void>;
23
+ forget?(): Promise<void>;
24
+ sendReport(reportId: number, data: BufferSource): Promise<void>;
25
+ sendFeatureReport(reportId: number, data: BufferSource): Promise<void>;
26
+ receiveFeatureReport(reportId: number): Promise<DataView>;
27
+ }
28
+ export interface MoldableHidRequestOptions extends MoldableHidOperationOptions {
29
+ filters: readonly MoldableHidDeviceFilter[];
30
+ exclusionFilters?: readonly MoldableHidDeviceFilter[];
31
+ }
32
+ /** Returns true only when this WebView exposes the WebHID entry point. */
33
+ export declare function isMoldableHidSupported(): boolean;
34
+ /** Lists devices previously authorized through WebHID. */
35
+ export declare function getMoldableHidDevices(): Promise<MoldableHidDevice[]>;
36
+ /**
37
+ * Shows the browser's HID chooser. Call this directly from a user gesture.
38
+ * Aborting stops awaiting the result but cannot dismiss every browser chooser.
39
+ */
40
+ export declare function requestMoldableHidDevices(options: MoldableHidRequestOptions): Promise<MoldableHidDevice[]>;
41
+ export declare function openMoldableHidDevice(device: MoldableHidDevice): Promise<void>;
42
+ export declare function closeMoldableHidDevice(device: MoldableHidDevice): Promise<void>;
43
+ /** Revokes the saved permission when the runtime supports HIDDevice.forget(). */
44
+ export declare function forgetMoldableHidDevice(device: MoldableHidDevice): Promise<void>;
45
+ export declare function sendMoldableHidReport(device: MoldableHidDevice, reportId: number, data: BufferSource, options?: MoldableHidOperationOptions): Promise<void>;
46
+ export declare function sendMoldableHidFeatureReport(device: MoldableHidDevice, reportId: number, data: BufferSource, options?: MoldableHidOperationOptions): Promise<void>;
47
+ export declare function receiveMoldableHidFeatureReport(device: MoldableHidDevice, reportId: number, options?: MoldableHidOperationOptions): Promise<DataView>;
48
+ /** Registers an input-report listener and returns an idempotent cleanup handle. */
49
+ export declare function listenForMoldableHidInputReports(device: MoldableHidDevice, listener: (event: MoldableHidInputReportEvent) => void, options?: {
50
+ signal?: AbortSignal;
51
+ }): () => void;
52
+ //# sourceMappingURL=hid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hid.d.ts","sourceRoot":"","sources":["../../../src/lib/native-capabilities/hid.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,2BAA2B;IAC1C,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,2BAA4B,SAAQ,KAAK;IACxD,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAA;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B;AAED,iFAAiF;AACjF,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACrB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACtB,MAAM,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACxB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/D,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,C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B;AAED,mFAAmF;AACnF,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,iBAAiB,EACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,2BAA2B,KAAK,IAAI,EACtD,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAA;CAAO,GACrC,MAAM,IAAI,CAqBZ"}
@@ -0,0 +1,163 @@
1
+ import { assertMoldableNativeCapabilityAccess, requireMoldableNativeCapabilityAccess, } from './access';
2
+ import { NativeCapabilityBridgeError } from './bridge';
3
+ import { awaitDeviceIoWithAbort, deviceIoError, unsupportedDeviceIoError, } from './device-io-errors';
4
+ import { NativeMoldableHidDevice, isNativeMoldableHidDevice, } from './hid-native';
5
+ import { listMoldableNativeDevices } from './native-device-io';
6
+ function assertNativeHidFiltersSupported(filters) {
7
+ if (filters?.some((filter) => filter.usagePage !== undefined || filter.usage !== undefined)) {
8
+ throw new NativeCapabilityBridgeError({
9
+ code: 'unsupported',
10
+ message: 'The native HID fallback cannot match usagePage or usage filters on this platform.',
11
+ retryable: false,
12
+ });
13
+ }
14
+ }
15
+ function hidApi() {
16
+ const api = typeof navigator === 'undefined'
17
+ ? undefined
18
+ : navigator.hid;
19
+ if (!api)
20
+ throw unsupportedDeviceIoError('hid');
21
+ return api;
22
+ }
23
+ /** Returns true only when this WebView exposes the WebHID entry point. */
24
+ export function isMoldableHidSupported() {
25
+ return (typeof navigator !== 'undefined' && !!navigator.hid);
26
+ }
27
+ /** Lists devices previously authorized through WebHID. */
28
+ export async function getMoldableHidDevices() {
29
+ await assertMoldableNativeCapabilityAccess('hid');
30
+ if (!isMoldableHidSupported()) {
31
+ throw unsupportedDeviceIoError('hid');
32
+ }
33
+ try {
34
+ return await hidApi().getDevices();
35
+ }
36
+ catch (error) {
37
+ throw deviceIoError('hid', 'enumerate', error);
38
+ }
39
+ }
40
+ /**
41
+ * Shows the browser's HID chooser. Call this directly from a user gesture.
42
+ * Aborting stops awaiting the result but cannot dismiss every browser chooser.
43
+ */
44
+ export async function requestMoldableHidDevices(options) {
45
+ await requireMoldableNativeCapabilityAccess('hid', options);
46
+ if (!isMoldableHidSupported()) {
47
+ assertNativeHidFiltersSupported(options.filters);
48
+ assertNativeHidFiltersSupported(options.exclusionFilters);
49
+ const descriptors = await listMoldableNativeDevices('hid', {
50
+ signal: options.signal,
51
+ filters: options.filters.map(({ vendorId, productId }) => ({
52
+ vendorId,
53
+ productId,
54
+ })),
55
+ ...(options.exclusionFilters
56
+ ? {
57
+ exclusionFilters: options.exclusionFilters.map(({ vendorId, productId }) => ({ vendorId, productId })),
58
+ }
59
+ : {}),
60
+ });
61
+ return descriptors
62
+ .filter((descriptor) => options.filters.length === 0
63
+ ? true
64
+ : options.filters.some((filter) => (filter.vendorId === undefined ||
65
+ filter.vendorId === descriptor.vendorId) &&
66
+ (filter.productId === undefined ||
67
+ filter.productId === descriptor.productId)))
68
+ .filter((descriptor) => !options.exclusionFilters?.some((filter) => (filter.vendorId === undefined ||
69
+ filter.vendorId === descriptor.vendorId) &&
70
+ (filter.productId === undefined ||
71
+ filter.productId === descriptor.productId)))
72
+ .map((descriptor) => new NativeMoldableHidDevice(descriptor));
73
+ }
74
+ try {
75
+ return await awaitDeviceIoWithAbort(hidApi().requestDevice({
76
+ filters: [...options.filters],
77
+ ...(options.exclusionFilters
78
+ ? { exclusionFilters: [...options.exclusionFilters] }
79
+ : {}),
80
+ }), 'hid', 'request', options.signal);
81
+ }
82
+ catch (error) {
83
+ throw deviceIoError('hid', 'request', error);
84
+ }
85
+ }
86
+ export async function openMoldableHidDevice(device) {
87
+ if (device.opened)
88
+ return;
89
+ try {
90
+ await device.open();
91
+ }
92
+ catch (error) {
93
+ throw deviceIoError('hid', 'open', error);
94
+ }
95
+ }
96
+ export async function closeMoldableHidDevice(device) {
97
+ if (!device.opened && !isNativeMoldableHidDevice(device))
98
+ return;
99
+ try {
100
+ await device.close();
101
+ }
102
+ catch (error) {
103
+ throw deviceIoError('hid', 'close', error);
104
+ }
105
+ }
106
+ /** Revokes the saved permission when the runtime supports HIDDevice.forget(). */
107
+ export async function forgetMoldableHidDevice(device) {
108
+ if (typeof device.forget !== 'function') {
109
+ throw unsupportedDeviceIoError('hid');
110
+ }
111
+ try {
112
+ await device.forget();
113
+ }
114
+ catch (error) {
115
+ throw deviceIoError('hid', 'close', error);
116
+ }
117
+ }
118
+ export async function sendMoldableHidReport(device, reportId, data, options = {}) {
119
+ try {
120
+ await awaitDeviceIoWithAbort(device.sendReport(reportId, data), 'hid', 'write', options.signal);
121
+ }
122
+ catch (error) {
123
+ throw deviceIoError('hid', 'write', error);
124
+ }
125
+ }
126
+ export async function sendMoldableHidFeatureReport(device, reportId, data, options = {}) {
127
+ try {
128
+ await awaitDeviceIoWithAbort(device.sendFeatureReport(reportId, data), 'hid', 'write', options.signal);
129
+ }
130
+ catch (error) {
131
+ throw deviceIoError('hid', 'write', error);
132
+ }
133
+ }
134
+ export async function receiveMoldableHidFeatureReport(device, reportId, options = {}) {
135
+ try {
136
+ return await awaitDeviceIoWithAbort(device.receiveFeatureReport(reportId), 'hid', 'read', options.signal);
137
+ }
138
+ catch (error) {
139
+ throw deviceIoError('hid', 'read', error);
140
+ }
141
+ }
142
+ /** Registers an input-report listener and returns an idempotent cleanup handle. */
143
+ export function listenForMoldableHidInputReports(device, listener, options = {}) {
144
+ if (isNativeMoldableHidDevice(device)) {
145
+ return device.listen(listener, options.signal);
146
+ }
147
+ if (options.signal?.aborted)
148
+ return () => undefined;
149
+ const handleReport = (event) => {
150
+ listener(event);
151
+ };
152
+ let active = true;
153
+ const cleanup = () => {
154
+ if (!active)
155
+ return;
156
+ active = false;
157
+ device.removeEventListener('inputreport', handleReport);
158
+ options.signal?.removeEventListener('abort', cleanup);
159
+ };
160
+ device.addEventListener('inputreport', handleReport);
161
+ options.signal?.addEventListener('abort', cleanup, { once: true });
162
+ return cleanup;
163
+ }
@@ -0,0 +1,40 @@
1
+ export { NativeCapabilityBridgeError, getMoldableNativeCapabilities, toNativeCapabilityBridgeError, } from './bridge';
2
+ export type { NativeCapabilityBridgeOptions } from './bridge';
3
+ export { assertMoldableNativeCapabilityAccess, getMoldableNativeCapabilityAccess, requestMoldableNativeCapabilityAccess, requireMoldableNativeCapabilityAccess, } from './access';
4
+ export type { MoldableNativeCapabilityAccessState } from './access';
5
+ export { getNativeCapability, isNativeCapabilityDescriptor, isNativeCapabilityId, isNativeCapabilityManifest, supportsNativeCapability, } from './capabilities';
6
+ export { readMoldableClipboardText, writeMoldableClipboardText, } from './clipboard';
7
+ export { MoldableBluetoothConnection, connectMoldableBluetoothDevice, getMoldableBluetoothAvailability, getMoldableBluetoothCharacteristic, isMoldableBluetoothSupported, observeMoldableBluetoothNotifications, readMoldableBluetoothValue, requestMoldableBluetoothDevice, requestMoldableBluetoothWithFallback, writeMoldableBluetoothValue, } from './bluetooth';
8
+ export type { MoldableBluetoothAPI, MoldableBluetoothAvailability, MoldableBluetoothConnectionOptions, MoldableBluetoothDataFilter, MoldableBluetoothDevice, MoldableBluetoothDeviceEventMap, MoldableBluetoothLEScanFilter, MoldableBluetoothManufacturerDataFilter, MoldableBluetoothNavigator, MoldableBluetoothOperationOptions, MoldableBluetoothRemoteGATTCharacteristic, MoldableBluetoothRemoteGATTServer, MoldableBluetoothRemoteGATTService, MoldableBluetoothRequestDeviceOptions, MoldableBluetoothRequestOptions, MoldableBluetoothServiceDataFilter, MoldableBluetoothTransport, MoldableBluetoothUUID, MoldableBluetoothWriteMode, MoldableNativeBluetoothDevice, MoldableNativeBluetoothService, } from './bluetooth';
9
+ export { getMoldableDisplays } from './displays';
10
+ export type { GetMoldableDisplaysOptions, MoldableDisplay, MoldableDisplayPosition, MoldableDisplaySize, MoldableDisplaysResult, } from './displays';
11
+ export { areMoldableGlobalShortcutsSuspended, isMoldableGlobalShortcutRegistered, isMoldableGlobalShortcut, registerAllMoldableGlobalShortcuts, registerMoldableGlobalShortcut, setMoldableGlobalShortcutsSuspended, unregisterAllMoldableGlobalShortcuts, unregisterMoldableGlobalShortcut, } from './global-shortcuts';
12
+ export type { MoldableGlobalShortcutEvent, MoldableGlobalShortcutHandler, MoldableGlobalShortcutRegistration, MoldableGlobalShortcutState, } from './global-shortcuts';
13
+ export { getMoldableHapticAvailability, performMoldableHapticFeedback, } from './haptics';
14
+ export type { MoldableHapticAvailability, MoldableHapticPattern, MoldableHapticResult, } from './haptics';
15
+ export { closeMoldableHidDevice, forgetMoldableHidDevice, getMoldableHidDevices, isMoldableHidSupported, listenForMoldableHidInputReports, openMoldableHidDevice, receiveMoldableHidFeatureReport, requestMoldableHidDevices, sendMoldableHidFeatureReport, sendMoldableHidReport, } from './hid';
16
+ export type { MoldableHidDevice, MoldableHidDeviceFilter, MoldableHidInputReportEvent, MoldableHidOperationOptions, MoldableHidRequestOptions, } from './hid';
17
+ export { MOLDABLE_LOCATION_MAX_CACHE_AGE_MS, MOLDABLE_LOCATION_MAX_TIMEOUT_MS, MOLDABLE_LOCATION_MIN_TIMEOUT_MS, getMoldableCurrentPosition, getMoldableLocationAuthorizationStatus, } from './location';
18
+ export type { MoldableLocationAuthorization, MoldableLocationAuthorizationState, MoldableLocationCoordinates, MoldableLocationOptions, MoldableLocationResult, } from './location';
19
+ export { LOCAL_AUTHENTICATION_MAX_REASON_BYTES, authenticateMoldableLocalUser, getMoldableLocalAuthenticationAvailability, } from './local-authentication';
20
+ export type { MoldableLocalAuthenticationAvailability, MoldableLocalAuthenticationMethod, MoldableLocalAuthenticationOptions, MoldableLocalAuthenticationOutcome, MoldableLocalAuthenticationPolicy, MoldableLocalAuthenticationResult, } from './local-authentication';
21
+ export { enumerateMoldableMediaDevices, getMoldableCameraStream, getMoldableDisplayStream, getMoldableMicrophoneStream, stopMoldableMediaStream, } from './media';
22
+ export { NATIVE_SYSTEM_AUDIO_MAX_REPLAY_FRAMES, NATIVE_SYSTEM_AUDIO_PERMISSION_REQUEST_TIMEOUT_MS, getMoldableSystemAudioCapabilities, getMoldableSystemAudioStatus, replayMoldableSystemAudioFrames, requestMoldableSystemAudioPermission, startMoldableSystemAudioCapture, stopMoldableSystemAudioCapture, subscribeMoldableSystemAudioEvents, } from './system-audio';
23
+ export type { MoldableSystemAudioCapabilities, MoldableSystemAudioCapabilityResult, MoldableSystemAudioCaptureMode, MoldableSystemAudioEvent, MoldableSystemAudioEventListener, MoldableSystemAudioReplayOptions, MoldableSystemAudioSource, MoldableSystemAudioSourceState, MoldableSystemAudioStartOptions, MoldableSystemAudioStartResult, MoldableSystemAudioStatus, MoldableSystemAudioStopOptions, SubscribeMoldableSystemAudioEventsOptions, UnsubscribeMoldableSystemAudioEvents, } from './system-audio';
24
+ export { NATIVE_MEDIA_PERMISSION_REQUEST_TIMEOUT_MS, getMoldableMediaPermissionDiagnostics, getMoldableMediaPermissionStatus, requestMoldableMediaPermission, } from './media-permissions';
25
+ export type { MoldableMediaPermission, MoldableMediaPermissionDiagnostics, MoldableMediaPermissionState, MoldableMediaPermissionStatus, } from './media-permissions';
26
+ export { getMoldableMIDIInputs, getMoldableMIDIOutputs, isMoldableMIDISupported, observeMoldableMIDIState, openMoldableMIDIInput, openMoldableMIDIOutput, requestMoldableMIDIAccess, requestMoldableMIDIWithFallback, } from './midi';
27
+ export type { MoldableMIDIAccessOptions, MoldableMIDIConnectionOptions, MoldableMIDIInputConnection, MoldableMIDIOutputConnection, MoldableMIDITransport, MoldableNativeMIDIAccess, MoldableNativeMIDIPort, } from './midi';
28
+ export { NATIVE_NOTIFICATION_MAX_BODY_LENGTH, NATIVE_NOTIFICATION_MAX_TAG_LENGTH, NATIVE_NOTIFICATION_MAX_TITLE_LENGTH, getMoldableNotificationPermission, requestMoldableNotificationPermission, sendMoldableNotification, } from './notifications';
29
+ export type { MoldableNotificationOptions, MoldableNotificationPermission, MoldableNotificationPermissionResult, MoldableNotificationSendResult, } from './notifications';
30
+ export { getMoldableCurrentThermalState, getMoldablePowerState, getMoldableSystemIdleState, getMoldableSystemIdleTime, isMoldableSleepBlockerStarted, isMoldablePowerSessionEvent, startMoldableSleepBlocker, stopMoldableSleepBlocker, watchMoldablePowerSession, } from './power-session';
31
+ export type { MoldableBatteryState, MoldableBatteryStatus, MoldablePowerSessionEvent, MoldablePowerSource, MoldablePowerState, MoldableSleepBlocker, MoldableSleepBlockerType, MoldableSystemIdleResult, MoldableSystemIdleState, MoldableThermalState, StopWatchingMoldablePowerSession, WatchMoldablePowerSessionOptions, } from './power-session';
32
+ export { SECURE_STORAGE_MAX_KEY_LENGTH, SECURE_STORAGE_MAX_VALUE_BYTES, deleteMoldableSecureValue, getMoldableSecureStorageDiagnostics, getMoldableSecureValue, listMoldableSecureValues, setMoldableSecureValue, } from './secure-storage';
33
+ export type { MoldableSecureStorageDeleteResult, MoldableSecureStorageBackend, MoldableSecureStorageDiagnostics, MoldableSecureStorageEntryMetadata, MoldableSecureStorageListResult, MoldableSecureStorageSetResult, MoldableSecureStorageValueResult, } from './secure-storage';
34
+ export { closeMoldableSerialPort, forgetMoldableSerialPort, getMoldableSerialPorts, getMoldableSerialSignals, isMoldableSerialSupported, openMoldableSerialPort, readMoldableSerialPort, requestMoldableSerialPort, setMoldableSerialSignals, writeMoldableSerialPort, } from './serial';
35
+ export type { MoldableBluetoothServiceUuid, MoldableSerialInputSignals, MoldableSerialOpenOptions, MoldableSerialOperationOptions, MoldableSerialOutputSignals, MoldableSerialPort, MoldableSerialPortFilter, MoldableSerialPortInfo, MoldableSerialRequestOptions, } from './serial';
36
+ export { NATIVE_CAPABILITY_IDS, NATIVE_CAPABILITY_MANIFEST_SCHEMA_VERSION, } from './types';
37
+ export type { NativeCapabilityDescriptor, NativeCapabilityId, NativeCapabilityManifest, NativeCapabilityErrorCode, NativeCapabilityErrorPayload, NativeCapabilityPermissionAuthority, NativeCapabilityPermissionMetadata, NativeCapabilityPermissionName, NativeCapabilityPermissionRequest, NativeCapabilityPlatform, NativeCapabilitySupport, NativeCapabilityTransportKind, NativeCapabilityTransportMetadata, } from './types';
38
+ export { clearMoldableUsbHalt, closeMoldableUsbDevice, forgetMoldableUsbDevice, getMoldableUsbDevices, isMoldableUsbSupported, openMoldableUsbDevice, readMoldableUsbControlTransfer, readMoldableUsbEndpoint, requestMoldableUsbDevice, resetMoldableUsbDevice, writeMoldableUsbControlTransfer, writeMoldableUsbEndpoint, } from './usb';
39
+ export type { MoldableUsbConfiguration, MoldableUsbControlTransferParameters, MoldableUsbDevice, MoldableUsbDeviceFilter, MoldableUsbInTransferResult, MoldableUsbOpenOptions, MoldableUsbOperationOptions, MoldableUsbOutTransferResult, MoldableUsbRequestOptions, } from './usb';
40
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/native-capabilities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,6BAA6B,GAC9B,MAAM,UAAU,CAAA;AACjB,YAAY,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAE7D,OAAO,EACL,oCAAoC,EACpC,iCAAiC,EACjC,qCAAqC,EACrC,qCAAqC,GACtC,MAAM,UAAU,CAAA;AACjB,YAAY,EAAE,mCAAmC,EAAE,MAAM,UAAU,CAAA;AAEnE,OAAO,EACL,mBAAmB,EACnB,4BAA4B,EAC5B,oBAAoB,EACpB,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EACL,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,2BAA2B,EAC3B,8BAA8B,EAC9B,gCAAgC,EAChC,kCAAkC,EAClC,4BAA4B,EAC5B,qCAAqC,EACrC,0BAA0B,EAC1B,8BAA8B,EAC9B,oCAAoC,EACpC,2BAA2B,GAC5B,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,oBAAoB,EACpB,6BAA6B,EAC7B,kCAAkC,EAClC,2BAA2B,EAC3B,uBAAuB,EACvB,+BAA+B,EAC/B,6BAA6B,EAC7B,uCAAuC,EACv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B,EACxB,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,UAAU,CAAA;AAEjB,OAAO,EACL,qBAAqB,EACrB,yCAAyC,GAC1C,MAAM,SAAS,CAAA;AAChB,YAAY,EACV,0BAA0B,EAC1B,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EACzB,4BAA4B,EAC5B,mCAAmC,EACnC,kCAAkC,EAClC,8BAA8B,EAC9B,iCAAiC,EACjC,wBAAwB,EACxB,uBAAuB,EACvB,6BAA6B,EAC7B,iCAAiC,GAClC,MAAM,SAAS,CAAA;AAEhB,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,8BAA8B,EAC9B,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,+BAA+B,EAC/B,wBAAwB,GACzB,MAAM,OAAO,CAAA;AACd,YAAY,EACV,wBAAwB,EACxB,oCAAoC,EACpC,iBAAiB,EACjB,uBAAuB,EACvB,2BAA2B,EAC3B,sBAAsB,EACtB,2BAA2B,EAC3B,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,OAAO,CAAA"}
@@ -0,0 +1,21 @@
1
+ export { NativeCapabilityBridgeError, getMoldableNativeCapabilities, toNativeCapabilityBridgeError, } from './bridge';
2
+ export { assertMoldableNativeCapabilityAccess, getMoldableNativeCapabilityAccess, requestMoldableNativeCapabilityAccess, requireMoldableNativeCapabilityAccess, } from './access';
3
+ export { getNativeCapability, isNativeCapabilityDescriptor, isNativeCapabilityId, isNativeCapabilityManifest, supportsNativeCapability, } from './capabilities';
4
+ export { readMoldableClipboardText, writeMoldableClipboardText, } from './clipboard';
5
+ export { MoldableBluetoothConnection, connectMoldableBluetoothDevice, getMoldableBluetoothAvailability, getMoldableBluetoothCharacteristic, isMoldableBluetoothSupported, observeMoldableBluetoothNotifications, readMoldableBluetoothValue, requestMoldableBluetoothDevice, requestMoldableBluetoothWithFallback, writeMoldableBluetoothValue, } from './bluetooth';
6
+ export { getMoldableDisplays } from './displays';
7
+ export { areMoldableGlobalShortcutsSuspended, isMoldableGlobalShortcutRegistered, isMoldableGlobalShortcut, registerAllMoldableGlobalShortcuts, registerMoldableGlobalShortcut, setMoldableGlobalShortcutsSuspended, unregisterAllMoldableGlobalShortcuts, unregisterMoldableGlobalShortcut, } from './global-shortcuts';
8
+ export { getMoldableHapticAvailability, performMoldableHapticFeedback, } from './haptics';
9
+ export { closeMoldableHidDevice, forgetMoldableHidDevice, getMoldableHidDevices, isMoldableHidSupported, listenForMoldableHidInputReports, openMoldableHidDevice, receiveMoldableHidFeatureReport, requestMoldableHidDevices, sendMoldableHidFeatureReport, sendMoldableHidReport, } from './hid';
10
+ export { MOLDABLE_LOCATION_MAX_CACHE_AGE_MS, MOLDABLE_LOCATION_MAX_TIMEOUT_MS, MOLDABLE_LOCATION_MIN_TIMEOUT_MS, getMoldableCurrentPosition, getMoldableLocationAuthorizationStatus, } from './location';
11
+ export { LOCAL_AUTHENTICATION_MAX_REASON_BYTES, authenticateMoldableLocalUser, getMoldableLocalAuthenticationAvailability, } from './local-authentication';
12
+ export { enumerateMoldableMediaDevices, getMoldableCameraStream, getMoldableDisplayStream, getMoldableMicrophoneStream, stopMoldableMediaStream, } from './media';
13
+ export { NATIVE_SYSTEM_AUDIO_MAX_REPLAY_FRAMES, NATIVE_SYSTEM_AUDIO_PERMISSION_REQUEST_TIMEOUT_MS, getMoldableSystemAudioCapabilities, getMoldableSystemAudioStatus, replayMoldableSystemAudioFrames, requestMoldableSystemAudioPermission, startMoldableSystemAudioCapture, stopMoldableSystemAudioCapture, subscribeMoldableSystemAudioEvents, } from './system-audio';
14
+ export { NATIVE_MEDIA_PERMISSION_REQUEST_TIMEOUT_MS, getMoldableMediaPermissionDiagnostics, getMoldableMediaPermissionStatus, requestMoldableMediaPermission, } from './media-permissions';
15
+ export { getMoldableMIDIInputs, getMoldableMIDIOutputs, isMoldableMIDISupported, observeMoldableMIDIState, openMoldableMIDIInput, openMoldableMIDIOutput, requestMoldableMIDIAccess, requestMoldableMIDIWithFallback, } from './midi';
16
+ export { NATIVE_NOTIFICATION_MAX_BODY_LENGTH, NATIVE_NOTIFICATION_MAX_TAG_LENGTH, NATIVE_NOTIFICATION_MAX_TITLE_LENGTH, getMoldableNotificationPermission, requestMoldableNotificationPermission, sendMoldableNotification, } from './notifications';
17
+ export { getMoldableCurrentThermalState, getMoldablePowerState, getMoldableSystemIdleState, getMoldableSystemIdleTime, isMoldableSleepBlockerStarted, isMoldablePowerSessionEvent, startMoldableSleepBlocker, stopMoldableSleepBlocker, watchMoldablePowerSession, } from './power-session';
18
+ export { SECURE_STORAGE_MAX_KEY_LENGTH, SECURE_STORAGE_MAX_VALUE_BYTES, deleteMoldableSecureValue, getMoldableSecureStorageDiagnostics, getMoldableSecureValue, listMoldableSecureValues, setMoldableSecureValue, } from './secure-storage';
19
+ export { closeMoldableSerialPort, forgetMoldableSerialPort, getMoldableSerialPorts, getMoldableSerialSignals, isMoldableSerialSupported, openMoldableSerialPort, readMoldableSerialPort, requestMoldableSerialPort, setMoldableSerialSignals, writeMoldableSerialPort, } from './serial';
20
+ export { NATIVE_CAPABILITY_IDS, NATIVE_CAPABILITY_MANIFEST_SCHEMA_VERSION, } from './types';
21
+ export { clearMoldableUsbHalt, closeMoldableUsbDevice, forgetMoldableUsbDevice, getMoldableUsbDevices, isMoldableUsbSupported, openMoldableUsbDevice, readMoldableUsbControlTransfer, readMoldableUsbEndpoint, requestMoldableUsbDevice, resetMoldableUsbDevice, writeMoldableUsbControlTransfer, writeMoldableUsbEndpoint, } from './usb';
@@ -0,0 +1,32 @@
1
+ import { type NativeCapabilityBridgeOptions } from './bridge';
2
+ export declare const NATIVE_LOCAL_AUTHENTICATION_REQUEST_TYPE: "moldable:native-local-authentication";
3
+ export declare const NATIVE_LOCAL_AUTHENTICATION_RESULT_TYPE: "moldable:native-local-authentication-result";
4
+ export declare const LOCAL_AUTHENTICATION_MAX_REASON_BYTES = 160;
5
+ export declare const LOCAL_AUTHENTICATION_TIMEOUT_MS = 125000;
6
+ export type MoldableLocalAuthenticationMethod = 'biometric' | 'device-owner' | 'device-credential' | 'unknown';
7
+ export type MoldableLocalAuthenticationPolicy = 'biometric-only' | 'device-owner';
8
+ export interface MoldableLocalAuthenticationOptions extends NativeCapabilityBridgeOptions {
9
+ /** Defaults to device-owner for compatibility with earlier releases. */
10
+ policy?: MoldableLocalAuthenticationPolicy;
11
+ }
12
+ export type MoldableLocalAuthenticationOutcome = 'authenticated' | 'cancelled' | 'failed' | 'locked-out' | 'unavailable';
13
+ export interface MoldableLocalAuthenticationAvailability {
14
+ available: boolean;
15
+ method: MoldableLocalAuthenticationMethod;
16
+ reason?: string;
17
+ }
18
+ export interface MoldableLocalAuthenticationResult {
19
+ outcome: MoldableLocalAuthenticationOutcome;
20
+ method: MoldableLocalAuthenticationMethod;
21
+ message?: string;
22
+ retryable: boolean;
23
+ }
24
+ export declare function getMoldableLocalAuthenticationAvailability(options?: NativeCapabilityBridgeOptions): Promise<MoldableLocalAuthenticationAvailability>;
25
+ /**
26
+ * Ask the operating system to verify the current device user.
27
+ *
28
+ * Authentication failures and user cancellation are returned as reasoned
29
+ * outcomes. Bridge failures still reject with NativeCapabilityBridgeError.
30
+ */
31
+ export declare function authenticateMoldableLocalUser(reason: string, options?: MoldableLocalAuthenticationOptions): Promise<MoldableLocalAuthenticationResult>;
32
+ //# sourceMappingURL=local-authentication.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-authentication.d.ts","sourceRoot":"","sources":["../../../src/lib/native-capabilities/local-authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,6BAA6B,EAEnC,MAAM,UAAU,CAAA;AAEjB,eAAO,MAAM,wCAAwC,EACnD,sCAA+C,CAAA;AACjD,eAAO,MAAM,uCAAuC,EAClD,6CAAsD,CAAA;AAExD,eAAO,MAAM,qCAAqC,MAAM,CAAA;AACxD,eAAO,MAAM,+BAA+B,SAAU,CAAA;AAEtD,MAAM,MAAM,iCAAiC,GACzC,WAAW,GACX,cAAc,GACd,mBAAmB,GACnB,SAAS,CAAA;AAEb,MAAM,MAAM,iCAAiC,GACzC,gBAAgB,GAChB,cAAc,CAAA;AAElB,MAAM,WAAW,kCACf,SAAQ,6BAA6B;IACrC,wEAAwE;IACxE,MAAM,CAAC,EAAE,iCAAiC,CAAA;CAC3C;AAED,MAAM,MAAM,kCAAkC,GAC1C,eAAe,GACf,WAAW,GACX,QAAQ,GACR,YAAY,GACZ,aAAa,CAAA;AAEjB,MAAM,WAAW,uCAAuC;IACtD,SAAS,EAAE,OAAO,CAAA;IAClB,MAAM,EAAE,iCAAiC,CAAA;IACzC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,iCAAiC;IAChD,OAAO,EAAE,kCAAkC,CAAA;IAC3C,MAAM,EAAE,iCAAiC,CAAA;IACzC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,OAAO,CAAA;CACnB;AASD,wBAAgB,0CAA0C,CACxD,OAAO,GAAE,6BAAkC,GAC1C,OAAO,CAAC,uCAAuC,CAAC,CAUlD;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,kCAAuC,GAC/C,OAAO,CAAC,iCAAiC,CAAC,CAiC5C"}
@@ -0,0 +1,46 @@
1
+ import { callNativeCapabilityBridge, } from './bridge';
2
+ export const NATIVE_LOCAL_AUTHENTICATION_REQUEST_TYPE = 'moldable:native-local-authentication';
3
+ export const NATIVE_LOCAL_AUTHENTICATION_RESULT_TYPE = 'moldable:native-local-authentication-result';
4
+ export const LOCAL_AUTHENTICATION_MAX_REASON_BYTES = 160;
5
+ export const LOCAL_AUTHENTICATION_TIMEOUT_MS = 125_000;
6
+ function hasControlCharacters(value) {
7
+ return Array.from(value).some((character) => {
8
+ const codePoint = character.codePointAt(0) ?? 0;
9
+ return codePoint <= 0x1f || (codePoint >= 0x7f && codePoint <= 0x9f);
10
+ });
11
+ }
12
+ export function getMoldableLocalAuthenticationAvailability(options = {}) {
13
+ return callNativeCapabilityBridge({
14
+ type: NATIVE_LOCAL_AUTHENTICATION_REQUEST_TYPE,
15
+ capability: 'local-authentication',
16
+ action: 'getAvailability',
17
+ }, NATIVE_LOCAL_AUTHENTICATION_RESULT_TYPE, options);
18
+ }
19
+ /**
20
+ * Ask the operating system to verify the current device user.
21
+ *
22
+ * Authentication failures and user cancellation are returned as reasoned
23
+ * outcomes. Bridge failures still reject with NativeCapabilityBridgeError.
24
+ */
25
+ export function authenticateMoldableLocalUser(reason, options = {}) {
26
+ if (reason.trim().length === 0 ||
27
+ hasControlCharacters(reason) ||
28
+ new TextEncoder().encode(reason).byteLength >
29
+ LOCAL_AUTHENTICATION_MAX_REASON_BYTES) {
30
+ return Promise.reject(new TypeError(`Authentication reason must contain 1-${LOCAL_AUTHENTICATION_MAX_REASON_BYTES} UTF-8 bytes and no control characters.`));
31
+ }
32
+ const { policy = 'device-owner', ...bridgeOptions } = options;
33
+ if (policy !== 'biometric-only' && policy !== 'device-owner') {
34
+ return Promise.reject(new TypeError('Invalid local authentication policy.'));
35
+ }
36
+ return callNativeCapabilityBridge({
37
+ type: NATIVE_LOCAL_AUTHENTICATION_REQUEST_TYPE,
38
+ capability: 'local-authentication',
39
+ action: 'authenticate',
40
+ reason,
41
+ policy,
42
+ }, NATIVE_LOCAL_AUTHENTICATION_RESULT_TYPE, {
43
+ ...bridgeOptions,
44
+ timeoutMs: bridgeOptions.timeoutMs ?? LOCAL_AUTHENTICATION_TIMEOUT_MS,
45
+ });
46
+ }