@camstack/ui-library 0.1.57 → 0.2.0
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/addon-global-settings-form.d.ts +1 -1
- package/dist/composites/agent-step-editor.d.ts +1 -1
- package/dist/composites/app-shell/app-shell.d.ts +1 -1
- package/dist/composites/app-shell/sidebar-item.d.ts +1 -1
- package/dist/composites/app-shell/sidebar.d.ts +1 -1
- package/dist/composites/audio-classification-list.d.ts +1 -1
- package/dist/composites/audio-level-waveform.d.ts +1 -1
- package/dist/composites/audio-waveform.d.ts +1 -1
- package/dist/composites/battery-badge.d.ts +4 -1
- package/dist/composites/breadcrumb.d.ts +2 -1
- package/dist/composites/camera-stream-player.d.ts +94 -2
- package/dist/composites/cap-settings/AutotrackSection.d.ts +1 -1
- package/dist/composites/cap-settings/ConsumablesPanel.d.ts +2 -0
- package/dist/composites/cap-settings/CoverageTrack.d.ts +12 -0
- package/dist/composites/cap-settings/EventBucketStrip.d.ts +25 -0
- package/dist/composites/cap-settings/EventHeatmap.d.ts +10 -0
- package/dist/composites/cap-settings/MaskShapeCanvas.d.ts +1 -1
- package/dist/composites/cap-settings/MotionZonesSettings.d.ts +1 -1
- package/dist/composites/cap-settings/PrivacyMaskSettings.d.ts +1 -1
- package/dist/composites/cap-settings/PtzPanel.d.ts +1 -1
- package/dist/composites/cap-settings/RecordingPanel.d.ts +2 -0
- package/dist/composites/cap-settings/RecordingRulesEditor.d.ts +7 -0
- package/dist/composites/cap-settings/RecordingSettings.d.ts +8 -0
- package/dist/composites/cap-settings/RecordingTimeline.d.ts +5 -0
- package/dist/composites/cap-settings/ScheduleBandsEditor.d.ts +7 -0
- package/dist/composites/cap-settings/TimelineControls.d.ts +21 -0
- package/dist/composites/cap-settings/event-thumb.d.ts +11 -0
- package/dist/composites/cap-settings/index.d.ts +4 -0
- package/dist/composites/cap-settings/recording-config-form.d.ts +34 -0
- package/dist/composites/cap-settings/recording-spans.d.ts +22 -0
- package/dist/composites/cap-settings/recording-timeline-model.d.ts +84 -0
- package/dist/composites/code-block.d.ts +1 -1
- package/dist/composites/config-form-builder.d.ts +1 -1
- package/dist/composites/config-form-field.d.ts +3 -3
- package/dist/composites/confirm-action-button.d.ts +1 -1
- package/dist/composites/confirm-dialog.d.ts +1 -1
- package/dist/composites/data-table/data-table-header.d.ts +1 -1
- package/dist/composites/data-table/data-table-pagination.d.ts +1 -1
- package/dist/composites/data-table/data-table-row.d.ts +1 -1
- package/dist/composites/data-table/data-table.d.ts +1 -1
- package/dist/composites/data-table.d.ts +1 -1
- package/dist/composites/detection-canvas.d.ts +1 -1
- package/dist/composites/detection-overlay.d.ts +1 -1
- package/dist/composites/detection-result-tree.d.ts +1 -1
- package/dist/composites/dev-shell.d.ts +1 -1
- package/dist/composites/device-activity-panel.d.ts +5 -1
- package/dist/composites/device-card.d.ts +1 -1
- package/dist/composites/device-controls/alarm-hero-card.d.ts +24 -0
- package/dist/composites/device-controls/atoms.d.ts +81 -0
- package/dist/composites/device-controls/brightness-panel.d.ts +3 -0
- package/dist/composites/device-controls/button-control.d.ts +18 -0
- package/dist/composites/device-controls/climate-panel.d.ts +16 -0
- package/dist/composites/device-controls/container-primary-hero.d.ts +24 -0
- package/dist/composites/device-controls/container-primary.d.ts +46 -0
- package/dist/composites/device-controls/control-panel.d.ts +10 -0
- package/dist/composites/device-controls/control-registry.d.ts +74 -0
- package/dist/composites/device-controls/cover-hero-card.d.ts +27 -0
- package/dist/composites/device-controls/cover-inline.d.ts +27 -0
- package/dist/composites/device-controls/cover-panel.d.ts +3 -0
- package/dist/composites/device-controls/dummy-hero-card.d.ts +6 -0
- package/dist/composites/device-controls/fan-hero-card.d.ts +21 -0
- package/dist/composites/device-controls/fan-panel.d.ts +3 -0
- package/dist/composites/device-controls/humidifier-control.d.ts +37 -0
- package/dist/composites/device-controls/image-control.d.ts +24 -0
- package/dist/composites/device-controls/index.d.ts +33 -0
- package/dist/composites/device-controls/lawn-mower-control.d.ts +24 -0
- package/dist/composites/device-controls/light-hero-card.d.ts +16 -0
- package/dist/composites/device-controls/lock-hero-card.d.ts +15 -0
- package/dist/composites/device-controls/lock-panel.d.ts +3 -0
- package/dist/composites/device-controls/media-player-hero-card.d.ts +17 -0
- package/dist/composites/device-controls/media-player-panel.d.ts +9 -0
- package/dist/composites/device-controls/offline-badge.d.ts +11 -0
- package/dist/composites/device-controls/panel-controls.d.ts +17 -0
- package/dist/composites/device-controls/popover-row-action.d.ts +9 -0
- package/dist/composites/device-controls/primary-child.d.ts +18 -0
- package/dist/composites/device-controls/radial-gauge.d.ts +20 -0
- package/dist/composites/device-controls/sensor-hero-card.d.ts +10 -0
- package/dist/composites/device-controls/sensor-inline-control.d.ts +11 -0
- package/dist/composites/device-controls/sensor-value-atom.d.ts +106 -0
- package/dist/composites/device-controls/switch-hero-card.d.ts +13 -0
- package/dist/composites/device-controls/switch-panel.d.ts +3 -0
- package/dist/composites/device-controls/tap-toggle.d.ts +17 -0
- package/dist/composites/device-controls/thermostat-hero-card.d.ts +17 -0
- package/dist/composites/device-controls/types.d.ts +17 -0
- package/dist/composites/device-controls/update-control.d.ts +11 -0
- package/dist/composites/device-controls/vacuum-control.d.ts +36 -0
- package/dist/composites/device-controls/valve-control.d.ts +46 -0
- package/dist/composites/device-controls/water-heater-control.d.ts +41 -0
- package/dist/composites/device-controls/weather-control.d.ts +41 -0
- package/dist/composites/device-export-panel.d.ts +1 -1
- package/dist/composites/device-grid.d.ts +1 -1
- package/dist/composites/device-item/actions.d.ts +12 -1
- package/dist/composites/device-item/child-layout.d.ts +32 -0
- package/dist/composites/device-item/child-section-accordion.d.ts +9 -0
- package/dist/composites/device-item/children-accordion.d.ts +1 -1
- package/dist/composites/device-item/container-children-context.d.ts +15 -0
- package/dist/composites/device-item/device-delete-action.d.ts +8 -0
- package/dist/composites/device-item/header.d.ts +8 -1
- package/dist/composites/device-item/helpers.d.ts +108 -2
- package/dist/composites/device-item/index.d.ts +4 -0
- package/dist/composites/device-item/preview.d.ts +3 -3
- package/dist/composites/device-item/reboot-quick-action.d.ts +9 -0
- package/dist/composites/device-item/status-dot.d.ts +4 -1
- package/dist/composites/device-list/batch-actions-bar.d.ts +15 -0
- package/dist/composites/device-list/batch-toolbar.d.ts +15 -0
- package/dist/composites/device-list/cards-layout.d.ts +18 -0
- package/dist/composites/device-list/columns.d.ts +68 -0
- package/dist/composites/device-list/device-mode.d.ts +115 -0
- package/dist/composites/device-list/filter-chips.d.ts +15 -6
- package/dist/composites/device-list/fuzzy-match.d.ts +27 -0
- package/dist/composites/device-list/generic-mode.d.ts +81 -0
- package/dist/composites/device-list/group.d.ts +19 -0
- package/dist/composites/device-list/hardware-cell.d.ts +7 -0
- package/dist/composites/device-list/hardware.d.ts +26 -0
- package/dist/composites/device-list/icon-action.d.ts +17 -0
- package/dist/composites/device-list/index.d.ts +23 -39
- package/dist/composites/device-list/multi-select.d.ts +22 -0
- package/dist/composites/device-list/sort.d.ts +18 -0
- package/dist/composites/device-list/sortable-header.d.ts +10 -0
- package/dist/composites/device-list/table-layout.d.ts +25 -0
- package/dist/composites/device-list/type-filter.d.ts +19 -0
- package/dist/composites/device-list/url-state.d.ts +7 -2
- package/dist/composites/device-meta.d.ts +38 -0
- package/dist/composites/discovery-panel.d.ts +4 -4
- package/dist/composites/doorbell-recent-panel.d.ts +1 -1
- package/dist/composites/empty-state.d.ts +1 -1
- package/dist/composites/error-box.d.ts +1 -1
- package/dist/composites/event-stream.d.ts +2 -2
- package/dist/composites/filter-bar.d.ts +1 -1
- package/dist/composites/form-field.d.ts +1 -1
- package/dist/composites/hls-quality.d.ts +35 -0
- package/dist/composites/hls-video.d.ts +26 -0
- package/dist/composites/hover-zoom-image.d.ts +18 -0
- package/dist/composites/image-selector.d.ts +1 -1
- package/dist/composites/index.d.ts +15 -4
- package/dist/composites/inference-config-selector.d.ts +1 -1
- package/dist/composites/kebab-menu.d.ts +1 -1
- package/dist/composites/key-value-list.d.ts +1 -1
- package/dist/composites/log-stream-scroll.d.ts +32 -0
- package/dist/composites/log-stream.d.ts +9 -2
- package/dist/composites/login-form.d.ts +1 -1
- package/dist/composites/node-picker.d.ts +1 -1
- package/dist/composites/page-header.d.ts +1 -1
- package/dist/composites/phase-icon.d.ts +1 -1
- package/dist/composites/pipeline-builder.d.ts +1 -1
- package/dist/composites/pipeline-runtime-selector.d.ts +1 -1
- package/dist/composites/pipeline-step.d.ts +3 -3
- package/dist/composites/pipeline-tree-matrix.d.ts +1 -1
- package/dist/composites/provider-badge.d.ts +1 -1
- package/dist/composites/ptz-overlay.d.ts +1 -1
- package/dist/composites/qr-code.d.ts +1 -1
- package/dist/composites/response-log.d.ts +1 -1
- package/dist/composites/scope-picker.d.ts +1 -1
- package/dist/composites/slide-over-panel.d.ts +1 -1
- package/dist/composites/snapshot-button.d.ts +1 -1
- package/dist/composites/stat-card.d.ts +1 -1
- package/dist/composites/state-values-stream.d.ts +1 -1
- package/dist/composites/status-badge.d.ts +1 -1
- package/dist/composites/step-timings.d.ts +1 -1
- package/dist/composites/step-tree-master.d.ts +1 -1
- package/dist/composites/stream-panel.d.ts +45 -10
- package/dist/composites/timezone-selector.d.ts +18 -0
- package/dist/composites/version-badge.d.ts +2 -2
- package/dist/composites/widget-panel.d.ts +28 -0
- package/dist/contexts/custom-field-renderers.d.ts +1 -1
- package/dist/contexts/device-context.d.ts +1 -1
- package/dist/contexts/player-overlays.d.ts +1 -1
- package/dist/contexts/system-context.d.ts +1 -1
- package/dist/contexts/vod-playback.d.ts +17 -0
- package/dist/contexts/widget-registry.d.ts +1 -1
- package/dist/contexts/zone-editing.d.ts +1 -1
- package/dist/generated/system-hooks.d.ts +386 -56
- package/dist/hooks/index.d.ts +8 -2
- package/dist/hooks/use-device-cap-slice.d.ts +19 -0
- package/dist/hooks/use-device-capability.d.ts +12 -0
- package/dist/hooks/use-device-list-page-size.d.ts +14 -0
- package/dist/hooks/use-device-webrtc.d.ts +36 -4
- package/dist/hooks/use-optimistic-slice.d.ts +11 -0
- package/dist/index.cjs +54834 -11195
- package/dist/index.d.ts +1 -0
- package/dist/index.js +54483 -11136
- package/dist/lib/format-control-datetime.d.ts +18 -0
- package/dist/lib/format-last-seen.d.ts +12 -0
- package/dist/lib/format-numeric.d.ts +9 -0
- package/dist/lib/index.d.ts +3 -0
- package/dist/primitives/bottom-sheet.d.ts +1 -1
- package/dist/primitives/collapsible-card.d.ts +1 -1
- package/dist/primitives/dialog.d.ts +19 -6
- package/dist/primitives/dropdown.d.ts +3 -3
- package/dist/primitives/floating-panel.d.ts +1 -1
- package/dist/primitives/mobile-drawer.d.ts +1 -1
- package/dist/primitives/popover.d.ts +3 -3
- package/dist/primitives/tabs.d.ts +4 -4
- package/dist/primitives/tooltip.d.ts +11 -5
- package/dist/theme/index.cjs +0 -3
- package/dist/theme/index.js +0 -2
- package/dist/theme/theme-provider.d.ts +1 -1
- package/package.json +13 -5
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/theme/index.cjs.map +0 -1
- package/dist/theme/index.js.map +0 -1
package/dist/hooks/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type { UseDeviceAutotrack } from './use-device-autotrack';
|
|
|
8
8
|
export { useDeviceBattery } from './use-device-battery';
|
|
9
9
|
export type { UseDeviceBatteryTrpc } from './use-device-battery';
|
|
10
10
|
export { useDoorbellEvents } from './use-doorbell-events';
|
|
11
|
-
export type { DoorbellPressEvent, UseDoorbellEventsResult, UseDoorbellEventsOptions } from './use-doorbell-events';
|
|
11
|
+
export type { DoorbellPressEvent, UseDoorbellEventsResult, UseDoorbellEventsOptions, } from './use-doorbell-events';
|
|
12
12
|
export { useClusterNodes } from './use-cluster-nodes';
|
|
13
13
|
export { useDebouncedString } from './use-debounced-string';
|
|
14
14
|
export { useEventStreamLatest, useEventStreamMap } from './use-event-stream';
|
|
@@ -20,10 +20,16 @@ export { useDeviceSnapshotImage } from './use-device-snapshot';
|
|
|
20
20
|
export type { DeviceSnapshotImage } from './use-device-snapshot';
|
|
21
21
|
export type { ClusterNode } from './use-cluster-nodes';
|
|
22
22
|
export type { DeviceDetections, MotionState, MotionZone, MotionRawState, MotionRawBox, DetectionState, } from './use-device-detections';
|
|
23
|
-
export type { DeviceWebrtcResult, UseDeviceWebrtcTrpc, DevicePipelineMetrics } from './use-device-webrtc';
|
|
23
|
+
export type { DeviceWebrtcResult, UseDeviceWebrtcTrpc, DevicePipelineMetrics, WebrtcTarget, SessionRenegotiationState, } from './use-device-webrtc';
|
|
24
24
|
export { useLiveBuffer } from './use-live-buffer';
|
|
25
25
|
export type { LiveBuffer } from './use-live-buffer';
|
|
26
26
|
export { useDevices, useDevice } from './use-devices';
|
|
27
27
|
export { useSystemQuery, useSystemMutation, type SystemQuerySelector, type SystemMutationSelector, } from './use-system-query';
|
|
28
28
|
export { useLiveEvent, type LiveEventCallback } from './use-live-event';
|
|
29
29
|
export { useEventInvalidation } from './use-event-invalidation';
|
|
30
|
+
export { useOptimisticSlice } from './use-optimistic-slice';
|
|
31
|
+
export type { UseOptimisticSliceOptions, UseOptimisticSliceResult } from './use-optimistic-slice';
|
|
32
|
+
export { useDeviceCapSlice } from './use-device-cap-slice';
|
|
33
|
+
export type { UseDeviceCapSliceTrpc } from './use-device-cap-slice';
|
|
34
|
+
export { useDeviceListPageSize, DEVICE_LIST_PAGE_SIZE_OPTIONS, DEVICE_LIST_PAGE_SIZE_KEY, } from './use-device-list-page-size';
|
|
35
|
+
export type { SetDeviceListPageSize } from './use-device-list-page-size';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SliceHandleApi } from '@camstack/types';
|
|
2
|
+
/**
|
|
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
|
+
export type UseDeviceCapSliceTrpc = SliceHandleApi;
|
|
10
|
+
/**
|
|
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
|
+
export declare function useDeviceCapSlice(trpc: UseDeviceCapSliceTrpc, deviceId: number | null, capName: string): unknown | undefined;
|
|
@@ -13,5 +13,17 @@ export interface UseDeviceCapabilityResult<TCap, TSlice> {
|
|
|
13
13
|
readonly cap: TCap | undefined;
|
|
14
14
|
readonly slice: TSlice | undefined;
|
|
15
15
|
readonly available: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Resolved device liveness from the auto-registered `device-status`
|
|
18
|
+
* cap slice. Defaults to `true` until the slice lands so initial load
|
|
19
|
+
* never false-disables a control. Drives `available` (offline = no
|
|
20
|
+
* control).
|
|
21
|
+
*/
|
|
22
|
+
readonly online: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Ms epoch of the last `online` transition when the device is
|
|
25
|
+
* currently offline, else `null`. Lets a badge render "offline since".
|
|
26
|
+
*/
|
|
27
|
+
readonly offlineSince: number | null;
|
|
16
28
|
}
|
|
17
29
|
export declare function useDeviceCapability<TCap, TSlice>(options: UseDeviceCapabilityOptions<TCap, TSlice>): UseDeviceCapabilityResult<TCap, TSlice>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Selectable per-page sizes. The table default (50) is intentionally one of them. */
|
|
2
|
+
export declare const DEVICE_LIST_PAGE_SIZE_OPTIONS: readonly number[];
|
|
3
|
+
/** Canonical default — used whenever a caller's `defaultSize` is itself invalid. */
|
|
4
|
+
export declare const DEVICE_LIST_PAGE_SIZE_DEFAULT = 50;
|
|
5
|
+
/** Single global key shared across every device-list surface. */
|
|
6
|
+
export declare const DEVICE_LIST_PAGE_SIZE_KEY = "camstack.device-list.pageSize";
|
|
7
|
+
export type SetDeviceListPageSize = (next: number) => void;
|
|
8
|
+
/**
|
|
9
|
+
* @param defaultSize fallback when nothing valid is stored. If it is not itself
|
|
10
|
+
* a member of {@link DEVICE_LIST_PAGE_SIZE_OPTIONS}, it is replaced by
|
|
11
|
+
* {@link DEVICE_LIST_PAGE_SIZE_DEFAULT} so it can never seed a phantom value.
|
|
12
|
+
* @returns `[size, setSize]` — `setSize` ignores values outside the allowed set.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useDeviceListPageSize(defaultSize: number): readonly [number, SetDeviceListPageSize];
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import { CamProfile } from '@camstack/types';
|
|
1
2
|
import { StreamChoice } from '../composites/stream-panel';
|
|
2
3
|
import { ClientStreamHints, SignalingResult, ClientOfferResult } from '../composites/camera-stream-player';
|
|
3
4
|
/**
|
|
4
5
|
* Discriminated WebRTC target — same shape as `WebrtcStreamTarget` on
|
|
5
|
-
* the backend cap.
|
|
6
|
-
*
|
|
6
|
+
* the backend cap. The `profile` tier uses the canonical `CamProfile`
|
|
7
|
+
* enum so an invalid tier is a compile error.
|
|
7
8
|
*/
|
|
8
9
|
export type WebrtcTarget = {
|
|
9
10
|
readonly kind: 'adaptive';
|
|
10
11
|
} | {
|
|
11
12
|
readonly kind: 'profile';
|
|
12
|
-
readonly profile:
|
|
13
|
+
readonly profile: CamProfile;
|
|
13
14
|
} | {
|
|
14
15
|
readonly kind: 'cam-stream';
|
|
15
16
|
readonly camStreamId: string;
|
|
@@ -63,6 +64,7 @@ export interface UseDeviceWebrtcTrpc {
|
|
|
63
64
|
deviceId: number;
|
|
64
65
|
target: WebrtcTarget;
|
|
65
66
|
sdpOffer: string;
|
|
67
|
+
sessionId?: string;
|
|
66
68
|
}, {
|
|
67
69
|
sessionId: string;
|
|
68
70
|
sdpAnswer: string;
|
|
@@ -96,6 +98,21 @@ export interface UseDeviceWebrtcTrpc {
|
|
|
96
98
|
deviceId: number;
|
|
97
99
|
sessionId: string;
|
|
98
100
|
}, void>;
|
|
101
|
+
/**
|
|
102
|
+
* Poll the live signaling state of a session. `pendingRenegotiation`
|
|
103
|
+
* is non-null after the server swaps the broker source to a different
|
|
104
|
+
* tier (adaptive downgrade) — the client must re-offer on the same
|
|
105
|
+
* `sessionId`; `epoch` guards against acting on a stale poll twice.
|
|
106
|
+
*/
|
|
107
|
+
getSessionState: QueryFn<{
|
|
108
|
+
deviceId: number;
|
|
109
|
+
sessionId: string;
|
|
110
|
+
}, {
|
|
111
|
+
pendingRenegotiation: {
|
|
112
|
+
target: WebrtcTarget;
|
|
113
|
+
epoch: number;
|
|
114
|
+
} | null;
|
|
115
|
+
}>;
|
|
99
116
|
};
|
|
100
117
|
pipelineOrchestrator?: {
|
|
101
118
|
getCameraMetrics: QueryFn<{
|
|
@@ -143,7 +160,7 @@ export interface DeviceWebrtcResult {
|
|
|
143
160
|
* H.264 decode caps in the offer, so a Main/High (incl. 4K) source passes
|
|
144
161
|
* through with no transcode — the only path that lets iOS decode High.
|
|
145
162
|
*/
|
|
146
|
-
readonly handleOffer: (target: WebrtcTarget, sdpOffer: string) => Promise<ClientOfferResult>;
|
|
163
|
+
readonly handleOffer: (target: WebrtcTarget, sdpOffer: string, sessionId?: string) => Promise<ClientOfferResult>;
|
|
147
164
|
/**
|
|
148
165
|
* Fetch the browser-side ICE servers (STUN + TURN from the `turn-provider`
|
|
149
166
|
* cap). Needed for client-offer mode, where the PeerConnection must be
|
|
@@ -161,6 +178,21 @@ export interface DeviceWebrtcResult {
|
|
|
161
178
|
}>;
|
|
162
179
|
/** Close a WebRTC session on the server. */
|
|
163
180
|
readonly closeSession: (sessionId: string) => Promise<void>;
|
|
181
|
+
/**
|
|
182
|
+
* Poll the live signaling state of a session. After an adaptive tier
|
|
183
|
+
* switch the server returns a non-null `pendingRenegotiation` (the new
|
|
184
|
+
* target + a monotonic `epoch`); the player re-offers on the SAME
|
|
185
|
+
* `sessionId` so the session re-negotiates against the new tier. Returns
|
|
186
|
+
* `{ pendingRenegotiation: null }` for non-adaptive / steady sessions.
|
|
187
|
+
*/
|
|
188
|
+
readonly getSessionState: (sessionId: string) => Promise<SessionRenegotiationState>;
|
|
189
|
+
}
|
|
190
|
+
/** Live signaling state for a session — the adaptive re-offer signal. */
|
|
191
|
+
export interface SessionRenegotiationState {
|
|
192
|
+
readonly pendingRenegotiation: {
|
|
193
|
+
readonly target: WebrtcTarget;
|
|
194
|
+
readonly epoch: number;
|
|
195
|
+
} | null;
|
|
164
196
|
}
|
|
165
197
|
/**
|
|
166
198
|
* Hook that provides WebRTC signaling callbacks and stream choices for a device.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface UseOptimisticSliceOptions {
|
|
2
|
+
readonly enabled?: boolean;
|
|
3
|
+
readonly timeoutMs?: number;
|
|
4
|
+
}
|
|
5
|
+
export interface UseOptimisticSliceResult<T> {
|
|
6
|
+
/** The slice to RENDER: the optimistic override if active, else the real slice. */
|
|
7
|
+
readonly display: T | undefined;
|
|
8
|
+
/** Apply an optimistic patch (merged onto the current display) after issuing a command. */
|
|
9
|
+
readonly applyOptimistic: (patch: Partial<T>) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function useOptimisticSlice<T extends object>(realSlice: T | undefined, opts?: UseOptimisticSliceOptions): UseOptimisticSliceResult<T>;
|