@camstack/ui-library 1.2.256 → 1.2.258
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/composites/accelerator-label.d.ts +9 -9
- package/dist/composites/adaptive-downlink.d.ts +141 -143
- package/dist/composites/addon-global-settings-form.d.ts +73 -60
- package/dist/composites/addon-page-props.d.ts +34 -10
- package/dist/composites/agent-step-editor.d.ts +48 -47
- package/dist/composites/app-shell/app-shell.d.ts +17 -17
- package/dist/composites/app-shell/index.d.ts +3 -3
- package/dist/composites/app-shell/sidebar-item.d.ts +9 -8
- package/dist/composites/app-shell/sidebar.d.ts +10 -10
- package/dist/composites/audio-classification-list.d.ts +16 -15
- package/dist/composites/audio-level-waveform.d.ts +31 -30
- package/dist/composites/audio-waveform.d.ts +18 -17
- package/dist/composites/battery-badge.d.ts +27 -13
- package/dist/composites/breadcrumb.d.ts +21 -21
- package/dist/composites/camera-stream-player.d.ts +309 -309
- package/dist/composites/cap-settings/AutotrackSection.d.ts +19 -2
- package/dist/composites/cap-settings/CameraGridLayoutEditor.d.ts +24 -2
- package/dist/composites/cap-settings/ConsumablesPanel.d.ts +21 -2
- package/dist/composites/cap-settings/CoverageTrack.d.ts +21 -20
- package/dist/composites/cap-settings/EventBucketStrip.d.ts +21 -20
- package/dist/composites/cap-settings/EventHeatmap.d.ts +8 -7
- package/dist/composites/cap-settings/HomePresetPicker.d.ts +2 -2
- package/dist/composites/cap-settings/MaskShapeCanvas.d.ts +143 -41
- package/dist/composites/cap-settings/MotionZonesSettings.d.ts +41 -2
- package/dist/composites/cap-settings/NavigationPanel.d.ts +14 -2
- package/dist/composites/cap-settings/PrivacyMaskSettings.d.ts +3 -2
- package/dist/composites/cap-settings/PtzPanel.d.ts +15 -2
- package/dist/composites/cap-settings/RecordingBandsEditor.d.ts +33 -32
- package/dist/composites/cap-settings/RecordingPanel.d.ts +3 -2
- package/dist/composites/cap-settings/RecordingSettings.d.ts +11 -10
- package/dist/composites/cap-settings/RecordingTimeline.d.ts +3 -2
- package/dist/composites/cap-settings/SceneMonitorEditor.d.ts +3 -51
- package/dist/composites/cap-settings/SceneReferenceGallery.d.ts +62 -23
- package/dist/composites/cap-settings/SceneSettingsForm.d.ts +52 -16
- package/dist/composites/cap-settings/TimelineControls.d.ts +21 -20
- package/dist/composites/cap-settings/camera-grid-layout.d.ts +95 -95
- package/dist/composites/cap-settings/event-thumb.d.ts +9 -8
- package/dist/composites/cap-settings/index.d.ts +20 -20
- package/dist/composites/cap-settings/privacy-mask-audio.d.ts +47 -47
- package/dist/composites/cap-settings/recording-config-form.d.ts +25 -25
- package/dist/composites/cap-settings/recording-spans.d.ts +14 -14
- package/dist/composites/cap-settings/recording-timeline-model.d.ts +57 -57
- package/dist/composites/cap-settings/scene-monitor-copy.d.ts +58 -49
- package/dist/composites/client-network-sample.d.ts +41 -41
- package/dist/composites/clips/ClipBandBar.d.ts +44 -14
- package/dist/composites/clips/ClipPanel.d.ts +30 -6
- package/dist/composites/clips/ClipTile.d.ts +26 -5
- package/dist/composites/clips/ClipsSection.d.ts +107 -2
- package/dist/composites/clips/clip-band.d.ts +72 -38
- package/dist/composites/clips/clip-day-window.d.ts +7 -30
- package/dist/composites/clips/clip-source-state.d.ts +55 -26
- package/dist/composites/clips/clip-still-retry.d.ts +39 -39
- package/dist/composites/clips/clip-thumbnail-fetch.d.ts +9 -9
- package/dist/composites/clips/clip-tile-media.d.ts +64 -32
- package/dist/composites/clips/clip-view-state.d.ts +76 -46
- package/dist/composites/code-block.d.ts +5 -4
- package/dist/composites/config-form-builder.d.ts +14 -13
- package/dist/composites/config-form-field.d.ts +63 -62
- package/dist/composites/config-icon-field.d.ts +10 -9
- package/dist/composites/config-secret-field.d.ts +51 -27
- package/dist/composites/confirm-action-button.d.ts +52 -39
- package/dist/composites/confirm-dialog.d.ts +110 -48
- package/dist/composites/copy-button.d.ts +25 -19
- package/dist/composites/data-table/data-table-header.d.ts +8 -7
- package/dist/composites/data-table/data-table-pagination.d.ts +7 -6
- package/dist/composites/data-table/data-table-row.d.ts +8 -7
- package/dist/composites/data-table/data-table.d.ts +3 -2
- package/dist/composites/data-table/index.d.ts +2 -2
- package/dist/composites/data-table/types.d.ts +29 -29
- package/dist/composites/data-table-filter-bar.d.ts +30 -29
- package/dist/composites/data-table-filter.d.ts +34 -34
- package/dist/composites/data-table-layout.d.ts +24 -24
- package/dist/composites/data-table-pager.d.ts +5 -5
- package/dist/composites/data-table-pagination.d.ts +23 -23
- package/dist/composites/data-table-selection.d.ts +10 -10
- package/dist/composites/data-table.d.ts +167 -118
- package/dist/composites/detection-canvas.d.ts +34 -25
- package/dist/composites/detection-colors.d.ts +9 -9
- package/dist/composites/detection-overlay.d.ts +33 -32
- package/dist/composites/detection-result-tree.d.ts +22 -9
- package/dist/composites/dev-shell.d.ts +15 -14
- package/dist/composites/device-activity-panel.d.ts +37 -31
- package/dist/composites/device-card.d.ts +32 -32
- package/dist/composites/device-controls/ac-panel.d.ts +2 -2
- package/dist/composites/device-controls/alarm-hero-card.d.ts +42 -42
- package/dist/composites/device-controls/atoms.d.ts +50 -50
- package/dist/composites/device-controls/brightness-panel.d.ts +3 -3
- package/dist/composites/device-controls/button-control.d.ts +14 -14
- package/dist/composites/device-controls/climate-panel.d.ts +12 -12
- package/dist/composites/device-controls/container-primary-hero.d.ts +33 -16
- package/dist/composites/device-controls/container-primary.d.ts +68 -39
- package/dist/composites/device-controls/control-panel.d.ts +4 -4
- package/dist/composites/device-controls/control-registry.d.ts +81 -70
- package/dist/composites/device-controls/cover-hero-card.d.ts +26 -26
- package/dist/composites/device-controls/cover-inline.d.ts +20 -20
- package/dist/composites/device-controls/cover-panel.d.ts +2 -2
- package/dist/composites/device-controls/dummy-hero-card.d.ts +2 -2
- package/dist/composites/device-controls/fan-hero-card.d.ts +20 -20
- package/dist/composites/device-controls/fan-panel.d.ts +3 -3
- package/dist/composites/device-controls/humidifier-control.d.ts +46 -29
- package/dist/composites/device-controls/image-control.d.ts +41 -27
- package/dist/composites/device-controls/index.d.ts +34 -34
- package/dist/composites/device-controls/lawn-mower-control.d.ts +30 -16
- package/dist/composites/device-controls/light-hero-card.d.ts +15 -15
- package/dist/composites/device-controls/lock-hero-card.d.ts +14 -14
- package/dist/composites/device-controls/lock-panel.d.ts +3 -3
- package/dist/composites/device-controls/media-player-hero-card.d.ts +16 -16
- package/dist/composites/device-controls/media-player-panel.d.ts +7 -7
- package/dist/composites/device-controls/offline-badge.d.ts +23 -8
- package/dist/composites/device-controls/panel-controls.d.ts +39 -20
- package/dist/composites/device-controls/pet-feeder-panel.d.ts +27 -9
- package/dist/composites/device-controls/popover-row-action.d.ts +18 -6
- package/dist/composites/device-controls/primary-child-picker.d.ts +31 -15
- package/dist/composites/device-controls/primary-child.d.ts +14 -25
- package/dist/composites/device-controls/radial-gauge.d.ts +17 -17
- package/dist/composites/device-controls/script-automation-controls.d.ts +9 -9
- package/dist/composites/device-controls/sensor-hero-card.d.ts +26 -8
- package/dist/composites/device-controls/sensor-inline-control.d.ts +21 -9
- package/dist/composites/device-controls/sensor-value-atom.d.ts +97 -76
- package/dist/composites/device-controls/switch-hero-card.d.ts +11 -11
- package/dist/composites/device-controls/switch-panel.d.ts +2 -2
- package/dist/composites/device-controls/tap-toggle.d.ts +13 -13
- package/dist/composites/device-controls/thermostat-hero-card.d.ts +16 -16
- package/dist/composites/device-controls/types.d.ts +11 -11
- package/dist/composites/device-controls/update-control.d.ts +20 -7
- package/dist/composites/device-controls/vacuum-control.d.ts +41 -25
- package/dist/composites/device-controls/valve-control.d.ts +51 -35
- package/dist/composites/device-controls/water-heater-control.d.ts +48 -31
- package/dist/composites/device-controls/weather-control.d.ts +46 -28
- package/dist/composites/device-export-panel.d.ts +34 -34
- package/dist/composites/device-grid.d.ts +10 -10
- package/dist/composites/device-item/actions.d.ts +40 -18
- package/dist/composites/device-item/admin-link-quick-action.d.ts +66 -26
- package/dist/composites/device-item/child-layout.d.ts +43 -26
- package/dist/composites/device-item/child-section-accordion.d.ts +20 -6
- package/dist/composites/device-item/children-accordion.d.ts +11 -11
- package/dist/composites/device-item/container-children-context.d.ts +28 -11
- package/dist/composites/device-item/device-delete-action.d.ts +23 -5
- package/dist/composites/device-item/features.d.ts +33 -15
- package/dist/composites/device-item/header.d.ts +53 -31
- package/dist/composites/device-item/helpers.d.ts +291 -274
- package/dist/composites/device-item/index.d.ts +18 -9
- package/dist/composites/device-item/preview.d.ts +41 -21
- package/dist/composites/device-item/quick-detail-action.d.ts +4 -4
- package/dist/composites/device-item/reboot-quick-action.d.ts +28 -7
- package/dist/composites/device-item/role-display-defaults-context.d.ts +28 -12
- package/dist/composites/device-item/status-dot.d.ts +24 -6
- package/dist/composites/device-list/batch-actions-bar.d.ts +23 -12
- package/dist/composites/device-list/batch-toolbar.d.ts +13 -13
- package/dist/composites/device-list/columns.d.ts +108 -108
- package/dist/composites/device-list/device-integration.d.ts +48 -58
- package/dist/composites/device-list/device-mode.d.ts +121 -121
- package/dist/composites/device-list/empty-state.d.ts +14 -3
- package/dist/composites/device-list/filter-chips.d.ts +42 -29
- package/dist/composites/device-list/fuzzy-match.d.ts +22 -22
- package/dist/composites/device-list/generic-mode.d.ts +88 -88
- package/dist/composites/device-list/group.d.ts +62 -35
- package/dist/composites/device-list/hardware-cell.d.ts +14 -3
- package/dist/composites/device-list/hardware.d.ts +29 -11
- package/dist/composites/device-list/icon-action.d.ts +27 -15
- package/dist/composites/device-list/index.d.ts +46 -23
- package/dist/composites/device-list/multi-select.d.ts +17 -17
- package/dist/composites/device-list/page-size-select.d.ts +13 -7
- package/dist/composites/device-list/pagination.d.ts +19 -12
- package/dist/composites/device-list/sort.d.ts +28 -15
- package/dist/composites/device-list/sortable-header.d.ts +20 -7
- package/dist/composites/device-list/table-layout.d.ts +44 -44
- package/dist/composites/device-list/type-filter.d.ts +16 -16
- package/dist/composites/device-list/url-state.d.ts +35 -35
- package/dist/composites/device-meta.d.ts +43 -43
- package/dist/composites/device-picker/DevicePicker.d.ts +72 -33
- package/dist/composites/device-picker/SelectedChip.d.ts +10 -9
- package/dist/composites/device-picker/device-filter-bar.d.ts +19 -18
- package/dist/composites/device-picker/device-fleet-view.d.ts +11 -3
- package/dist/composites/device-picker/device-parent.d.ts +27 -27
- package/dist/composites/device-picker/device-picker-grouping.d.ts +3 -3
- package/dist/composites/device-picker/device-picker-model.d.ts +140 -140
- package/dist/composites/device-picker/device-selection-rows.d.ts +31 -24
- package/dist/composites/device-picker/device-selection.d.ts +43 -43
- package/dist/composites/device-picker/index.d.ts +9 -9
- package/dist/composites/device-select-field.d.ts +17 -16
- package/dist/composites/device-select-filter.d.ts +78 -78
- package/dist/composites/device-selector-picker.d.ts +25 -25
- package/dist/composites/device-step-matrix.d.ts +54 -28
- package/dist/composites/discovery-panel.d.ts +22 -22
- package/dist/composites/doorbell-recent-panel.d.ts +9 -8
- package/dist/composites/empty-state.d.ts +8 -8
- package/dist/composites/error-box.d.ts +32 -17
- package/dist/composites/event-kind-visuals.d.ts +29 -18
- package/dist/composites/event-stream.d.ts +59 -42
- package/dist/composites/extensions/AssociationSlotCard.d.ts +45 -24
- package/dist/composites/extensions/ExtensionsPanel.d.ts +41 -18
- package/dist/composites/extensions/extensions-view-state.d.ts +71 -53
- package/dist/composites/filter-bar.d.ts +22 -21
- package/dist/composites/form-field.d.ts +9 -9
- package/dist/composites/format-state-value.d.ts +23 -51
- package/dist/composites/grouped-model-selector.d.ts +7 -6
- package/dist/composites/hls-quality.d.ts +26 -26
- package/dist/composites/hls-video.d.ts +62 -39
- package/dist/composites/hover-zoom-image.d.ts +35 -16
- package/dist/composites/icon-picker.d.ts +86 -50
- package/dist/composites/image-selector.d.ts +21 -20
- package/dist/composites/index.d.ts +204 -204
- package/dist/composites/inference-config-selector.d.ts +36 -35
- package/dist/composites/kebab-menu.d.ts +53 -35
- package/dist/composites/key-value-list.d.ts +14 -14
- package/dist/composites/log-stream-scroll.d.ts +24 -24
- package/dist/composites/log-stream.d.ts +81 -70
- package/dist/composites/login-form.d.ts +7 -6
- package/dist/composites/model-bound-slider.d.ts +46 -26
- package/dist/composites/model-picker.d.ts +20 -19
- package/dist/composites/mount-addon-page.d.ts +12 -12
- package/dist/composites/network-link-badge.d.ts +7 -6
- package/dist/composites/node-picker.d.ts +14 -13
- package/dist/composites/notification-targets-field.d.ts +76 -58
- package/dist/composites/notification-targets-options.d.ts +9 -6
- package/dist/composites/option-select/OptionSelect.d.ts +23 -22
- package/dist/composites/option-select/index.d.ts +4 -4
- package/dist/composites/option-select/option-select-model.d.ts +35 -35
- package/dist/composites/page-header.d.ts +6 -6
- package/dist/composites/peer-connection-config.d.ts +9 -9
- package/dist/composites/phase-icon.d.ts +10 -3
- package/dist/composites/pipeline-builder.d.ts +21 -13
- package/dist/composites/pipeline-matrix-shared.d.ts +159 -150
- package/dist/composites/pipeline-runtime-selector.d.ts +12 -11
- package/dist/composites/pipeline-step.d.ts +39 -31
- package/dist/composites/placeholder-field/PlaceholderChipField.d.ts +23 -22
- package/dist/composites/placeholder-field/index.d.ts +1 -1
- package/dist/composites/provider-badge.d.ts +6 -5
- package/dist/composites/ptz-overlay.d.ts +38 -18
- package/dist/composites/qr-code.d.ts +24 -10
- package/dist/composites/reconnect-schedule.d.ts +22 -22
- package/dist/composites/resolve-step-default-model.d.ts +94 -94
- package/dist/composites/response-log.d.ts +7 -6
- package/dist/composites/root-model-source.d.ts +21 -10
- package/dist/composites/scope-picker.d.ts +49 -25
- package/dist/composites/section-card.d.ts +19 -11
- package/dist/composites/setting-row.d.ts +39 -21
- package/dist/composites/snapshot-button.d.ts +23 -19
- package/dist/composites/sort-header-button.d.ts +25 -8
- package/dist/composites/stat-card.d.ts +20 -8
- package/dist/composites/state-values-stream.d.ts +49 -24
- package/dist/composites/status-badge.d.ts +10 -8
- package/dist/composites/step-inspector/gate-control.d.ts +13 -12
- package/dist/composites/step-inspector/index.d.ts +8 -8
- package/dist/composites/step-inspector/layered-settings-form.d.ts +41 -30
- package/dist/composites/step-inspector/segmented-choice.d.ts +8 -7
- package/dist/composites/step-inspector/setting-values.d.ts +13 -8
- package/dist/composites/step-inspector/step-detail-dock.d.ts +39 -23
- package/dist/composites/step-inspector/step-inspector-panel.d.ts +34 -28
- package/dist/composites/step-inspector/step-model-row.d.ts +29 -24
- package/dist/composites/step-inspector/step-search.d.ts +11 -11
- package/dist/composites/step-timings.d.ts +7 -6
- package/dist/composites/step-tree.d.ts +17 -12
- package/dist/composites/stream-broker-selector.d.ts +29 -8
- package/dist/composites/stream-debug/stream-debug-overlay.d.ts +40 -40
- package/dist/composites/stream-debug/webrtc-debug-stats.d.ts +144 -129
- package/dist/composites/stream-panel.d.ts +212 -201
- package/dist/composites/table-sort.d.ts +61 -61
- package/dist/composites/timezone-selector.d.ts +15 -13
- package/dist/composites/training/send-frame-to-training.d.ts +5 -4
- package/dist/composites/training/training-collection-picker.d.ts +4 -3
- package/dist/composites/training/training-refusal-text.d.ts +6 -6
- package/dist/composites/unit-picker/UnitPicker.d.ts +19 -14
- package/dist/composites/unit-picker/index.d.ts +1 -1
- package/dist/composites/use-data-table-filter.d.ts +19 -19
- package/dist/composites/version-badge.d.ts +19 -18
- package/dist/composites/webrtc-diagnostics/EndpointTestCard.d.ts +7 -7
- package/dist/composites/webrtc-diagnostics/HubSessionTestCard.d.ts +14 -14
- package/dist/composites/webrtc-diagnostics/RunReport.d.ts +10 -5
- package/dist/composites/webrtc-diagnostics/endpoint-probe.d.ts +41 -21
- package/dist/composites/webrtc-diagnostics/endpoint-test.d.ts +37 -32
- package/dist/composites/webrtc-diagnostics/format.d.ts +3 -3
- package/dist/composites/webrtc-diagnostics/ice-candidates.d.ts +49 -49
- package/dist/composites/webrtc-diagnostics/nat-mapping.d.ts +36 -36
- package/dist/composites/webrtc-diagnostics/session-run.d.ts +108 -95
- package/dist/composites/webrtc-diagnostics/session-verdict.d.ts +29 -20
- package/dist/composites/widget-panel.d.ts +23 -23
- package/dist/composites/widget-slot.d.ts +35 -17
- package/dist/contexts/custom-field-renderers.d.ts +53 -17
- package/dist/contexts/device-context.d.ts +32 -12
- package/dist/contexts/device-quick-detail.d.ts +13 -4
- package/dist/contexts/player-overlays.d.ts +82 -42
- package/dist/contexts/recorded-playback.d.ts +40 -18
- package/dist/contexts/system-context.d.ts +28 -13
- package/dist/contexts/vod-playback.d.ts +39 -22
- package/dist/contexts/widget-registry.d.ts +139 -102
- package/dist/contexts/zone-editing.d.ts +69 -46
- package/dist/generated/system-hooks.d.ts +17 -1
- package/dist/hooks/index.d.ts +43 -43
- package/dist/hooks/turn-server-cache.d.ts +69 -69
- package/dist/hooks/use-capability-presence.d.ts +65 -28
- package/dist/hooks/use-cluster-nodes.d.ts +54 -27
- package/dist/hooks/use-device-autotrack.d.ts +7 -7
- package/dist/hooks/use-device-battery.d.ts +24 -11
- package/dist/hooks/use-device-cap-slice.d.ts +15 -15
- package/dist/hooks/use-device-capability.d.ts +61 -27
- package/dist/hooks/use-device-detections.d.ts +32 -32
- package/dist/hooks/use-device-features.d.ts +18 -18
- package/dist/hooks/use-device-list-page-size.d.ts +19 -6
- package/dist/hooks/use-device-network-link.d.ts +15 -7
- package/dist/hooks/use-device-proxy.d.ts +98 -92
- package/dist/hooks/use-device-snapshot.d.ts +23 -23
- package/dist/hooks/use-device-webrtc.d.ts +211 -205
- package/dist/hooks/use-devices.d.ts +9 -9
- package/dist/hooks/use-doorbell-events.d.ts +13 -13
- package/dist/hooks/use-event-stream.d.ts +6 -3
- package/dist/hooks/use-is-mobile.d.ts +5 -5
- package/dist/hooks/use-live-buffer.d.ts +5 -5
- package/dist/hooks/use-live-event.d.ts +1 -1
- package/dist/hooks/use-navigation.d.ts +20 -20
- package/dist/hooks/use-optimistic-slice.d.ts +13 -13
- package/dist/hooks/use-persisted-page-size.d.ts +10 -10
- package/dist/hooks/use-ptz.d.ts +108 -108
- package/dist/hooks/use-stationary-overlay.d.ts +37 -37
- package/dist/hooks/use-system-query.d.ts +33 -10
- package/dist/hooks/use-url-query.d.ts +3 -3
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/provider-icons.d.ts +2 -2
- package/dist/icons/status-icons.d.ts +2 -2
- package/dist/index.cjs +123 -69
- package/dist/index.d.ts +31 -27
- package/dist/index.js +123 -69
- package/dist/lib/cap-error.d.ts +18 -39
- package/dist/lib/cn.d.ts +1 -1
- package/dist/lib/fleet-query-defaults.d.ts +68 -34
- package/dist/lib/format-control-datetime.d.ts +16 -16
- package/dist/lib/format-duration.d.ts +12 -12
- package/dist/lib/format-last-seen.d.ts +5 -18
- package/dist/lib/format-numeric.d.ts +7 -7
- package/dist/lib/hub-mount.d.ts +8 -42
- package/dist/lib/index.d.ts +21 -21
- package/dist/lib/phase-config.d.ts +24 -11
- package/dist/lib/pipeline-mirror.d.ts +16 -16
- package/dist/lib/recorded-control-protocol.d.ts +41 -43
- package/dist/lib/resolve-sensor-display.d.ts +36 -20
- package/dist/lib/responsive.d.ts +54 -54
- package/dist/lib/scrub-controller.d.ts +75 -78
- package/dist/lib/shared-context.d.ts +27 -2
- package/dist/lib/tailwind-variants.d.ts +20 -20
- package/dist/primitives/badge.d.ts +5 -10
- package/dist/primitives/bottom-sheet.d.ts +7 -7
- package/dist/primitives/button.d.ts +5 -9
- package/dist/primitives/card.d.ts +4 -8
- package/dist/primitives/checkbox.d.ts +3 -4
- package/dist/primitives/collapsible-card.d.ts +23 -13
- package/dist/primitives/dialog.d.ts +33 -59
- package/dist/primitives/dropdown.d.ts +13 -13
- package/dist/primitives/floating-panel.d.ts +41 -20
- package/dist/primitives/icon-button.d.ts +8 -12
- package/dist/primitives/index.d.ts +22 -22
- package/dist/primitives/input.d.ts +6 -16
- package/dist/primitives/label.d.ts +3 -4
- package/dist/primitives/mobile-drawer.d.ts +8 -8
- package/dist/primitives/password-input.d.ts +18 -18
- package/dist/primitives/popover.d.ts +7 -7
- package/dist/primitives/scroll-area.d.ts +3 -4
- package/dist/primitives/select.d.ts +20 -20
- package/dist/primitives/separator.d.ts +4 -8
- package/dist/primitives/skeleton.d.ts +3 -4
- package/dist/primitives/switch.d.ts +6 -6
- package/dist/primitives/tabs.d.ts +26 -26
- package/dist/primitives/tooltip.d.ts +12 -12
- package/dist/theme/create-theme.d.ts +1 -1
- package/dist/theme/defaults.d.ts +1 -1
- package/dist/theme/index.d.ts +6 -6
- package/dist/theme/theme-provider.d.ts +8 -7
- package/dist/theme/theme-to-css.d.ts +1 -1
- package/dist/theme/types.d.ts +98 -100
- package/dist/theme/use-theme-mode.d.ts +1 -1
- package/dist/trpc-react.d.ts +23 -3
- package/dist/widgets/host-widgets.d.ts +4 -4
- package/package.json +8 -4
- package/src/tailwind/camstack-theme.css +11 -0
- package/dist/composites/unit-picker/UnitPicker.spec.d.ts +0 -1
|
@@ -1,16 +1,29 @@
|
|
|
1
|
-
import { BatteryStatus } from '@camstack/types';
|
|
2
|
-
import { UseDeviceProxyTrpc } from './use-device-proxy';
|
|
3
1
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
* useDeviceBattery — battery status for a device.
|
|
3
|
+
*
|
|
4
|
+
* Thin wrapper over the `useDeviceState` combinator, which itself
|
|
5
|
+
* wraps `useDeviceProxy + useDeviceStateSlice(dev?.state.battery)`.
|
|
6
|
+
* The kernel runtime-state mirror keeps the slice value warm — one
|
|
7
|
+
* initial fetch on first subscribe, then push updates on every
|
|
8
|
+
* `setCapSlice` for the battery slice. No manual event subscription,
|
|
9
|
+
* no parallel `getStatus` polling.
|
|
10
|
+
*
|
|
11
|
+
* Returns `null` when no provider has emitted yet (non-battery
|
|
12
|
+
* camera, or initial fetch hasn't returned).
|
|
13
|
+
*/
|
|
14
|
+
import type { BatteryStatus } from "@camstack/types";
|
|
15
|
+
import { type UseDeviceProxyTrpc } from "./use-device-proxy";
|
|
16
|
+
/**
|
|
17
|
+
* The cap's own runtime-state shape (`z.infer<BatteryStatusSchema>`) —
|
|
18
|
+
* `percentage` is `number | null`: `null` means no reading has landed yet
|
|
19
|
+
* (D315). Re-exported so call sites don't have to reach into
|
|
20
|
+
* `@camstack/types` themselves.
|
|
21
|
+
*/
|
|
9
22
|
export type { BatteryStatus };
|
|
10
23
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
24
|
+
* Backwards-compatible alias for the trpc shape — historically the
|
|
25
|
+
* hook took its own narrow contract; the proxy generalisation
|
|
26
|
+
* supersedes that.
|
|
27
|
+
*/
|
|
15
28
|
export type UseDeviceBatteryTrpc = UseDeviceProxyTrpc;
|
|
16
29
|
export declare function useDeviceBattery(trpc: UseDeviceProxyTrpc, deviceId: number | null): BatteryStatus | null;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { SliceHandleApi } from
|
|
1
|
+
import { type SliceHandleApi } from "@camstack/types";
|
|
2
2
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
* The tRPC shape required by this hook — a superset of `UseDeviceProxyTrpc`
|
|
4
|
+
* that also exposes `deviceState.getCapSlice` and `deviceState.setCapSlice`
|
|
5
|
+
* so the lazy source can bootstrap a per-cap subscription.
|
|
6
|
+
*
|
|
7
|
+
* `System.trpcClient` satisfies this structurally.
|
|
8
|
+
*/
|
|
9
9
|
export type UseDeviceCapSliceTrpc = SliceHandleApi;
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
* Read an arbitrary cap's runtime-state slice by its raw kebab-case name.
|
|
12
|
+
*
|
|
13
|
+
* Returns `unknown | undefined`:
|
|
14
|
+
* - `undefined` while the slice hasn't been seeded yet (cold-start)
|
|
15
|
+
* - the raw slice record once the kernel has published at least one push
|
|
16
|
+
*
|
|
17
|
+
* Pass `null` for `deviceId` to suppress all fetches (renders `undefined`).
|
|
18
|
+
*/
|
|
19
19
|
export declare function useDeviceCapSlice(trpc: UseDeviceCapSliceTrpc, deviceId: number | null, capName: string): unknown | undefined;
|
|
@@ -1,29 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
/**
|
|
2
|
+
* useDeviceCapability — accessor-based readiness wrapper around
|
|
3
|
+
* `useDeviceProxy` + `useDeviceStateSlice`. Combines the three
|
|
4
|
+
* preconditions a UI quick-action needs in one call:
|
|
5
|
+
*
|
|
6
|
+
* 1. Device proxy resolved (bindings landed)
|
|
7
|
+
* 2. Cap handle present on the proxy (i.e. cap is bound)
|
|
8
|
+
* 3. Slice has arrived (provider has published its first snapshot)
|
|
9
|
+
*
|
|
10
|
+
* Optional fourth precondition: a `DeviceFeature` flag advertised on
|
|
11
|
+
* the device row. Useful for surfaces that only render a control when
|
|
12
|
+
* the feature is declared (e.g. the on-motion toggle on a switch).
|
|
13
|
+
*
|
|
14
|
+
* Caller passes typed accessor callbacks so the cap + slice types
|
|
15
|
+
* carry through TypeScript without casts:
|
|
16
|
+
*
|
|
17
|
+
* const { dev, cap, slice, available } = useDeviceCapability({
|
|
18
|
+
* trpc, deviceId,
|
|
19
|
+
* cap: (dev) => dev.switch,
|
|
20
|
+
* slice: (dev) => dev.state.switch,
|
|
21
|
+
* requireFeature: 'switch', // optional
|
|
22
|
+
* deviceFeatures: device.features, // optional, only if feature gate used
|
|
23
|
+
* })
|
|
24
|
+
* if (available) await cap.setState({ on: !slice.on })
|
|
25
|
+
*/
|
|
26
|
+
import type { DeviceProxy, SliceHandle } from "@camstack/types";
|
|
27
|
+
import { type UseDeviceProxyTrpc } from "./use-device-proxy";
|
|
28
|
+
export interface UseDeviceCapabilityOptions<
|
|
29
|
+
TCap,
|
|
30
|
+
TSlice
|
|
31
|
+
> {
|
|
32
|
+
readonly trpc: UseDeviceProxyTrpc;
|
|
33
|
+
readonly deviceId: number | null;
|
|
34
|
+
readonly cap: (dev: DeviceProxy) => TCap | undefined;
|
|
35
|
+
readonly slice: (dev: DeviceProxy) => SliceHandle<TSlice> | undefined;
|
|
36
|
+
readonly requireFeature?: string;
|
|
37
|
+
readonly deviceFeatures?: readonly string[];
|
|
10
38
|
}
|
|
11
|
-
export interface UseDeviceCapabilityResult<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
39
|
+
export interface UseDeviceCapabilityResult<
|
|
40
|
+
TCap,
|
|
41
|
+
TSlice
|
|
42
|
+
> {
|
|
43
|
+
readonly dev: DeviceProxy | null;
|
|
44
|
+
readonly cap: TCap | undefined;
|
|
45
|
+
readonly slice: TSlice | undefined;
|
|
46
|
+
readonly available: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Resolved device liveness from the auto-registered `device-status`
|
|
49
|
+
* cap slice. Defaults to `true` until the slice lands so initial load
|
|
50
|
+
* never false-disables a control. Drives `available` (offline = no
|
|
51
|
+
* control).
|
|
52
|
+
*/
|
|
53
|
+
readonly online: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Ms epoch of the last `online` transition when the device is
|
|
56
|
+
* currently offline, else `null`. Lets a badge render "offline since".
|
|
57
|
+
*/
|
|
58
|
+
readonly offlineSince: number | null;
|
|
28
59
|
}
|
|
29
|
-
export declare function useDeviceCapability<
|
|
60
|
+
export declare function useDeviceCapability<
|
|
61
|
+
TCap,
|
|
62
|
+
TSlice
|
|
63
|
+
>(options: UseDeviceCapabilityOptions<TCap, TSlice>): UseDeviceCapabilityResult<TCap, TSlice>;
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { ObjectDetection } from
|
|
1
|
+
import type { ObjectDetection } from "@camstack/types";
|
|
2
2
|
export interface MotionZone {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
readonly x: number;
|
|
4
|
+
readonly y: number;
|
|
5
|
+
readonly w: number;
|
|
6
|
+
readonly h: number;
|
|
7
|
+
readonly intensity: number;
|
|
8
8
|
}
|
|
9
9
|
export interface MotionState {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
readonly zones: readonly MotionZone[];
|
|
11
|
+
readonly frameWidth: number;
|
|
12
|
+
readonly frameHeight: number;
|
|
13
13
|
}
|
|
14
14
|
export interface DetectionState {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
readonly detections: readonly ObjectDetection[];
|
|
16
|
+
readonly frameWidth: number;
|
|
17
|
+
readonly frameHeight: number;
|
|
18
18
|
}
|
|
19
19
|
export interface MotionRawBox {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
readonly bbox: readonly [number, number, number, number];
|
|
21
|
+
readonly changeScore: number;
|
|
22
22
|
}
|
|
23
23
|
export interface MotionRawState {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
readonly boxes: readonly MotionRawBox[];
|
|
25
|
+
readonly frameWidth: number;
|
|
26
|
+
readonly frameHeight: number;
|
|
27
|
+
readonly motionScore: number;
|
|
28
28
|
}
|
|
29
29
|
export interface DeviceDetections {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
readonly motion: MotionState | null;
|
|
31
|
+
readonly motionRaw: MotionRawState | null;
|
|
32
|
+
readonly detection: DetectionState | null;
|
|
33
|
+
readonly phase: string;
|
|
34
34
|
}
|
|
35
35
|
interface LiveOnEvent {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
subscribe: (input: {
|
|
37
|
+
category: string;
|
|
38
|
+
}, opts: {
|
|
39
|
+
onData: (event: unknown) => void;
|
|
40
|
+
}) => {
|
|
41
|
+
unsubscribe: () => void;
|
|
42
|
+
};
|
|
43
43
|
}
|
|
44
44
|
interface UseDetectionsTrpc {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
live?: {
|
|
46
|
+
onEvent?: LiveOnEvent;
|
|
47
|
+
};
|
|
48
48
|
}
|
|
49
49
|
export declare function useDeviceDetections(trpc: UseDetectionsTrpc, deviceId: number | null): DeviceDetections;
|
|
50
50
|
export {};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { UseDeviceProxyTrpc } from
|
|
2
|
-
export type ResolvedFeatureKind =
|
|
1
|
+
import type { UseDeviceProxyTrpc } from "./use-device-proxy";
|
|
2
|
+
export type ResolvedFeatureKind = "native" | "enhanced" | "marker";
|
|
3
3
|
export type ResolvedFeature = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
readonly kind: "native";
|
|
5
|
+
readonly feature: string;
|
|
6
|
+
readonly capName: string;
|
|
7
7
|
} | {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
readonly kind: "enhanced";
|
|
9
|
+
readonly feature: string;
|
|
10
|
+
readonly capName: string;
|
|
11
11
|
} | {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
readonly kind: "marker";
|
|
13
|
+
readonly feature: string;
|
|
14
14
|
};
|
|
15
15
|
export interface UseDeviceFeaturesResult {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
/** Pending or unresolved (during initial bindings fetch). */
|
|
17
|
+
readonly loading: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Resolved list — features whose corresponding cap is in bindings,
|
|
20
|
+
* PLUS pure markers (FEATURE_TO_CAP_NAME has no entry). Features
|
|
21
|
+
* with a cap mapping that is NOT in bindings are filtered out.
|
|
22
|
+
*/
|
|
23
|
+
readonly resolved: readonly ResolvedFeature[];
|
|
24
24
|
}
|
|
25
25
|
export declare function useDeviceFeatures(trpc: UseDeviceProxyTrpc, deviceId: number | null, rawFeatures: readonly string[]): UseDeviceFeaturesResult;
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* useDeviceListPageSize — global page-size preference for the device-list
|
|
3
|
+
* surfaces (Devices, Integrations, integration detail).
|
|
4
|
+
*
|
|
5
|
+
* ONE shared localStorage key (`camstack.device-list.pageSize`) so changing
|
|
6
|
+
* the per-page size on any device-list page applies everywhere. The stored
|
|
7
|
+
* value is validated against {@link DEVICE_LIST_PAGE_SIZE_OPTIONS}; any
|
|
8
|
+
* garbage / out-of-range value falls back to the provided default.
|
|
9
|
+
*
|
|
10
|
+
* A thin binding of `usePersistedPageSize` to that key and option set; a
|
|
11
|
+
* surface with a different default or options uses the generic hook with a
|
|
12
|
+
* key of its own.
|
|
13
|
+
*/
|
|
14
|
+
import { type SetPageSize } from "./use-persisted-page-size";
|
|
2
15
|
/** Selectable per-page sizes. The table default (50) is intentionally one of them. */
|
|
3
16
|
export declare const DEVICE_LIST_PAGE_SIZE_OPTIONS: readonly number[];
|
|
4
17
|
/** Canonical default — used whenever a caller's `defaultSize` is itself invalid. */
|
|
@@ -7,9 +20,9 @@ export declare const DEVICE_LIST_PAGE_SIZE_DEFAULT = 50;
|
|
|
7
20
|
export declare const DEVICE_LIST_PAGE_SIZE_KEY = "camstack.device-list.pageSize";
|
|
8
21
|
export type SetDeviceListPageSize = SetPageSize;
|
|
9
22
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
23
|
+
* @param defaultSize fallback when nothing valid is stored. If it is not itself
|
|
24
|
+
* a member of {@link DEVICE_LIST_PAGE_SIZE_OPTIONS}, it is replaced by
|
|
25
|
+
* {@link DEVICE_LIST_PAGE_SIZE_DEFAULT} so it can never seed a phantom value.
|
|
26
|
+
* @returns `[size, setSize]` — `setSize` ignores values outside the allowed set.
|
|
27
|
+
*/
|
|
15
28
|
export declare function useDeviceListPageSize(defaultSize: number): readonly [number, SetDeviceListPageSize];
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* useDeviceNetworkLink — the device's own network link (medium + signal).
|
|
3
|
+
*
|
|
4
|
+
* Same shape as `useDeviceBattery`: a thin wrapper over `useDeviceState`,
|
|
5
|
+
* fed by the kernel runtime-state mirror (one fetch on first subscribe, then
|
|
6
|
+
* push updates on every `network-link` slice write). Returns `null` when no
|
|
7
|
+
* provider has emitted yet — a device without the cap simply has no badge.
|
|
8
|
+
*/
|
|
9
|
+
import { type UseDeviceProxyTrpc } from "./use-device-proxy";
|
|
2
10
|
export interface NetworkLinkStatus {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
readonly type: "wifi" | "ethernet" | "cellular" | "unknown";
|
|
12
|
+
/** `null` = not known or not applicable (a wired link has no signal). */
|
|
13
|
+
readonly signalPercent: number | null;
|
|
14
|
+
readonly rssiDbm?: number;
|
|
15
|
+
readonly ssid?: string;
|
|
16
|
+
readonly lastUpdated: number;
|
|
9
17
|
}
|
|
10
18
|
export declare function useDeviceNetworkLink(trpc: UseDeviceProxyTrpc, deviceId: number | null): NetworkLinkStatus | null;
|
|
@@ -1,106 +1,112 @@
|
|
|
1
|
-
import { DeviceBinding, DeviceProxy } from
|
|
1
|
+
import type { DeviceBinding, DeviceProxy } from "@camstack/types";
|
|
2
2
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
* Reactive runtime-state read handle as exposed by the codegen
|
|
4
|
+
* `DeviceProxy` factory. Same shape useDeviceStateSlice expects —
|
|
5
|
+
* defined here so the combinator's selector parameter has a tight
|
|
6
|
+
* type without re-importing the codegen file.
|
|
7
|
+
*/
|
|
8
8
|
interface StateSliceHandle<T> {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
readonly value: T | undefined;
|
|
10
|
+
subscribe(cb: (slice: T | undefined) => void): () => void;
|
|
11
11
|
}
|
|
12
|
-
interface QueryFn<
|
|
13
|
-
|
|
12
|
+
interface QueryFn<
|
|
13
|
+
I,
|
|
14
|
+
O
|
|
15
|
+
> {
|
|
16
|
+
query(input: I): Promise<O>;
|
|
14
17
|
}
|
|
15
|
-
interface SubscribeFn<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
interface SubscribeFn<
|
|
19
|
+
I,
|
|
20
|
+
T
|
|
21
|
+
> {
|
|
22
|
+
subscribe(input: I, opts: {
|
|
23
|
+
onData: (evt: {
|
|
24
|
+
data: T;
|
|
25
|
+
}) => void;
|
|
26
|
+
onError?: (err: unknown) => void;
|
|
27
|
+
}): {
|
|
28
|
+
unsubscribe: () => void;
|
|
29
|
+
};
|
|
24
30
|
}
|
|
25
31
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
* Minimal vanilla tRPC proxy shape. Same contract `useDeviceWebrtc`,
|
|
33
|
+
* `useDeviceBattery` etc. use — both `BackendClient.trpc` and an
|
|
34
|
+
* addon page's injected `trpc` satisfy this structurally.
|
|
35
|
+
*
|
|
36
|
+
* The proxy is also passed (cast) into `createDeviceProxy` as the
|
|
37
|
+
* `AddonApi` argument — the cap-method dispatchers structurally
|
|
38
|
+
* match `client.<cap>.<method>.{query|mutate|subscribe}`.
|
|
39
|
+
*/
|
|
34
40
|
export interface UseDeviceProxyTrpc {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
41
|
+
readonly deviceManager: {
|
|
42
|
+
readonly getBindings: QueryFn<{
|
|
43
|
+
deviceId: number;
|
|
44
|
+
}, DeviceBinding>;
|
|
45
|
+
};
|
|
46
|
+
readonly live?: {
|
|
47
|
+
readonly onEvent: SubscribeFn<{
|
|
48
|
+
category: string;
|
|
49
|
+
}, {
|
|
50
|
+
category?: string;
|
|
51
|
+
data?: unknown;
|
|
52
|
+
source?: {
|
|
53
|
+
type: string;
|
|
54
|
+
id: string | number;
|
|
55
|
+
};
|
|
56
|
+
}>;
|
|
57
|
+
};
|
|
52
58
|
}
|
|
53
59
|
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
* @returns the proxy, or `null` while bindings are still loading or
|
|
61
|
+
* when `deviceId` is null. Re-rendered when bindings change.
|
|
62
|
+
*/
|
|
57
63
|
export declare function useDeviceProxy(trpc: UseDeviceProxyTrpc, deviceId: number | null): DeviceProxy | null;
|
|
58
64
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
65
|
+
* Companion hook — reads a `SliceHandle` reactively, returning the
|
|
66
|
+
* current value and re-rendering on every push from the kernel
|
|
67
|
+
* mirror. Pass `dev?.state.battery` etc. as the handle.
|
|
68
|
+
*
|
|
69
|
+
* const dev = useDeviceProxy(trpc, deviceId)
|
|
70
|
+
* const battery = useDeviceStateSlice(dev?.state.battery)
|
|
71
|
+
*
|
|
72
|
+
* Why a hook (and not just `dev.state.battery.subscribe(...)` inline)?
|
|
73
|
+
* React doesn't observe external mutations on its own — a bare
|
|
74
|
+
* subscribe call inside a render would fire on every render (memory
|
|
75
|
+
* leak), wouldn't trigger a re-render on slice change, and wouldn't
|
|
76
|
+
* clean up at unmount. The hook bridges the imperative
|
|
77
|
+
* `(value, subscribe)` pair into React's declarative lifecycle via
|
|
78
|
+
* `useSyncExternalStore` (the canonical React 18 primitive for
|
|
79
|
+
* external stores — handles tearing in concurrent rendering and
|
|
80
|
+
* de-dups identical pushes).
|
|
81
|
+
*/
|
|
76
82
|
export declare function useDeviceStateSlice<T>(handle: StateSliceHandle<T> | undefined): T | undefined;
|
|
77
83
|
/**
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
export declare function useDeviceState<T>(trpc: UseDeviceProxyTrpc, deviceId: number | null, select: (state: DeviceProxy[
|
|
84
|
+
* One-line combinator — collapse the common
|
|
85
|
+
* `useDeviceProxy + useDeviceStateSlice(dev?.state.<cap>)` pair into a
|
|
86
|
+
* single hook. The selector receives the live `DeviceProxy['state']`
|
|
87
|
+
* bag (typed against the codegen, so `s.battery` etc. autocomplete)
|
|
88
|
+
* and returns one slice handle. Returns the slice value, undefined
|
|
89
|
+
* while the binding resolves OR when the slice has no cached push yet.
|
|
90
|
+
*
|
|
91
|
+
* Idiomatic call-site:
|
|
92
|
+
*
|
|
93
|
+
* const battery = useDeviceState(trpc, deviceId, (s) => s.battery)
|
|
94
|
+
* const zones = useDeviceState(trpc, deviceId, (s) => s.zones)
|
|
95
|
+
*
|
|
96
|
+
* vs. the manual pair:
|
|
97
|
+
*
|
|
98
|
+
* const dev = useDeviceProxy(trpc, deviceId)
|
|
99
|
+
* const battery = useDeviceStateSlice(dev?.state.battery)
|
|
100
|
+
* const zones = useDeviceStateSlice(dev?.state.zones)
|
|
101
|
+
*
|
|
102
|
+
* Use the manual pair when:
|
|
103
|
+
* - you also need the proxy's cap method bag (`dev.zones?.addZone(...)`)
|
|
104
|
+
* - you want to share the proxy across multiple slice reads with a
|
|
105
|
+
* single binding fetch (the combinator calls useDeviceProxy
|
|
106
|
+
* internally, which dedups bindings via React Query in practice
|
|
107
|
+
* but spawns one extra subscription per call site)
|
|
108
|
+
*
|
|
109
|
+
* Use the combinator when reading just one slice — most common case.
|
|
110
|
+
*/
|
|
111
|
+
export declare function useDeviceState<T>(trpc: UseDeviceProxyTrpc, deviceId: number | null, select: (state: DeviceProxy["state"]) => StateSliceHandle<T>): T | undefined;
|
|
106
112
|
export {};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
/** The hub-proxied path prefix for the snapshot image data plane, composed
|
|
2
|
-
|
|
2
|
+
* below on `baseUrl` or, for the same-origin case, on the page's mount. */
|
|
3
3
|
export declare const SNAPSHOT_MEDIA_PATH = "/addon/snapshot/media";
|
|
4
4
|
export interface DeviceSnapshotImage {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
/** Image URL ready for `<img src>`, or `null` when there is no device. */
|
|
6
|
+
readonly src: string | null;
|
|
7
|
+
/**
|
|
8
|
+
* Always false. Kept so existing callers' spinners compile; a URL needs no
|
|
9
|
+
* fetch state, and the `<img>` element owns its own load lifecycle (an
|
|
10
|
+
* unavailable snapshot surfaces as `onError`, which every consumer already
|
|
11
|
+
* handles because a device can legitimately have no camera).
|
|
12
|
+
*/
|
|
13
|
+
readonly loading: boolean;
|
|
14
|
+
/** Force ONE fresh capture (bypasses the wrapper's freshness gate, and wakes
|
|
15
|
+
* a battery camera — an operator action only). */
|
|
16
|
+
readonly refresh: () => void;
|
|
17
17
|
}
|
|
18
18
|
export interface UseDeviceSnapshotOptions {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Target width in px. The server snaps it to a ladder
|
|
21
|
+
* ([160, 240, 320, 480, 640, 960]) and derives the variant once per capture,
|
|
22
|
+
* so nearby sizes share one image. **Omitting it returns the frame as
|
|
23
|
+
* captured** — which is how a 28 px thumbnail came to cost a megabyte.
|
|
24
|
+
*/
|
|
25
|
+
readonly width?: number;
|
|
26
|
+
/** Absolute hub base. Omit in the admin UI, which is same-origin with the
|
|
27
|
+
* hub — the path then follows the page's mount (`hub-mount.ts`). */
|
|
28
|
+
readonly baseUrl?: string;
|
|
29
29
|
}
|
|
30
30
|
export declare function useDeviceSnapshotImage(deviceId: number | null, options?: UseDeviceSnapshotOptions): DeviceSnapshotImage;
|