@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,86 @@
|
|
|
1
|
+
import { type NativeHardwareBridgeOptions } from './bridge';
|
|
2
|
+
import type { NativeHardwareRequestEnvelope, NativeHardwareResultEnvelope } from './types';
|
|
3
|
+
export declare const NATIVE_GLOBAL_SHORTCUT_REQUEST_TYPE: "moldable:native-global-shortcuts";
|
|
4
|
+
export declare const NATIVE_GLOBAL_SHORTCUT_RESULT_TYPE: "moldable:native-global-shortcuts-result";
|
|
5
|
+
export declare const NATIVE_GLOBAL_SHORTCUT_EVENT_TYPE: "moldable:native-global-shortcut-event";
|
|
6
|
+
export declare const NATIVE_GLOBAL_SHORTCUT_MAX_LENGTH = 128;
|
|
7
|
+
export declare const NATIVE_GLOBAL_SHORTCUT_MAX_PER_APP = 32;
|
|
8
|
+
export type MoldableGlobalShortcutState = 'Pressed' | 'Released';
|
|
9
|
+
export interface MoldableGlobalShortcutEvent {
|
|
10
|
+
registrationId: string;
|
|
11
|
+
shortcut: string;
|
|
12
|
+
state: MoldableGlobalShortcutState;
|
|
13
|
+
}
|
|
14
|
+
export type MoldableGlobalShortcutHandler = (event: MoldableGlobalShortcutEvent) => void;
|
|
15
|
+
export interface MoldableGlobalShortcutRegistration {
|
|
16
|
+
readonly registrationId: string;
|
|
17
|
+
readonly shortcut: string;
|
|
18
|
+
unregister(options?: NativeHardwareBridgeOptions): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export interface NativeGlobalShortcutRegistrationInput {
|
|
21
|
+
registrationId: string;
|
|
22
|
+
shortcut: string;
|
|
23
|
+
}
|
|
24
|
+
export type NativeGlobalShortcutRequest = NativeHardwareRequestEnvelope<typeof NATIVE_GLOBAL_SHORTCUT_REQUEST_TYPE, {
|
|
25
|
+
capability: 'global-shortcuts';
|
|
26
|
+
action: 'register';
|
|
27
|
+
registrationId: string;
|
|
28
|
+
shortcut: string;
|
|
29
|
+
} | {
|
|
30
|
+
capability: 'global-shortcuts';
|
|
31
|
+
action: 'unregister';
|
|
32
|
+
registrationId: string;
|
|
33
|
+
} | {
|
|
34
|
+
capability: 'global-shortcuts';
|
|
35
|
+
action: 'unregisterAll';
|
|
36
|
+
} | {
|
|
37
|
+
capability: 'global-shortcuts';
|
|
38
|
+
action: 'registerAll';
|
|
39
|
+
registrations: NativeGlobalShortcutRegistrationInput[];
|
|
40
|
+
} | {
|
|
41
|
+
capability: 'global-shortcuts';
|
|
42
|
+
action: 'isRegistered';
|
|
43
|
+
shortcut: string;
|
|
44
|
+
} | {
|
|
45
|
+
capability: 'global-shortcuts';
|
|
46
|
+
action: 'setSuspended';
|
|
47
|
+
suspended: boolean;
|
|
48
|
+
} | {
|
|
49
|
+
capability: 'global-shortcuts';
|
|
50
|
+
action: 'isSuspended';
|
|
51
|
+
}>;
|
|
52
|
+
export interface NativeGlobalShortcutRegistrationResult {
|
|
53
|
+
registered: true;
|
|
54
|
+
registrationId: string;
|
|
55
|
+
shortcut: string;
|
|
56
|
+
}
|
|
57
|
+
export interface NativeGlobalShortcutUnregisterResult {
|
|
58
|
+
unregistered: true;
|
|
59
|
+
registrationId: string;
|
|
60
|
+
}
|
|
61
|
+
export interface NativeGlobalShortcutUnregisterAllResult {
|
|
62
|
+
unregisteredCount: number;
|
|
63
|
+
}
|
|
64
|
+
export interface NativeGlobalShortcutRegisterAllResult {
|
|
65
|
+
registered: true;
|
|
66
|
+
registrations: NativeGlobalShortcutRegistrationResult[];
|
|
67
|
+
}
|
|
68
|
+
export interface NativeGlobalShortcutIsRegisteredResult {
|
|
69
|
+
registered: boolean;
|
|
70
|
+
shortcut: string;
|
|
71
|
+
}
|
|
72
|
+
export interface NativeGlobalShortcutSuspendedResult {
|
|
73
|
+
suspended: boolean;
|
|
74
|
+
}
|
|
75
|
+
export type NativeGlobalShortcutResult = NativeHardwareResultEnvelope<typeof NATIVE_GLOBAL_SHORTCUT_RESULT_TYPE, NativeGlobalShortcutRegistrationResult | NativeGlobalShortcutUnregisterResult | NativeGlobalShortcutUnregisterAllResult | NativeGlobalShortcutRegisterAllResult | NativeGlobalShortcutIsRegisteredResult | NativeGlobalShortcutSuspendedResult>;
|
|
76
|
+
export declare function isMoldableGlobalShortcut(value: unknown): value is string;
|
|
77
|
+
export declare function registerMoldableGlobalShortcut(shortcut: string, handler: MoldableGlobalShortcutHandler, options?: NativeHardwareBridgeOptions): Promise<MoldableGlobalShortcutRegistration>;
|
|
78
|
+
export declare function registerAllMoldableGlobalShortcuts(shortcuts: readonly string[], handler: MoldableGlobalShortcutHandler, options?: NativeHardwareBridgeOptions): Promise<MoldableGlobalShortcutRegistration[]>;
|
|
79
|
+
export declare function isMoldableGlobalShortcutRegistered(shortcut: string, options?: NativeHardwareBridgeOptions): Promise<boolean>;
|
|
80
|
+
export declare function setMoldableGlobalShortcutsSuspended(suspended: boolean, options?: NativeHardwareBridgeOptions): Promise<void>;
|
|
81
|
+
export declare function areMoldableGlobalShortcutsSuspended(options?: NativeHardwareBridgeOptions): Promise<boolean>;
|
|
82
|
+
export declare function unregisterMoldableGlobalShortcut(registrationId: string, options?: NativeHardwareBridgeOptions): Promise<void>;
|
|
83
|
+
export declare function unregisterAllMoldableGlobalShortcuts(options?: NativeHardwareBridgeOptions): Promise<NativeGlobalShortcutUnregisterAllResult>;
|
|
84
|
+
/** Test-only reset for module-level event delivery state. */
|
|
85
|
+
export declare function resetMoldableGlobalShortcutClientForTests(): void;
|
|
86
|
+
//# sourceMappingURL=global-shortcuts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-shortcuts.d.ts","sourceRoot":"","sources":["../../../src/lib/native-hardware/global-shortcuts.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import { NativeHardwareBridgeError, callNativeHardwareBridge, } from './bridge';
|
|
2
|
+
export const NATIVE_GLOBAL_SHORTCUT_REQUEST_TYPE = 'moldable:native-global-shortcuts';
|
|
3
|
+
export const NATIVE_GLOBAL_SHORTCUT_RESULT_TYPE = 'moldable:native-global-shortcuts-result';
|
|
4
|
+
export const NATIVE_GLOBAL_SHORTCUT_EVENT_TYPE = 'moldable:native-global-shortcut-event';
|
|
5
|
+
export const NATIVE_GLOBAL_SHORTCUT_MAX_LENGTH = 128;
|
|
6
|
+
export const NATIVE_GLOBAL_SHORTCUT_MAX_PER_APP = 32;
|
|
7
|
+
const MODIFIERS = new Set([
|
|
8
|
+
'alt',
|
|
9
|
+
'altgr',
|
|
10
|
+
'capslock',
|
|
11
|
+
'cmd',
|
|
12
|
+
'cmdorctrl',
|
|
13
|
+
'command',
|
|
14
|
+
'commandorcontrol',
|
|
15
|
+
'control',
|
|
16
|
+
'ctrl',
|
|
17
|
+
'fn',
|
|
18
|
+
'fnlock',
|
|
19
|
+
'hyper',
|
|
20
|
+
'meta',
|
|
21
|
+
'numlock',
|
|
22
|
+
'option',
|
|
23
|
+
'scrolllock',
|
|
24
|
+
'shift',
|
|
25
|
+
'super',
|
|
26
|
+
'symbol',
|
|
27
|
+
'symbollock',
|
|
28
|
+
]);
|
|
29
|
+
const handlers = new Map();
|
|
30
|
+
const pendingEvents = new Map();
|
|
31
|
+
const MAX_PENDING_REGISTRATIONS = 64;
|
|
32
|
+
let listeningWindow = null;
|
|
33
|
+
function isRecord(value) {
|
|
34
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
35
|
+
}
|
|
36
|
+
export function isMoldableGlobalShortcut(value) {
|
|
37
|
+
if (typeof value !== 'string' || value !== value.trim())
|
|
38
|
+
return false;
|
|
39
|
+
if (value.length < 3 || value.length > NATIVE_GLOBAL_SHORTCUT_MAX_LENGTH) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
if (/\s/u.test(value) ||
|
|
43
|
+
[...value].some((character) => {
|
|
44
|
+
const code = character.charCodeAt(0);
|
|
45
|
+
return code <= 31 || code === 127;
|
|
46
|
+
})) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
const parts = value.split('+');
|
|
50
|
+
if (parts.length < 2 || parts.length > 8)
|
|
51
|
+
return false;
|
|
52
|
+
if (parts.some((part) => !/^[A-Za-z0-9]{1,32}$/u.test(part)))
|
|
53
|
+
return false;
|
|
54
|
+
const normalized = parts.map((part) => part.toLowerCase());
|
|
55
|
+
if (new Set(normalized).size !== normalized.length)
|
|
56
|
+
return false;
|
|
57
|
+
if (!normalized.slice(0, -1).every((part) => MODIFIERS.has(part))) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
return !MODIFIERS.has(normalized[normalized.length - 1] ?? '');
|
|
61
|
+
}
|
|
62
|
+
function isGlobalShortcutEvent(value) {
|
|
63
|
+
return (isRecord(value) &&
|
|
64
|
+
value.type === NATIVE_GLOBAL_SHORTCUT_EVENT_TYPE &&
|
|
65
|
+
typeof value.registrationId === 'string' &&
|
|
66
|
+
value.registrationId.length > 0 &&
|
|
67
|
+
isMoldableGlobalShortcut(value.shortcut) &&
|
|
68
|
+
(value.state === 'Pressed' || value.state === 'Released'));
|
|
69
|
+
}
|
|
70
|
+
function handleShortcutMessage(event) {
|
|
71
|
+
if (event.source !== window.parent || !isGlobalShortcutEvent(event.data)) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const handler = handlers.get(event.data.registrationId);
|
|
75
|
+
if (handler) {
|
|
76
|
+
try {
|
|
77
|
+
handler({
|
|
78
|
+
registrationId: event.data.registrationId,
|
|
79
|
+
shortcut: event.data.shortcut,
|
|
80
|
+
state: event.data.state,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// One app callback must not break delivery for other registrations.
|
|
85
|
+
}
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (!pendingEvents.has(event.data.registrationId) &&
|
|
89
|
+
pendingEvents.size >= MAX_PENDING_REGISTRATIONS) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const queued = pendingEvents.get(event.data.registrationId) ?? [];
|
|
93
|
+
if (queued.length < 4)
|
|
94
|
+
queued.push(event.data);
|
|
95
|
+
pendingEvents.set(event.data.registrationId, queued);
|
|
96
|
+
}
|
|
97
|
+
function ensureGlobalShortcutListener() {
|
|
98
|
+
if (typeof window === 'undefined' || listeningWindow === window)
|
|
99
|
+
return;
|
|
100
|
+
if (listeningWindow) {
|
|
101
|
+
listeningWindow.removeEventListener('message', handleShortcutMessage);
|
|
102
|
+
}
|
|
103
|
+
window.addEventListener('message', handleShortcutMessage);
|
|
104
|
+
listeningWindow = window;
|
|
105
|
+
}
|
|
106
|
+
function bindHandler(registrationId, handler) {
|
|
107
|
+
handlers.set(registrationId, handler);
|
|
108
|
+
const queued = pendingEvents.get(registrationId) ?? [];
|
|
109
|
+
pendingEvents.delete(registrationId);
|
|
110
|
+
for (const event of queued) {
|
|
111
|
+
try {
|
|
112
|
+
handler({
|
|
113
|
+
registrationId: event.registrationId,
|
|
114
|
+
shortcut: event.shortcut,
|
|
115
|
+
state: event.state,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
// Callback errors do not change a successfully created registration.
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function invalidShortcutError() {
|
|
124
|
+
return new NativeHardwareBridgeError({
|
|
125
|
+
code: 'invalid_request',
|
|
126
|
+
message: 'A global shortcut must contain modifiers and one key, for example CommandOrControl+Shift+P.',
|
|
127
|
+
retryable: false,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function canonicalShortcut(shortcut) {
|
|
131
|
+
const aliases = {
|
|
132
|
+
cmd: 'meta',
|
|
133
|
+
command: 'meta',
|
|
134
|
+
cmdorctrl: 'commandorcontrol',
|
|
135
|
+
ctrl: 'control',
|
|
136
|
+
option: 'alt',
|
|
137
|
+
};
|
|
138
|
+
return shortcut
|
|
139
|
+
.split('+')
|
|
140
|
+
.map((part) => aliases[part.toLowerCase()] ?? part.toLowerCase())
|
|
141
|
+
.join('+');
|
|
142
|
+
}
|
|
143
|
+
function makeRegistrationId() {
|
|
144
|
+
if (typeof crypto !== 'undefined' && 'randomUUID' in crypto) {
|
|
145
|
+
return `native-shortcut-${crypto.randomUUID()}`;
|
|
146
|
+
}
|
|
147
|
+
return `native-shortcut-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
148
|
+
}
|
|
149
|
+
function makeRegistration(result) {
|
|
150
|
+
let active = true;
|
|
151
|
+
return {
|
|
152
|
+
registrationId: result.registrationId,
|
|
153
|
+
shortcut: result.shortcut,
|
|
154
|
+
async unregister(unregisterOptions = {}) {
|
|
155
|
+
if (!active)
|
|
156
|
+
return;
|
|
157
|
+
await unregisterMoldableGlobalShortcut(result.registrationId, unregisterOptions);
|
|
158
|
+
active = false;
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
export async function registerMoldableGlobalShortcut(shortcut, handler, options = {}) {
|
|
163
|
+
if (!isMoldableGlobalShortcut(shortcut) || typeof handler !== 'function') {
|
|
164
|
+
throw invalidShortcutError();
|
|
165
|
+
}
|
|
166
|
+
ensureGlobalShortcutListener();
|
|
167
|
+
const registrationId = makeRegistrationId();
|
|
168
|
+
let result;
|
|
169
|
+
try {
|
|
170
|
+
result =
|
|
171
|
+
await callNativeHardwareBridge({
|
|
172
|
+
type: NATIVE_GLOBAL_SHORTCUT_REQUEST_TYPE,
|
|
173
|
+
capability: 'global-shortcuts',
|
|
174
|
+
action: 'register',
|
|
175
|
+
registrationId,
|
|
176
|
+
shortcut,
|
|
177
|
+
}, NATIVE_GLOBAL_SHORTCUT_RESULT_TYPE, options);
|
|
178
|
+
if (result.registered !== true ||
|
|
179
|
+
result.registrationId !== registrationId ||
|
|
180
|
+
result.shortcut !== shortcut) {
|
|
181
|
+
throw new NativeHardwareBridgeError({
|
|
182
|
+
code: 'invalid_response',
|
|
183
|
+
message: 'Moldable returned an invalid global shortcut registration.',
|
|
184
|
+
details: result,
|
|
185
|
+
retryable: false,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
if (error instanceof NativeHardwareBridgeError &&
|
|
191
|
+
(error.code === 'timeout' ||
|
|
192
|
+
error.code === 'aborted' ||
|
|
193
|
+
error.code === 'invalid_response')) {
|
|
194
|
+
void unregisterMoldableGlobalShortcut(registrationId).catch(() => {
|
|
195
|
+
// App-view teardown remains the final cleanup boundary.
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
throw error;
|
|
199
|
+
}
|
|
200
|
+
bindHandler(result.registrationId, handler);
|
|
201
|
+
return makeRegistration(result);
|
|
202
|
+
}
|
|
203
|
+
export async function registerAllMoldableGlobalShortcuts(shortcuts, handler, options = {}) {
|
|
204
|
+
if (!Array.isArray(shortcuts) ||
|
|
205
|
+
shortcuts.length === 0 ||
|
|
206
|
+
shortcuts.length > NATIVE_GLOBAL_SHORTCUT_MAX_PER_APP ||
|
|
207
|
+
typeof handler !== 'function' ||
|
|
208
|
+
!shortcuts.every(isMoldableGlobalShortcut) ||
|
|
209
|
+
new Set(shortcuts.map(canonicalShortcut)).size !== shortcuts.length) {
|
|
210
|
+
throw invalidShortcutError();
|
|
211
|
+
}
|
|
212
|
+
ensureGlobalShortcutListener();
|
|
213
|
+
const registrations = shortcuts.map((shortcut) => ({
|
|
214
|
+
registrationId: makeRegistrationId(),
|
|
215
|
+
shortcut,
|
|
216
|
+
}));
|
|
217
|
+
let result;
|
|
218
|
+
try {
|
|
219
|
+
result =
|
|
220
|
+
await callNativeHardwareBridge({
|
|
221
|
+
type: NATIVE_GLOBAL_SHORTCUT_REQUEST_TYPE,
|
|
222
|
+
capability: 'global-shortcuts',
|
|
223
|
+
action: 'registerAll',
|
|
224
|
+
registrations,
|
|
225
|
+
}, NATIVE_GLOBAL_SHORTCUT_RESULT_TYPE, options);
|
|
226
|
+
if (result.registered !== true ||
|
|
227
|
+
!Array.isArray(result.registrations) ||
|
|
228
|
+
result.registrations.length !== registrations.length ||
|
|
229
|
+
result.registrations.some((registered, index) => {
|
|
230
|
+
const requested = registrations[index];
|
|
231
|
+
return (registered.registered !== true ||
|
|
232
|
+
registered.registrationId !== requested?.registrationId ||
|
|
233
|
+
registered.shortcut !== requested.shortcut);
|
|
234
|
+
})) {
|
|
235
|
+
throw new NativeHardwareBridgeError({
|
|
236
|
+
code: 'invalid_response',
|
|
237
|
+
message: 'Moldable returned invalid global shortcut registrations.',
|
|
238
|
+
details: result,
|
|
239
|
+
retryable: false,
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
catch (error) {
|
|
244
|
+
if (error instanceof NativeHardwareBridgeError &&
|
|
245
|
+
(error.code === 'timeout' ||
|
|
246
|
+
error.code === 'aborted' ||
|
|
247
|
+
error.code === 'host_error' ||
|
|
248
|
+
error.code === 'invalid_response')) {
|
|
249
|
+
void Promise.allSettled(registrations.map((registration) => unregisterMoldableGlobalShortcut(registration.registrationId)));
|
|
250
|
+
}
|
|
251
|
+
throw error;
|
|
252
|
+
}
|
|
253
|
+
for (const registration of result.registrations) {
|
|
254
|
+
bindHandler(registration.registrationId, handler);
|
|
255
|
+
}
|
|
256
|
+
return result.registrations.map(makeRegistration);
|
|
257
|
+
}
|
|
258
|
+
export async function isMoldableGlobalShortcutRegistered(shortcut, options = {}) {
|
|
259
|
+
if (!isMoldableGlobalShortcut(shortcut))
|
|
260
|
+
throw invalidShortcutError();
|
|
261
|
+
const result = await callNativeHardwareBridge({
|
|
262
|
+
type: NATIVE_GLOBAL_SHORTCUT_REQUEST_TYPE,
|
|
263
|
+
capability: 'global-shortcuts',
|
|
264
|
+
action: 'isRegistered',
|
|
265
|
+
shortcut,
|
|
266
|
+
}, NATIVE_GLOBAL_SHORTCUT_RESULT_TYPE, options);
|
|
267
|
+
if (typeof result.registered !== 'boolean' || result.shortcut !== shortcut) {
|
|
268
|
+
throw new NativeHardwareBridgeError({
|
|
269
|
+
code: 'invalid_response',
|
|
270
|
+
message: 'Moldable returned an invalid global shortcut status.',
|
|
271
|
+
details: result,
|
|
272
|
+
retryable: false,
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
return result.registered;
|
|
276
|
+
}
|
|
277
|
+
export async function setMoldableGlobalShortcutsSuspended(suspended, options = {}) {
|
|
278
|
+
if (typeof suspended !== 'boolean') {
|
|
279
|
+
throw new NativeHardwareBridgeError({
|
|
280
|
+
code: 'invalid_request',
|
|
281
|
+
message: 'Global shortcut suspension must be a boolean.',
|
|
282
|
+
retryable: false,
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
const result = await callNativeHardwareBridge({
|
|
286
|
+
type: NATIVE_GLOBAL_SHORTCUT_REQUEST_TYPE,
|
|
287
|
+
capability: 'global-shortcuts',
|
|
288
|
+
action: 'setSuspended',
|
|
289
|
+
suspended,
|
|
290
|
+
}, NATIVE_GLOBAL_SHORTCUT_RESULT_TYPE, options);
|
|
291
|
+
if (result.suspended !== suspended) {
|
|
292
|
+
throw new NativeHardwareBridgeError({
|
|
293
|
+
code: 'invalid_response',
|
|
294
|
+
message: 'Moldable returned an invalid global shortcut suspension state.',
|
|
295
|
+
details: result,
|
|
296
|
+
retryable: false,
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
export async function areMoldableGlobalShortcutsSuspended(options = {}) {
|
|
301
|
+
const result = await callNativeHardwareBridge({
|
|
302
|
+
type: NATIVE_GLOBAL_SHORTCUT_REQUEST_TYPE,
|
|
303
|
+
capability: 'global-shortcuts',
|
|
304
|
+
action: 'isSuspended',
|
|
305
|
+
}, NATIVE_GLOBAL_SHORTCUT_RESULT_TYPE, options);
|
|
306
|
+
if (typeof result.suspended !== 'boolean') {
|
|
307
|
+
throw new NativeHardwareBridgeError({
|
|
308
|
+
code: 'invalid_response',
|
|
309
|
+
message: 'Moldable returned an invalid global shortcut suspension state.',
|
|
310
|
+
details: result,
|
|
311
|
+
retryable: false,
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
return result.suspended;
|
|
315
|
+
}
|
|
316
|
+
export async function unregisterMoldableGlobalShortcut(registrationId, options = {}) {
|
|
317
|
+
if (registrationId.trim().length === 0 || registrationId.length > 128) {
|
|
318
|
+
throw new NativeHardwareBridgeError({
|
|
319
|
+
code: 'invalid_request',
|
|
320
|
+
message: 'A valid global shortcut registration ID is required.',
|
|
321
|
+
retryable: false,
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
await callNativeHardwareBridge({
|
|
325
|
+
type: NATIVE_GLOBAL_SHORTCUT_REQUEST_TYPE,
|
|
326
|
+
capability: 'global-shortcuts',
|
|
327
|
+
action: 'unregister',
|
|
328
|
+
registrationId,
|
|
329
|
+
}, NATIVE_GLOBAL_SHORTCUT_RESULT_TYPE, options);
|
|
330
|
+
handlers.delete(registrationId);
|
|
331
|
+
pendingEvents.delete(registrationId);
|
|
332
|
+
}
|
|
333
|
+
export async function unregisterAllMoldableGlobalShortcuts(options = {}) {
|
|
334
|
+
const result = await callNativeHardwareBridge({
|
|
335
|
+
type: NATIVE_GLOBAL_SHORTCUT_REQUEST_TYPE,
|
|
336
|
+
capability: 'global-shortcuts',
|
|
337
|
+
action: 'unregisterAll',
|
|
338
|
+
}, NATIVE_GLOBAL_SHORTCUT_RESULT_TYPE, options);
|
|
339
|
+
handlers.clear();
|
|
340
|
+
pendingEvents.clear();
|
|
341
|
+
return result;
|
|
342
|
+
}
|
|
343
|
+
/** Test-only reset for module-level event delivery state. */
|
|
344
|
+
export function resetMoldableGlobalShortcutClientForTests() {
|
|
345
|
+
if (listeningWindow) {
|
|
346
|
+
listeningWindow.removeEventListener('message', handleShortcutMessage);
|
|
347
|
+
}
|
|
348
|
+
listeningWindow = null;
|
|
349
|
+
handlers.clear();
|
|
350
|
+
pendingEvents.clear();
|
|
351
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type NativeHardwareBridgeOptions } from './bridge';
|
|
2
|
+
export declare const NATIVE_HAPTICS_REQUEST_TYPE: "moldable:native-haptics";
|
|
3
|
+
export declare const NATIVE_HAPTICS_RESULT_TYPE: "moldable:native-haptics-result";
|
|
4
|
+
export type MoldableHapticPattern = 'generic' | 'alignment' | 'level-change';
|
|
5
|
+
export interface MoldableHapticAvailability {
|
|
6
|
+
/** Compatibility alias for apiAvailable. */
|
|
7
|
+
available: boolean;
|
|
8
|
+
/** Whether the host can submit feedback requests to the operating system. */
|
|
9
|
+
apiAvailable: boolean;
|
|
10
|
+
/** Physical haptic hardware cannot be detected reliably by the macOS API. */
|
|
11
|
+
hardwareStatus: 'unknown' | 'unavailable';
|
|
12
|
+
patterns: MoldableHapticPattern[];
|
|
13
|
+
reason?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface MoldableHapticResult {
|
|
16
|
+
/** Compatibility alias indicating that the OS accepted the request. */
|
|
17
|
+
performed: true;
|
|
18
|
+
accepted: true;
|
|
19
|
+
/** macOS does not report whether compatible hardware produced feedback. */
|
|
20
|
+
physicalFeedback: 'unknown';
|
|
21
|
+
pattern: MoldableHapticPattern;
|
|
22
|
+
}
|
|
23
|
+
export declare function getMoldableHapticAvailability(options?: NativeHardwareBridgeOptions): Promise<MoldableHapticAvailability>;
|
|
24
|
+
export declare function performMoldableHapticFeedback(pattern?: MoldableHapticPattern, options?: NativeHardwareBridgeOptions): Promise<MoldableHapticResult>;
|
|
25
|
+
//# sourceMappingURL=haptics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"haptics.d.ts","sourceRoot":"","sources":["../../../src/lib/native-hardware/haptics.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,UAAU,CAAA;AAEjB,eAAO,MAAM,2BAA2B,EAAG,yBAAkC,CAAA;AAC7E,eAAO,MAAM,0BAA0B,EACrC,gCAAyC,CAAA;AAE3C,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,WAAW,GAAG,cAAc,CAAA;AAE5E,MAAM,WAAW,0BAA0B;IACzC,4CAA4C;IAC5C,SAAS,EAAE,OAAO,CAAA;IAClB,6EAA6E;IAC7E,YAAY,EAAE,OAAO,CAAA;IACrB,6EAA6E;IAC7E,cAAc,EAAE,SAAS,GAAG,aAAa,CAAA;IACzC,QAAQ,EAAE,qBAAqB,EAAE,CAAA;IACjC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,uEAAuE;IACvE,SAAS,EAAE,IAAI,CAAA;IACf,QAAQ,EAAE,IAAI,CAAA;IACd,2EAA2E;IAC3E,gBAAgB,EAAE,SAAS,CAAA;IAC3B,OAAO,EAAE,qBAAqB,CAAA;CAC/B;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,0BAA0B,CAAC,CAUrC;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,GAAE,qBAAiC,EAC1C,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,oBAAoB,CAAC,CAW/B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { callNativeHardwareBridge, } from './bridge';
|
|
2
|
+
export const NATIVE_HAPTICS_REQUEST_TYPE = 'moldable:native-haptics';
|
|
3
|
+
export const NATIVE_HAPTICS_RESULT_TYPE = 'moldable:native-haptics-result';
|
|
4
|
+
export function getMoldableHapticAvailability(options = {}) {
|
|
5
|
+
return callNativeHardwareBridge({
|
|
6
|
+
type: NATIVE_HAPTICS_REQUEST_TYPE,
|
|
7
|
+
capability: 'haptics',
|
|
8
|
+
action: 'getAvailability',
|
|
9
|
+
}, NATIVE_HAPTICS_RESULT_TYPE, options);
|
|
10
|
+
}
|
|
11
|
+
export function performMoldableHapticFeedback(pattern = 'generic', options = {}) {
|
|
12
|
+
return callNativeHardwareBridge({
|
|
13
|
+
type: NATIVE_HAPTICS_REQUEST_TYPE,
|
|
14
|
+
capability: 'haptics',
|
|
15
|
+
action: 'perform',
|
|
16
|
+
pattern,
|
|
17
|
+
}, NATIVE_HAPTICS_RESULT_TYPE, options);
|
|
18
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { MoldableHidDevice, MoldableHidInputReportEvent } from './hid';
|
|
2
|
+
import { type MoldableNativeDeviceDescriptor } from './native-device-io';
|
|
3
|
+
export declare class NativeMoldableHidDevice extends EventTarget implements MoldableHidDevice {
|
|
4
|
+
readonly descriptor: MoldableNativeDeviceDescriptor;
|
|
5
|
+
readonly vendorId: number;
|
|
6
|
+
readonly productId: number;
|
|
7
|
+
readonly productName: string;
|
|
8
|
+
private handle?;
|
|
9
|
+
private closing?;
|
|
10
|
+
private inputPump?;
|
|
11
|
+
private readonly lifecycle;
|
|
12
|
+
constructor(descriptor: MoldableNativeDeviceDescriptor);
|
|
13
|
+
get opened(): boolean;
|
|
14
|
+
open(): Promise<void>;
|
|
15
|
+
close(): Promise<void>;
|
|
16
|
+
forget(): Promise<void>;
|
|
17
|
+
sendReport(reportId: number, data: BufferSource): Promise<void>;
|
|
18
|
+
sendFeatureReport(reportId: number, data: BufferSource): Promise<void>;
|
|
19
|
+
receiveFeatureReport(reportId: number): Promise<DataView>;
|
|
20
|
+
listen(listener: (event: MoldableHidInputReportEvent) => void, signal?: AbortSignal): () => void;
|
|
21
|
+
private startInputPump;
|
|
22
|
+
private readLoop;
|
|
23
|
+
private execute;
|
|
24
|
+
}
|
|
25
|
+
export declare function isNativeMoldableHidDevice(device: MoldableHidDevice): device is NativeMoldableHidDevice;
|
|
26
|
+
//# sourceMappingURL=hid-native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hid-native.d.ts","sourceRoot":"","sources":["../../../src/lib/native-hardware/hid-native.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,OAAO,CAAA;AAC3E,OAAO,EACL,KAAK,8BAA8B,EAMpC,MAAM,oBAAoB,CAAA;AAM3B,qBAAa,uBACX,SAAQ,WACR,YAAW,iBAAiB;IAUhB,QAAQ,CAAC,UAAU,EAAE,8BAA8B;IAR/D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,OAAO,CAAC,MAAM,CAAC,CAAQ;IACvB,OAAO,CAAC,OAAO,CAAC,CAAe;IAC/B,OAAO,CAAC,SAAS,CAAC,CAAiB;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA8B;gBAEnC,UAAU,EAAE,8BAA8B;IAO/D,IAAI,MAAM,IAAI,OAAO,CAEpB;IAEK,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAerB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA0BtB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAsB/D,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAStE,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAW/D,MAAM,CACJ,QAAQ,EAAE,CAAC,KAAK,EAAE,2BAA2B,KAAK,IAAI,EACtD,MAAM,CAAC,EAAE,WAAW,GACnB,MAAM,IAAI;IAiBb,OAAO,CAAC,cAAc;YASR,QAAQ;YA6DR,OAAO;CA+BtB;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,iBAAiB,GACxB,MAAM,IAAI,uBAAuB,CAEnC"}
|