@moldable-ai/ui 0.2.18 → 0.2.20
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.
- package/dist/catalog/catalog-manifest.d.ts +6 -0
- package/dist/catalog/catalog-manifest.d.ts.map +1 -0
- package/dist/catalog/catalog-manifest.js +105 -0
- package/dist/catalog/catalog-types.d.ts +54 -0
- package/dist/catalog/catalog-types.d.ts.map +1 -0
- package/dist/catalog/catalog-types.js +14 -0
- package/dist/catalog/component-catalog.d.ts +14 -0
- package/dist/catalog/component-catalog.d.ts.map +1 -0
- package/dist/catalog/component-catalog.js +39 -0
- package/dist/catalog/core-catalog.d.ts +6 -0
- package/dist/catalog/core-catalog.d.ts.map +1 -0
- package/dist/catalog/core-catalog.js +105 -0
- package/dist/catalog/index.d.ts +5 -0
- package/dist/catalog/index.d.ts.map +1 -0
- package/dist/catalog/index.js +4 -0
- package/dist/components/app-error-boundary.d.ts +1 -0
- package/dist/components/app-error-boundary.d.ts.map +1 -1
- package/dist/components/app-error-boundary.js +13 -0
- package/dist/components/chat/chat-image-lightbox.d.ts +9 -0
- package/dist/components/chat/chat-image-lightbox.d.ts.map +1 -0
- package/dist/components/chat/chat-image-lightbox.js +9 -0
- package/dist/components/chat/chat-message.d.ts +19 -1
- package/dist/components/chat/chat-message.d.ts.map +1 -1
- package/dist/components/chat/chat-message.js +66 -16
- package/dist/components/chat/chat-messages.d.ts +5 -2
- package/dist/components/chat/chat-messages.d.ts.map +1 -1
- package/dist/components/chat/chat-messages.js +61 -6
- package/dist/components/chat/chat-panel.d.ts +67 -17
- package/dist/components/chat/chat-panel.d.ts.map +1 -1
- package/dist/components/chat/chat-panel.js +250 -159
- package/dist/components/chat/conversation-history.d.ts +39 -5
- package/dist/components/chat/conversation-history.d.ts.map +1 -1
- package/dist/components/chat/conversation-history.js +192 -26
- package/dist/components/chat/index.d.ts +3 -2
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +3 -2
- package/dist/components/chat/model-effort-power-effects.d.ts +7 -0
- package/dist/components/chat/model-effort-power-effects.d.ts.map +1 -0
- package/dist/components/chat/model-effort-power-effects.js +54 -0
- package/dist/components/chat/model-effort-selector.d.ts +26 -0
- package/dist/components/chat/model-effort-selector.d.ts.map +1 -0
- package/dist/components/chat/model-effort-selector.js +179 -0
- package/dist/components/chat/model-effort-ultra-effects.d.ts +5 -0
- package/dist/components/chat/model-effort-ultra-effects.d.ts.map +1 -0
- package/dist/components/chat/model-effort-ultra-effects.js +56 -0
- package/dist/components/chat/tool-handlers.d.ts.map +1 -1
- package/dist/components/chat/tool-handlers.js +40 -2
- package/dist/components/chat/vertical-scroll-fade.d.ts +6 -0
- package/dist/components/chat/vertical-scroll-fade.d.ts.map +1 -0
- package/dist/components/chat/vertical-scroll-fade.js +12 -0
- package/dist/components/hardware/bluetooth-panel-helpers.d.ts +9 -0
- package/dist/components/hardware/bluetooth-panel-helpers.d.ts.map +1 -0
- package/dist/components/hardware/bluetooth-panel-helpers.js +37 -0
- package/dist/components/hardware/bluetooth-panel.d.ts +56 -0
- package/dist/components/hardware/bluetooth-panel.d.ts.map +1 -0
- package/dist/components/hardware/bluetooth-panel.js +470 -0
- package/dist/components/hardware/camera-preview.d.ts +39 -0
- package/dist/components/hardware/camera-preview.d.ts.map +1 -0
- package/dist/components/hardware/camera-preview.js +228 -0
- package/dist/components/hardware/capability-badge.d.ts +23 -0
- package/dist/components/hardware/capability-badge.d.ts.map +1 -0
- package/dist/components/hardware/capability-badge.js +39 -0
- package/dist/components/hardware/capability-matrix.d.ts +14 -0
- package/dist/components/hardware/capability-matrix.d.ts.map +1 -0
- package/dist/components/hardware/capability-matrix.js +97 -0
- package/dist/components/hardware/clipboard-button.d.ts +26 -0
- package/dist/components/hardware/clipboard-button.d.ts.map +1 -0
- package/dist/components/hardware/clipboard-button.js +114 -0
- package/dist/components/hardware/device-io-controls.d.ts +4 -0
- package/dist/components/hardware/device-io-controls.d.ts.map +1 -0
- package/dist/components/hardware/device-io-controls.js +28 -0
- package/dist/components/hardware/device-list.d.ts +20 -0
- package/dist/components/hardware/device-list.d.ts.map +1 -0
- package/dist/components/hardware/device-list.js +14 -0
- package/dist/components/hardware/display-map.d.ts +23 -0
- package/dist/components/hardware/display-map.d.ts.map +1 -0
- package/dist/components/hardware/display-map.js +114 -0
- package/dist/components/hardware/haptic-button.d.ts +26 -0
- package/dist/components/hardware/haptic-button.d.ts.map +1 -0
- package/dist/components/hardware/haptic-button.js +94 -0
- package/dist/components/hardware/hardware-panel.d.ts +11 -0
- package/dist/components/hardware/hardware-panel.d.ts.map +1 -0
- package/dist/components/hardware/hardware-panel.js +28 -0
- package/dist/components/hardware/hid-panel.d.ts +40 -0
- package/dist/components/hardware/hid-panel.d.ts.map +1 -0
- package/dist/components/hardware/hid-panel.js +373 -0
- package/dist/components/hardware/index.d.ts +27 -0
- package/dist/components/hardware/index.d.ts.map +1 -0
- package/dist/components/hardware/index.js +26 -0
- package/dist/components/hardware/live-indicator.d.ts +15 -0
- package/dist/components/hardware/live-indicator.d.ts.map +1 -0
- package/dist/components/hardware/live-indicator.js +26 -0
- package/dist/components/hardware/local-auth-button.d.ts +33 -0
- package/dist/components/hardware/local-auth-button.d.ts.map +1 -0
- package/dist/components/hardware/local-auth-button.js +115 -0
- package/dist/components/hardware/location-panel.d.ts +29 -0
- package/dist/components/hardware/location-panel.d.ts.map +1 -0
- package/dist/components/hardware/location-panel.js +154 -0
- package/dist/components/hardware/microphone-meter.d.ts +35 -0
- package/dist/components/hardware/microphone-meter.d.ts.map +1 -0
- package/dist/components/hardware/microphone-meter.js +244 -0
- package/dist/components/hardware/midi-monitor.d.ts +54 -0
- package/dist/components/hardware/midi-monitor.d.ts.map +1 -0
- package/dist/components/hardware/midi-monitor.js +534 -0
- package/dist/components/hardware/notification-panel.d.ts +24 -0
- package/dist/components/hardware/notification-panel.d.ts.map +1 -0
- package/dist/components/hardware/notification-panel.js +124 -0
- package/dist/components/hardware/power-blocker-controller.d.ts +19 -0
- package/dist/components/hardware/power-blocker-controller.d.ts.map +1 -0
- package/dist/components/hardware/power-blocker-controller.js +83 -0
- package/dist/components/hardware/power-panel.d.ts +67 -0
- package/dist/components/hardware/power-panel.d.ts.map +1 -0
- package/dist/components/hardware/power-panel.js +309 -0
- package/dist/components/hardware/readout.d.ts +10 -0
- package/dist/components/hardware/readout.d.ts.map +1 -0
- package/dist/components/hardware/readout.js +11 -0
- package/dist/components/hardware/screen-share-preview.d.ts +36 -0
- package/dist/components/hardware/screen-share-preview.d.ts.map +1 -0
- package/dist/components/hardware/screen-share-preview.js +191 -0
- package/dist/components/hardware/secure-storage-panel.d.ts +36 -0
- package/dist/components/hardware/secure-storage-panel.d.ts.map +1 -0
- package/dist/components/hardware/secure-storage-panel.js +193 -0
- package/dist/components/hardware/serial-console.d.ts +64 -0
- package/dist/components/hardware/serial-console.d.ts.map +1 -0
- package/dist/components/hardware/serial-console.js +399 -0
- package/dist/components/hardware/shortcut-recorder.d.ts +35 -0
- package/dist/components/hardware/shortcut-recorder.d.ts.map +1 -0
- package/dist/components/hardware/shortcut-recorder.js +217 -0
- package/dist/components/hardware/stream-log.d.ts +35 -0
- package/dist/components/hardware/stream-log.d.ts.map +1 -0
- package/dist/components/hardware/stream-log.js +65 -0
- package/dist/components/hardware/system-audio-monitor.d.ts +34 -0
- package/dist/components/hardware/system-audio-monitor.d.ts.map +1 -0
- package/dist/components/hardware/system-audio-monitor.js +275 -0
- package/dist/components/hardware/usb-panel.d.ts +54 -0
- package/dist/components/hardware/usb-panel.d.ts.map +1 -0
- package/dist/components/hardware/usb-panel.js +363 -0
- package/dist/components/hardware/use-capability.d.ts +20 -0
- package/dist/components/hardware/use-capability.d.ts.map +1 -0
- package/dist/components/hardware/use-capability.js +61 -0
- package/dist/components/native-capabilities/bluetooth-panel-helpers.d.ts +9 -0
- package/dist/components/native-capabilities/bluetooth-panel-helpers.d.ts.map +1 -0
- package/dist/components/native-capabilities/bluetooth-panel-helpers.js +37 -0
- package/dist/components/native-capabilities/bluetooth-panel.d.ts +56 -0
- package/dist/components/native-capabilities/bluetooth-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/bluetooth-panel.js +470 -0
- package/dist/components/native-capabilities/camera-preview.d.ts +39 -0
- package/dist/components/native-capabilities/camera-preview.d.ts.map +1 -0
- package/dist/components/native-capabilities/camera-preview.js +228 -0
- package/dist/components/native-capabilities/capability-badge.d.ts +23 -0
- package/dist/components/native-capabilities/capability-badge.d.ts.map +1 -0
- package/dist/components/native-capabilities/capability-badge.js +39 -0
- package/dist/components/native-capabilities/capability-matrix.d.ts +14 -0
- package/dist/components/native-capabilities/capability-matrix.d.ts.map +1 -0
- package/dist/components/native-capabilities/capability-matrix.js +97 -0
- package/dist/components/native-capabilities/clipboard-button.d.ts +26 -0
- package/dist/components/native-capabilities/clipboard-button.d.ts.map +1 -0
- package/dist/components/native-capabilities/clipboard-button.js +99 -0
- package/dist/components/native-capabilities/device-io-controls.d.ts +4 -0
- package/dist/components/native-capabilities/device-io-controls.d.ts.map +1 -0
- package/dist/components/native-capabilities/device-io-controls.js +28 -0
- package/dist/components/native-capabilities/device-list.d.ts +20 -0
- package/dist/components/native-capabilities/device-list.d.ts.map +1 -0
- package/dist/components/native-capabilities/device-list.js +14 -0
- package/dist/components/native-capabilities/display-map.d.ts +23 -0
- package/dist/components/native-capabilities/display-map.d.ts.map +1 -0
- package/dist/components/native-capabilities/display-map.js +114 -0
- package/dist/components/native-capabilities/haptic-button.d.ts +26 -0
- package/dist/components/native-capabilities/haptic-button.d.ts.map +1 -0
- package/dist/components/native-capabilities/haptic-button.js +94 -0
- package/dist/components/native-capabilities/hid-panel.d.ts +40 -0
- package/dist/components/native-capabilities/hid-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/hid-panel.js +373 -0
- package/dist/components/native-capabilities/index.d.ts +27 -0
- package/dist/components/native-capabilities/index.d.ts.map +1 -0
- package/dist/components/native-capabilities/index.js +26 -0
- package/dist/components/native-capabilities/live-indicator.d.ts +15 -0
- package/dist/components/native-capabilities/live-indicator.d.ts.map +1 -0
- package/dist/components/native-capabilities/live-indicator.js +26 -0
- package/dist/components/native-capabilities/local-auth-button.d.ts +33 -0
- package/dist/components/native-capabilities/local-auth-button.d.ts.map +1 -0
- package/dist/components/native-capabilities/local-auth-button.js +115 -0
- package/dist/components/native-capabilities/location-panel.d.ts +29 -0
- package/dist/components/native-capabilities/location-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/location-panel.js +146 -0
- package/dist/components/native-capabilities/microphone-meter.d.ts +35 -0
- package/dist/components/native-capabilities/microphone-meter.d.ts.map +1 -0
- package/dist/components/native-capabilities/microphone-meter.js +244 -0
- package/dist/components/native-capabilities/midi-monitor.d.ts +54 -0
- package/dist/components/native-capabilities/midi-monitor.d.ts.map +1 -0
- package/dist/components/native-capabilities/midi-monitor.js +534 -0
- package/dist/components/native-capabilities/native-capability-panel.d.ts +11 -0
- package/dist/components/native-capabilities/native-capability-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/native-capability-panel.js +28 -0
- package/dist/components/native-capabilities/notification-panel.d.ts +24 -0
- package/dist/components/native-capabilities/notification-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/notification-panel.js +124 -0
- package/dist/components/native-capabilities/power-blocker-controller.d.ts +19 -0
- package/dist/components/native-capabilities/power-blocker-controller.d.ts.map +1 -0
- package/dist/components/native-capabilities/power-blocker-controller.js +83 -0
- package/dist/components/native-capabilities/power-panel.d.ts +67 -0
- package/dist/components/native-capabilities/power-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/power-panel.js +309 -0
- package/dist/components/native-capabilities/readout.d.ts +10 -0
- package/dist/components/native-capabilities/readout.d.ts.map +1 -0
- package/dist/components/native-capabilities/readout.js +11 -0
- package/dist/components/native-capabilities/screen-share-preview.d.ts +36 -0
- package/dist/components/native-capabilities/screen-share-preview.d.ts.map +1 -0
- package/dist/components/native-capabilities/screen-share-preview.js +191 -0
- package/dist/components/native-capabilities/secure-storage-panel.d.ts +36 -0
- package/dist/components/native-capabilities/secure-storage-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/secure-storage-panel.js +193 -0
- package/dist/components/native-capabilities/serial-console.d.ts +64 -0
- package/dist/components/native-capabilities/serial-console.d.ts.map +1 -0
- package/dist/components/native-capabilities/serial-console.js +399 -0
- package/dist/components/native-capabilities/shortcut-recorder.d.ts +35 -0
- package/dist/components/native-capabilities/shortcut-recorder.d.ts.map +1 -0
- package/dist/components/native-capabilities/shortcut-recorder.js +217 -0
- package/dist/components/native-capabilities/stream-log.d.ts +35 -0
- package/dist/components/native-capabilities/stream-log.d.ts.map +1 -0
- package/dist/components/native-capabilities/stream-log.js +65 -0
- package/dist/components/native-capabilities/system-audio-monitor.d.ts +34 -0
- package/dist/components/native-capabilities/system-audio-monitor.d.ts.map +1 -0
- package/dist/components/native-capabilities/system-audio-monitor.js +275 -0
- package/dist/components/native-capabilities/usb-panel.d.ts +54 -0
- package/dist/components/native-capabilities/usb-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/usb-panel.js +363 -0
- package/dist/components/native-capabilities/use-capability.d.ts +20 -0
- package/dist/components/native-capabilities/use-capability.d.ts.map +1 -0
- package/dist/components/native-capabilities/use-capability.js +61 -0
- package/dist/components/ui/app-frame.d.ts +22 -0
- package/dist/components/ui/app-frame.d.ts.map +1 -0
- package/dist/components/ui/app-frame.js +56 -0
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/color-well.d.ts +13 -0
- package/dist/components/ui/color-well.d.ts.map +1 -0
- package/dist/components/ui/color-well.js +30 -0
- package/dist/components/ui/date-field.d.ts +19 -0
- package/dist/components/ui/date-field.d.ts.map +1 -0
- package/dist/components/ui/date-field.js +54 -0
- package/dist/components/ui/edge-fade.d.ts +11 -0
- package/dist/components/ui/edge-fade.d.ts.map +1 -0
- package/dist/components/ui/edge-fade.js +41 -0
- package/dist/components/ui/empty.js +1 -1
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/grid.d.ts +24 -0
- package/dist/components/ui/grid.d.ts.map +1 -0
- package/dist/components/ui/grid.js +234 -0
- package/dist/components/ui/icon-button.d.ts +15 -0
- package/dist/components/ui/icon-button.d.ts.map +1 -0
- package/dist/components/ui/icon-button.js +15 -0
- package/dist/components/ui/index.d.ts +19 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +19 -0
- package/dist/components/ui/inspector.d.ts +15 -0
- package/dist/components/ui/inspector.d.ts.map +1 -0
- package/dist/components/ui/inspector.js +26 -0
- package/dist/components/ui/kbd.d.ts +1 -1
- package/dist/components/ui/list.d.ts +24 -0
- package/dist/components/ui/list.d.ts.map +1 -0
- package/dist/components/ui/list.js +224 -0
- package/dist/components/ui/message-scroller-layout-stability.d.ts +33 -0
- package/dist/components/ui/message-scroller-layout-stability.d.ts.map +1 -0
- package/dist/components/ui/message-scroller-layout-stability.js +153 -0
- package/dist/components/ui/message-scroller.d.ts +11 -0
- package/dist/components/ui/message-scroller.d.ts.map +1 -0
- package/dist/components/ui/message-scroller.js +37 -0
- package/dist/components/ui/notification-dot.d.ts +4 -0
- package/dist/components/ui/notification-dot.d.ts.map +1 -0
- package/dist/components/ui/notification-dot.js +7 -0
- package/dist/components/ui/number-input.d.ts +16 -0
- package/dist/components/ui/number-input.d.ts.map +1 -0
- package/dist/components/ui/number-input.js +56 -0
- package/dist/components/ui/panel.d.ts +18 -0
- package/dist/components/ui/panel.d.ts.map +1 -0
- package/dist/components/ui/panel.js +40 -0
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/search-field.d.ts +19 -0
- package/dist/components/ui/search-field.d.ts.map +1 -0
- package/dist/components/ui/search-field.js +64 -0
- package/dist/components/ui/segmented-control.d.ts +21 -0
- package/dist/components/ui/segmented-control.d.ts.map +1 -0
- package/dist/components/ui/segmented-control.js +61 -0
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/slider.d.ts +4 -1
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/slider.js +2 -2
- package/dist/components/ui/sonner.d.ts +4 -3
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/sonner.js +7 -6
- package/dist/components/ui/split-view.d.ts +11 -0
- package/dist/components/ui/split-view.d.ts.map +1 -0
- package/dist/components/ui/split-view.js +13 -0
- package/dist/components/ui/status.d.ts +13 -0
- package/dist/components/ui/status.d.ts.map +1 -0
- package/dist/components/ui/status.js +36 -0
- package/dist/components/ui/table.d.ts +11 -2
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +28 -6
- package/dist/components/ui/text.d.ts +17 -0
- package/dist/components/ui/text.d.ts.map +1 -0
- package/dist/components/ui/text.js +55 -0
- package/dist/components/ui/toggle.js +1 -1
- package/dist/components/ui/toolbar.d.ts +20 -0
- package/dist/components/ui/toolbar.d.ts.map +1 -0
- package/dist/components/ui/toolbar.js +52 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/lib/frame-lifecycle.d.ts +28 -0
- package/dist/lib/frame-lifecycle.d.ts.map +1 -1
- package/dist/lib/frame-lifecycle.js +84 -0
- package/dist/lib/native-capabilities/access.d.ts +13 -0
- package/dist/lib/native-capabilities/access.d.ts.map +1 -0
- package/dist/lib/native-capabilities/access.js +53 -0
- package/dist/lib/native-capabilities/bluetooth-access.d.ts +14 -0
- package/dist/lib/native-capabilities/bluetooth-access.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth-access.js +43 -0
- package/dist/lib/native-capabilities/bluetooth-connection.d.ts +19 -0
- package/dist/lib/native-capabilities/bluetooth-connection.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth-connection.js +88 -0
- package/dist/lib/native-capabilities/bluetooth-gatt.d.ts +7 -0
- package/dist/lib/native-capabilities/bluetooth-gatt.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth-gatt.js +77 -0
- package/dist/lib/native-capabilities/bluetooth-internal.d.ts +10 -0
- package/dist/lib/native-capabilities/bluetooth-internal.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth-internal.js +105 -0
- package/dist/lib/native-capabilities/bluetooth-native-fallback.d.ts +33 -0
- package/dist/lib/native-capabilities/bluetooth-native-fallback.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth-native-fallback.js +214 -0
- package/dist/lib/native-capabilities/bluetooth-types.d.ts +85 -0
- package/dist/lib/native-capabilities/bluetooth-types.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth-types.js +2 -0
- package/dist/lib/native-capabilities/bluetooth.d.ts +7 -0
- package/dist/lib/native-capabilities/bluetooth.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth.js +4 -0
- package/dist/lib/native-capabilities/bridge.d.ts +23 -0
- package/dist/lib/native-capabilities/bridge.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bridge.js +266 -0
- package/dist/lib/native-capabilities/capabilities.d.ts +7 -0
- package/dist/lib/native-capabilities/capabilities.d.ts.map +1 -0
- package/dist/lib/native-capabilities/capabilities.js +95 -0
- package/dist/lib/native-capabilities/clipboard.d.ts +11 -0
- package/dist/lib/native-capabilities/clipboard.d.ts.map +1 -0
- package/dist/lib/native-capabilities/clipboard.js +58 -0
- package/dist/lib/native-capabilities/device-io-errors.d.ts +11 -0
- package/dist/lib/native-capabilities/device-io-errors.d.ts.map +1 -0
- package/dist/lib/native-capabilities/device-io-errors.js +82 -0
- package/dist/lib/native-capabilities/displays.d.ts +38 -0
- package/dist/lib/native-capabilities/displays.d.ts.map +1 -0
- package/dist/lib/native-capabilities/displays.js +12 -0
- package/dist/lib/native-capabilities/global-shortcuts.d.ts +86 -0
- package/dist/lib/native-capabilities/global-shortcuts.d.ts.map +1 -0
- package/dist/lib/native-capabilities/global-shortcuts.js +351 -0
- package/dist/lib/native-capabilities/haptics.d.ts +25 -0
- package/dist/lib/native-capabilities/haptics.d.ts.map +1 -0
- package/dist/lib/native-capabilities/haptics.js +18 -0
- package/dist/lib/native-capabilities/hid-native.d.ts +26 -0
- package/dist/lib/native-capabilities/hid-native.d.ts.map +1 -0
- package/dist/lib/native-capabilities/hid-native.js +229 -0
- package/dist/lib/native-capabilities/hid.d.ts +52 -0
- package/dist/lib/native-capabilities/hid.d.ts.map +1 -0
- package/dist/lib/native-capabilities/hid.js +163 -0
- package/dist/lib/native-capabilities/index.d.ts +40 -0
- package/dist/lib/native-capabilities/index.d.ts.map +1 -0
- package/dist/lib/native-capabilities/index.js +21 -0
- package/dist/lib/native-capabilities/local-authentication.d.ts +32 -0
- package/dist/lib/native-capabilities/local-authentication.d.ts.map +1 -0
- package/dist/lib/native-capabilities/local-authentication.js +46 -0
- package/dist/lib/native-capabilities/location.d.ts +49 -0
- package/dist/lib/native-capabilities/location.d.ts.map +1 -0
- package/dist/lib/native-capabilities/location.js +114 -0
- package/dist/lib/native-capabilities/media-permissions.d.ts +28 -0
- package/dist/lib/native-capabilities/media-permissions.d.ts.map +1 -0
- package/dist/lib/native-capabilities/media-permissions.js +37 -0
- package/dist/lib/native-capabilities/media.d.ts +17 -0
- package/dist/lib/native-capabilities/media.d.ts.map +1 -0
- package/dist/lib/native-capabilities/media.js +104 -0
- package/dist/lib/native-capabilities/midi-access.d.ts +13 -0
- package/dist/lib/native-capabilities/midi-access.d.ts.map +1 -0
- package/dist/lib/native-capabilities/midi-access.js +68 -0
- package/dist/lib/native-capabilities/midi-internal.d.ts +12 -0
- package/dist/lib/native-capabilities/midi-internal.d.ts.map +1 -0
- package/dist/lib/native-capabilities/midi-internal.js +88 -0
- package/dist/lib/native-capabilities/midi-native-fallback.d.ts +27 -0
- package/dist/lib/native-capabilities/midi-native-fallback.d.ts.map +1 -0
- package/dist/lib/native-capabilities/midi-native-fallback.js +127 -0
- package/dist/lib/native-capabilities/midi-ports.d.ts +6 -0
- package/dist/lib/native-capabilities/midi-ports.d.ts.map +1 -0
- package/dist/lib/native-capabilities/midi-ports.js +115 -0
- package/dist/lib/native-capabilities/midi-types.d.ts +25 -0
- package/dist/lib/native-capabilities/midi-types.d.ts.map +1 -0
- package/dist/lib/native-capabilities/midi-types.js +1 -0
- package/dist/lib/native-capabilities/midi.d.ts +6 -0
- package/dist/lib/native-capabilities/midi.d.ts.map +1 -0
- package/dist/lib/native-capabilities/midi.js +3 -0
- package/dist/lib/native-capabilities/native-device-io.d.ts +28 -0
- package/dist/lib/native-capabilities/native-device-io.d.ts.map +1 -0
- package/dist/lib/native-capabilities/native-device-io.js +91 -0
- package/dist/lib/native-capabilities/native-device-lifecycle.d.ts +13 -0
- package/dist/lib/native-capabilities/native-device-lifecycle.d.ts.map +1 -0
- package/dist/lib/native-capabilities/native-device-lifecycle.js +40 -0
- package/dist/lib/native-capabilities/notifications.d.ts +38 -0
- package/dist/lib/native-capabilities/notifications.d.ts.map +1 -0
- package/dist/lib/native-capabilities/notifications.js +50 -0
- package/dist/lib/native-capabilities/power-session.d.ts +113 -0
- package/dist/lib/native-capabilities/power-session.d.ts.map +1 -0
- package/dist/lib/native-capabilities/power-session.js +264 -0
- package/dist/lib/native-capabilities/secure-storage.d.ts +36 -0
- package/dist/lib/native-capabilities/secure-storage.d.ts.map +1 -0
- package/dist/lib/native-capabilities/secure-storage.js +64 -0
- package/dist/lib/native-capabilities/serial-native.d.ts +23 -0
- package/dist/lib/native-capabilities/serial-native.d.ts.map +1 -0
- package/dist/lib/native-capabilities/serial-native.js +181 -0
- package/dist/lib/native-capabilities/serial.d.ts +76 -0
- package/dist/lib/native-capabilities/serial.d.ts.map +1 -0
- package/dist/lib/native-capabilities/serial.js +215 -0
- package/dist/lib/native-capabilities/system-audio.d.ts +127 -0
- package/dist/lib/native-capabilities/system-audio.d.ts.map +1 -0
- package/dist/lib/native-capabilities/system-audio.js +330 -0
- package/dist/lib/native-capabilities/types.d.ts +62 -0
- package/dist/lib/native-capabilities/types.d.ts.map +1 -0
- package/dist/lib/native-capabilities/types.js +27 -0
- package/dist/lib/native-capabilities/usb-native.d.ts +39 -0
- package/dist/lib/native-capabilities/usb-native.d.ts.map +1 -0
- package/dist/lib/native-capabilities/usb-native.js +217 -0
- package/dist/lib/native-capabilities/usb.d.ts +85 -0
- package/dist/lib/native-capabilities/usb.d.ts.map +1 -0
- package/dist/lib/native-capabilities/usb.js +225 -0
- package/dist/lib/native-hardware/bluetooth-access.d.ts +14 -0
- package/dist/lib/native-hardware/bluetooth-access.d.ts.map +1 -0
- package/dist/lib/native-hardware/bluetooth-access.js +40 -0
- package/dist/lib/native-hardware/bluetooth-connection.d.ts +19 -0
- package/dist/lib/native-hardware/bluetooth-connection.d.ts.map +1 -0
- package/dist/lib/native-hardware/bluetooth-connection.js +88 -0
- package/dist/lib/native-hardware/bluetooth-gatt.d.ts +7 -0
- package/dist/lib/native-hardware/bluetooth-gatt.d.ts.map +1 -0
- package/dist/lib/native-hardware/bluetooth-gatt.js +77 -0
- package/dist/lib/native-hardware/bluetooth-internal.d.ts +10 -0
- package/dist/lib/native-hardware/bluetooth-internal.d.ts.map +1 -0
- package/dist/lib/native-hardware/bluetooth-internal.js +105 -0
- package/dist/lib/native-hardware/bluetooth-native-fallback.d.ts +33 -0
- package/dist/lib/native-hardware/bluetooth-native-fallback.d.ts.map +1 -0
- package/dist/lib/native-hardware/bluetooth-native-fallback.js +214 -0
- package/dist/lib/native-hardware/bluetooth-types.d.ts +85 -0
- package/dist/lib/native-hardware/bluetooth-types.d.ts.map +1 -0
- package/dist/lib/native-hardware/bluetooth-types.js +2 -0
- package/dist/lib/native-hardware/bluetooth.d.ts +7 -0
- package/dist/lib/native-hardware/bluetooth.d.ts.map +1 -0
- package/dist/lib/native-hardware/bluetooth.js +4 -0
- package/dist/lib/native-hardware/bridge.d.ts +23 -0
- package/dist/lib/native-hardware/bridge.d.ts.map +1 -0
- package/dist/lib/native-hardware/bridge.js +266 -0
- package/dist/lib/native-hardware/capabilities.d.ts +7 -0
- package/dist/lib/native-hardware/capabilities.d.ts.map +1 -0
- package/dist/lib/native-hardware/capabilities.js +95 -0
- package/dist/lib/native-hardware/clipboard.d.ts +11 -0
- package/dist/lib/native-hardware/clipboard.d.ts.map +1 -0
- package/dist/lib/native-hardware/clipboard.js +55 -0
- package/dist/lib/native-hardware/device-io-errors.d.ts +11 -0
- package/dist/lib/native-hardware/device-io-errors.d.ts.map +1 -0
- package/dist/lib/native-hardware/device-io-errors.js +82 -0
- package/dist/lib/native-hardware/displays.d.ts +38 -0
- package/dist/lib/native-hardware/displays.d.ts.map +1 -0
- package/dist/lib/native-hardware/displays.js +12 -0
- package/dist/lib/native-hardware/global-shortcuts.d.ts +86 -0
- package/dist/lib/native-hardware/global-shortcuts.d.ts.map +1 -0
- package/dist/lib/native-hardware/global-shortcuts.js +351 -0
- package/dist/lib/native-hardware/haptics.d.ts +25 -0
- package/dist/lib/native-hardware/haptics.d.ts.map +1 -0
- package/dist/lib/native-hardware/haptics.js +18 -0
- package/dist/lib/native-hardware/hid-native.d.ts +26 -0
- package/dist/lib/native-hardware/hid-native.d.ts.map +1 -0
- package/dist/lib/native-hardware/hid-native.js +229 -0
- package/dist/lib/native-hardware/hid.d.ts +52 -0
- package/dist/lib/native-hardware/hid.d.ts.map +1 -0
- package/dist/lib/native-hardware/hid.js +160 -0
- package/dist/lib/native-hardware/index.d.ts +38 -0
- package/dist/lib/native-hardware/index.d.ts.map +1 -0
- package/dist/lib/native-hardware/index.js +20 -0
- package/dist/lib/native-hardware/local-authentication.d.ts +32 -0
- package/dist/lib/native-hardware/local-authentication.d.ts.map +1 -0
- package/dist/lib/native-hardware/local-authentication.js +46 -0
- package/dist/lib/native-hardware/location.d.ts +49 -0
- package/dist/lib/native-hardware/location.d.ts.map +1 -0
- package/dist/lib/native-hardware/location.js +114 -0
- package/dist/lib/native-hardware/media-permissions.d.ts +28 -0
- package/dist/lib/native-hardware/media-permissions.d.ts.map +1 -0
- package/dist/lib/native-hardware/media-permissions.js +37 -0
- package/dist/lib/native-hardware/media.d.ts +17 -0
- package/dist/lib/native-hardware/media.d.ts.map +1 -0
- package/dist/lib/native-hardware/media.js +99 -0
- package/dist/lib/native-hardware/midi-access.d.ts +13 -0
- package/dist/lib/native-hardware/midi-access.d.ts.map +1 -0
- package/dist/lib/native-hardware/midi-access.js +66 -0
- package/dist/lib/native-hardware/midi-internal.d.ts +12 -0
- package/dist/lib/native-hardware/midi-internal.d.ts.map +1 -0
- package/dist/lib/native-hardware/midi-internal.js +88 -0
- package/dist/lib/native-hardware/midi-native-fallback.d.ts +27 -0
- package/dist/lib/native-hardware/midi-native-fallback.d.ts.map +1 -0
- package/dist/lib/native-hardware/midi-native-fallback.js +127 -0
- package/dist/lib/native-hardware/midi-ports.d.ts +6 -0
- package/dist/lib/native-hardware/midi-ports.d.ts.map +1 -0
- package/dist/lib/native-hardware/midi-ports.js +115 -0
- package/dist/lib/native-hardware/midi-types.d.ts +25 -0
- package/dist/lib/native-hardware/midi-types.d.ts.map +1 -0
- package/dist/lib/native-hardware/midi-types.js +1 -0
- package/dist/lib/native-hardware/midi.d.ts +6 -0
- package/dist/lib/native-hardware/midi.d.ts.map +1 -0
- package/dist/lib/native-hardware/midi.js +3 -0
- package/dist/lib/native-hardware/native-device-io.d.ts +28 -0
- package/dist/lib/native-hardware/native-device-io.d.ts.map +1 -0
- package/dist/lib/native-hardware/native-device-io.js +91 -0
- package/dist/lib/native-hardware/native-device-lifecycle.d.ts +13 -0
- package/dist/lib/native-hardware/native-device-lifecycle.d.ts.map +1 -0
- package/dist/lib/native-hardware/native-device-lifecycle.js +40 -0
- package/dist/lib/native-hardware/notifications.d.ts +38 -0
- package/dist/lib/native-hardware/notifications.d.ts.map +1 -0
- package/dist/lib/native-hardware/notifications.js +50 -0
- package/dist/lib/native-hardware/power-session.d.ts +113 -0
- package/dist/lib/native-hardware/power-session.d.ts.map +1 -0
- package/dist/lib/native-hardware/power-session.js +264 -0
- package/dist/lib/native-hardware/secure-storage.d.ts +36 -0
- package/dist/lib/native-hardware/secure-storage.d.ts.map +1 -0
- package/dist/lib/native-hardware/secure-storage.js +64 -0
- package/dist/lib/native-hardware/serial-native.d.ts +23 -0
- package/dist/lib/native-hardware/serial-native.d.ts.map +1 -0
- package/dist/lib/native-hardware/serial-native.js +181 -0
- package/dist/lib/native-hardware/serial.d.ts +76 -0
- package/dist/lib/native-hardware/serial.d.ts.map +1 -0
- package/dist/lib/native-hardware/serial.js +212 -0
- package/dist/lib/native-hardware/system-audio.d.ts +127 -0
- package/dist/lib/native-hardware/system-audio.d.ts.map +1 -0
- package/dist/lib/native-hardware/system-audio.js +330 -0
- package/dist/lib/native-hardware/types.d.ts +62 -0
- package/dist/lib/native-hardware/types.d.ts.map +1 -0
- package/dist/lib/native-hardware/types.js +27 -0
- package/dist/lib/native-hardware/usb-native.d.ts +39 -0
- package/dist/lib/native-hardware/usb-native.d.ts.map +1 -0
- package/dist/lib/native-hardware/usb-native.js +217 -0
- package/dist/lib/native-hardware/usb.d.ts +85 -0
- package/dist/lib/native-hardware/usb.d.ts.map +1 -0
- package/dist/lib/native-hardware/usb.js +222 -0
- package/docs/README.md +37 -0
- package/docs/accessibility.md +32 -0
- package/docs/app-anatomy.md +72 -0
- package/docs/component-catalog.md +59 -0
- package/docs/component-guide-template.md +37 -0
- package/docs/design-tokens.md +172 -0
- package/docs/foundations.md +56 -0
- package/docs/native-integration.md +33 -0
- package/docs/standalone-app-windows.md +128 -0
- package/package.json +9 -3
- package/src/components/ui/alert.md +55 -0
- package/src/components/ui/app-frame.md +33 -0
- package/src/components/ui/badge.md +57 -0
- package/src/components/ui/button.md +76 -0
- package/src/components/ui/color-well.md +11 -0
- package/src/components/ui/combobox.md +43 -0
- package/src/components/ui/date-field.md +32 -0
- package/src/components/ui/edge-fade.md +7 -0
- package/src/components/ui/empty.md +82 -0
- package/src/components/ui/field.md +77 -0
- package/src/components/ui/grid.md +105 -0
- package/src/components/ui/icon-button.md +36 -0
- package/src/components/ui/inspector.md +11 -0
- package/src/components/ui/item.md +87 -0
- package/src/components/ui/list.md +107 -0
- package/src/components/ui/notification-dot.md +7 -0
- package/src/components/ui/number-input.md +19 -0
- package/src/components/ui/panel.md +11 -0
- package/src/components/ui/resizable.md +66 -0
- package/src/components/ui/scroll-area.md +68 -0
- package/src/components/ui/search-field.md +33 -0
- package/src/components/ui/segmented-control.md +39 -0
- package/src/components/ui/sidebar.md +113 -0
- package/src/components/ui/sonner.md +37 -0
- package/src/components/ui/split-view.md +15 -0
- package/src/components/ui/status.md +12 -0
- package/src/components/ui/table.md +35 -0
- package/src/components/ui/tabs.md +66 -0
- package/src/components/ui/text.md +17 -0
- package/src/components/ui/toggle-group.md +80 -0
- package/src/components/ui/toggle.md +73 -0
- package/src/components/ui/toolbar.md +21 -0
- package/src/styles/index.css +868 -3
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { NativeHardwareBridgeError, callNativeHardwareBridge, resolveNativeHardwareParentOrigin, } from './bridge';
|
|
2
|
+
const NATIVE_SYSTEM_AUDIO_REQUEST_TYPE = 'moldable:system-audio-request';
|
|
3
|
+
const NATIVE_SYSTEM_AUDIO_RESULT_TYPE = 'moldable:system-audio-response';
|
|
4
|
+
const NATIVE_SYSTEM_AUDIO_EVENT_TYPE = 'moldable:system-audio-event';
|
|
5
|
+
export const NATIVE_SYSTEM_AUDIO_MAX_REPLAY_FRAMES = 500;
|
|
6
|
+
export const NATIVE_SYSTEM_AUDIO_PERMISSION_REQUEST_TIMEOUT_MS = 125_000;
|
|
7
|
+
function isRecord(value) {
|
|
8
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
9
|
+
}
|
|
10
|
+
function invalidRequest(message) {
|
|
11
|
+
return new NativeHardwareBridgeError({
|
|
12
|
+
code: 'invalid_request',
|
|
13
|
+
message,
|
|
14
|
+
retryable: false,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function invalidResponse(message, details) {
|
|
18
|
+
throw new NativeHardwareBridgeError({
|
|
19
|
+
code: 'invalid_response',
|
|
20
|
+
message,
|
|
21
|
+
details,
|
|
22
|
+
retryable: false,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function isOptionalString(value) {
|
|
26
|
+
return value === undefined || value === null || typeof value === 'string';
|
|
27
|
+
}
|
|
28
|
+
function isOptionalFiniteNumber(value) {
|
|
29
|
+
return value === undefined || value === null || Number.isFinite(value);
|
|
30
|
+
}
|
|
31
|
+
function isCapabilities(value) {
|
|
32
|
+
if (!isRecord(value))
|
|
33
|
+
return false;
|
|
34
|
+
const strings = [
|
|
35
|
+
value.osVersion,
|
|
36
|
+
value.microphonePermission,
|
|
37
|
+
value.screenCapturePermission,
|
|
38
|
+
value.systemAudioPermission,
|
|
39
|
+
value.systemAudioPermissionPreflight,
|
|
40
|
+
value.systemAudioPermissionRequest,
|
|
41
|
+
value.systemAudioPermissionGuidance,
|
|
42
|
+
];
|
|
43
|
+
const booleans = [
|
|
44
|
+
value.osSupported,
|
|
45
|
+
value.canCaptureMicrophone,
|
|
46
|
+
value.screenCaptureKitAvailable,
|
|
47
|
+
value.coreAudioProcessTapAvailable,
|
|
48
|
+
value.defaultInputDeviceAvailable,
|
|
49
|
+
value.defaultOutputDeviceAvailable,
|
|
50
|
+
value.canRequestSystemAudioPermission,
|
|
51
|
+
value.systemAudioPermissionRequired,
|
|
52
|
+
value.canCaptureSystemAudio,
|
|
53
|
+
];
|
|
54
|
+
return (strings.every((item) => typeof item === 'string') &&
|
|
55
|
+
booleans.every((item) => typeof item === 'boolean') &&
|
|
56
|
+
isOptionalString(value.defaultInputDevice) &&
|
|
57
|
+
isOptionalString(value.defaultOutputDevice) &&
|
|
58
|
+
isOptionalString(value.degradedReason) &&
|
|
59
|
+
isRecord(value.architecture));
|
|
60
|
+
}
|
|
61
|
+
function isCapabilityResult(value) {
|
|
62
|
+
return (isRecord(value) &&
|
|
63
|
+
typeof value.available === 'boolean' &&
|
|
64
|
+
isCapabilities(value.capabilities) &&
|
|
65
|
+
(value.requested === undefined || typeof value.requested === 'boolean'));
|
|
66
|
+
}
|
|
67
|
+
function isSourceState(value) {
|
|
68
|
+
return (isRecord(value) &&
|
|
69
|
+
typeof value.active === 'boolean' &&
|
|
70
|
+
Number.isSafeInteger(value.frameCount) &&
|
|
71
|
+
Number(value.frameCount) >= 0 &&
|
|
72
|
+
isOptionalFiniteNumber(value.lastAudioAtMs) &&
|
|
73
|
+
isOptionalFiniteNumber(value.peak) &&
|
|
74
|
+
isOptionalFiniteNumber(value.rms));
|
|
75
|
+
}
|
|
76
|
+
function isStatus(value) {
|
|
77
|
+
if (!isRecord(value) ||
|
|
78
|
+
typeof value.active !== 'boolean' ||
|
|
79
|
+
!Number.isSafeInteger(value.restartCount) ||
|
|
80
|
+
Number(value.restartCount) < 0 ||
|
|
81
|
+
!Number.isSafeInteger(value.restartLimit) ||
|
|
82
|
+
Number(value.restartLimit) < 0 ||
|
|
83
|
+
!Number.isSafeInteger(value.memoryLimitBytes) ||
|
|
84
|
+
Number(value.memoryLimitBytes) < 0) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
if (!isOptionalString(value.sessionId) ||
|
|
88
|
+
!isOptionalString(value.mode) ||
|
|
89
|
+
!isOptionalString(value.desiredState) ||
|
|
90
|
+
!isOptionalString(value.actualState) ||
|
|
91
|
+
!isOptionalString(value.lastCrashReason) ||
|
|
92
|
+
!isOptionalString(value.degradedReason) ||
|
|
93
|
+
!isOptionalString(value.stopReason) ||
|
|
94
|
+
!isOptionalFiniteNumber(value.startedAtMs) ||
|
|
95
|
+
!isOptionalFiniteNumber(value.lastHeartbeatAtMs) ||
|
|
96
|
+
!isOptionalFiniteNumber(value.restartWindowStartedAtMs) ||
|
|
97
|
+
!isOptionalFiniteNumber(value.sidecarPid) ||
|
|
98
|
+
!isOptionalFiniteNumber(value.sidecarMemoryBytes) ||
|
|
99
|
+
!isOptionalFiniteNumber(value.stopRequestedAtMs)) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
if (value.sources !== undefined &&
|
|
103
|
+
value.sources !== null &&
|
|
104
|
+
(!isRecord(value.sources) ||
|
|
105
|
+
!isSourceState(value.sources.microphone) ||
|
|
106
|
+
!isSourceState(value.sources.system))) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
return value.aec === undefined || value.aec === null || isRecord(value.aec);
|
|
110
|
+
}
|
|
111
|
+
function isOptionalPositiveNumber(value) {
|
|
112
|
+
return value === undefined || (Number.isFinite(value) && Number(value) >= 0);
|
|
113
|
+
}
|
|
114
|
+
function isNativeSystemAudioEvent(value) {
|
|
115
|
+
if (!isRecord(value) || value.type !== NATIVE_SYSTEM_AUDIO_EVENT_TYPE) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
if (value.event === 'started') {
|
|
119
|
+
return value.sessionId === undefined || typeof value.sessionId === 'string';
|
|
120
|
+
}
|
|
121
|
+
if (value.event === 'stopped' || value.event === 'error') {
|
|
122
|
+
return ((value.payload === undefined || typeof value.payload === 'string') &&
|
|
123
|
+
(value.recoverable === undefined ||
|
|
124
|
+
typeof value.recoverable === 'boolean') &&
|
|
125
|
+
(value.sessionId === undefined || typeof value.sessionId === 'string'));
|
|
126
|
+
}
|
|
127
|
+
return (value.event === 'data' &&
|
|
128
|
+
value.data instanceof ArrayBuffer &&
|
|
129
|
+
typeof value.sessionId === 'string' &&
|
|
130
|
+
value.sessionId.length > 0 &&
|
|
131
|
+
Number.isSafeInteger(value.sequence) &&
|
|
132
|
+
Number(value.sequence) >= 0 &&
|
|
133
|
+
(value.source === 'microphone' || value.source === 'system') &&
|
|
134
|
+
isOptionalPositiveNumber(value.sampleRate) &&
|
|
135
|
+
isOptionalPositiveNumber(value.channels) &&
|
|
136
|
+
isOptionalPositiveNumber(value.frameCount) &&
|
|
137
|
+
isOptionalFiniteNumber(value.peak) &&
|
|
138
|
+
isOptionalFiniteNumber(value.rms));
|
|
139
|
+
}
|
|
140
|
+
function toPublicEvent(event) {
|
|
141
|
+
if (event.event === 'started') {
|
|
142
|
+
return { kind: 'started', sessionId: event.sessionId };
|
|
143
|
+
}
|
|
144
|
+
if (event.event === 'stopped') {
|
|
145
|
+
return {
|
|
146
|
+
kind: 'stopped',
|
|
147
|
+
sessionId: event.sessionId,
|
|
148
|
+
reason: event.payload,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
if (event.event === 'error') {
|
|
152
|
+
return {
|
|
153
|
+
kind: 'error',
|
|
154
|
+
sessionId: event.sessionId,
|
|
155
|
+
message: event.payload,
|
|
156
|
+
recoverable: event.recoverable === true,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
kind: 'data',
|
|
161
|
+
sessionId: event.sessionId,
|
|
162
|
+
sequence: event.sequence,
|
|
163
|
+
source: event.source,
|
|
164
|
+
data: event.data,
|
|
165
|
+
sampleRate: event.sampleRate,
|
|
166
|
+
channels: event.channels,
|
|
167
|
+
frameCount: event.frameCount,
|
|
168
|
+
peak: event.peak,
|
|
169
|
+
rms: event.rms,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function validateStartOptions(options) {
|
|
173
|
+
const sampleRate = options.sampleRate ?? 48_000;
|
|
174
|
+
const channels = options.channels ?? 1;
|
|
175
|
+
if ((options.captureMode !== undefined &&
|
|
176
|
+
options.captureMode !== 'systemAudio' &&
|
|
177
|
+
options.captureMode !== 'systemMicrophone') ||
|
|
178
|
+
!Number.isSafeInteger(sampleRate) ||
|
|
179
|
+
sampleRate < 8_000 ||
|
|
180
|
+
sampleRate > 192_000 ||
|
|
181
|
+
!Number.isSafeInteger(channels) ||
|
|
182
|
+
channels < 1 ||
|
|
183
|
+
channels > 2) {
|
|
184
|
+
throw invalidRequest('System audio capture requires a supported mode, an 8,000–192,000 Hz sample rate, and one or two channels.');
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/** Reads capture support and permission diagnostics without opening audio input. */
|
|
188
|
+
export async function getMoldableSystemAudioCapabilities(options = {}) {
|
|
189
|
+
const result = await callNativeHardwareBridge({ type: NATIVE_SYSTEM_AUDIO_REQUEST_TYPE, action: 'availability' }, NATIVE_SYSTEM_AUDIO_RESULT_TYPE, options);
|
|
190
|
+
if (!isCapabilityResult(result)) {
|
|
191
|
+
invalidResponse('Moldable returned invalid system audio capabilities.', result);
|
|
192
|
+
}
|
|
193
|
+
return result;
|
|
194
|
+
}
|
|
195
|
+
/** Requests system-audio permission. Call this only from a direct user action. */
|
|
196
|
+
export async function requestMoldableSystemAudioPermission(options = {}) {
|
|
197
|
+
const result = await callNativeHardwareBridge({ type: NATIVE_SYSTEM_AUDIO_REQUEST_TYPE, action: 'requestPermission' }, NATIVE_SYSTEM_AUDIO_RESULT_TYPE, {
|
|
198
|
+
...options,
|
|
199
|
+
timeoutMs: options.timeoutMs ??
|
|
200
|
+
NATIVE_SYSTEM_AUDIO_PERMISSION_REQUEST_TIMEOUT_MS,
|
|
201
|
+
});
|
|
202
|
+
if (!isCapabilityResult(result) || result.requested !== true) {
|
|
203
|
+
invalidResponse('Moldable returned an invalid system audio permission result.', result);
|
|
204
|
+
}
|
|
205
|
+
return result;
|
|
206
|
+
}
|
|
207
|
+
/** Starts an owner-scoped capture session from a direct user action. */
|
|
208
|
+
export async function startMoldableSystemAudioCapture(options = {}) {
|
|
209
|
+
validateStartOptions(options);
|
|
210
|
+
const result = await callNativeHardwareBridge({
|
|
211
|
+
type: NATIVE_SYSTEM_AUDIO_REQUEST_TYPE,
|
|
212
|
+
action: 'start',
|
|
213
|
+
captureMode: options.captureMode ?? 'systemAudio',
|
|
214
|
+
sampleRate: options.sampleRate ?? 48_000,
|
|
215
|
+
channels: options.channels ?? 1,
|
|
216
|
+
}, NATIVE_SYSTEM_AUDIO_RESULT_TYPE, options);
|
|
217
|
+
if (!isRecord(result) ||
|
|
218
|
+
result.started !== true ||
|
|
219
|
+
typeof result.sessionId !== 'string' ||
|
|
220
|
+
result.sessionId.length === 0) {
|
|
221
|
+
invalidResponse('Moldable returned an invalid capture session.', result);
|
|
222
|
+
}
|
|
223
|
+
return result;
|
|
224
|
+
}
|
|
225
|
+
/** Reads the status of the capture session owned by this app view. */
|
|
226
|
+
export async function getMoldableSystemAudioStatus(options = {}) {
|
|
227
|
+
const result = await callNativeHardwareBridge({ type: NATIVE_SYSTEM_AUDIO_REQUEST_TYPE, action: 'status' }, NATIVE_SYSTEM_AUDIO_RESULT_TYPE, options);
|
|
228
|
+
if (!isRecord(result) || !isStatus(result.status)) {
|
|
229
|
+
invalidResponse('Moldable returned an invalid capture status.', result);
|
|
230
|
+
}
|
|
231
|
+
return result.status;
|
|
232
|
+
}
|
|
233
|
+
/** Stops only the capture session owned by this app view. */
|
|
234
|
+
export async function stopMoldableSystemAudioCapture(options = {}) {
|
|
235
|
+
if (options.reason !== undefined &&
|
|
236
|
+
(typeof options.reason !== 'string' ||
|
|
237
|
+
options.reason.length > 256 ||
|
|
238
|
+
[...options.reason].some((character) => {
|
|
239
|
+
const code = character.charCodeAt(0);
|
|
240
|
+
return code <= 31 || code === 127;
|
|
241
|
+
}))) {
|
|
242
|
+
throw invalidRequest('A system audio stop reason must be at most 256 characters without control characters.');
|
|
243
|
+
}
|
|
244
|
+
const result = await callNativeHardwareBridge({
|
|
245
|
+
type: NATIVE_SYSTEM_AUDIO_REQUEST_TYPE,
|
|
246
|
+
action: 'stop',
|
|
247
|
+
...(options.reason === undefined ? {} : { reason: options.reason }),
|
|
248
|
+
}, NATIVE_SYSTEM_AUDIO_RESULT_TYPE, options);
|
|
249
|
+
if (!isRecord(result) || typeof result.stopped !== 'boolean') {
|
|
250
|
+
invalidResponse('Moldable returned an invalid capture stop result.', result);
|
|
251
|
+
}
|
|
252
|
+
return result.stopped;
|
|
253
|
+
}
|
|
254
|
+
/** Replays recent frames through active event subscriptions after a sequence gap. */
|
|
255
|
+
export async function replayMoldableSystemAudioFrames(options = {}) {
|
|
256
|
+
if ((options.afterSequence !== undefined &&
|
|
257
|
+
(!Number.isSafeInteger(options.afterSequence) ||
|
|
258
|
+
options.afterSequence < 0)) ||
|
|
259
|
+
(options.limit !== undefined &&
|
|
260
|
+
(!Number.isSafeInteger(options.limit) ||
|
|
261
|
+
options.limit < 1 ||
|
|
262
|
+
options.limit > NATIVE_SYSTEM_AUDIO_MAX_REPLAY_FRAMES))) {
|
|
263
|
+
throw invalidRequest(`Replay requires a non-negative sequence and a limit from 1 to ${NATIVE_SYSTEM_AUDIO_MAX_REPLAY_FRAMES}.`);
|
|
264
|
+
}
|
|
265
|
+
const result = await callNativeHardwareBridge({
|
|
266
|
+
type: NATIVE_SYSTEM_AUDIO_REQUEST_TYPE,
|
|
267
|
+
action: 'replay',
|
|
268
|
+
...(options.afterSequence === undefined
|
|
269
|
+
? {}
|
|
270
|
+
: { afterSequence: options.afterSequence }),
|
|
271
|
+
...(options.limit === undefined ? {} : { limit: options.limit }),
|
|
272
|
+
}, NATIVE_SYSTEM_AUDIO_RESULT_TYPE, options);
|
|
273
|
+
if (!isRecord(result) ||
|
|
274
|
+
!Number.isSafeInteger(result.replayed) ||
|
|
275
|
+
result.replayed < 0) {
|
|
276
|
+
invalidResponse('Moldable returned an invalid replay result.', result);
|
|
277
|
+
}
|
|
278
|
+
return result.replayed;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Subscribes to lifecycle and source-separated PCM frames for this app view.
|
|
282
|
+
* Subscribe before starting capture so the first lifecycle event is observable.
|
|
283
|
+
*/
|
|
284
|
+
export function subscribeMoldableSystemAudioEvents(listener, options = {}) {
|
|
285
|
+
if (typeof listener !== 'function') {
|
|
286
|
+
throw invalidRequest('A system audio event listener is required.');
|
|
287
|
+
}
|
|
288
|
+
if (typeof window === 'undefined' || window.parent === window) {
|
|
289
|
+
throw new NativeHardwareBridgeError({
|
|
290
|
+
code: 'not_in_moldable',
|
|
291
|
+
message: 'System audio events are only available inside Moldable.',
|
|
292
|
+
retryable: false,
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
const parentOrigin = resolveNativeHardwareParentOrigin(document.referrer);
|
|
296
|
+
if (!parentOrigin) {
|
|
297
|
+
throw new NativeHardwareBridgeError({
|
|
298
|
+
code: 'not_in_moldable',
|
|
299
|
+
message: 'The system audio event parent could not be verified.',
|
|
300
|
+
retryable: false,
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
let active = !options.signal?.aborted;
|
|
304
|
+
const handleMessage = (event) => {
|
|
305
|
+
if (!active ||
|
|
306
|
+
event.source !== window.parent ||
|
|
307
|
+
event.origin !== parentOrigin ||
|
|
308
|
+
!isNativeSystemAudioEvent(event.data)) {
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
try {
|
|
312
|
+
listener(toPublicEvent(event.data));
|
|
313
|
+
}
|
|
314
|
+
catch {
|
|
315
|
+
// One app callback must not break native event delivery.
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
const unsubscribe = () => {
|
|
319
|
+
if (!active)
|
|
320
|
+
return;
|
|
321
|
+
active = false;
|
|
322
|
+
window.removeEventListener('message', handleMessage);
|
|
323
|
+
options.signal?.removeEventListener('abort', unsubscribe);
|
|
324
|
+
};
|
|
325
|
+
if (active) {
|
|
326
|
+
window.addEventListener('message', handleMessage);
|
|
327
|
+
options.signal?.addEventListener('abort', unsubscribe, { once: true });
|
|
328
|
+
}
|
|
329
|
+
return unsubscribe;
|
|
330
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export declare const NATIVE_HARDWARE_CAPABILITY_IDS: readonly ["camera", "microphone", "screen-capture", "system-audio", "location", "clipboard-read", "clipboard-write", "notifications", "displays", "global-shortcuts", "power-monitor", "idle-state", "session-events", "sleep-blocker", "local-authentication", "haptics", "secure-storage", "usb", "hid", "serial", "midi", "bluetooth"];
|
|
2
|
+
export type NativeHardwareCapabilityId = (typeof NATIVE_HARDWARE_CAPABILITY_IDS)[number];
|
|
3
|
+
export type NativeHardwarePlatform = 'macos' | 'windows' | 'linux' | 'unknown';
|
|
4
|
+
export type NativeHardwareSupport = 'supported' | 'partial' | 'unsupported';
|
|
5
|
+
export type NativeHardwareTransportKind = 'web-api' | 'desktop-bridge' | 'tauri-command' | 'hybrid' | 'unavailable';
|
|
6
|
+
export interface NativeHardwareTransportMetadata {
|
|
7
|
+
kind: NativeHardwareTransportKind;
|
|
8
|
+
/** Stable API or bridge name that an app can use for diagnostics. */
|
|
9
|
+
name: string;
|
|
10
|
+
}
|
|
11
|
+
export type NativeHardwarePermissionName = 'camera' | 'microphone' | 'screen-recording' | 'location' | 'clipboard-read' | 'clipboard-write' | 'notifications' | 'global-shortcuts' | 'local-authentication' | 'secure-storage' | 'usb' | 'hid' | 'serial' | 'midi' | 'bluetooth' | 'none';
|
|
12
|
+
export type NativeHardwarePermissionAuthority = 'webview' | 'operating-system' | 'both' | 'none';
|
|
13
|
+
export type NativeHardwarePermissionRequest = 'on-use' | 'explicit' | 'system-settings' | 'none';
|
|
14
|
+
export interface NativeHardwarePermissionMetadata {
|
|
15
|
+
name: NativeHardwarePermissionName;
|
|
16
|
+
required: boolean;
|
|
17
|
+
authority: NativeHardwarePermissionAuthority;
|
|
18
|
+
request: NativeHardwarePermissionRequest;
|
|
19
|
+
}
|
|
20
|
+
export interface NativeHardwareCapabilityDescriptor {
|
|
21
|
+
id: NativeHardwareCapabilityId;
|
|
22
|
+
support: NativeHardwareSupport;
|
|
23
|
+
transport: NativeHardwareTransportMetadata;
|
|
24
|
+
permission: NativeHardwarePermissionMetadata;
|
|
25
|
+
/** Explains a platform limitation or why support is only partial. */
|
|
26
|
+
reason?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const NATIVE_HARDWARE_MANIFEST_SCHEMA_VERSION: 2;
|
|
29
|
+
export interface NativeHardwareCapabilityManifest {
|
|
30
|
+
schemaVersion: typeof NATIVE_HARDWARE_MANIFEST_SCHEMA_VERSION;
|
|
31
|
+
platform: NativeHardwarePlatform;
|
|
32
|
+
capabilities: Record<NativeHardwareCapabilityId, NativeHardwareCapabilityDescriptor>;
|
|
33
|
+
}
|
|
34
|
+
export type NativeHardwareErrorCode = 'invalid_request' | 'not_in_moldable' | 'timeout' | 'aborted' | 'invalid_response' | 'unsupported' | 'unavailable' | 'permission_denied' | 'cancelled' | 'host_error';
|
|
35
|
+
export interface NativeHardwareErrorPayload {
|
|
36
|
+
code: NativeHardwareErrorCode;
|
|
37
|
+
message: string;
|
|
38
|
+
details?: unknown;
|
|
39
|
+
retryable?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export type NativeHardwareRequestEnvelope<TType extends string = string, TPayload extends object = Record<string, never>> = {
|
|
42
|
+
type: TType;
|
|
43
|
+
requestId: string;
|
|
44
|
+
} & TPayload;
|
|
45
|
+
export type NativeHardwareResultEnvelope<TType extends string = string, TResult = unknown> = {
|
|
46
|
+
type: TType;
|
|
47
|
+
requestId: string;
|
|
48
|
+
ok: true;
|
|
49
|
+
result: TResult;
|
|
50
|
+
error?: never;
|
|
51
|
+
} | {
|
|
52
|
+
type: TType;
|
|
53
|
+
requestId: string;
|
|
54
|
+
ok: false;
|
|
55
|
+
result?: never;
|
|
56
|
+
error: NativeHardwareErrorPayload;
|
|
57
|
+
};
|
|
58
|
+
export declare const NATIVE_HARDWARE_CAPABILITIES_REQUEST_TYPE: "moldable:native-hardware-capabilities-request";
|
|
59
|
+
export declare const NATIVE_HARDWARE_CAPABILITIES_RESULT_TYPE: "moldable:native-hardware-capabilities-result";
|
|
60
|
+
export type NativeHardwareCapabilitiesRequest = NativeHardwareRequestEnvelope<typeof NATIVE_HARDWARE_CAPABILITIES_REQUEST_TYPE>;
|
|
61
|
+
export type NativeHardwareCapabilitiesResult = NativeHardwareResultEnvelope<typeof NATIVE_HARDWARE_CAPABILITIES_RESULT_TYPE, NativeHardwareCapabilityManifest>;
|
|
62
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/native-hardware/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,2UAuBjC,CAAA;AAEV,MAAM,MAAM,0BAA0B,GACpC,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,CAAC,CAAA;AAEjD,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;AAE9E,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG,SAAS,GAAG,aAAa,CAAA;AAE3E,MAAM,MAAM,2BAA2B,GACnC,SAAS,GACT,gBAAgB,GAChB,eAAe,GACf,QAAQ,GACR,aAAa,CAAA;AAEjB,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,2BAA2B,CAAA;IACjC,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,MAAM,4BAA4B,GACpC,QAAQ,GACR,YAAY,GACZ,kBAAkB,GAClB,UAAU,GACV,gBAAgB,GAChB,iBAAiB,GACjB,eAAe,GACf,kBAAkB,GAClB,sBAAsB,GACtB,gBAAgB,GAChB,KAAK,GACL,KAAK,GACL,QAAQ,GACR,MAAM,GACN,WAAW,GACX,MAAM,CAAA;AAEV,MAAM,MAAM,iCAAiC,GACzC,SAAS,GACT,kBAAkB,GAClB,MAAM,GACN,MAAM,CAAA;AAEV,MAAM,MAAM,+BAA+B,GACvC,QAAQ,GACR,UAAU,GACV,iBAAiB,GACjB,MAAM,CAAA;AAEV,MAAM,WAAW,gCAAgC;IAC/C,IAAI,EAAE,4BAA4B,CAAA;IAClC,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,iCAAiC,CAAA;IAC5C,OAAO,EAAE,+BAA+B,CAAA;CACzC;AAED,MAAM,WAAW,kCAAkC;IACjD,EAAE,EAAE,0BAA0B,CAAA;IAC9B,OAAO,EAAE,qBAAqB,CAAA;IAC9B,SAAS,EAAE,+BAA+B,CAAA;IAC1C,UAAU,EAAE,gCAAgC,CAAA;IAC5C,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,uCAAuC,EAAG,CAAU,CAAA;AAEjE,MAAM,WAAW,gCAAgC;IAC/C,aAAa,EAAE,OAAO,uCAAuC,CAAA;IAC7D,QAAQ,EAAE,sBAAsB,CAAA;IAChC,YAAY,EAAE,MAAM,CAClB,0BAA0B,EAC1B,kCAAkC,CACnC,CAAA;CACF;AAED,MAAM,MAAM,uBAAuB,GAC/B,iBAAiB,GACjB,iBAAiB,GACjB,SAAS,GACT,SAAS,GACT,kBAAkB,GAClB,aAAa,GACb,aAAa,GACb,mBAAmB,GACnB,WAAW,GACX,YAAY,CAAA;AAEhB,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,uBAAuB,CAAA;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,MAAM,6BAA6B,CACvC,KAAK,SAAS,MAAM,GAAG,MAAM,EAC7B,QAAQ,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAC7C;IACF,IAAI,EAAE,KAAK,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;CAClB,GAAG,QAAQ,CAAA;AAEZ,MAAM,MAAM,4BAA4B,CACtC,KAAK,SAAS,MAAM,GAAG,MAAM,EAC7B,OAAO,GAAG,OAAO,IAEf;IACE,IAAI,EAAE,KAAK,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,EAAE,EAAE,IAAI,CAAA;IACR,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,GACD;IACE,IAAI,EAAE,KAAK,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,EAAE,EAAE,KAAK,CAAA;IACT,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,KAAK,EAAE,0BAA0B,CAAA;CAClC,CAAA;AAEL,eAAO,MAAM,yCAAyC,EACpD,+CAAwD,CAAA;AAC1D,eAAO,MAAM,wCAAwC,EACnD,8CAAuD,CAAA;AAEzD,MAAM,MAAM,iCAAiC,GAAG,6BAA6B,CAC3E,OAAO,yCAAyC,CACjD,CAAA;AAED,MAAM,MAAM,gCAAgC,GAAG,4BAA4B,CACzE,OAAO,wCAAwC,EAC/C,gCAAgC,CACjC,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const NATIVE_HARDWARE_CAPABILITY_IDS = [
|
|
2
|
+
'camera',
|
|
3
|
+
'microphone',
|
|
4
|
+
'screen-capture',
|
|
5
|
+
'system-audio',
|
|
6
|
+
'location',
|
|
7
|
+
'clipboard-read',
|
|
8
|
+
'clipboard-write',
|
|
9
|
+
'notifications',
|
|
10
|
+
'displays',
|
|
11
|
+
'global-shortcuts',
|
|
12
|
+
'power-monitor',
|
|
13
|
+
'idle-state',
|
|
14
|
+
'session-events',
|
|
15
|
+
'sleep-blocker',
|
|
16
|
+
'local-authentication',
|
|
17
|
+
'haptics',
|
|
18
|
+
'secure-storage',
|
|
19
|
+
'usb',
|
|
20
|
+
'hid',
|
|
21
|
+
'serial',
|
|
22
|
+
'midi',
|
|
23
|
+
'bluetooth',
|
|
24
|
+
];
|
|
25
|
+
export const NATIVE_HARDWARE_MANIFEST_SCHEMA_VERSION = 2;
|
|
26
|
+
export const NATIVE_HARDWARE_CAPABILITIES_REQUEST_TYPE = 'moldable:native-hardware-capabilities-request';
|
|
27
|
+
export const NATIVE_HARDWARE_CAPABILITIES_RESULT_TYPE = 'moldable:native-hardware-capabilities-result';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type MoldableNativeDeviceDescriptor } from './native-device-io';
|
|
2
|
+
import type { MoldableUsbControlTransferParameters, MoldableUsbDevice, MoldableUsbInTransferResult, MoldableUsbOpenOptions, MoldableUsbOperationOptions, MoldableUsbOutTransferResult } from './usb';
|
|
3
|
+
export declare class NativeMoldableUsbDevice extends EventTarget implements MoldableUsbDevice {
|
|
4
|
+
readonly descriptor: MoldableNativeDeviceDescriptor;
|
|
5
|
+
readonly vendorId: number;
|
|
6
|
+
readonly productId: number;
|
|
7
|
+
readonly productName: string;
|
|
8
|
+
readonly manufacturerName: null;
|
|
9
|
+
readonly serialNumber: null;
|
|
10
|
+
configuration: {
|
|
11
|
+
configurationValue: number;
|
|
12
|
+
} | null;
|
|
13
|
+
private handle?;
|
|
14
|
+
private closing?;
|
|
15
|
+
private readonly lifecycle;
|
|
16
|
+
constructor(descriptor: MoldableNativeDeviceDescriptor);
|
|
17
|
+
get opened(): boolean;
|
|
18
|
+
openWithOptions(options: MoldableUsbOpenOptions): Promise<void>;
|
|
19
|
+
open(): Promise<void>;
|
|
20
|
+
close(): Promise<void>;
|
|
21
|
+
forget(): Promise<void>;
|
|
22
|
+
selectConfiguration(): Promise<void>;
|
|
23
|
+
claimInterface(): Promise<void>;
|
|
24
|
+
releaseInterface(): Promise<void>;
|
|
25
|
+
transferIn(endpointNumber: number, length: number): Promise<MoldableUsbInTransferResult>;
|
|
26
|
+
transferInWithOptions(endpointNumber: number, length: number, options?: MoldableUsbOperationOptions): Promise<MoldableUsbInTransferResult>;
|
|
27
|
+
transferOut(endpointNumber: number, data: BufferSource): Promise<MoldableUsbOutTransferResult>;
|
|
28
|
+
transferOutWithOptions(endpointNumber: number, data: BufferSource, options?: MoldableUsbOperationOptions): Promise<MoldableUsbOutTransferResult>;
|
|
29
|
+
controlTransferIn(setup: MoldableUsbControlTransferParameters, length: number): Promise<MoldableUsbInTransferResult>;
|
|
30
|
+
controlTransferInWithOptions(setup: MoldableUsbControlTransferParameters, length: number, options?: MoldableUsbOperationOptions): Promise<MoldableUsbInTransferResult>;
|
|
31
|
+
controlTransferOut(setup: MoldableUsbControlTransferParameters, data?: BufferSource): Promise<MoldableUsbOutTransferResult>;
|
|
32
|
+
controlTransferOutWithOptions(setup: MoldableUsbControlTransferParameters, data?: BufferSource, options?: MoldableUsbOperationOptions): Promise<MoldableUsbOutTransferResult>;
|
|
33
|
+
clearHalt(direction: 'in' | 'out', endpointNumber: number): Promise<void>;
|
|
34
|
+
reset(): Promise<void>;
|
|
35
|
+
private execute;
|
|
36
|
+
private reopenRequired;
|
|
37
|
+
}
|
|
38
|
+
export declare function isNativeMoldableUsbDevice(device: MoldableUsbDevice): device is NativeMoldableUsbDevice;
|
|
39
|
+
//# sourceMappingURL=usb-native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usb-native.d.ts","sourceRoot":"","sources":["../../../src/lib/native-hardware/usb-native.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,8BAA8B,EAMpC,MAAM,oBAAoB,CAAA;AAK3B,OAAO,KAAK,EACV,oCAAoC,EACpC,iBAAiB,EACjB,2BAA2B,EAC3B,sBAAsB,EACtB,2BAA2B,EAC3B,4BAA4B,EAC7B,MAAM,OAAO,CAAA;AAId,qBAAa,uBACX,SAAQ,WACR,YAAW,iBAAiB;IAYhB,QAAQ,CAAC,UAAU,EAAE,8BAA8B;IAV/D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,gBAAgB,OAAO;IAChC,QAAQ,CAAC,YAAY,OAAO;IAC5B,aAAa,EAAE;QAAE,kBAAkB,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAO;IAC3D,OAAO,CAAC,MAAM,CAAC,CAAQ;IACvB,OAAO,CAAC,OAAO,CAAC,CAAe;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA8B;gBAEnC,UAAU,EAAE,8BAA8B;IAO/D,IAAI,MAAM,IAAI,OAAO,CAEpB;IAEK,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAsB/D,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBtB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjC,UAAU,CACd,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,2BAA2B,CAAC;IAIjC,qBAAqB,CACzB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,2BAA2B,CAAC;IAkBjC,WAAW,CACf,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,YAAY,GACjB,OAAO,CAAC,4BAA4B,CAAC;IAIlC,sBAAsB,CAC1B,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,YAAY,EAClB,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,4BAA4B,CAAC;IAiBlC,iBAAiB,CACrB,KAAK,EAAE,oCAAoC,EAC3C,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,2BAA2B,CAAC;IAIjC,4BAA4B,CAChC,KAAK,EAAE,oCAAoC,EAC3C,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,2BAA2B,CAAC;IAoBjC,kBAAkB,CACtB,KAAK,EAAE,oCAAoC,EAC3C,IAAI,GAAE,YAA+B,GACpC,OAAO,CAAC,4BAA4B,CAAC;IAIlC,6BAA6B,CACjC,KAAK,EAAE,oCAAoC,EAC3C,IAAI,GAAE,YAA+B,EACrC,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,4BAA4B,CAAC;IAmBlC,SAAS,CACb,SAAS,EAAE,IAAI,GAAG,KAAK,EACvB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC;IAOV,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAId,OAAO;IAgCrB,OAAO,CAAC,cAAc;CAMvB;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,iBAAiB,GACxB,MAAM,IAAI,uBAAuB,CAEnC"}
|