@camera.ui/sdk 0.0.19 → 0.0.21

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/index.d.ts CHANGED
@@ -2339,7 +2339,13 @@ declare enum PTZCapability {
2339
2339
  /** Camera supports named position presets */
2340
2340
  Presets = "presets",
2341
2341
  /** Camera supports a home position */
2342
- Home = "home"
2342
+ Home = "home",
2343
+ /** Camera executes relative displacement moves */
2344
+ RelativeMove = "relativeMove",
2345
+ /** Camera accepts absolute position writes via `setPosition()` */
2346
+ AbsolutePosition = "absolutePosition",
2347
+ /** Camera accepts continuous-move commands via `setVelocity()` */
2348
+ VelocityControl = "velocityControl"
2343
2349
  }
2344
2350
  /**
2345
2351
  * Properties for PTZ controls
@@ -2356,7 +2362,9 @@ declare enum PTZProperty {
2356
2362
  /** Current movement velocity (continuous move) */
2357
2363
  Velocity = "velocity",
2358
2364
  /** Target preset to move to */
2359
- TargetPreset = "targetPreset"
2365
+ TargetPreset = "targetPreset",
2366
+ /** Relative displacement move command (write-only) */
2367
+ RelativeMove = "relativeMove"
2360
2368
  }
2361
2369
  /** Absolute PTZ position */
2362
2370
  interface PTZPosition {
@@ -2381,6 +2389,20 @@ interface PTZDirection {
2381
2389
  tiltSpeed: number;
2382
2390
  zoomSpeed: number;
2383
2391
  }
2392
+ /**
2393
+ * Relative displacement for a single PTZ move.
2394
+ *
2395
+ * Deltas are normalized to the camera's field of view: `panDelta: 1` moves the
2396
+ * view by one full frame width, `tiltDelta: 1` by one full frame height.
2397
+ * Conventions match {@link PTZDirection}: positive `panDelta` = right,
2398
+ * positive `tiltDelta` = up, positive `zoomDelta` = zoom in. Plugins map the
2399
+ * deltas to hardware-specific translation spaces (e.g. ONVIF RelativeMove).
2400
+ */
2401
+ interface PTZRelativeMove {
2402
+ panDelta: number;
2403
+ tiltDelta: number;
2404
+ zoomDelta: number;
2405
+ }
2384
2406
  /**
2385
2407
  * Property value map for PTZ controls.
2386
2408
  *
@@ -2392,6 +2414,7 @@ interface PTZControlProperties {
2392
2414
  [PTZProperty.Presets]: string[];
2393
2415
  [PTZProperty.Velocity]?: PTZDirection;
2394
2416
  [PTZProperty.TargetPreset]?: string;
2417
+ [PTZProperty.RelativeMove]?: PTZRelativeMove;
2395
2418
  }
2396
2419
  /** Read-only proxy interface for a PTZ control */
2397
2420
  interface PTZControlLike extends SensorLike {
@@ -2403,6 +2426,7 @@ interface PTZControlLike extends SensorLike {
2403
2426
  getValue(property: PTZProperty.Presets): string[] | undefined;
2404
2427
  getValue(property: PTZProperty.Velocity): PTZDirection | undefined;
2405
2428
  getValue(property: PTZProperty.TargetPreset): string | undefined;
2429
+ getValue(property: PTZProperty.RelativeMove): PTZRelativeMove | undefined;
2406
2430
  getValue(property: string): unknown;
2407
2431
  }
2408
2432
  /**
@@ -2449,6 +2473,21 @@ declare class PTZControl<TStorage extends object = Record<string, any>> extends
2449
2473
  * ```
2450
2474
  */
2451
2475
  setVelocity(value: PTZDirection | undefined): Promise<void>;
2476
+ /**
2477
+ * Relative displacement move. Override to drive hardware (e.g. ONVIF
2478
+ * RelativeMove in a translation space) and call
2479
+ * `await super.setRelativeMove(value)` after success to sync the SDK state.
2480
+ * Advertise {@link PTZCapability.RelativeMove} when the camera supports it.
2481
+ *
2482
+ * @param value - Per-axis displacement, normalized to the field of view.
2483
+ *
2484
+ * @example
2485
+ * ```ts
2486
+ * // move the view a third of a frame to the right, a tenth down
2487
+ * await ptz.setRelativeMove({ panDelta: 0.33, tiltDelta: -0.1, zoomDelta: 0 });
2488
+ * ```
2489
+ */
2490
+ setRelativeMove(value: PTZRelativeMove): Promise<void>;
2452
2491
  /**
2453
2492
  * Preset-move command. Override to drive hardware and call
2454
2493
  * `await super.setTargetPreset(value)` after success to sync the SDK state.
@@ -3350,6 +3389,8 @@ interface MotionDetectionSettings {
3350
3389
  interface ObjectDetectionSettings {
3351
3390
  /** Minimum confidence threshold (0-1) */
3352
3391
  confidence: number;
3392
+ /** Suppress events from objects that stay stationary across events (e.g. parked cars). Defaults to true. */
3393
+ suppressStatic?: boolean;
3353
3394
  }
3354
3395
  /**
3355
3396
  * Audio detection settings.
@@ -5794,4 +5835,4 @@ interface OAuthClientCredentialsCapable extends OAuthCapable {
5794
5835
  }
5795
5836
 
5796
5837
  export { API_EVENT, AudioDetectorSensor, AudioProperty, AudioSensor, BASE_AUDIO_LABELS, BasePlugin, BatteryCapability, BatteryInfo, BatteryProperty, BehaviorSubject, ChargingState, ClassifierDetectorSensor, ClassifierProperty, ClassifierSensor, ClipDetectorSensor, ContactProperty, ContactSensor, DETECTION_ATTRIBUTES, DETECTION_LABELS, Disposable, DoorbellProperty, DoorbellTrigger, EVENT_TRIGGER_TYPES, FaceDetectorSensor, FaceProperty, FaceSensor, GarageControl, GarageProperty, GarageState, HumidityInfo, HumidityProperty, LeakProperty, LeakSensor, LicensePlateDetectorSensor, LicensePlateProperty, LicensePlateSensor, LightCapability, LightControl, LightProperty, LockControl, LockProperty, LockState, MotionDetectorSensor, MotionProperty, MotionSensor, ObjectDetectorSensor, ObjectProperty, ObjectSensor, Observable, OccupancyProperty, OccupancySensor, PTZCapability, PTZControl, PTZProperty, PluginCapability, PluginInterface, PluginRole, RING_AUTO_RESET_MS, ReplaySubject, RtpPacket, SecuritySystem, SecuritySystemProperty, SecuritySystemState, Sensor, SensorCategory, SensorType, Severity, SirenCapability, SirenControl, SirenProperty, SmokeProperty, SmokeSensor, Subject, SwitchControl, SwitchProperty, TemperatureInfo, TemperatureProperty, canCreateCameras, canProvideSensorsToAnyCameras, distinctUntilChanged, filter, firstValueFrom, getContractValidationErrors, hasCapability, hasInterface, isHub, map, mergeMap, pairwise, share, validateContractConsistency };
5797
- export type { AssignedPlugin, AudioCodec, AudioCodecProperties, AudioDetectionInterface, AudioDetectionPluginResponse, AudioDetectionSettings, AudioFFmpegCodec, AudioFrameData, AudioInputSpec, AudioLabel, AudioMetadata, AudioModelSpec, AudioResult, AudioSensorLike, AudioSensorProperties, AudioStreamInfo, BaseAudioLabel, BaseCamera, BaseCameraConfig, BatteryInfoLike, BatteryInfoProperties, BoundingBox, Camera, CameraAspectRatio, CameraConfig, CameraConfigInputSettings, CameraDetectionSettings, CameraDevice, CameraDeviceSource, CameraFrameWorkerSettings, CameraImplementation, CameraInformation, CameraInput, CameraPluginInfo, CameraRole, CameraSource, CameraType, CameraUiSettings, ClassifierDetection, ClassifierDetectionInterface, ClassifierDetectionPluginResponse, ClassifierResult, ClassifierSensorLike, ClassifierSensorProperties, ClipDetectionInterface, ClipDetectionPluginResponse, ClipEmbedding, ClipResult, ClipTextEmbeddingResult, ContactSensorLike, ContactSensorProperties, CoreManager, CoreManagerEvent, CreateDownloadOptions, CreateStreamDownloadOptions, Detection, DetectionAttribute, DetectionEvent, DetectionEventState, DetectionEventType, DetectionLabel, DetectionLine, DetectionZone, DeviceManager, DeviceStorage, DiscoveredCamera, DiscoveryProvider, DoorbellTriggerLike, DoorbellTriggerProperties, DownloadCleanup, DownloadManager, DownloadToken, EventAttribute, EventDescription, EventDetection, EventSegment, EventTrigger, EventTriggerType, FMTPInfo, FaceDetection, FaceDetectionInterface, FaceDetectionPluginResponse, FaceResult, FaceSensorLike, FaceSensorProperties, Fmp4Session, Fmp4SessionOptions, FormSubmitResponse, FormSubmitSchema, GarageControlLike, GarageControlProperties, Go2RtcRTSPSource, Go2RtcSnapshotSource, Go2RtcWSSource, HardwareAcceleration, HumidityInfoLike, HumidityInfoProperties, ImageMetadata, JsonArraySchema, JsonBaseSchema, JsonBaseSchemaWithoutCallbacks, JsonBooleanSchema, JsonEnumSchema, JsonFactorySchema, JsonNumberSchema, JsonSchema, JsonSchemaArray, JsonSchemaArrayWithoutCallbacks, JsonSchemaBoolean, JsonSchemaBooleanWithoutCallbacks, JsonSchemaButton, JsonSchemaEnum, JsonSchemaEnumWithoutCallbacks, JsonSchemaNumber, JsonSchemaNumberWithoutCallbacks, JsonSchemaString, JsonSchemaStringWithoutCallbacks, JsonSchemaSubmit, JsonSchemaType, JsonSchemaWithoutCallbacks, JsonSchemaWithoutKey, JsonStringSchema, LeakSensorLike, LeakSensorProperties, LicensePlateDetection, LicensePlateDetectionInterface, LicensePlateDetectionPluginResponse, LicensePlateResult, LicensePlateSensorLike, LicensePlateSensorProperties, LightControlLike, LightControlProperties, LineDirection, LockControlLike, LockControlProperties, LoggerService, ModelSpec, MotionDetectionInterface, MotionDetectionPluginResponse, MotionDetectionSettings, MotionResolution, MotionResult, MotionSensorLike, MotionSensorProperties, Notification, NotificationManager, NotifierDevice, NotifierInterface, OAuthAuthCodeFlowCapable, OAuthCapable, OAuthClientCredentialsCapable, OAuthDeviceFlowCapable, OAuthMetadata, OAuthProviderConfig, OAuthProviderDeclaration, OAuthState, OAuthStatus, ObjectDetectionInterface, ObjectDetectionPluginResponse, ObjectDetectionSettings, ObjectModelSpec, ObjectResult, ObjectSensorLike, ObjectSensorProperties, OccupancySensorLike, OccupancySensorProperties, OperatorFn, PTZControlLike, PTZControlProperties, PTZDirection, PTZPosition, PluginAPI, PluginAssignments, PluginConfig, PluginContract, PluginInfo, PluginInterfaces, Point, ProbeAudioCodec, ProbeConfig, ProbeStream, PropertyChangeOf, PtzAutotrackSettings, PythonVersion, RTPInfo, RTSPAudioCodec, RTSPUrlOptions, RtpSession, RtpSessionBackchannelOptions, RtpSessionOptions, SchemaCondition, SchemaConditionOperator, SchemaConfig, SecuritySystemLike, SecuritySystemProperties, SensorCapability, SensorLike, SensorPropertyType, SensorTriggerRef, SensorTriggerSettings, SirenControlLike, SirenControlProperties, SmokeSensorLike, SmokeSensorProperties, SnapshotInterface, SnapshotSettings, SnapshotUrlOptions, StreamDirection, StreamUrls, StreamingInterface, StreamingRole, SwitchControlLike, SwitchControlProperties, TemperatureInfoLike, TemperatureInfoProperties, ToastMessage, TrackedDetection, VideoCodec, VideoCodecProperties, VideoFFmpegCodec, VideoFrameData, VideoInputSpec, VideoStreamInfo, VideoStreamingMode, ZoneFilter, ZoneType };
5838
+ export type { AssignedPlugin, AudioCodec, AudioCodecProperties, AudioDetectionInterface, AudioDetectionPluginResponse, AudioDetectionSettings, AudioFFmpegCodec, AudioFrameData, AudioInputSpec, AudioLabel, AudioMetadata, AudioModelSpec, AudioResult, AudioSensorLike, AudioSensorProperties, AudioStreamInfo, BaseAudioLabel, BaseCamera, BaseCameraConfig, BatteryInfoLike, BatteryInfoProperties, BoundingBox, Camera, CameraAspectRatio, CameraConfig, CameraConfigInputSettings, CameraDetectionSettings, CameraDevice, CameraDeviceSource, CameraFrameWorkerSettings, CameraImplementation, CameraInformation, CameraInput, CameraPluginInfo, CameraRole, CameraSource, CameraType, CameraUiSettings, ClassifierDetection, ClassifierDetectionInterface, ClassifierDetectionPluginResponse, ClassifierResult, ClassifierSensorLike, ClassifierSensorProperties, ClipDetectionInterface, ClipDetectionPluginResponse, ClipEmbedding, ClipResult, ClipTextEmbeddingResult, ContactSensorLike, ContactSensorProperties, CoreManager, CoreManagerEvent, CreateDownloadOptions, CreateStreamDownloadOptions, Detection, DetectionAttribute, DetectionEvent, DetectionEventState, DetectionEventType, DetectionLabel, DetectionLine, DetectionZone, DeviceManager, DeviceStorage, DiscoveredCamera, DiscoveryProvider, DoorbellTriggerLike, DoorbellTriggerProperties, DownloadCleanup, DownloadManager, DownloadToken, EventAttribute, EventDescription, EventDetection, EventSegment, EventTrigger, EventTriggerType, FMTPInfo, FaceDetection, FaceDetectionInterface, FaceDetectionPluginResponse, FaceResult, FaceSensorLike, FaceSensorProperties, Fmp4Session, Fmp4SessionOptions, FormSubmitResponse, FormSubmitSchema, GarageControlLike, GarageControlProperties, Go2RtcRTSPSource, Go2RtcSnapshotSource, Go2RtcWSSource, HardwareAcceleration, HumidityInfoLike, HumidityInfoProperties, ImageMetadata, JsonArraySchema, JsonBaseSchema, JsonBaseSchemaWithoutCallbacks, JsonBooleanSchema, JsonEnumSchema, JsonFactorySchema, JsonNumberSchema, JsonSchema, JsonSchemaArray, JsonSchemaArrayWithoutCallbacks, JsonSchemaBoolean, JsonSchemaBooleanWithoutCallbacks, JsonSchemaButton, JsonSchemaEnum, JsonSchemaEnumWithoutCallbacks, JsonSchemaNumber, JsonSchemaNumberWithoutCallbacks, JsonSchemaString, JsonSchemaStringWithoutCallbacks, JsonSchemaSubmit, JsonSchemaType, JsonSchemaWithoutCallbacks, JsonSchemaWithoutKey, JsonStringSchema, LeakSensorLike, LeakSensorProperties, LicensePlateDetection, LicensePlateDetectionInterface, LicensePlateDetectionPluginResponse, LicensePlateResult, LicensePlateSensorLike, LicensePlateSensorProperties, LightControlLike, LightControlProperties, LineDirection, LockControlLike, LockControlProperties, LoggerService, ModelSpec, MotionDetectionInterface, MotionDetectionPluginResponse, MotionDetectionSettings, MotionResolution, MotionResult, MotionSensorLike, MotionSensorProperties, Notification, NotificationManager, NotifierDevice, NotifierInterface, OAuthAuthCodeFlowCapable, OAuthCapable, OAuthClientCredentialsCapable, OAuthDeviceFlowCapable, OAuthMetadata, OAuthProviderConfig, OAuthProviderDeclaration, OAuthState, OAuthStatus, ObjectDetectionInterface, ObjectDetectionPluginResponse, ObjectDetectionSettings, ObjectModelSpec, ObjectResult, ObjectSensorLike, ObjectSensorProperties, OccupancySensorLike, OccupancySensorProperties, OperatorFn, PTZControlLike, PTZControlProperties, PTZDirection, PTZPosition, PTZRelativeMove, PluginAPI, PluginAssignments, PluginConfig, PluginContract, PluginInfo, PluginInterfaces, Point, ProbeAudioCodec, ProbeConfig, ProbeStream, PropertyChangeOf, PtzAutotrackSettings, PythonVersion, RTPInfo, RTSPAudioCodec, RTSPUrlOptions, RtpSession, RtpSessionBackchannelOptions, RtpSessionOptions, SchemaCondition, SchemaConditionOperator, SchemaConfig, SecuritySystemLike, SecuritySystemProperties, SensorCapability, SensorLike, SensorPropertyType, SensorTriggerRef, SensorTriggerSettings, SirenControlLike, SirenControlProperties, SmokeSensorLike, SmokeSensorProperties, SnapshotInterface, SnapshotSettings, SnapshotUrlOptions, StreamDirection, StreamUrls, StreamingInterface, StreamingRole, SwitchControlLike, SwitchControlProperties, TemperatureInfoLike, TemperatureInfoProperties, ToastMessage, TrackedDetection, VideoCodec, VideoCodecProperties, VideoFFmpegCodec, VideoFrameData, VideoInputSpec, VideoStreamInfo, VideoStreamingMode, ZoneFilter, ZoneType };
@@ -236,7 +236,9 @@ declare enum PTZProperty {
236
236
  /** Current movement velocity (continuous move) */
237
237
  Velocity = "velocity",
238
238
  /** Target preset to move to */
239
- TargetPreset = "targetPreset"
239
+ TargetPreset = "targetPreset",
240
+ /** Relative displacement move command (write-only) */
241
+ RelativeMove = "relativeMove"
240
242
  }
241
243
 
242
244
  /**
@@ -1,4 +1,4 @@
1
- import { Sensor, SensorType, SensorCategory } from './base.js';
1
+ import { Sensor, SensorCategory, SensorType } from './base.js';
2
2
  /** Optional capabilities for PTZ controls. Add to `capabilities` to enable features. */
3
3
  export var PTZCapability;
4
4
  (function (PTZCapability) {
@@ -9,6 +9,12 @@ export var PTZCapability;
9
9
  PTZCapability["Presets"] = "presets";
10
10
  /** Camera supports a home position */
11
11
  PTZCapability["Home"] = "home";
12
+ /** Camera executes relative displacement moves */
13
+ PTZCapability["RelativeMove"] = "relativeMove";
14
+ /** Camera accepts absolute position writes via `setPosition()` */
15
+ PTZCapability["AbsolutePosition"] = "absolutePosition";
16
+ /** Camera accepts continuous-move commands via `setVelocity()` */
17
+ PTZCapability["VelocityControl"] = "velocityControl";
12
18
  })(PTZCapability || (PTZCapability = {}));
13
19
  /**
14
20
  * Properties for PTZ controls
@@ -27,6 +33,8 @@ export var PTZProperty;
27
33
  PTZProperty["Velocity"] = "velocity";
28
34
  /** Target preset to move to */
29
35
  PTZProperty["TargetPreset"] = "targetPreset";
36
+ /** Relative displacement move command (write-only) */
37
+ PTZProperty["RelativeMove"] = "relativeMove";
30
38
  })(PTZProperty || (PTZProperty = {}));
31
39
  /**
32
40
  * Pan-tilt-zoom camera control. Override `setPosition()` / `setVelocity()` /
@@ -93,6 +101,23 @@ export class PTZControl extends Sensor {
93
101
  async setVelocity(value) {
94
102
  this._writeState({ [PTZProperty.Velocity]: value });
95
103
  }
104
+ /**
105
+ * Relative displacement move. Override to drive hardware (e.g. ONVIF
106
+ * RelativeMove in a translation space) and call
107
+ * `await super.setRelativeMove(value)` after success to sync the SDK state.
108
+ * Advertise {@link PTZCapability.RelativeMove} when the camera supports it.
109
+ *
110
+ * @param value - Per-axis displacement, normalized to the field of view.
111
+ *
112
+ * @example
113
+ * ```ts
114
+ * // move the view a third of a frame to the right, a tenth down
115
+ * await ptz.setRelativeMove({ panDelta: 0.33, tiltDelta: -0.1, zoomDelta: 0 });
116
+ * ```
117
+ */
118
+ async setRelativeMove(value) {
119
+ this._writeState({ [PTZProperty.RelativeMove]: value });
120
+ }
96
121
  /**
97
122
  * Preset-move command. Override to drive hardware and call
98
123
  * `await super.setTargetPreset(value)` after success to sync the SDK state.
@@ -167,6 +192,9 @@ export class PTZControl extends Sensor {
167
192
  case PTZProperty.TargetPreset:
168
193
  await this.setTargetPreset(value);
169
194
  return;
195
+ case PTZProperty.RelativeMove:
196
+ await this.setRelativeMove(value);
197
+ return;
170
198
  }
171
199
  // Unknown / non-writable property (incl. moving, presets) — ignored.
172
200
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camera.ui/sdk",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "description": "camera.ui sdk",
5
5
  "exports": {
6
6
  ".": {
@@ -35,7 +35,7 @@
35
35
  "@stylistic/eslint-plugin": "^5.10.0",
36
36
  "@types/multicast-dns": "^7.2.4",
37
37
  "@types/node": "26.1.1",
38
- "@typescript-eslint/parser": "^8.63.0",
38
+ "@typescript-eslint/parser": "^8.64.0",
39
39
  "cpy-cli": "^7.0.0",
40
40
  "eslint": "9.39.2",
41
41
  "eslint-plugin-jsdoc": "^63.0.13",
@@ -48,7 +48,7 @@
48
48
  "typedoc-plugin-markdown": "^4.12.0",
49
49
  "typedoc-vitepress-theme": "^1.1.3",
50
50
  "typescript": "5.9.3",
51
- "typescript-eslint": "^8.63.0",
51
+ "typescript-eslint": "^8.64.0",
52
52
  "vitepress": "^1.6.4",
53
53
  "vitest": "^4.1.10",
54
54
  "werift": "0.23.0",