@virtualdisplay.io/client 3.4.0 → 3.5.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/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [3.5.0](https://github.com/virtualdisplay-io/client/compare/v3.4.1...v3.5.0) (2025-07-16)
6
+
7
+ ### ✨ Features
8
+
9
+ * camera control API ([#4](https://github.com/virtualdisplay-io/client/issues/4)) ([1e4c147](https://github.com/virtualdisplay-io/client/commit/1e4c14747cad2a4617c4cc763522b50941adaa7f))
10
+
11
+ ## [3.4.1](https://github.com/virtualdisplay-io/client/compare/v3.4.0...v3.4.1) (2025-07-10)
12
+
13
+ ### 🐛 Bug Fixes
14
+
15
+ * EventBus once handlers and logging improvements ([#3](https://github.com/virtualdisplay-io/client/issues/3)) ([5a99d8d](https://github.com/virtualdisplay-io/client/commit/5a99d8d6ef82d058799734b54c98ca171d17dd36))
16
+
5
17
  ## [3.4.0](https://github.com/virtualdisplay-io/client/compare/v3.3.0...v3.4.0) (2025-07-09)
6
18
 
7
19
  ### ✨ Features
package/dist/index.d.ts CHANGED
@@ -121,6 +121,56 @@ export declare interface AttributeValueConfig {
121
121
  readonly isSelected?: boolean;
122
122
  }
123
123
 
124
+ /**
125
+ * Camera control API for positioning and zoom
126
+ * Uses chaining pattern for building commands
127
+ */
128
+ export declare class Camera {
129
+ private readonly eventBus;
130
+ private commands;
131
+ constructor(eventBus: EventBus);
132
+ /**
133
+ * Rotate camera horizontally
134
+ * @param degrees - Absolute rotation in degrees (0 = front view)
135
+ */
136
+ rotate(degrees: number): this;
137
+ /**
138
+ * Tilt camera vertically
139
+ * @param degrees - Absolute tilt in degrees (0 = top view, 90 = horizontal)
140
+ */
141
+ tilt(degrees: number): this;
142
+ /**
143
+ * Zoom camera
144
+ * @param percentage - Zoom percentage (100 = normal, >100 = zoom in, <100 = zoom out)
145
+ */
146
+ zoom(percentage: number): this;
147
+ /**
148
+ * Execute accumulated camera commands
149
+ */
150
+ set(): void;
151
+ /**
152
+ * Reset camera to initial position
153
+ * This is not chainable and executes immediately
154
+ */
155
+ reset(): void;
156
+ }
157
+
158
+ /**
159
+ * Camera command
160
+ */
161
+ export declare interface CameraCommand {
162
+ readonly action: 'rotate' | 'tilt' | 'zoom' | 'reset';
163
+ readonly value?: number;
164
+ }
165
+
166
+ /**
167
+ * Camera message sent to server
168
+ */
169
+ export declare interface CameraMessage {
170
+ readonly type: typeof MESSAGE_TYPES.CAMERA;
171
+ readonly commands: CameraCommand[];
172
+ }
173
+
124
174
  /**
125
175
  * Configuration options for VirtualdisplayClient
126
176
  */
@@ -157,6 +207,7 @@ export declare interface DomainEvents extends Record<string, unknown> {
157
207
  [EVENT_NAMES.IFRAME_READY]: VoidEvent;
158
208
  [EVENT_NAMES.MUTATION_MESSAGE]: MessageEvent_2<MutationMessage>;
159
209
  [EVENT_NAMES.CONFIG_MESSAGE]: MessageEvent_2<ConfigMessage>;
210
+ [EVENT_NAMES.CAMERA_MESSAGE]: MessageEvent_2<CameraMessage>;
160
211
  [EVENT_NAMES.MESSAGE_RECEIVED]: MessageEvent_2;
161
212
  [EVENT_NAMES.STATE_CHANGED]: StateChangedEvent;
162
213
  [EVENT_NAMES.INITIAL_STATE_RECEIVED]: VoidEvent;
@@ -185,6 +236,7 @@ export declare const EVENT_NAMES: {
185
236
  readonly IFRAME_READY: "iframe:ready";
186
237
  readonly MUTATION_MESSAGE: "mutation:message";
187
238
  readonly CONFIG_MESSAGE: "config:message";
239
+ readonly CAMERA_MESSAGE: "camera:message";
188
240
  readonly MESSAGE_RECEIVED: "message:received";
189
241
  readonly STATE_CHANGED: "state:changed";
190
242
  readonly INITIAL_STATE_RECEIVED: "state:initial-received";
@@ -198,7 +250,14 @@ declare class EventBus {
198
250
  private readonly listeners;
199
251
  on<K extends keyof DomainEvents>(event: K, listener: EventListener_2<DomainEvents[K]>): void;
200
252
  emit<K extends keyof DomainEvents>(event: K, payload: DomainEvents[K]): void;
253
+ /**
254
+ * Register a listener that will be called only once
255
+ * The listener is automatically removed after the first call
256
+ */
201
257
  once<K extends keyof DomainEvents>(event: K, listener: EventListener_2<DomainEvents[K]>): void;
258
+ /**
259
+ * Remove a specific listener for an event
260
+ */
202
261
  off<K extends keyof DomainEvents>(event: K, listener: EventListener_2<DomainEvents[K]>): void;
203
262
  }
204
263
 
@@ -299,7 +358,7 @@ export declare class MappingValidator {
299
358
  /**
300
359
  * Union of all possible messages
301
360
  */
302
- export declare type Message = MutationMessage | StateMessage | ConfigMessage;
361
+ export declare type Message = MutationMessage | StateMessage | ConfigMessage | CameraMessage;
303
362
 
304
363
  /**
305
364
  * Types of messages exchanged between client and server
@@ -309,6 +368,7 @@ export declare const MESSAGE_TYPES: {
309
368
  readonly MUTATION: "mutation";
310
369
  readonly STATE: "state";
311
370
  readonly CONFIG: "config";
371
+ readonly CAMERA: "camera";
312
372
  };
313
373
 
314
374
  /**
@@ -476,6 +536,7 @@ export declare class VirtualdisplayClient {
476
536
  private readonly stateService;
477
537
  private readonly messageHandler;
478
538
  private readonly viewerService;
539
+ private readonly cameraApi;
479
540
  private readonly options;
480
541
  private iframe;
481
542
  constructor(options: ClientOptions);
@@ -513,6 +574,10 @@ export declare class VirtualdisplayClient {
513
574
  * Get the viewer service for UI configuration
514
575
  */
515
576
  get viewer(): VirtualdisplayViewerService;
577
+ /**
578
+ * Get the camera control API
579
+ */
580
+ get camera(): Camera;
516
581
  destroy(): void;
517
582
  }
518
583