@camstack/ui-library 0.1.51 → 0.1.53
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/cap-settings/AutotrackSection.d.ts +5 -0
- package/dist/composites/cap-settings/MotionGridCanvas.d.ts +9 -0
- package/dist/composites/cap-settings/MotionZonesSettings.d.ts +2 -0
- package/dist/composites/cap-settings/PtzPanel.d.ts +2 -0
- package/dist/composites/cap-settings/index.d.ts +14 -0
- package/dist/composites/index.d.ts +2 -0
- package/dist/composites/state-values-stream.d.ts +14 -18
- package/dist/contexts/widget-registry.d.ts +67 -6
- package/dist/generated/system-hooks.d.ts +66 -30
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/use-device-autotrack.d.ts +10 -0
- package/dist/hooks/use-ptz.d.ts +29 -1
- package/dist/index.cjs +2140 -1162
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2099 -1148
- package/dist/index.js.map +1 -1
- package/dist/widgets/host-widgets.d.ts +9 -0
- package/package.json +9 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MotionZoneOptions } from '@camstack/types';
|
|
2
|
+
export interface MotionGridCanvasProps {
|
|
3
|
+
/** Fixed lattice dimensions — from the cap's `getOptions`. */
|
|
4
|
+
readonly options: MotionZoneOptions;
|
|
5
|
+
/** Row-major active-cell grid, length === gridWidth*gridHeight. */
|
|
6
|
+
readonly cells: readonly boolean[];
|
|
7
|
+
readonly onCellsChange: (next: boolean[]) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function MotionGridCanvas({ options, cells, onCellsChange }: MotionGridCanvasProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { PtzPanel } from './PtzPanel';
|
|
2
|
+
export { AutotrackSection } from './AutotrackSection';
|
|
3
|
+
export { MotionZonesSettings } from './MotionZonesSettings';
|
|
4
|
+
/**
|
|
5
|
+
* Props every cap-settings component receives.
|
|
6
|
+
*
|
|
7
|
+
* Components are resolved by `componentId` through the admin-ui
|
|
8
|
+
* `UI_COMPONENTS` registry (the cap-name-keyed `CAP_SETTINGS_COMPONENTS`
|
|
9
|
+
* registry has been retired). This shape mirrors the admin-ui
|
|
10
|
+
* `UiComponentProps` contract.
|
|
11
|
+
*/
|
|
12
|
+
export interface CapSettingsComponentProps {
|
|
13
|
+
readonly deviceId: number;
|
|
14
|
+
}
|
|
@@ -108,3 +108,5 @@ export { WidgetSlot } from './widget-slot';
|
|
|
108
108
|
export type { WidgetSlotProps } from './widget-slot';
|
|
109
109
|
export { ScopePicker, validateScopes } from './scope-picker';
|
|
110
110
|
export type { ScopeAccess } from './scope-picker';
|
|
111
|
+
export { PtzPanel, AutotrackSection, MotionZonesSettings } from './cap-settings';
|
|
112
|
+
export type { CapSettingsComponentProps } from './cap-settings';
|
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
import { LiveBuffer } from '../hooks/use-live-buffer';
|
|
2
|
-
interface StateChangeEntry {
|
|
3
|
-
readonly id: string;
|
|
4
|
-
readonly timestamp: string;
|
|
5
|
-
readonly capName: string;
|
|
6
|
-
readonly slice: Record<string, unknown>;
|
|
7
|
-
}
|
|
8
2
|
export interface StateValuesStreamProps {
|
|
9
|
-
/** Device whose runtime-state
|
|
3
|
+
/** Device whose runtime-state we want to render. Required. */
|
|
10
4
|
readonly deviceId: number;
|
|
11
5
|
/** Initial cap-name filter — empty = all caps visible. */
|
|
12
6
|
readonly defaultCaps?: readonly string[];
|
|
13
|
-
/** Max height CSS class. */
|
|
7
|
+
/** Max height CSS class for the scrollable tree body. */
|
|
14
8
|
readonly maxHeight?: string;
|
|
15
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated The State panel no longer keeps a chronological log,
|
|
11
|
+
* so there is no historical fetch to size. Accepted but ignored;
|
|
12
|
+
* retained so existing callers don't break.
|
|
13
|
+
*/
|
|
16
14
|
readonly limit?: number;
|
|
17
15
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* so
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* tabs).
|
|
16
|
+
* @deprecated The State panel now renders a live current-state tree
|
|
17
|
+
* sourced from `deviceState.getAllSnapshots` + the realtime
|
|
18
|
+
* subscription, so there is no append-buffer to host across
|
|
19
|
+
* tab switches. Accepted but ignored; retained so `DeviceActivityPanel`
|
|
20
|
+
* (which passes a buffer) keeps type-checking without a ripple edit.
|
|
24
21
|
*/
|
|
25
|
-
readonly liveBuffer?: LiveBuffer<
|
|
22
|
+
readonly liveBuffer?: LiveBuffer<unknown>;
|
|
26
23
|
readonly onClose?: () => void;
|
|
27
24
|
readonly className?: string;
|
|
28
25
|
}
|
|
29
|
-
export declare function StateValuesStream({ deviceId, defaultCaps, maxHeight,
|
|
30
|
-
export {};
|
|
26
|
+
export declare function StateValuesStream({ deviceId, defaultCaps, maxHeight, onClose, className, }: StateValuesStreamProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { UiContributionRemote } from '@camstack/types';
|
|
2
3
|
/** Standard props every addon-contributed widget receives. */
|
|
3
4
|
export interface WidgetProps {
|
|
4
5
|
/** Stable id of THIS widget instance (form-builder field key, dashboard slot UUID, etc.). */
|
|
@@ -22,6 +23,11 @@ export interface WidgetRegistry {
|
|
|
22
23
|
* Returns the resolved widget component for `<addonId>/<stableId>`,
|
|
23
24
|
* or `undefined` when the widget id is unknown to the registry, or
|
|
24
25
|
* `null` while the bundle is still loading.
|
|
26
|
+
*
|
|
27
|
+
* @deprecated Unused by all render paths since the unified
|
|
28
|
+
* UI-contribution model (Task 10). Resolve remotes through
|
|
29
|
+
* `useRemoteComponent` / `<WidgetSlot>` instead. Kept for external
|
|
30
|
+
* addons that may still call it.
|
|
25
31
|
*/
|
|
26
32
|
resolve(widgetId: string): ComponentType<WidgetProps> | null | undefined;
|
|
27
33
|
/** Metadata lookup — used by `<WidgetSlot>` to validate `requires`. */
|
|
@@ -29,32 +35,71 @@ export interface WidgetRegistry {
|
|
|
29
35
|
/** Every contributed widget. Used by host pickers (e.g. dashboard
|
|
30
36
|
* add-widget modal) to enumerate the available widgets. */
|
|
31
37
|
listAll(): readonly WidgetMetadataEntry[];
|
|
38
|
+
/**
|
|
39
|
+
* Resolve the versioned MF entry URL for a remote name — the
|
|
40
|
+
* aggregator-stamped `bundleUrl`. Used by the unified
|
|
41
|
+
* `ContributionRenderer` `kind:'remote'` path to load a remote it
|
|
42
|
+
* only knows by `remoteName`. `undefined` when no widget in the
|
|
43
|
+
* registry references that remote.
|
|
44
|
+
*/
|
|
45
|
+
entryUrlFor(remoteName: string): string | undefined;
|
|
32
46
|
}
|
|
33
|
-
/**
|
|
47
|
+
/** Widget host kinds — a widget can run on more than one host. */
|
|
48
|
+
export type WidgetHost = 'device-tab' | 'dashboard' | 'integration-detail';
|
|
49
|
+
/** Dashboard sizing hints. */
|
|
50
|
+
export type WidgetSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
51
|
+
/**
|
|
52
|
+
* One enriched-aggregator entry exposed to consumers.
|
|
53
|
+
*
|
|
54
|
+
* A widget declaration IS a `UiContribution` (`kind:'remote'`) plus
|
|
55
|
+
* widget-only metadata — this entry mirrors that shape with the
|
|
56
|
+
* aggregator-stamped `addonId` + `bundleUrl` added.
|
|
57
|
+
*/
|
|
34
58
|
export interface WidgetMetadataEntry {
|
|
35
59
|
readonly widgetId: string;
|
|
36
60
|
readonly addonId: string;
|
|
37
61
|
readonly stableId: string;
|
|
62
|
+
readonly tab: string;
|
|
63
|
+
readonly subTab?: string;
|
|
38
64
|
readonly label: string;
|
|
65
|
+
readonly order?: number;
|
|
66
|
+
readonly kind: 'remote';
|
|
67
|
+
readonly remote: UiContributionRemote;
|
|
39
68
|
readonly description?: string;
|
|
40
69
|
readonly icon?: string;
|
|
41
|
-
readonly remoteName: string;
|
|
42
70
|
readonly bundleUrl: string;
|
|
43
|
-
readonly hosts: readonly
|
|
71
|
+
readonly hosts: readonly WidgetHost[];
|
|
44
72
|
readonly requires: {
|
|
45
73
|
readonly deviceContext: boolean;
|
|
46
74
|
readonly integrationContext: boolean;
|
|
47
75
|
};
|
|
48
|
-
readonly defaultSize:
|
|
49
|
-
readonly allowedSizes: readonly
|
|
76
|
+
readonly defaultSize: WidgetSize;
|
|
77
|
+
readonly allowedSizes: readonly WidgetSize[];
|
|
50
78
|
readonly defaultColumns: number;
|
|
51
79
|
readonly defaultRows: number;
|
|
52
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Register the MF remote (idempotent) and load one of its exposed
|
|
83
|
+
* modules. Returns the resolved `Record<componentKey, Component>` map
|
|
84
|
+
* (the exposed module's `default` export).
|
|
85
|
+
*
|
|
86
|
+
* Exported so the unified `ContributionRenderer` `kind:'remote'` path
|
|
87
|
+
* can load an arbitrary `{ remoteName, exposedModule }` descriptor —
|
|
88
|
+
* the same path the `WidgetRegistry` uses internally for widgets.
|
|
89
|
+
*/
|
|
90
|
+
export declare function loadRemoteBundle(remoteName: string, exposedModule: string, entryUrl: string): Promise<Record<string, ComponentType<WidgetProps>>>;
|
|
53
91
|
export interface WidgetRegistryProviderProps {
|
|
54
92
|
readonly children: ReactNode;
|
|
55
93
|
}
|
|
56
94
|
export declare function WidgetRegistryProvider({ children }: WidgetRegistryProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
57
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* Returns the registered widget component, `null` while loading, or
|
|
97
|
+
* `undefined` if unknown.
|
|
98
|
+
*
|
|
99
|
+
* @deprecated Unused by all render paths since the unified
|
|
100
|
+
* UI-contribution model (Task 10). Use `useRemoteComponent` /
|
|
101
|
+
* `<WidgetSlot>` instead. Kept for external addons that may import it.
|
|
102
|
+
*/
|
|
58
103
|
export declare function useWidget(widgetId: string): ComponentType<WidgetProps> | null | undefined;
|
|
59
104
|
/** Returns the metadata entry for a widget, or `undefined` if unknown. */
|
|
60
105
|
export declare function useWidgetMetadata(widgetId: string): WidgetMetadataEntry | undefined;
|
|
@@ -62,6 +107,22 @@ export declare function useWidgetMetadata(widgetId: string): WidgetMetadataEntry
|
|
|
62
107
|
* add-widget modal, settings UI palette) consume this to enumerate
|
|
63
108
|
* the registry. Filter on the call site by `metadata.hosts.includes()`. */
|
|
64
109
|
export declare function useAllWidgets(): readonly WidgetMetadataEntry[];
|
|
110
|
+
/**
|
|
111
|
+
* Resolve a `kind:'remote'` `UiContributionRemote` descriptor to a
|
|
112
|
+
* React component. Drives the unified `ContributionRenderer`
|
|
113
|
+
* `kind:'remote'` path — both device-detail contributions and dashboard
|
|
114
|
+
* widgets resolve through the same MF `loadRemoteBundle` loader.
|
|
115
|
+
*
|
|
116
|
+
* Returns:
|
|
117
|
+
* - `undefined` — the remote couldn't be resolved (no entry URL known,
|
|
118
|
+
* or the remote exposed no component for `componentKey`),
|
|
119
|
+
* - `null` — the bundle is still loading,
|
|
120
|
+
* - the component otherwise.
|
|
121
|
+
*
|
|
122
|
+
* `entryUrl` may be passed explicitly; when omitted it's resolved from
|
|
123
|
+
* the registry's aggregator-stamped `bundleUrl` for `remote.remoteName`.
|
|
124
|
+
*/
|
|
125
|
+
export declare function useRemoteComponent(remote: UiContributionRemote, entryUrl?: string): ComponentType<WidgetProps> | null | undefined;
|
|
65
126
|
/** Read the registry instance — throws when no provider is mounted. */
|
|
66
127
|
export declare function useWidgetRegistry(): WidgetRegistry;
|
|
67
128
|
/** Variant returning `null` when no provider is mounted — for boot splash etc. */
|
|
@@ -39,6 +39,8 @@ export declare const useAddonsGetLastRestart: typeof trpc.addons.getLastRestart.
|
|
|
39
39
|
export declare const useAddonsListFrameworkPackages: typeof trpc.addons.listFrameworkPackages.useQuery;
|
|
40
40
|
/** Generated alias around `trpc.addons.listCapabilityProviders.useQuery`. */
|
|
41
41
|
export declare const useAddonsListCapabilityProviders: typeof trpc.addons.listCapabilityProviders.useQuery;
|
|
42
|
+
/** Generated alias around `trpc.addons.setCapabilityProviderEnabled.useMutation`. */
|
|
43
|
+
export declare const useAddonsSetCapabilityProviderEnabled: typeof trpc.addons.setCapabilityProviderEnabled.useMutation;
|
|
42
44
|
/** Generated alias around `trpc.addons.updateFrameworkPackage.useMutation`. */
|
|
43
45
|
export declare const useAddonsUpdateFrameworkPackage: typeof trpc.addons.updateFrameworkPackage.useMutation;
|
|
44
46
|
/** Generated alias around `trpc.addons.getVersions.useQuery`. */
|
|
@@ -129,10 +131,6 @@ export declare const useAudioCodecListActiveSessions: typeof trpc.audioCodec.lis
|
|
|
129
131
|
export declare const useAudioMetricsGetCurrentSnapshot: typeof trpc.audioMetrics.getCurrentSnapshot.useQuery;
|
|
130
132
|
/** Generated alias around `trpc.audioMetrics.getHistory.useQuery`. */
|
|
131
133
|
export declare const useAudioMetricsGetHistory: typeof trpc.audioMetrics.getHistory.useQuery;
|
|
132
|
-
/** Generated alias around `trpc.authentication.listProviders.useQuery`. */
|
|
133
|
-
export declare const useAuthenticationListProviders: typeof trpc.authentication.listProviders.useQuery;
|
|
134
|
-
/** Generated alias around `trpc.authentication.setProviderEnabled.useMutation`. */
|
|
135
|
-
export declare const useAuthenticationSetProviderEnabled: typeof trpc.authentication.setProviderEnabled.useMutation;
|
|
136
134
|
/** Generated alias around `trpc.backup.listDestinations.useQuery`. */
|
|
137
135
|
export declare const useBackupListDestinations: typeof trpc.backup.listDestinations.useQuery;
|
|
138
136
|
/** Generated alias around `trpc.backup.trigger.useMutation`. */
|
|
@@ -183,6 +181,12 @@ export declare const useDecoderPushPacket: typeof trpc.decoder.pushPacket.useQue
|
|
|
183
181
|
export declare const useDecoderOpenStream: typeof trpc.decoder.openStream.useQuery;
|
|
184
182
|
/** Generated alias around `trpc.decoder.pullFrames.useQuery`. */
|
|
185
183
|
export declare const useDecoderPullFrames: typeof trpc.decoder.pullFrames.useQuery;
|
|
184
|
+
/** Generated alias around `trpc.decoder.pullHandles.useQuery`. */
|
|
185
|
+
export declare const useDecoderPullHandles: typeof trpc.decoder.pullHandles.useQuery;
|
|
186
|
+
/** Generated alias around `trpc.decoder.getFrame.useQuery`. */
|
|
187
|
+
export declare const useDecoderGetFrame: typeof trpc.decoder.getFrame.useQuery;
|
|
188
|
+
/** Generated alias around `trpc.decoder.getShmStats.useQuery`. */
|
|
189
|
+
export declare const useDecoderGetShmStats: typeof trpc.decoder.getShmStats.useQuery;
|
|
186
190
|
/** Generated alias around `trpc.decoder.updateConfig.useQuery`. */
|
|
187
191
|
export declare const useDecoderUpdateConfig: typeof trpc.decoder.updateConfig.useQuery;
|
|
188
192
|
/** Generated alias around `trpc.decoder.getStats.useQuery`. */
|
|
@@ -425,18 +429,6 @@ export declare const useMeshNetworkLogout: typeof trpc.meshNetwork.logout.useMut
|
|
|
425
429
|
export declare const useMeshNetworkListPeers: typeof trpc.meshNetwork.listPeers.useQuery;
|
|
426
430
|
/** Generated alias around `trpc.meshNetwork.testConnection.useMutation`. */
|
|
427
431
|
export declare const useMeshNetworkTestConnection: typeof trpc.meshNetwork.testConnection.useMutation;
|
|
428
|
-
/** Generated alias around `trpc.meshOrchestrator.listProviders.useQuery`. */
|
|
429
|
-
export declare const useMeshOrchestratorListProviders: typeof trpc.meshOrchestrator.listProviders.useQuery;
|
|
430
|
-
/** Generated alias around `trpc.meshOrchestrator.joinProvider.useMutation`. */
|
|
431
|
-
export declare const useMeshOrchestratorJoinProvider: typeof trpc.meshOrchestrator.joinProvider.useMutation;
|
|
432
|
-
/** Generated alias around `trpc.meshOrchestrator.leaveProvider.useMutation`. */
|
|
433
|
-
export declare const useMeshOrchestratorLeaveProvider: typeof trpc.meshOrchestrator.leaveProvider.useMutation;
|
|
434
|
-
/** Generated alias around `trpc.meshOrchestrator.startLoginProvider.useMutation`. */
|
|
435
|
-
export declare const useMeshOrchestratorStartLoginProvider: typeof trpc.meshOrchestrator.startLoginProvider.useMutation;
|
|
436
|
-
/** Generated alias around `trpc.meshOrchestrator.logoutProvider.useMutation`. */
|
|
437
|
-
export declare const useMeshOrchestratorLogoutProvider: typeof trpc.meshOrchestrator.logoutProvider.useMutation;
|
|
438
|
-
/** Generated alias around `trpc.meshOrchestrator.listProviderPeers.useQuery`. */
|
|
439
|
-
export declare const useMeshOrchestratorListProviderPeers: typeof trpc.meshOrchestrator.listProviderPeers.useQuery;
|
|
440
432
|
/** Generated alias around `trpc.metricsProvider.collectSnapshot.useQuery`. */
|
|
441
433
|
export declare const useMetricsProviderCollectSnapshot: typeof trpc.metricsProvider.collectSnapshot.useQuery;
|
|
442
434
|
/** Generated alias around `trpc.metricsProvider.getCached.useQuery`. */
|
|
@@ -479,6 +471,12 @@ export declare const useMotionDetectionApplyDeviceSettingsPatch: typeof trpc.mot
|
|
|
479
471
|
export declare const useMotionTriggerSetMotionTrigger: typeof trpc.motionTrigger.setMotionTrigger.useMutation;
|
|
480
472
|
/** Generated alias around `trpc.motionTrigger.getStatus.useQuery`. */
|
|
481
473
|
export declare const useMotionTriggerGetStatus: typeof trpc.motionTrigger.getStatus.useQuery;
|
|
474
|
+
/** Generated alias around `trpc.motionZones.getOptions.useQuery`. */
|
|
475
|
+
export declare const useMotionZonesGetOptions: typeof trpc.motionZones.getOptions.useQuery;
|
|
476
|
+
/** Generated alias around `trpc.motionZones.setZone.useMutation`. */
|
|
477
|
+
export declare const useMotionZonesSetZone: typeof trpc.motionZones.setZone.useMutation;
|
|
478
|
+
/** Generated alias around `trpc.motionZones.getStatus.useQuery`. */
|
|
479
|
+
export declare const useMotionZonesGetStatus: typeof trpc.motionZones.getStatus.useQuery;
|
|
482
480
|
/** Generated alias around `trpc.mqttBroker.listBrokers.useQuery`. */
|
|
483
481
|
export declare const useMqttBrokerListBrokers: typeof trpc.mqttBroker.listBrokers.useQuery;
|
|
484
482
|
/** Generated alias around `trpc.mqttBroker.getBrokerConfig.useQuery`. */
|
|
@@ -497,6 +495,16 @@ export declare const useMqttBrokerStopEmbeddedBroker: typeof trpc.mqttBroker.sto
|
|
|
497
495
|
export declare const useMqttBrokerGetStatus: typeof trpc.mqttBroker.getStatus.useQuery;
|
|
498
496
|
/** Generated alias around `trpc.nativeObjectDetection.getStatus.useQuery`. */
|
|
499
497
|
export declare const useNativeObjectDetectionGetStatus: typeof trpc.nativeObjectDetection.getStatus.useQuery;
|
|
498
|
+
/** Generated alias around `trpc.networkAccess.start.useMutation`. */
|
|
499
|
+
export declare const useNetworkAccessStart: typeof trpc.networkAccess.start.useMutation;
|
|
500
|
+
/** Generated alias around `trpc.networkAccess.stop.useMutation`. */
|
|
501
|
+
export declare const useNetworkAccessStop: typeof trpc.networkAccess.stop.useMutation;
|
|
502
|
+
/** Generated alias around `trpc.networkAccess.getEndpoint.useQuery`. */
|
|
503
|
+
export declare const useNetworkAccessGetEndpoint: typeof trpc.networkAccess.getEndpoint.useQuery;
|
|
504
|
+
/** Generated alias around `trpc.networkAccess.getStatus.useQuery`. */
|
|
505
|
+
export declare const useNetworkAccessGetStatus: typeof trpc.networkAccess.getStatus.useQuery;
|
|
506
|
+
/** Generated alias around `trpc.networkAccess.listEndpoints.useQuery`. */
|
|
507
|
+
export declare const useNetworkAccessListEndpoints: typeof trpc.networkAccess.listEndpoints.useQuery;
|
|
500
508
|
/** Generated alias around `trpc.networkQuality.getDeviceStats.useQuery`. */
|
|
501
509
|
export declare const useNetworkQualityGetDeviceStats: typeof trpc.networkQuality.getDeviceStats.useQuery;
|
|
502
510
|
/** Generated alias around `trpc.networkQuality.getAllStats.useQuery`. */
|
|
@@ -521,6 +529,8 @@ export declare const useNodesShutdownNode: typeof trpc.nodes.shutdownNode.useMut
|
|
|
521
529
|
export declare const useNodesRenameNode: typeof trpc.nodes.renameNode.useMutation;
|
|
522
530
|
/** Generated alias around `trpc.nodes.clusterAddonStatus.useQuery`. */
|
|
523
531
|
export declare const useNodesClusterAddonStatus: typeof trpc.nodes.clusterAddonStatus.useQuery;
|
|
532
|
+
/** Generated alias around `trpc.nodes.getCapUsageGraph.useQuery`. */
|
|
533
|
+
export declare const useNodesGetCapUsageGraph: typeof trpc.nodes.getCapUsageGraph.useQuery;
|
|
524
534
|
/** Generated alias around `trpc.nodes.getNodeAddons.useQuery`. */
|
|
525
535
|
export declare const useNodesGetNodeAddons: typeof trpc.nodes.getNodeAddons.useQuery;
|
|
526
536
|
/** Generated alias around `trpc.nodes.setProcessLogLevel.useMutation`. */
|
|
@@ -739,10 +749,18 @@ export declare const usePtzStop: typeof trpc.ptz.stop.useMutation;
|
|
|
739
749
|
export declare const usePtzGetPresets: typeof trpc.ptz.getPresets.useQuery;
|
|
740
750
|
/** Generated alias around `trpc.ptz.goToPreset.useMutation`. */
|
|
741
751
|
export declare const usePtzGoToPreset: typeof trpc.ptz.goToPreset.useMutation;
|
|
752
|
+
/** Generated alias around `trpc.ptz.savePreset.useMutation`. */
|
|
753
|
+
export declare const usePtzSavePreset: typeof trpc.ptz.savePreset.useMutation;
|
|
754
|
+
/** Generated alias around `trpc.ptz.deletePreset.useMutation`. */
|
|
755
|
+
export declare const usePtzDeletePreset: typeof trpc.ptz.deletePreset.useMutation;
|
|
756
|
+
/** Generated alias around `trpc.ptz.getOptions.useQuery`. */
|
|
757
|
+
export declare const usePtzGetOptions: typeof trpc.ptz.getOptions.useQuery;
|
|
742
758
|
/** Generated alias around `trpc.ptz.goHome.useMutation`. */
|
|
743
759
|
export declare const usePtzGoHome: typeof trpc.ptz.goHome.useMutation;
|
|
744
760
|
/** Generated alias around `trpc.ptz.getPosition.useQuery`. */
|
|
745
761
|
export declare const usePtzGetPosition: typeof trpc.ptz.getPosition.useQuery;
|
|
762
|
+
/** Generated alias around `trpc.ptz.setAutofocus.useMutation`. */
|
|
763
|
+
export declare const usePtzSetAutofocus: typeof trpc.ptz.setAutofocus.useMutation;
|
|
746
764
|
/** Generated alias around `trpc.ptz.getStatus.useQuery`. */
|
|
747
765
|
export declare const usePtzGetStatus: typeof trpc.ptz.getStatus.useQuery;
|
|
748
766
|
/** Generated alias around `trpc.ptzAutotrack.getStatus.useQuery`. */
|
|
@@ -797,12 +815,6 @@ export declare const useRecordingEngineGetRetentionConfig: typeof trpc.recording
|
|
|
797
815
|
export declare const useRecordingEngineUpdateRetentionConfig: typeof trpc.recordingEngine.updateRetentionConfig.useMutation;
|
|
798
816
|
/** Generated alias around `trpc.recordingEngine.getMotionStats.useQuery`. */
|
|
799
817
|
export declare const useRecordingEngineGetMotionStats: typeof trpc.recordingEngine.getMotionStats.useQuery;
|
|
800
|
-
/** Generated alias around `trpc.remoteAccess.listProviders.useQuery`. */
|
|
801
|
-
export declare const useRemoteAccessListProviders: typeof trpc.remoteAccess.listProviders.useQuery;
|
|
802
|
-
/** Generated alias around `trpc.remoteAccess.startProvider.useMutation`. */
|
|
803
|
-
export declare const useRemoteAccessStartProvider: typeof trpc.remoteAccess.startProvider.useMutation;
|
|
804
|
-
/** Generated alias around `trpc.remoteAccess.stopProvider.useMutation`. */
|
|
805
|
-
export declare const useRemoteAccessStopProvider: typeof trpc.remoteAccess.stopProvider.useMutation;
|
|
806
818
|
/** Generated alias around `trpc.settingsStore.get.useQuery`. */
|
|
807
819
|
export declare const useSettingsStoreGet: typeof trpc.settingsStore.get.useQuery;
|
|
808
820
|
/** Generated alias around `trpc.settingsStore.set.useMutation`. */
|
|
@@ -905,8 +917,18 @@ export declare const useStreamBrokerGetStreamUrl: typeof trpc.streamBroker.getSt
|
|
|
905
917
|
export declare const useStreamBrokerGetStreamWithCodec: typeof trpc.streamBroker.getStreamWithCodec.useMutation;
|
|
906
918
|
/** Generated alias around `trpc.streamBroker.releaseStreamWithCodec.useMutation`. */
|
|
907
919
|
export declare const useStreamBrokerReleaseStreamWithCodec: typeof trpc.streamBroker.releaseStreamWithCodec.useMutation;
|
|
908
|
-
/** Generated alias around `trpc.streamBroker.
|
|
909
|
-
export declare const
|
|
920
|
+
/** Generated alias around `trpc.streamBroker.subscribeAudioChunks.useMutation`. */
|
|
921
|
+
export declare const useStreamBrokerSubscribeAudioChunks: typeof trpc.streamBroker.subscribeAudioChunks.useMutation;
|
|
922
|
+
/** Generated alias around `trpc.streamBroker.pullAudioChunks.useQuery`. */
|
|
923
|
+
export declare const useStreamBrokerPullAudioChunks: typeof trpc.streamBroker.pullAudioChunks.useQuery;
|
|
924
|
+
/** Generated alias around `trpc.streamBroker.unsubscribeAudioChunks.useMutation`. */
|
|
925
|
+
export declare const useStreamBrokerUnsubscribeAudioChunks: typeof trpc.streamBroker.unsubscribeAudioChunks.useMutation;
|
|
926
|
+
/** Generated alias around `trpc.streamBroker.subscribeFrames.useMutation`. */
|
|
927
|
+
export declare const useStreamBrokerSubscribeFrames: typeof trpc.streamBroker.subscribeFrames.useMutation;
|
|
928
|
+
/** Generated alias around `trpc.streamBroker.pullFrameHandles.useQuery`. */
|
|
929
|
+
export declare const useStreamBrokerPullFrameHandles: typeof trpc.streamBroker.pullFrameHandles.useQuery;
|
|
930
|
+
/** Generated alias around `trpc.streamBroker.unsubscribeFrames.useMutation`. */
|
|
931
|
+
export declare const useStreamBrokerUnsubscribeFrames: typeof trpc.streamBroker.unsubscribeFrames.useMutation;
|
|
910
932
|
/** Generated alias around `trpc.streamBroker.setPreBufferDuration.useMutation`. */
|
|
911
933
|
export declare const useStreamBrokerSetPreBufferDuration: typeof trpc.streamBroker.setPreBufferDuration.useMutation;
|
|
912
934
|
/** Generated alias around `trpc.streamBroker.getPreBufferInfo.useQuery`. */
|
|
@@ -929,6 +951,14 @@ export declare const useStreamBrokerGetDeviceSettingsContribution: typeof trpc.s
|
|
|
929
951
|
export declare const useStreamBrokerGetDeviceLiveContribution: typeof trpc.streamBroker.getDeviceLiveContribution.useQuery;
|
|
930
952
|
/** Generated alias around `trpc.streamBroker.applyDeviceSettingsPatch.useMutation`. */
|
|
931
953
|
export declare const useStreamBrokerApplyDeviceSettingsPatch: typeof trpc.streamBroker.applyDeviceSettingsPatch.useMutation;
|
|
954
|
+
/** Generated alias around `trpc.streamParams.getOptions.useQuery`. */
|
|
955
|
+
export declare const useStreamParamsGetOptions: typeof trpc.streamParams.getOptions.useQuery;
|
|
956
|
+
/** Generated alias around `trpc.streamParams.setProfile.useMutation`. */
|
|
957
|
+
export declare const useStreamParamsSetProfile: typeof trpc.streamParams.setProfile.useMutation;
|
|
958
|
+
/** Generated alias around `trpc.streamParams.getConfigSchema.useQuery`. */
|
|
959
|
+
export declare const useStreamParamsGetConfigSchema: typeof trpc.streamParams.getConfigSchema.useQuery;
|
|
960
|
+
/** Generated alias around `trpc.streamParams.getStatus.useQuery`. */
|
|
961
|
+
export declare const useStreamParamsGetStatus: typeof trpc.streamParams.getStatus.useQuery;
|
|
932
962
|
/** Generated alias around `trpc.switch.setState.useMutation`. */
|
|
933
963
|
export declare const useSwitchSetState: typeof trpc.switch.setState.useMutation;
|
|
934
964
|
/** Generated alias around `trpc.switch.getStatus.useQuery`. */
|
|
@@ -949,12 +979,6 @@ export declare const useSystemSetRetentionConfig: typeof trpc.system.setRetentio
|
|
|
949
979
|
export declare const useSystemForceRetentionCleanup: typeof trpc.system.forceRetentionCleanup.useMutation;
|
|
950
980
|
/** Generated alias around `trpc.toast.onToast.useSubscription`. */
|
|
951
981
|
export declare const useToastOnToast: typeof trpc.toast.onToast.useSubscription;
|
|
952
|
-
/** Generated alias around `trpc.turnOrchestrator.listProviders.useQuery`. */
|
|
953
|
-
export declare const useTurnOrchestratorListProviders: typeof trpc.turnOrchestrator.listProviders.useQuery;
|
|
954
|
-
/** Generated alias around `trpc.turnOrchestrator.getAllServers.useQuery`. */
|
|
955
|
-
export declare const useTurnOrchestratorGetAllServers: typeof trpc.turnOrchestrator.getAllServers.useQuery;
|
|
956
|
-
/** Generated alias around `trpc.turnOrchestrator.setProviderEnabled.useMutation`. */
|
|
957
|
-
export declare const useTurnOrchestratorSetProviderEnabled: typeof trpc.turnOrchestrator.setProviderEnabled.useMutation;
|
|
958
982
|
/** Generated alias around `trpc.turnProvider.getTurnServers.useQuery`. */
|
|
959
983
|
export declare const useTurnProviderGetTurnServers: typeof trpc.turnProvider.getTurnServers.useQuery;
|
|
960
984
|
/** Generated alias around `trpc.userManagement.listUsers.useQuery`. */
|
|
@@ -997,6 +1021,18 @@ export declare const useUserManagementDisableTotp: typeof trpc.userManagement.di
|
|
|
997
1021
|
export declare const useUserManagementGetTotpStatus: typeof trpc.userManagement.getTotpStatus.useQuery;
|
|
998
1022
|
/** Generated alias around `trpc.userManagement.verifyTotp.useMutation`. */
|
|
999
1023
|
export declare const useUserManagementVerifyTotp: typeof trpc.userManagement.verifyTotp.useMutation;
|
|
1024
|
+
/** Generated alias around `trpc.userManagement.oauthIssueCode.useMutation`. */
|
|
1025
|
+
export declare const useUserManagementOauthIssueCode: typeof trpc.userManagement.oauthIssueCode.useMutation;
|
|
1026
|
+
/** Generated alias around `trpc.userManagement.oauthExchangeCode.useMutation`. */
|
|
1027
|
+
export declare const useUserManagementOauthExchangeCode: typeof trpc.userManagement.oauthExchangeCode.useMutation;
|
|
1028
|
+
/** Generated alias around `trpc.userManagement.oauthRefresh.useMutation`. */
|
|
1029
|
+
export declare const useUserManagementOauthRefresh: typeof trpc.userManagement.oauthRefresh.useMutation;
|
|
1030
|
+
/** Generated alias around `trpc.userManagement.oauthVerifyAccessToken.useQuery`. */
|
|
1031
|
+
export declare const useUserManagementOauthVerifyAccessToken: typeof trpc.userManagement.oauthVerifyAccessToken.useQuery;
|
|
1032
|
+
/** Generated alias around `trpc.userManagement.listOauthSessions.useQuery`. */
|
|
1033
|
+
export declare const useUserManagementListOauthSessions: typeof trpc.userManagement.listOauthSessions.useQuery;
|
|
1034
|
+
/** Generated alias around `trpc.userManagement.revokeOauthSession.useMutation`. */
|
|
1035
|
+
export declare const useUserManagementRevokeOauthSession: typeof trpc.userManagement.revokeOauthSession.useMutation;
|
|
1000
1036
|
/** Generated alias around `trpc.webrtcSession.listStreams.useQuery`. */
|
|
1001
1037
|
export declare const useWebrtcSessionListStreams: typeof trpc.webrtcSession.listStreams.useQuery;
|
|
1002
1038
|
/** Generated alias around `trpc.webrtcSession.createSession.useMutation`. */
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export { useDeviceDetections } from './use-device-detections';
|
|
|
3
3
|
export { useDeviceWebrtc } from './use-device-webrtc';
|
|
4
4
|
export { usePTZ } from './use-ptz';
|
|
5
5
|
export type { UsePTZResult, UsePTZOptions, PTZDirection, PTZTrpcProxy } from './use-ptz';
|
|
6
|
+
export { useDeviceAutotrack } from './use-device-autotrack';
|
|
7
|
+
export type { UseDeviceAutotrack } from './use-device-autotrack';
|
|
6
8
|
export { useDeviceBattery } from './use-device-battery';
|
|
7
9
|
export type { UseDeviceBatteryTrpc } from './use-device-battery';
|
|
8
10
|
export { useDoorbellEvents } from './use-doorbell-events';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PtzAutotrackSettings, PtzAutotrackStatus } from '@camstack/types';
|
|
2
|
+
export interface UseDeviceAutotrack {
|
|
3
|
+
status: PtzAutotrackStatus | null;
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
isPending: boolean;
|
|
6
|
+
error: string | null;
|
|
7
|
+
setEnabled: (on: boolean) => Promise<void>;
|
|
8
|
+
setSettings: (patch: Partial<PtzAutotrackSettings>) => Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare function useDeviceAutotrack(deviceId: number | null): UseDeviceAutotrack;
|
package/dist/hooks/use-ptz.d.ts
CHANGED
|
@@ -9,6 +9,21 @@ interface PTZPreset {
|
|
|
9
9
|
readonly id: string;
|
|
10
10
|
readonly name: string;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Per-camera PTZ availability descriptor returned by `ptz.getOptions`.
|
|
14
|
+
* Drives which controls the UI shows — preset save/delete is gated on
|
|
15
|
+
* `supportsPresets`, and the save button disables once `maxPresets`
|
|
16
|
+
* (when known) is reached.
|
|
17
|
+
*/
|
|
18
|
+
export interface PTZOptions {
|
|
19
|
+
readonly hasPan: boolean;
|
|
20
|
+
readonly hasTilt: boolean;
|
|
21
|
+
readonly hasZoom: boolean;
|
|
22
|
+
readonly supportsPresets: boolean;
|
|
23
|
+
readonly maxPresets?: number;
|
|
24
|
+
/** Whether the camera exposes a controllable autofocus toggle. */
|
|
25
|
+
readonly hasAutofocus: boolean;
|
|
26
|
+
}
|
|
12
27
|
/**
|
|
13
28
|
* Backwards-compatible alias for the trpc shape — historically the
|
|
14
29
|
* hook took its own narrow contract; the proxy generalisation
|
|
@@ -41,14 +56,27 @@ export interface UsePTZResult {
|
|
|
41
56
|
readonly goHome: () => Promise<void>;
|
|
42
57
|
/** Jump to a named preset. */
|
|
43
58
|
readonly goToPreset: (presetId: string) => Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Save the camera's current position as a new preset. Picks the
|
|
61
|
+
* lowest unused numeric slot id, then refreshes the presets list.
|
|
62
|
+
* Resolves to the created preset id, or `undefined` on failure.
|
|
63
|
+
*/
|
|
64
|
+
readonly savePreset: (name: string) => Promise<string | undefined>;
|
|
65
|
+
/** Delete a preset by id, then refresh the presets list. */
|
|
66
|
+
readonly deletePreset: (presetId: string) => Promise<void>;
|
|
44
67
|
/** List of presets reported by the camera. Empty until first refresh. */
|
|
45
68
|
readonly presets: readonly PTZPreset[];
|
|
46
69
|
/** Force a refresh of the presets list. */
|
|
47
70
|
readonly refreshPresets: () => Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Per-camera PTZ availability descriptor, or null until the first
|
|
73
|
+
* `getOptions` refresh resolves (or on cameras without the cap).
|
|
74
|
+
*/
|
|
75
|
+
readonly options: PTZOptions | null;
|
|
48
76
|
/** True while a control call is in flight (any path). */
|
|
49
77
|
readonly busy: boolean;
|
|
50
78
|
/** Last error message from any cap call, or null. */
|
|
51
79
|
readonly error: string | null;
|
|
52
80
|
}
|
|
53
|
-
export declare function usePTZ(trpc: UseDeviceProxyTrpc, deviceId: number,
|
|
81
|
+
export declare function usePTZ(trpc: UseDeviceProxyTrpc, deviceId: number, hookOptions?: UsePTZOptions): UsePTZResult;
|
|
54
82
|
export {};
|