@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,105 @@
|
|
|
1
|
+
import { NativeCapabilityBridgeError, toNativeCapabilityBridgeError, } from './bridge';
|
|
2
|
+
export function bluetoothError(error, operation) {
|
|
3
|
+
if (error instanceof NativeCapabilityBridgeError)
|
|
4
|
+
return error;
|
|
5
|
+
const name = error instanceof DOMException ? error.name : undefined;
|
|
6
|
+
let code = 'host_error';
|
|
7
|
+
let retryable = false;
|
|
8
|
+
if (name === 'NotSupportedError')
|
|
9
|
+
code = 'unsupported';
|
|
10
|
+
else if (name === 'NotAllowedError' || name === 'SecurityError') {
|
|
11
|
+
code = 'permission_denied';
|
|
12
|
+
}
|
|
13
|
+
else if (name === 'AbortError')
|
|
14
|
+
code = 'aborted';
|
|
15
|
+
else if (name === 'NotFoundError')
|
|
16
|
+
code = 'cancelled';
|
|
17
|
+
else if (name === 'NetworkError' ||
|
|
18
|
+
name === 'InvalidStateError' ||
|
|
19
|
+
name === 'OperationError') {
|
|
20
|
+
code = 'unavailable';
|
|
21
|
+
retryable = true;
|
|
22
|
+
}
|
|
23
|
+
else if (error instanceof TypeError)
|
|
24
|
+
code = 'invalid_request';
|
|
25
|
+
const fallbackMessage = `Unable to ${operation}`;
|
|
26
|
+
return toNativeCapabilityBridgeError({
|
|
27
|
+
code,
|
|
28
|
+
message: error instanceof Error
|
|
29
|
+
? error.message || fallbackMessage
|
|
30
|
+
: fallbackMessage,
|
|
31
|
+
details: {
|
|
32
|
+
capability: 'bluetooth',
|
|
33
|
+
operation,
|
|
34
|
+
...(name ? { cause: name } : {}),
|
|
35
|
+
},
|
|
36
|
+
retryable,
|
|
37
|
+
}, fallbackMessage);
|
|
38
|
+
}
|
|
39
|
+
export function bluetoothAborted(operation) {
|
|
40
|
+
return bluetoothError(new DOMException(`Bluetooth ${operation} was aborted`, 'AbortError'), operation);
|
|
41
|
+
}
|
|
42
|
+
export function getBluetoothNavigator() {
|
|
43
|
+
return typeof navigator === 'undefined'
|
|
44
|
+
? undefined
|
|
45
|
+
: navigator;
|
|
46
|
+
}
|
|
47
|
+
export function getBluetoothAPI(operation) {
|
|
48
|
+
const api = getBluetoothNavigator()?.bluetooth;
|
|
49
|
+
if (!api || typeof api.requestDevice !== 'function') {
|
|
50
|
+
throw bluetoothError(new DOMException('Web Bluetooth is unavailable', 'NotSupportedError'), operation);
|
|
51
|
+
}
|
|
52
|
+
return api;
|
|
53
|
+
}
|
|
54
|
+
export function assertBluetoothUserGesture() {
|
|
55
|
+
const activation = getBluetoothNavigator()?.userActivation;
|
|
56
|
+
if (activation && !activation.isActive) {
|
|
57
|
+
throw toNativeCapabilityBridgeError({
|
|
58
|
+
code: 'invalid_request',
|
|
59
|
+
message: 'Bluetooth device selection must be requested from a user-initiated action.',
|
|
60
|
+
details: { capability: 'bluetooth', cause: 'user_gesture_required' },
|
|
61
|
+
retryable: true,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export function validateBluetoothRequestOptions(options) {
|
|
66
|
+
const hasFilters = 'filters' in options && options.filters !== undefined;
|
|
67
|
+
const acceptsAll = options.acceptAllDevices === true;
|
|
68
|
+
if (hasFilters === acceptsAll) {
|
|
69
|
+
throw bluetoothError(new TypeError('Specify either a non-empty filters array or acceptAllDevices: true'), 'request a Bluetooth device');
|
|
70
|
+
}
|
|
71
|
+
if (hasFilters && options.filters.length === 0) {
|
|
72
|
+
throw bluetoothError(new TypeError('Bluetooth filters must not be empty'), 'request a Bluetooth device');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
export function abortableBluetooth(promise, signal, operation, onLateResolution) {
|
|
76
|
+
if (!signal)
|
|
77
|
+
return promise;
|
|
78
|
+
if (signal.aborted)
|
|
79
|
+
return Promise.reject(bluetoothAborted(operation));
|
|
80
|
+
return new Promise((resolve, reject) => {
|
|
81
|
+
let settled = false;
|
|
82
|
+
const onAbort = () => {
|
|
83
|
+
if (settled)
|
|
84
|
+
return;
|
|
85
|
+
settled = true;
|
|
86
|
+
reject(bluetoothAborted(operation));
|
|
87
|
+
};
|
|
88
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
89
|
+
void promise.then((value) => {
|
|
90
|
+
signal.removeEventListener('abort', onAbort);
|
|
91
|
+
if (settled) {
|
|
92
|
+
onLateResolution?.(value);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
settled = true;
|
|
96
|
+
resolve(value);
|
|
97
|
+
}, (error) => {
|
|
98
|
+
signal.removeEventListener('abort', onAbort);
|
|
99
|
+
if (settled)
|
|
100
|
+
return;
|
|
101
|
+
settled = true;
|
|
102
|
+
reject(error);
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { MoldableBluetoothDevice, MoldableBluetoothRequestDeviceOptions } from './bluetooth-types';
|
|
2
|
+
import { type NativeCapabilityBridgeOptions } from './bridge';
|
|
3
|
+
export type MoldableBluetoothTransport = {
|
|
4
|
+
kind: 'web-bluetooth';
|
|
5
|
+
device: MoldableBluetoothDevice;
|
|
6
|
+
} | {
|
|
7
|
+
kind: 'desktop-bridge';
|
|
8
|
+
device: MoldableNativeBluetoothDevice;
|
|
9
|
+
};
|
|
10
|
+
export interface MoldableNativeBluetoothService {
|
|
11
|
+
uuid: string;
|
|
12
|
+
characteristicUuids: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface MoldableNativeBluetoothDevice {
|
|
15
|
+
readonly id: string;
|
|
16
|
+
readonly name: string | null;
|
|
17
|
+
readonly connected: boolean;
|
|
18
|
+
addEventListener(type: 'gattserverdisconnected', listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
19
|
+
removeEventListener(type: 'gattserverdisconnected', listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
20
|
+
getServices(options?: NativeCapabilityBridgeOptions): Promise<MoldableNativeBluetoothService[]>;
|
|
21
|
+
read(serviceUuid: string, characteristicUuid: string, options?: NativeCapabilityBridgeOptions): Promise<DataView>;
|
|
22
|
+
write(serviceUuid: string, characteristicUuid: string, data: BufferSource, options?: NativeCapabilityBridgeOptions & {
|
|
23
|
+
withResponse?: boolean;
|
|
24
|
+
}): Promise<void>;
|
|
25
|
+
observe(serviceUuid: string, characteristicUuid: string, listener: (value: DataView) => void, options?: NativeCapabilityBridgeOptions): Promise<() => Promise<void>>;
|
|
26
|
+
disconnect(options?: NativeCapabilityBridgeOptions): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Uses Web Bluetooth first, with a restrictive desktop BLE chooser fallback.
|
|
30
|
+
* The native branch mirrors physical disconnect and adapter-loss events.
|
|
31
|
+
*/
|
|
32
|
+
export declare function requestMoldableBluetoothWithFallback(options: MoldableBluetoothRequestDeviceOptions, bridgeOptions?: NativeCapabilityBridgeOptions): Promise<MoldableBluetoothTransport>;
|
|
33
|
+
//# sourceMappingURL=bluetooth-native-fallback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bluetooth-native-fallback.d.ts","sourceRoot":"","sources":["../../../src/lib/native-capabilities/bluetooth-native-fallback.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,uBAAuB,EACvB,qCAAqC,EACtC,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,KAAK,6BAA6B,EAEnC,MAAM,UAAU,CAAA;AAMjB,MAAM,MAAM,0BAA0B,GAClC;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,MAAM,EAAE,uBAAuB,CAAA;CAAE,GAC1D;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,6BAA6B,CAAA;CAAE,CAAA;AAErE,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,mBAAmB,EAAE,MAAM,EAAE,CAAA;CAC9B;AAED,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,gBAAgB,CACd,IAAI,EAAE,wBAAwB,EAC9B,QAAQ,EAAE,kCAAkC,EAC5C,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC1C,IAAI,CAAA;IACP,mBAAmB,CACjB,IAAI,EAAE,wBAAwB,EAC9B,QAAQ,EAAE,kCAAkC,EAC5C,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,GACvC,IAAI,CAAA;IACP,WAAW,CACT,OAAO,CAAC,EAAE,6BAA6B,GACtC,OAAO,CAAC,8BAA8B,EAAE,CAAC,CAAA;IAC5C,IAAI,CACF,WAAW,EAAE,MAAM,EACnB,kBAAkB,EAAE,MAAM,EAC1B,OAAO,CAAC,EAAE,6BAA6B,GACtC,OAAO,CAAC,QAAQ,CAAC,CAAA;IACpB,KAAK,CACH,WAAW,EAAE,MAAM,EACnB,kBAAkB,EAAE,MAAM,EAC1B,IAAI,EAAE,YAAY,EAClB,OAAO,CAAC,EAAE,6BAA6B,GAAG;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE,GACnE,OAAO,CAAC,IAAI,CAAC,CAAA;IAChB,OAAO,CACL,WAAW,EAAE,MAAM,EACnB,kBAAkB,EAAE,MAAM,EAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,EACnC,OAAO,CAAC,EAAE,6BAA6B,GACtC,OAAO,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;IAC/B,UAAU,CAAC,OAAO,CAAC,EAAE,6BAA6B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACnE;AA2PD;;;GAGG;AACH,wBAAsB,oCAAoC,CACxD,OAAO,EAAE,qCAAqC,EAC9C,aAAa,GAAE,6BAAkC,GAChD,OAAO,CAAC,0BAA0B,CAAC,CAsCrC"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { isMoldableBluetoothSupported, requestMoldableBluetoothDevice, } from './bluetooth-access';
|
|
2
|
+
import { callNativeCapabilityBridge, } from './bridge';
|
|
3
|
+
const REQUEST_TYPE = 'moldable:native-bluetooth';
|
|
4
|
+
const RESULT_TYPE = 'moldable:native-bluetooth-result';
|
|
5
|
+
const EVENT_TYPE = 'moldable:native-bluetooth-event';
|
|
6
|
+
function isNativeConnectionResult(value) {
|
|
7
|
+
if (typeof value !== 'object' || value === null)
|
|
8
|
+
return false;
|
|
9
|
+
const connection = value;
|
|
10
|
+
return (typeof connection.connectionId === 'string' &&
|
|
11
|
+
connection.connectionId.length > 0 &&
|
|
12
|
+
(connection.name === null || typeof connection.name === 'string'));
|
|
13
|
+
}
|
|
14
|
+
function uuid(value) {
|
|
15
|
+
if (typeof value === 'number' &&
|
|
16
|
+
Number.isInteger(value) &&
|
|
17
|
+
value >= 0 &&
|
|
18
|
+
value <= 0xffff) {
|
|
19
|
+
return value.toString(16).padStart(4, '0');
|
|
20
|
+
}
|
|
21
|
+
if (typeof value === 'string' && /^[0-9a-fA-F-]{4,64}$/.test(value))
|
|
22
|
+
return value.toLowerCase();
|
|
23
|
+
throw new TypeError('The native Bluetooth fallback requires numeric or UUID service identifiers.');
|
|
24
|
+
}
|
|
25
|
+
function dataBytes(source) {
|
|
26
|
+
const bytes = source instanceof ArrayBuffer
|
|
27
|
+
? new Uint8Array(source)
|
|
28
|
+
: new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
|
|
29
|
+
if (bytes.byteLength > 512)
|
|
30
|
+
throw new TypeError('Bluetooth values are limited to 512 bytes.');
|
|
31
|
+
return Array.from(bytes);
|
|
32
|
+
}
|
|
33
|
+
function nativeRequest(connectionId, action, payload, options = {}) {
|
|
34
|
+
return callNativeCapabilityBridge({ type: REQUEST_TYPE, action, connectionId, ...payload }, RESULT_TYPE, options);
|
|
35
|
+
}
|
|
36
|
+
function nativeDevice(connection) {
|
|
37
|
+
let disconnected = false;
|
|
38
|
+
const events = new EventTarget();
|
|
39
|
+
const activeSubscriptions = new Set();
|
|
40
|
+
const transitionDisconnected = () => {
|
|
41
|
+
if (disconnected)
|
|
42
|
+
return;
|
|
43
|
+
disconnected = true;
|
|
44
|
+
window.removeEventListener('message', onLifecycleMessage);
|
|
45
|
+
for (const cleanup of [...activeSubscriptions]) {
|
|
46
|
+
void cleanup().catch(() => undefined);
|
|
47
|
+
}
|
|
48
|
+
events.dispatchEvent(new Event('gattserverdisconnected'));
|
|
49
|
+
};
|
|
50
|
+
function onLifecycleMessage(event) {
|
|
51
|
+
if (event.source !== window.parent ||
|
|
52
|
+
typeof event.data !== 'object' ||
|
|
53
|
+
!event.data)
|
|
54
|
+
return;
|
|
55
|
+
const message = event.data;
|
|
56
|
+
if (message.type !== EVENT_TYPE ||
|
|
57
|
+
typeof message.event !== 'object' ||
|
|
58
|
+
!message.event)
|
|
59
|
+
return;
|
|
60
|
+
const value = message.event;
|
|
61
|
+
if (value.connectionId === connection.connectionId &&
|
|
62
|
+
(value.kind === 'disconnected' || value.kind === 'adapterUnavailable')) {
|
|
63
|
+
transitionDisconnected();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
window.addEventListener('message', onLifecycleMessage);
|
|
67
|
+
const assertConnected = () => {
|
|
68
|
+
if (disconnected) {
|
|
69
|
+
throw new DOMException('The Bluetooth device is disconnected.', 'InvalidStateError');
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
id: connection.connectionId,
|
|
74
|
+
name: connection.name,
|
|
75
|
+
get connected() {
|
|
76
|
+
return !disconnected;
|
|
77
|
+
},
|
|
78
|
+
addEventListener(type, listener, options) {
|
|
79
|
+
events.addEventListener(type, listener, options);
|
|
80
|
+
},
|
|
81
|
+
removeEventListener(type, listener, options) {
|
|
82
|
+
events.removeEventListener(type, listener, options);
|
|
83
|
+
},
|
|
84
|
+
async getServices(options) {
|
|
85
|
+
assertConnected();
|
|
86
|
+
return nativeRequest(connection.connectionId, 'getServices', {}, options);
|
|
87
|
+
},
|
|
88
|
+
async read(serviceUuid, characteristicUuid, options) {
|
|
89
|
+
assertConnected();
|
|
90
|
+
const data = await nativeRequest(connection.connectionId, 'read', {
|
|
91
|
+
serviceUuid: uuid(serviceUuid),
|
|
92
|
+
characteristicUuid: uuid(characteristicUuid),
|
|
93
|
+
}, options);
|
|
94
|
+
if (!Array.isArray(data) ||
|
|
95
|
+
!data.every((byte) => Number.isInteger(byte))) {
|
|
96
|
+
throw new TypeError('The desktop returned an invalid Bluetooth value.');
|
|
97
|
+
}
|
|
98
|
+
return new DataView(Uint8Array.from(data).buffer);
|
|
99
|
+
},
|
|
100
|
+
async write(serviceUuid, characteristicUuid, data, options) {
|
|
101
|
+
assertConnected();
|
|
102
|
+
await nativeRequest(connection.connectionId, 'write', {
|
|
103
|
+
serviceUuid: uuid(serviceUuid),
|
|
104
|
+
characteristicUuid: uuid(characteristicUuid),
|
|
105
|
+
data: dataBytes(data),
|
|
106
|
+
withResponse: options?.withResponse !== false,
|
|
107
|
+
}, options);
|
|
108
|
+
},
|
|
109
|
+
async observe(serviceUuid, characteristicUuid, listener, options) {
|
|
110
|
+
assertConnected();
|
|
111
|
+
const service = uuid(serviceUuid);
|
|
112
|
+
const characteristic = uuid(characteristicUuid);
|
|
113
|
+
const onMessage = (event) => {
|
|
114
|
+
if (event.source !== window.parent ||
|
|
115
|
+
typeof event.data !== 'object' ||
|
|
116
|
+
!event.data)
|
|
117
|
+
return;
|
|
118
|
+
const message = event.data;
|
|
119
|
+
if (message.type !== EVENT_TYPE ||
|
|
120
|
+
typeof message.event !== 'object' ||
|
|
121
|
+
!message.event)
|
|
122
|
+
return;
|
|
123
|
+
const value = message.event;
|
|
124
|
+
if (value.connectionId !== connection.connectionId ||
|
|
125
|
+
value.kind !== 'notification' ||
|
|
126
|
+
value.serviceUuid !== service ||
|
|
127
|
+
value.characteristicUuid !== characteristic ||
|
|
128
|
+
!Array.isArray(value.data))
|
|
129
|
+
return;
|
|
130
|
+
if (!value.data.every((byte) => Number.isInteger(byte) &&
|
|
131
|
+
Number(byte) >= 0 &&
|
|
132
|
+
Number(byte) <= 255)) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
listener(new DataView(Uint8Array.from(value.data).buffer));
|
|
136
|
+
};
|
|
137
|
+
window.addEventListener('message', onMessage);
|
|
138
|
+
try {
|
|
139
|
+
await nativeRequest(connection.connectionId, 'subscribe', { serviceUuid: service, characteristicUuid: characteristic }, options);
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
window.removeEventListener('message', onMessage);
|
|
143
|
+
throw error;
|
|
144
|
+
}
|
|
145
|
+
let cleanupPromise = null;
|
|
146
|
+
const cleanup = () => {
|
|
147
|
+
if (cleanupPromise)
|
|
148
|
+
return cleanupPromise;
|
|
149
|
+
window.removeEventListener('message', onMessage);
|
|
150
|
+
options?.signal?.removeEventListener('abort', handleAbort);
|
|
151
|
+
activeSubscriptions.delete(cleanup);
|
|
152
|
+
cleanupPromise = disconnected
|
|
153
|
+
? Promise.resolve()
|
|
154
|
+
: nativeRequest(connection.connectionId, 'unsubscribe', { serviceUuid: service, characteristicUuid: characteristic }, { timeoutMs: options?.timeoutMs }).then(() => undefined);
|
|
155
|
+
return cleanupPromise;
|
|
156
|
+
};
|
|
157
|
+
const handleAbort = () => void cleanup().catch(() => undefined);
|
|
158
|
+
activeSubscriptions.add(cleanup);
|
|
159
|
+
options?.signal?.addEventListener('abort', handleAbort, { once: true });
|
|
160
|
+
if (options?.signal?.aborted)
|
|
161
|
+
handleAbort();
|
|
162
|
+
return cleanup;
|
|
163
|
+
},
|
|
164
|
+
async disconnect(options) {
|
|
165
|
+
if (disconnected)
|
|
166
|
+
return;
|
|
167
|
+
window.removeEventListener('message', onLifecycleMessage);
|
|
168
|
+
const subscriptions = [...activeSubscriptions];
|
|
169
|
+
disconnected = true;
|
|
170
|
+
await Promise.allSettled(subscriptions.map((cleanup) => cleanup()));
|
|
171
|
+
try {
|
|
172
|
+
await nativeRequest(connection.connectionId, 'disconnect', {}, options);
|
|
173
|
+
}
|
|
174
|
+
finally {
|
|
175
|
+
events.dispatchEvent(new Event('gattserverdisconnected'));
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Uses Web Bluetooth first, with a restrictive desktop BLE chooser fallback.
|
|
182
|
+
* The native branch mirrors physical disconnect and adapter-loss events.
|
|
183
|
+
*/
|
|
184
|
+
export async function requestMoldableBluetoothWithFallback(options, bridgeOptions = {}) {
|
|
185
|
+
if (isMoldableBluetoothSupported()) {
|
|
186
|
+
return {
|
|
187
|
+
kind: 'web-bluetooth',
|
|
188
|
+
device: await requestMoldableBluetoothDevice(options, bridgeOptions),
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
if (!('filters' in options) || !options.filters?.length) {
|
|
192
|
+
throw new TypeError('The native Bluetooth fallback does not allow acceptAllDevices.');
|
|
193
|
+
}
|
|
194
|
+
const filters = options.filters.map((filter) => {
|
|
195
|
+
if (filter.manufacturerData?.length || filter.serviceData?.length) {
|
|
196
|
+
throw new TypeError('The native Bluetooth fallback does not support data filters yet.');
|
|
197
|
+
}
|
|
198
|
+
return {
|
|
199
|
+
name: filter.name,
|
|
200
|
+
namePrefix: filter.namePrefix,
|
|
201
|
+
services: filter.services?.map(uuid),
|
|
202
|
+
};
|
|
203
|
+
});
|
|
204
|
+
const result = await callNativeCapabilityBridge({
|
|
205
|
+
type: REQUEST_TYPE,
|
|
206
|
+
action: 'requestDevice',
|
|
207
|
+
filters,
|
|
208
|
+
optionalServices: options.optionalServices?.map(uuid) ?? [],
|
|
209
|
+
}, RESULT_TYPE, { timeoutMs: 120_000, ...bridgeOptions });
|
|
210
|
+
if (!isNativeConnectionResult(result)) {
|
|
211
|
+
throw new TypeError('The desktop returned an invalid Bluetooth device.');
|
|
212
|
+
}
|
|
213
|
+
return { kind: 'desktop-bridge', device: nativeDevice(result) };
|
|
214
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/** Local structural Web Bluetooth types for runtimes whose DOM library omits them. */
|
|
2
|
+
export type MoldableBluetoothUUID = string | number;
|
|
3
|
+
export interface MoldableBluetoothDataFilter {
|
|
4
|
+
dataPrefix?: BufferSource;
|
|
5
|
+
mask?: BufferSource;
|
|
6
|
+
}
|
|
7
|
+
export interface MoldableBluetoothManufacturerDataFilter extends MoldableBluetoothDataFilter {
|
|
8
|
+
companyIdentifier: number;
|
|
9
|
+
}
|
|
10
|
+
export interface MoldableBluetoothServiceDataFilter extends MoldableBluetoothDataFilter {
|
|
11
|
+
service: MoldableBluetoothUUID;
|
|
12
|
+
}
|
|
13
|
+
export interface MoldableBluetoothLEScanFilter {
|
|
14
|
+
name?: string;
|
|
15
|
+
namePrefix?: string;
|
|
16
|
+
services?: MoldableBluetoothUUID[];
|
|
17
|
+
manufacturerData?: MoldableBluetoothManufacturerDataFilter[];
|
|
18
|
+
serviceData?: MoldableBluetoothServiceDataFilter[];
|
|
19
|
+
}
|
|
20
|
+
export type MoldableBluetoothRequestDeviceOptions = {
|
|
21
|
+
filters: MoldableBluetoothLEScanFilter[];
|
|
22
|
+
acceptAllDevices?: false;
|
|
23
|
+
optionalServices?: MoldableBluetoothUUID[];
|
|
24
|
+
optionalManufacturerData?: number[];
|
|
25
|
+
} | {
|
|
26
|
+
filters?: never;
|
|
27
|
+
acceptAllDevices: true;
|
|
28
|
+
optionalServices?: MoldableBluetoothUUID[];
|
|
29
|
+
optionalManufacturerData?: number[];
|
|
30
|
+
};
|
|
31
|
+
export interface MoldableBluetoothRemoteGATTCharacteristic extends EventTarget {
|
|
32
|
+
readonly service: MoldableBluetoothRemoteGATTService;
|
|
33
|
+
readonly uuid: string;
|
|
34
|
+
readonly value?: DataView;
|
|
35
|
+
startNotifications(): Promise<MoldableBluetoothRemoteGATTCharacteristic>;
|
|
36
|
+
stopNotifications(): Promise<MoldableBluetoothRemoteGATTCharacteristic>;
|
|
37
|
+
readValue(): Promise<DataView>;
|
|
38
|
+
writeValue(value: BufferSource): Promise<void>;
|
|
39
|
+
writeValueWithResponse?(value: BufferSource): Promise<void>;
|
|
40
|
+
writeValueWithoutResponse?(value: BufferSource): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
export interface MoldableBluetoothRemoteGATTService {
|
|
43
|
+
readonly device: MoldableBluetoothDevice;
|
|
44
|
+
readonly isPrimary: boolean;
|
|
45
|
+
readonly uuid: string;
|
|
46
|
+
getCharacteristic(characteristic: MoldableBluetoothUUID): Promise<MoldableBluetoothRemoteGATTCharacteristic>;
|
|
47
|
+
getCharacteristics(characteristic?: MoldableBluetoothUUID): Promise<MoldableBluetoothRemoteGATTCharacteristic[]>;
|
|
48
|
+
}
|
|
49
|
+
export interface MoldableBluetoothRemoteGATTServer {
|
|
50
|
+
readonly connected: boolean;
|
|
51
|
+
readonly device: MoldableBluetoothDevice;
|
|
52
|
+
connect(): Promise<MoldableBluetoothRemoteGATTServer>;
|
|
53
|
+
disconnect(): void;
|
|
54
|
+
getPrimaryService(service: MoldableBluetoothUUID): Promise<MoldableBluetoothRemoteGATTService>;
|
|
55
|
+
getPrimaryServices(service?: MoldableBluetoothUUID): Promise<MoldableBluetoothRemoteGATTService[]>;
|
|
56
|
+
}
|
|
57
|
+
export interface MoldableBluetoothDeviceEventMap {
|
|
58
|
+
gattserverdisconnected: Event;
|
|
59
|
+
}
|
|
60
|
+
export interface MoldableBluetoothDevice extends EventTarget {
|
|
61
|
+
readonly id: string;
|
|
62
|
+
readonly name?: string;
|
|
63
|
+
readonly gatt?: MoldableBluetoothRemoteGATTServer;
|
|
64
|
+
addEventListener<K extends keyof MoldableBluetoothDeviceEventMap>(type: K, listener: (event: MoldableBluetoothDeviceEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
65
|
+
removeEventListener<K extends keyof MoldableBluetoothDeviceEventMap>(type: K, listener: (event: MoldableBluetoothDeviceEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
66
|
+
}
|
|
67
|
+
export interface MoldableBluetoothAPI {
|
|
68
|
+
getAvailability?(): Promise<boolean>;
|
|
69
|
+
requestDevice(options: MoldableBluetoothRequestDeviceOptions): Promise<MoldableBluetoothDevice>;
|
|
70
|
+
}
|
|
71
|
+
export interface MoldableBluetoothNavigator extends Navigator {
|
|
72
|
+
bluetooth?: MoldableBluetoothAPI;
|
|
73
|
+
}
|
|
74
|
+
export type MoldableBluetoothAvailability = 'available' | 'unavailable' | 'unknown';
|
|
75
|
+
export interface MoldableBluetoothRequestOptions {
|
|
76
|
+
signal?: AbortSignal;
|
|
77
|
+
}
|
|
78
|
+
export interface MoldableBluetoothConnectionOptions {
|
|
79
|
+
signal?: AbortSignal;
|
|
80
|
+
}
|
|
81
|
+
export interface MoldableBluetoothOperationOptions {
|
|
82
|
+
signal?: AbortSignal;
|
|
83
|
+
}
|
|
84
|
+
export type MoldableBluetoothWriteMode = 'with-response' | 'without-response' | 'automatic';
|
|
85
|
+
//# sourceMappingURL=bluetooth-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bluetooth-types.d.ts","sourceRoot":"","sources":["../../../src/lib/native-capabilities/bluetooth-types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { getMoldableBluetoothAvailability, isMoldableBluetoothSupported, requestMoldableBluetoothDevice, } from './bluetooth-access';
|
|
2
|
+
export { connectMoldableBluetoothDevice, MoldableBluetoothConnection, } from './bluetooth-connection';
|
|
3
|
+
export { getMoldableBluetoothCharacteristic, observeMoldableBluetoothNotifications, readMoldableBluetoothValue, writeMoldableBluetoothValue, } from './bluetooth-gatt';
|
|
4
|
+
export type * from './bluetooth-types';
|
|
5
|
+
export { requestMoldableBluetoothWithFallback } from './bluetooth-native-fallback';
|
|
6
|
+
export type { MoldableBluetoothTransport, MoldableNativeBluetoothDevice, MoldableNativeBluetoothService, } from './bluetooth-native-fallback';
|
|
7
|
+
//# sourceMappingURL=bluetooth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bluetooth.d.ts","sourceRoot":"","sources":["../../../src/lib/native-capabilities/bluetooth.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,GAC5B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,kCAAkC,EAClC,qCAAqC,EACrC,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,kBAAkB,CAAA;AACzB,mBAAmB,mBAAmB,CAAA;AACtC,OAAO,EAAE,oCAAoC,EAAE,MAAM,6BAA6B,CAAA;AAClF,YAAY,EACV,0BAA0B,EAC1B,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,6BAA6B,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { getMoldableBluetoothAvailability, isMoldableBluetoothSupported, requestMoldableBluetoothDevice, } from './bluetooth-access';
|
|
2
|
+
export { connectMoldableBluetoothDevice, MoldableBluetoothConnection, } from './bluetooth-connection';
|
|
3
|
+
export { getMoldableBluetoothCharacteristic, observeMoldableBluetoothNotifications, readMoldableBluetoothValue, writeMoldableBluetoothValue, } from './bluetooth-gatt';
|
|
4
|
+
export { requestMoldableBluetoothWithFallback } from './bluetooth-native-fallback';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type NativeCapabilityErrorCode, type NativeCapabilityErrorPayload, type NativeCapabilityManifest } from './types';
|
|
2
|
+
export declare const NATIVE_CAPABILITY_CANCEL_REQUEST_TYPE: "moldable:native-capabilities-cancel";
|
|
3
|
+
export interface NativeCapabilityBridgeOptions {
|
|
4
|
+
timeoutMs?: number;
|
|
5
|
+
signal?: AbortSignal;
|
|
6
|
+
}
|
|
7
|
+
export declare class NativeCapabilityBridgeError extends Error {
|
|
8
|
+
readonly code: NativeCapabilityErrorCode;
|
|
9
|
+
readonly details?: unknown;
|
|
10
|
+
readonly retryable?: boolean;
|
|
11
|
+
constructor(error: NativeCapabilityErrorPayload);
|
|
12
|
+
}
|
|
13
|
+
export declare function toNativeCapabilityBridgeError(value: unknown, fallbackMessage?: string): NativeCapabilityBridgeError;
|
|
14
|
+
/** Resolve only desktop-owned parent origins; unknown embedders fail closed. */
|
|
15
|
+
export declare function resolveNativeCapabilityParentOrigin(referrer: string, immediateAncestorOrigin?: string, currentOrigin?: string, allowDevelopmentOrigin?: boolean): string | null;
|
|
16
|
+
export declare function callNativeCapabilityBridge<TResult>(request: {
|
|
17
|
+
type: string;
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
}, responseType: string, options?: NativeCapabilityBridgeOptions): Promise<TResult>;
|
|
20
|
+
export declare function getNativeCapabilities(options?: NativeCapabilityBridgeOptions): Promise<NativeCapabilityManifest>;
|
|
21
|
+
/** Public app-author API for querying the host's native capability manifest. */
|
|
22
|
+
export declare const getMoldableNativeCapabilities: typeof getNativeCapabilities;
|
|
23
|
+
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../../src/lib/native-capabilities/bridge.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC9B,MAAM,SAAS,CAAA;AAGhB,eAAO,MAAM,qCAAqC,EAChD,qCAA8C,CAAA;AAchD,MAAM,WAAW,6BAA6B;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAED,qBAAa,2BAA4B,SAAQ,KAAK;IACpD,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAA;IACxC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;gBAEhB,KAAK,EAAE,4BAA4B;CAOhD;AAiBD,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,OAAO,EACd,eAAe,SAAsC,GACpD,2BAA2B,CAW7B;AA6FD,gFAAgF;AAChF,wBAAgB,mCAAmC,CACjD,QAAQ,EAAE,MAAM,EAChB,uBAAuB,SAAgC,EACvD,aAAa,SAAyB,EACtC,sBAAsB,UAAmC,GACxD,MAAM,GAAG,IAAI,CAoBf;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAChD,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EACjD,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,6BAAkC,GAC1C,OAAO,CAAC,OAAO,CAAC,CAqIlB;AAED,wBAAsB,qBAAqB,CACzC,OAAO,GAAE,6BAAkC,GAC1C,OAAO,CAAC,wBAAwB,CAAC,CAiBnC;AAED,gFAAgF;AAChF,eAAO,MAAM,6BAA6B,8BAAwB,CAAA"}
|