@virtualdisplay.io/client 4.0.0-alpha.3 → 4.0.0-alpha.32

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.
Files changed (49) hide show
  1. package/CHANGELOG.md +254 -1
  2. package/README.md +127 -156
  3. package/dist/browser-7qZ1KQYo.cjs +8 -0
  4. package/dist/browser-B8yql1bQ.js +1226 -0
  5. package/dist/index.d.ts +672 -0
  6. package/dist/rolldown-runtime-5iZMYShA.cjs +1 -0
  7. package/dist/rolldown-runtime-CYdcPHCu.js +12 -0
  8. package/dist/virtualdisplay.client.cjs.js +691 -1
  9. package/dist/virtualdisplay.client.es.js +3142 -458
  10. package/dist/virtualdisplay.client.umd.js +698 -1
  11. package/package.json +3 -3
  12. package/dist/src/attributes/attribute.d.ts +0 -38
  13. package/dist/src/attributes/attribute.d.ts.map +0 -1
  14. package/dist/src/attributes/attributes.d.ts +0 -43
  15. package/dist/src/attributes/attributes.d.ts.map +0 -1
  16. package/dist/src/attributes/selections.d.ts +0 -16
  17. package/dist/src/attributes/selections.d.ts.map +0 -1
  18. package/dist/src/attributes/value.d.ts +0 -13
  19. package/dist/src/attributes/value.d.ts.map +0 -1
  20. package/dist/src/camera/camera.d.ts +0 -40
  21. package/dist/src/camera/camera.d.ts.map +0 -1
  22. package/dist/src/camera/index.d.ts +0 -4
  23. package/dist/src/camera/index.d.ts.map +0 -1
  24. package/dist/src/camera/position.d.ts +0 -43
  25. package/dist/src/camera/position.d.ts.map +0 -1
  26. package/dist/src/client/client.d.ts +0 -83
  27. package/dist/src/client/client.d.ts.map +0 -1
  28. package/dist/src/client/error.d.ts +0 -26
  29. package/dist/src/client/error.d.ts.map +0 -1
  30. package/dist/src/client/iframe-builder.d.ts +0 -25
  31. package/dist/src/client/iframe-builder.d.ts.map +0 -1
  32. package/dist/src/client/options.d.ts +0 -17
  33. package/dist/src/client/options.d.ts.map +0 -1
  34. package/dist/src/client/ready-state-tracker.d.ts +0 -26
  35. package/dist/src/client/ready-state-tracker.d.ts.map +0 -1
  36. package/dist/src/client/types.d.ts +0 -5
  37. package/dist/src/client/types.d.ts.map +0 -1
  38. package/dist/src/index.d.ts +0 -11
  39. package/dist/src/index.d.ts.map +0 -1
  40. package/dist/src/snapshot/index.d.ts +0 -3
  41. package/dist/src/snapshot/index.d.ts.map +0 -1
  42. package/dist/src/snapshot/photo.d.ts +0 -47
  43. package/dist/src/snapshot/photo.d.ts.map +0 -1
  44. package/dist/src/snapshot/snapshot.d.ts +0 -30
  45. package/dist/src/snapshot/snapshot.d.ts.map +0 -1
  46. package/dist/src/ui/viewer-config.d.ts +0 -63
  47. package/dist/src/ui/viewer-config.d.ts.map +0 -1
  48. package/dist/src/utils/logger.d.ts +0 -11
  49. package/dist/src/utils/logger.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@virtualdisplay.io/client",
3
3
  "description": "TypeScript-first 3D model integration library with iframe-based architecture",
4
- "version": "4.0.0-alpha.3",
4
+ "version": "4.0.0-alpha.32",
5
5
  "author": "Virtualdisplay <support@virtualdisplay.io>",
6
6
  "homepage": "https://virtualdisplay.io",
7
7
  "license": "MIT",
8
8
  "type": "module",
9
9
  "exports": {
10
10
  ".": {
11
- "types": "./dist/src/index.d.ts",
11
+ "types": "./dist/index.d.ts",
12
12
  "import": "./dist/virtualdisplay.client.es.js",
13
13
  "require": "./dist/virtualdisplay.client.cjs.js"
14
14
  }
15
15
  },
16
16
  "main": "dist/virtualdisplay.client.cjs.js",
17
17
  "module": "dist/virtualdisplay.client.es.js",
18
- "types": "dist/src/index.d.ts",
18
+ "types": "dist/index.d.ts",
19
19
  "files": [
20
20
  "dist",
21
21
  "CHANGELOG.md"
@@ -1,38 +0,0 @@
1
- import { AttributeValue } from './value';
2
- export interface AttributeOptions {
3
- readonly name: string;
4
- readonly values: string[];
5
- readonly onSelect: (name: string, value: string) => void;
6
- readonly defaultValue?: string;
7
- }
8
- /**
9
- * Represents a single attribute with its available values
10
- * Flat API - no source/target translation, works with server values directly
11
- */
12
- export declare class Attribute {
13
- readonly name: string;
14
- readonly defaultValue: string | undefined;
15
- private readonly values;
16
- private readonly onSelect;
17
- private onChangeCallback?;
18
- constructor(options: AttributeOptions);
19
- /**
20
- * Select a value for this attribute
21
- * @throws {VirtualdisplayError} When value not found
22
- */
23
- select(value: string): void;
24
- getValues(): AttributeValue[];
25
- getValue(value: string): AttributeValue | undefined;
26
- /**
27
- * Register callback that fires when selection changes
28
- * Receives the newly selected AttributeValue
29
- */
30
- onChange(callback: (selectedValue: AttributeValue) => void): void;
31
- /**
32
- * Update selection state from server mutation result
33
- * Direct value comparison - no source/target translation
34
- */
35
- handleResult(serverValue: string): void;
36
- private createValues;
37
- }
38
- //# sourceMappingURL=attribute.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attribute.d.ts","sourceRoot":"","sources":["../../../src/attributes/attribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;;GAGG;AACH,qBAAa,SAAS;IACpB,SAAgB,IAAI,EAAE,MAAM,CAAC;IAE7B,SAAgB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8B;IAErD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwC;IAEjE,OAAO,CAAC,gBAAgB,CAAC,CAA2C;gBAExD,OAAO,EAAE,gBAAgB;IAOrC;;;OAGG;IACI,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAQ3B,SAAS,IAAI,cAAc,EAAE;IAI7B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAI1D;;;OAGG;IACI,QAAQ,CAAC,QAAQ,EAAE,CAAC,aAAa,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;IAIxE;;;OAGG;IACI,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAgB9C,OAAO,CAAC,YAAY;CAarB"}
@@ -1,43 +0,0 @@
1
- import { Attribute } from './attribute';
2
- import { AttributeValue } from './value';
3
- import { MappingMessage, MessageCallback, MutationResultMessage } from '@virtualdisplay.io/messaging';
4
- /**
5
- * Public attribute API.
6
- * Receives mapping from server, provides query/select API,
7
- * and sends mutations via postMessage.
8
- *
9
- * select() can be called before the mapping arrives — mutations are sent
10
- * immediately and buffered by the messenger's publisher queue until the
11
- * iframe is ready. onChange() callbacks registered before the mapping are
12
- * replayed once the registry is created.
13
- */
14
- export declare class Attributes {
15
- private readonly send;
16
- private readonly onMutationFailed?;
17
- private registry;
18
- private readonly pendingCallbacks;
19
- constructor(send: MessageCallback, onMutationFailed?: ((attribute: string, value: string) => void) | undefined);
20
- /**
21
- * Handle incoming MAPPING message from server
22
- */
23
- handleMappingReceived(message: MappingMessage): void;
24
- handleMutationResult(message: MutationResultMessage): void;
25
- /**
26
- * Select a value for an attribute - sends mutation to server.
27
- * Can be called before the mapping arrives — the mutation is sent immediately
28
- * and the messenger's publisher queue holds it until the iframe is ready.
29
- */
30
- select(name: string, value: string): void;
31
- getValues(name: string): AttributeValue[];
32
- getValue(name: string, value: string): AttributeValue | undefined;
33
- /**
34
- * Register onChange callback for an attribute.
35
- * Buffers the callback if the mapping hasn't arrived yet.
36
- */
37
- onChange(name: string, callback: (selectedValue: AttributeValue) => void): void;
38
- getAttribute(name: string): Attribute | undefined;
39
- get hasMapping(): boolean;
40
- private sendMutation;
41
- private replayPendingCallbacks;
42
- }
43
- //# sourceMappingURL=attributes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../src/attributes/attributes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,eAAe,EAGpB,KAAK,qBAAqB,EAC3B,MAAM,8BAA8B,CAAC;AAGtC;;;;;;;;;GASG;AACH,qBAAa,UAAU;IAMnB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IANpC,OAAO,CAAC,QAAQ,CAAgC;IAEhD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAkF;gBAGhG,IAAI,EAAE,eAAe,EACrB,gBAAgB,CAAC,GAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,aAAA;IAGhF;;OAEG;IACI,qBAAqB,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAmBpD,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAIjE;;;;OAIG;IACI,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAIzC,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,EAAE;IAIzC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAIxE;;;OAGG;IACI,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,aAAa,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;IAe/E,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAIxD,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,sBAAsB;CAU/B"}
@@ -1,16 +0,0 @@
1
- import { Attribute } from './attribute';
2
- import { AttributeDefinition, MutationDto, MutationResult } from '@virtualdisplay.io/messaging';
3
- /**
4
- * Creates and tracks attribute instances from server definitions.
5
- * Handles mutation results by updating the corresponding attribute.
6
- */
7
- export declare class AttributeRegistry {
8
- private readonly attributes;
9
- constructor(definitions: AttributeDefinition[], sendMutation: (mutations: MutationDto[], isInitial: boolean) => void, onMutationFailed?: (attribute: string, value: string) => void);
10
- private readonly onMutationFailed;
11
- get(name: string): Attribute | undefined;
12
- defaults(): MutationDto[];
13
- handleResults(results: MutationResult[]): void;
14
- private buildOptions;
15
- }
16
- //# sourceMappingURL=selections.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selections.d.ts","sourceRoot":"","sources":["../../../src/attributes/selections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAyB,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAErG;;;GAGG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAgC;gBAGzD,WAAW,EAAE,mBAAmB,EAAE,EAClC,YAAY,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,EACpE,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI;IAS/D,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA2D;IAErF,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAIxC,QAAQ,IAAI,WAAW,EAAE;IAezB,aAAa,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,IAAI;IAWrD,OAAO,CAAC,YAAY;CAkBrB"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Pure domain entity representing a single attribute value
3
- * No side effects - only state
4
- */
5
- export declare class AttributeValue {
6
- readonly value: string;
7
- readonly attribute: string;
8
- private isSelectedValue;
9
- constructor(value: string, attribute: string);
10
- get isSelected(): boolean;
11
- setSelected(selected: boolean): void;
12
- }
13
- //# sourceMappingURL=value.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../../src/attributes/value.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,cAAc;aAIP,KAAK,EAAE,MAAM;aACb,SAAS,EAAE,MAAM;IAJnC,OAAO,CAAC,eAAe,CAAS;gBAGd,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM;IAGnC,IAAW,UAAU,IAAI,OAAO,CAE/B;IAEM,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;CAG5C"}
@@ -1,40 +0,0 @@
1
- import { MessageCallback } from '@virtualdisplay.io/messaging';
2
- /**
3
- * Camera control API for positioning and zoom
4
- * Uses chaining pattern for building commands
5
- */
6
- export declare class Camera {
7
- private readonly send;
8
- private commands;
9
- constructor(send: MessageCallback);
10
- /**
11
- * Rotate camera horizontally
12
- * @param degrees - Absolute rotation in degrees (0 = front view)
13
- * @throws VirtualdisplayError if value is not a finite number
14
- */
15
- rotate(degrees: number): this;
16
- /**
17
- * Tilt camera vertically
18
- * @param degrees - Absolute tilt in degrees (0 = top view, 90 = horizontal)
19
- * @throws VirtualdisplayError if value is not a finite number
20
- */
21
- tilt(degrees: number): this;
22
- /**
23
- * Zoom camera
24
- * @param percentage - Zoom percentage (100 = normal, >100 = zoom in, <100 = zoom out)
25
- * @throws VirtualdisplayError if value is not a finite number
26
- */
27
- zoom(percentage: number): this;
28
- /**
29
- * Execute accumulated camera commands
30
- * @throws VirtualdisplayError if no commands have been accumulated
31
- */
32
- set(): void;
33
- private validateFiniteNumber;
34
- /**
35
- * Reset camera to initial position
36
- * This is not chainable and executes immediately
37
- */
38
- reset(): void;
39
- }
40
- //# sourceMappingURL=camera.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../../src/camera/camera.ts"],"names":[],"mappings":"AACA,OAAO,EAAgE,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAElI;;;GAGG;AACH,qBAAa,MAAM;IAIf,OAAO,CAAC,QAAQ,CAAC,IAAI;IAHvB,OAAO,CAAC,QAAQ,CAAuB;gBAGpB,IAAI,EAAE,eAAe;IAGxC;;;;OAIG;IACI,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAMpC;;;;OAIG;IACI,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAMlC;;;;OAIG;IACI,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAMrC;;;OAGG;IACI,GAAG,IAAI,IAAI;IAiBlB,OAAO,CAAC,oBAAoB;IAQ5B;;;OAGG;IACI,KAAK,IAAI,IAAI;CAQrB"}
@@ -1,4 +0,0 @@
1
- export { Camera } from './camera';
2
- export { CameraPosition, type CameraPositionState } from './position';
3
- export type { CameraConfig } from '@virtualdisplay.io/messaging';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/camera/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtE,YAAY,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC"}
@@ -1,43 +0,0 @@
1
- import { CameraParameter, CameraPositionMessage } from '@virtualdisplay.io/messaging';
2
- /**
3
- * Camera position state object
4
- */
5
- export interface CameraPositionState {
6
- rotation: number;
7
- tilt: number;
8
- zoom: number;
9
- }
10
- /**
11
- * Camera position state
12
- * Tracks current rotation, tilt, and zoom values from server updates
13
- */
14
- export declare class CameraPosition {
15
- private readonly state;
16
- private readonly changeCallbacks;
17
- constructor();
18
- /**
19
- * Get current rotation in degrees
20
- */
21
- get rotation(): number;
22
- /**
23
- * Get current tilt in degrees
24
- */
25
- get tilt(): number;
26
- /**
27
- * Get current zoom percentage
28
- */
29
- get zoom(): number;
30
- /**
31
- * Subscribe to camera position changes
32
- */
33
- onChange(callback: (position: CameraPositionState) => void): void;
34
- /**
35
- * Handle incoming camera position message from server
36
- */
37
- handlePositionUpdate(message: CameraPositionMessage): void;
38
- /**
39
- * Update camera position from server transforms
40
- */
41
- update(transforms: CameraParameter[]): void;
42
- }
43
- //# sourceMappingURL=position.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../../src/camera/position.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAE3F;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAsB;IAE5C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAsD;;IAUtF;;OAEG;IACH,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED;;OAEG;IACH,IAAW,IAAI,IAAI,MAAM,CAExB;IAED;;OAEG;IACH,IAAW,IAAI,IAAI,MAAM,CAExB;IAED;;OAEG;IACI,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,GAAG,IAAI;IAIxE;;OAEG;IACI,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAIjE;;OAEG;IACI,MAAM,CAAC,UAAU,EAAE,eAAe,EAAE,GAAG,IAAI;CAmCnD"}
@@ -1,83 +0,0 @@
1
- import { ClientOptions } from './options';
2
- import { MutationFailedEvent } from './types';
3
- import { Attribute } from '../attributes/attribute';
4
- import { AttributeValue } from '../attributes/value';
5
- import { Camera, CameraPosition } from '../camera';
6
- import { Snapshot } from '../snapshot';
7
- import { VirtualdisplayViewerService } from '../ui/viewer-config';
8
- /**
9
- * Main Virtualdisplay Client
10
- * Provides the public API for 3D product visualization
11
- *
12
- * Acts as the composition root: wires all services together with direct dependency injection
13
- */
14
- export declare class VirtualdisplayClient {
15
- private readonly attributes;
16
- private readonly readyStateTracker;
17
- private readonly messenger;
18
- private readonly viewerService;
19
- private readonly cameraApi;
20
- private readonly cameraPositionApi;
21
- private readonly snapshotApi;
22
- private readonly options;
23
- private iframe;
24
- private readyCallbacks;
25
- private readonly mutationFailedCallbacks;
26
- constructor(options: ClientOptions);
27
- private registerHandlers;
28
- private initializeLogging;
29
- private createAndConnectIframe;
30
- /**
31
- * Select a value for an attribute — sends mutation to server.
32
- * Can be called immediately; the messenger's publisher queue holds
33
- * the message until the iframe is ready.
34
- */
35
- select(name: string, value: string): void;
36
- /**
37
- * Get all available values for an attribute
38
- */
39
- getValues(name: string): AttributeValue[];
40
- /**
41
- * Get a specific value for an attribute
42
- */
43
- getValue(name: string, value: string): AttributeValue | undefined;
44
- /**
45
- * Register callback that fires when an attribute's selection changes
46
- */
47
- onChange(name: string, callback: (selectedValue: AttributeValue) => void): void;
48
- /**
49
- * Get the Attribute instance for advanced use cases
50
- */
51
- getAttribute(name: string): Attribute | undefined;
52
- /**
53
- * Check if the client has received initial mutations and is ready
54
- */
55
- get isReady(): boolean;
56
- /**
57
- * Register a callback to be called when the client is ready
58
- * If already ready, the callback is called immediately
59
- */
60
- onReady(callback: (client: VirtualdisplayClient) => void): void;
61
- /**
62
- * Register a callback for when a mutation fails on the server
63
- */
64
- onMutationFailed(callback: (event: MutationFailedEvent) => void): void;
65
- /**
66
- * Get the viewer service for UI configuration
67
- */
68
- get viewer(): VirtualdisplayViewerService;
69
- /**
70
- * Get the camera control API
71
- */
72
- get camera(): Camera;
73
- /**
74
- * Get the camera position tracking API
75
- */
76
- get cameraPosition(): CameraPosition;
77
- /**
78
- * Get the snapshot API for taking screenshots
79
- */
80
- get snapshot(): Snapshot;
81
- destroy(): void;
82
- }
83
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/client/client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAUnD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAGlE;;;;;GAKG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAExC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAoB;IAEtD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkB;IAE5C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA8B;IAE5D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAiB;IAEnD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAW;IAEvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IAExC,OAAO,CAAC,MAAM,CAAgC;IAE9C,OAAO,CAAC,cAAc,CAAqD;IAE3E,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAmD;gBAE/E,OAAO,EAAE,aAAa;IA0ClC,OAAO,CAAC,gBAAgB;IAqCxB,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,sBAAsB;IAQ9B;;;;OAIG;IACI,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAIhD;;OAEG;IACI,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,EAAE;IAIhD;;OAEG;IACI,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAIxE;;OAEG;IACI,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,aAAa,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;IAItF;;OAEG;IACI,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAIxD;;OAEG;IACH,IAAW,OAAO,IAAI,OAAO,CAE5B;IAED;;;OAGG;IACI,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,GAAG,IAAI;IAStE;;OAEG;IACI,gBAAgB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,GAAG,IAAI;IAI7E;;OAEG;IACH,IAAW,MAAM,IAAI,2BAA2B,CAE/C;IAED;;OAEG;IACH,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED;;OAEG;IACH,IAAW,cAAc,IAAI,cAAc,CAE1C;IAED;;OAEG;IACH,IAAW,QAAQ,IAAI,QAAQ,CAE9B;IAEM,OAAO,IAAI,IAAI;CAevB"}
@@ -1,26 +0,0 @@
1
- /**
2
- * Error codes for Virtualdisplay client errors
3
- */
4
- export declare const ERROR_CODES: {
5
- readonly NO_MAPPING: "NO_MAPPING";
6
- readonly ATTRIBUTE_NOT_FOUND: "ATTRIBUTE_NOT_FOUND";
7
- readonly VALUE_NOT_FOUND: "VALUE_NOT_FOUND";
8
- readonly PARENT_NOT_FOUND: "PARENT_NOT_FOUND";
9
- readonly INVALID_PARAMETER: "INVALID_PARAMETER";
10
- readonly SNAPSHOT_FAILED: "SNAPSHOT_FAILED";
11
- };
12
- export type ErrorCode = typeof ERROR_CODES[keyof typeof ERROR_CODES];
13
- /**
14
- * Custom error class for Virtualdisplay client errors
15
- */
16
- export declare class VirtualdisplayError extends Error {
17
- readonly code: ErrorCode;
18
- constructor(message: string, code: ErrorCode);
19
- static noMapping(): VirtualdisplayError;
20
- static attributeNotFound(attributeName: string): VirtualdisplayError;
21
- static valueNotFound(attributeName: string, valueName: string): VirtualdisplayError;
22
- static parentNotFound(selector: string): VirtualdisplayError;
23
- static invalidParameter(reason: string): VirtualdisplayError;
24
- static snapshotFailed(filename: string, reason: string): VirtualdisplayError;
25
- }
26
- //# sourceMappingURL=error.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../src/client/error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;CAOd,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,OAAO,WAAW,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAErE;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,SAAgB,IAAI,EAAE,SAAS,CAAC;gBAEpB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS;WAU9B,SAAS,IAAI,mBAAmB;WAOhC,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,mBAAmB;WAO7D,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,mBAAmB;WAO5E,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB;WAOrD,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,mBAAmB;WAIrD,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,mBAAmB;CAMpF"}
@@ -1,25 +0,0 @@
1
- import { ClientOptions } from './options';
2
- /**
3
- * Builds and configures the iframe for Virtualdisplay
4
- */
5
- export declare class IframeBuilder {
6
- private readonly defaultServer;
7
- private readonly options;
8
- constructor(options: ClientOptions);
9
- /**
10
- * Create iframe element with Virtualdisplay viewer
11
- */
12
- create(): HTMLIFrameElement;
13
- private createIframe;
14
- private attachToParent;
15
- private buildUrl;
16
- /**
17
- * Get server URL from environment or use default
18
- */
19
- private getServerUrl;
20
- /**
21
- * Get parent element from selector or element
22
- */
23
- private getParentElement;
24
- }
25
- //# sourceMappingURL=iframe-builder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"iframe-builder.d.ts","sourceRoot":"","sources":["../../../src/client/iframe-builder.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAsC;IAEpE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;gBAE5B,OAAO,EAAE,aAAa;IAIlC;;OAEG;IACI,MAAM,IAAI,iBAAiB;IAMlC,OAAO,CAAC,YAAY;IAiBpB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,QAAQ;IAoBhB;;OAEG;IACH,OAAO,CAAC,YAAY;IASpB;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAYzB"}
@@ -1,17 +0,0 @@
1
- import { CameraConfig, UIConfig } from '@virtualdisplay.io/messaging';
2
- /**
3
- * Configuration options for VirtualdisplayClient
4
- */
5
- export interface ClientOptions {
6
- readonly parent: string | HTMLElement;
7
- readonly model: string;
8
- readonly license: string;
9
- readonly debug?: boolean;
10
- readonly language?: string;
11
- readonly arEnabled?: boolean;
12
- readonly fullscreenEnabled?: boolean;
13
- readonly loadingIndicatorEnabled?: boolean;
14
- readonly ui?: UIConfig;
15
- readonly camera?: CameraConfig;
16
- }
17
- //# sourceMappingURL=options.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/client/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAG3B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAG3C,QAAQ,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC;IAGvB,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;CAChC"}
@@ -1,26 +0,0 @@
1
- import { MutationResultMessage } from '@virtualdisplay.io/messaging';
2
- /**
3
- * Tracks when the client is ready for use
4
- *
5
- * Ready is triggered by whichever arrives first:
6
- * - A mapping message from the server (server-driven flow)
7
- * - An initial mutation result (legacy/client-driven flow)
8
- */
9
- export declare class ReadyStateTracker {
10
- private ready;
11
- private readonly onReady;
12
- constructor(onReady?: () => void);
13
- /**
14
- * Handle mapping received from server — marks client as ready
15
- */
16
- handleMappingReceived(): void;
17
- /**
18
- * Handle incoming mutation result message
19
- * When the first initial mutation result arrives, the client is considered ready
20
- */
21
- handleMutationResult(message: MutationResultMessage): void;
22
- get isReady(): boolean;
23
- clear(): void;
24
- private markReady;
25
- }
26
- //# sourceMappingURL=ready-state-tracker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ready-state-tracker.d.ts","sourceRoot":"","sources":["../../../src/client/ready-state-tracker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAG1E;;;;;;GAMG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,KAAK,CAAS;IAEtB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA2B;gBAEvC,OAAO,CAAC,EAAE,MAAM,IAAI;IAIhC;;OAEG;IACI,qBAAqB,IAAI,IAAI;IAIpC;;;OAGG;IACI,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAMjE,IAAW,OAAO,IAAI,OAAO,CAE5B;IAEM,KAAK,IAAI,IAAI;IAIpB,OAAO,CAAC,SAAS;CASlB"}
@@ -1,5 +0,0 @@
1
- export interface MutationFailedEvent {
2
- attribute: string;
3
- value: string;
4
- }
5
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/client/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -1,11 +0,0 @@
1
- export { VirtualdisplayClient } from './client/client';
2
- export type { ClientOptions } from './client/options';
3
- export { VirtualdisplayError, ERROR_CODES, type ErrorCode } from './client/error';
4
- export type { MutationFailedEvent } from './client/types';
5
- export { Attribute } from './attributes/attribute';
6
- export { AttributeValue } from './attributes/value';
7
- export { Camera } from './camera';
8
- export { Snapshot, Photo, type PhotoData } from './snapshot';
9
- export { VirtualdisplayViewerService } from './ui/viewer-config';
10
- export { logger, enableDebugMode, isDebugMode } from './utils/logger';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAClF,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAG7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAGjE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1,3 +0,0 @@
1
- export { Snapshot } from './snapshot';
2
- export { Photo, type PhotoData } from './photo';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/snapshot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC"}
@@ -1,47 +0,0 @@
1
- import { VirtualdisplayError } from '../client/error';
2
- export interface PhotoData {
3
- readonly filename: string;
4
- readonly data: string;
5
- }
6
- /**
7
- * Represents a photo being captured
8
- * Pure domain object that manages callbacks for when the photo is developed
9
- */
10
- export declare class Photo {
11
- private readonly filename;
12
- private readonly developedCallbacks;
13
- private readonly errorCallbacks;
14
- private developed;
15
- private failed;
16
- private photoData;
17
- constructor(filename: string);
18
- /**
19
- * Register a callback for when the photo is developed
20
- * If the photo is already developed, the callback is called immediately
21
- *
22
- * @param callback Function to call with photo data
23
- * @returns This Photo instance for chaining
24
- */
25
- onDeveloped(callback: (photo: PhotoData) => void): this;
26
- /**
27
- * Register a callback for when the photo capture fails
28
- *
29
- * @param callback Function to call with error
30
- * @returns This Photo instance for chaining
31
- */
32
- onError(callback: (error: VirtualdisplayError) => void): this;
33
- /**
34
- * Get the filename for this photo
35
- */
36
- getFilename(): string;
37
- /**
38
- * Mark the photo as developed and notify all callbacks
39
- * This method is called by Snapshot when the photo data arrives from the server
40
- */
41
- develop(photoData: PhotoData): void;
42
- /**
43
- * Mark the photo as failed and notify error callbacks
44
- */
45
- fail(error: VirtualdisplayError): void;
46
- }
47
- //# sourceMappingURL=photo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"photo.d.ts","sourceRoot":"","sources":["../../../src/snapshot/photo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,qBAAa,KAAK;IAYd,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAX3B,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA8C;IAEjF,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAwD;IAEvF,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO,CAAC,MAAM,CAAS;IAEvB,OAAO,CAAC,SAAS,CAA0B;gBAGxB,QAAQ,EAAE,MAAM;IAGnC;;;;;;OAMG;IACI,WAAW,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,GAAG,IAAI;IAS9D;;;;;OAKG;IACI,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,GAAG,IAAI;IAKpE;;OAEG;IACI,WAAW,IAAI,MAAM;IAI5B;;;OAGG;IACI,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAgB1C;;OAEG;IACI,IAAI,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI;CAc9C"}
@@ -1,30 +0,0 @@
1
- import { Photo } from './photo';
2
- import { MessageCallback, SnapshotResultMessage } from '@virtualdisplay.io/messaging';
3
- /**
4
- * API for taking screenshots of the 3D model
5
- * Following the camera analogy: take() triggers capture, onDeveloped() gets result
6
- */
7
- export declare class Snapshot {
8
- private readonly send;
9
- private readonly validExtensions;
10
- private readonly pendingPhotos;
11
- constructor(send: MessageCallback);
12
- /**
13
- * Take a snapshot of the current 3D model view
14
- *
15
- * @param filename The filename for the snapshot (must include valid extension)
16
- * @returns Photo object for registering callbacks
17
- * @throws VirtualdisplayError if filename is invalid
18
- */
19
- take(filename: string): Photo;
20
- /**
21
- * Handle incoming snapshot result from server
22
- * Matches the message to a pending photo by filename, then develops or fails it
23
- */
24
- handleSnapshotResult(message: SnapshotResultMessage): void;
25
- /**
26
- * Validate filename has a valid image extension
27
- */
28
- private validateFilename;
29
- }
30
- //# sourceMappingURL=snapshot.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../../src/snapshot/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAiB,KAAK,eAAe,EAAE,KAAK,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAG/G;;;GAGG;AACH,qBAAa,QAAQ;IAMjB,OAAO,CAAC,QAAQ,CAAC,IAAI;IALvB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAY;IAE5C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA4B;gBAGvC,IAAI,EAAE,eAAe;IAGxC;;;;;;OAMG;IACI,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK;IAgBpC;;;OAGG;IACI,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAuBjE;;OAEG;IACH,OAAO,CAAC,gBAAgB;CA2BzB"}