@virtualdisplay.io/client 4.0.0-alpha.1 → 4.0.0-alpha.11
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 +74 -0
- package/README.md +105 -157
- package/dist/browser-CDLfpTNV.cjs +8 -0
- package/dist/browser-DxtIwHNu.js +1227 -0
- package/dist/chunk-BcutgqC9.cjs +1 -0
- package/dist/chunk-C_CI6nMA.js +13 -0
- package/dist/src/annotations/annotations.d.ts +20 -0
- package/dist/src/annotations/annotations.d.ts.map +1 -0
- package/dist/src/annotations/index.d.ts +2 -0
- package/dist/src/annotations/index.d.ts.map +1 -0
- package/dist/src/attributes/attribute.d.ts +38 -0
- package/dist/src/attributes/attribute.d.ts.map +1 -0
- package/dist/src/attributes/attributes.d.ts +43 -0
- package/dist/src/attributes/attributes.d.ts.map +1 -0
- package/dist/src/attributes/selections.d.ts +16 -0
- package/dist/src/attributes/selections.d.ts.map +1 -0
- package/dist/src/attributes/value.d.ts +13 -0
- package/dist/src/attributes/value.d.ts.map +1 -0
- package/dist/src/camera/camera.d.ts +40 -0
- package/dist/src/camera/camera.d.ts.map +1 -0
- package/dist/src/camera/index.d.ts +4 -0
- package/dist/src/camera/index.d.ts.map +1 -0
- package/dist/src/camera/position.d.ts +56 -0
- package/dist/src/camera/position.d.ts.map +1 -0
- package/dist/src/client/client.d.ts +51 -0
- package/dist/src/client/client.d.ts.map +1 -0
- package/dist/src/client/error.d.ts +26 -0
- package/dist/src/client/error.d.ts.map +1 -0
- package/dist/src/client/iframe-builder.d.ts +27 -0
- package/dist/src/client/iframe-builder.d.ts.map +1 -0
- package/dist/src/client/options.d.ts +19 -0
- package/dist/src/client/options.d.ts.map +1 -0
- package/dist/src/client/ready-state-tracker.d.ts +13 -0
- package/dist/src/client/ready-state-tracker.d.ts.map +1 -0
- package/dist/src/client/types.d.ts +19 -0
- package/dist/src/client/types.d.ts.map +1 -0
- package/dist/src/index.d.ts +12 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/snapshot/index.d.ts +3 -0
- package/dist/src/snapshot/index.d.ts.map +1 -0
- package/dist/src/snapshot/photo.d.ts +47 -0
- package/dist/src/snapshot/photo.d.ts.map +1 -0
- package/dist/src/snapshot/snapshot.d.ts +30 -0
- package/dist/src/snapshot/snapshot.d.ts.map +1 -0
- package/dist/src/ui/action-bar.d.ts +18 -0
- package/dist/src/ui/action-bar.d.ts.map +1 -0
- package/dist/src/ui/camera-controls.d.ts +8 -0
- package/dist/src/ui/camera-controls.d.ts.map +1 -0
- package/dist/src/ui/controls/attribute-group.d.ts +6 -0
- package/dist/src/ui/controls/attribute-group.d.ts.map +1 -0
- package/dist/src/ui/event-bus.d.ts +12 -0
- package/dist/src/ui/event-bus.d.ts.map +1 -0
- package/dist/src/ui/loading.d.ts +43 -0
- package/dist/src/ui/loading.d.ts.map +1 -0
- package/dist/src/ui/standard-interface.d.ts +41 -0
- package/dist/src/ui/standard-interface.d.ts.map +1 -0
- package/dist/src/ui/styles.d.ts +3 -0
- package/dist/src/ui/styles.d.ts.map +1 -0
- package/dist/src/utils/logger.d.ts +11 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/virtualdisplay.client.cjs.js +303 -2
- package/dist/virtualdisplay.client.es.js +2213 -2
- package/dist/virtualdisplay.client.umd.js +310 -2
- package/package.json +3 -3
- package/dist/index.d.ts +0 -415
- package/dist/virtualdisplay.client.cjs.js.map +0 -1
- package/dist/virtualdisplay.client.es.js.map +0 -1
- package/dist/virtualdisplay.client.umd.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, i, o, s) => {
|
|
3
|
+
if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
|
|
4
|
+
get: ((e) => i[e]).bind(null, d),
|
|
5
|
+
enumerable: !(s = n(i, d)) || s.enumerable
|
|
6
|
+
});
|
|
7
|
+
return e;
|
|
8
|
+
}, c = (n, r, a) => (a = n == null ? {} : e(i(n)), s(r || !n || !n.__esModule ? t(a, "default", {
|
|
9
|
+
value: n,
|
|
10
|
+
enumerable: !0
|
|
11
|
+
}) : a, n));
|
|
12
|
+
//#endregion
|
|
13
|
+
export { c as n, o as t };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AnnotationPosition, Message } from '@virtualdisplay.io/messaging';
|
|
2
|
+
type SendFn = (message: Message) => void;
|
|
3
|
+
type PlacedCallback = (position: AnnotationPosition) => void;
|
|
4
|
+
/**
|
|
5
|
+
* Annotation controls for the viewer.
|
|
6
|
+
* Toggle visibility, and manage click-to-place for the annotation editor.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Annotations {
|
|
9
|
+
private readonly send;
|
|
10
|
+
private readonly placedCallbacks;
|
|
11
|
+
constructor(send: SendFn);
|
|
12
|
+
setEnabled(enabled: boolean): void;
|
|
13
|
+
startPlacing(): void;
|
|
14
|
+
stopPlacing(): void;
|
|
15
|
+
onPlaced(callback: PlacedCallback): void;
|
|
16
|
+
/** Called by the client when an ANNOTATION_PLACED message is received. */
|
|
17
|
+
handlePlaced(position: AnnotationPosition): void;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=annotations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../../src/annotations/annotations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,kBAAkB,EAAE,KAAK,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAEpG,KAAK,MAAM,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AACzC,KAAK,cAAc,GAAG,CAAC,QAAQ,EAAE,kBAAkB,KAAK,IAAI,CAAC;AAE7D;;;GAGG;AACH,qBAAa,WAAW;IAGV,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAwB;gBAE3B,IAAI,EAAE,MAAM;IAEzC,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAOlC,YAAY,IAAI,IAAI;IAOpB,WAAW,IAAI,IAAI;IAOnB,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAIxC,0EAA0E;IAC1E,YAAY,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI;CAKjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/annotations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;IAepD,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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { CameraLimits, 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, zoom, and movement limits from server updates.
|
|
13
|
+
*/
|
|
14
|
+
export declare class CameraPosition {
|
|
15
|
+
private readonly state;
|
|
16
|
+
private limitsState;
|
|
17
|
+
private readonly changeCallbacks;
|
|
18
|
+
constructor();
|
|
19
|
+
/**
|
|
20
|
+
* Get current rotation in degrees
|
|
21
|
+
*/
|
|
22
|
+
get rotation(): number;
|
|
23
|
+
/**
|
|
24
|
+
* Get current tilt in degrees
|
|
25
|
+
*/
|
|
26
|
+
get tilt(): number;
|
|
27
|
+
/**
|
|
28
|
+
* Get current zoom percentage
|
|
29
|
+
*/
|
|
30
|
+
get zoom(): number;
|
|
31
|
+
/**
|
|
32
|
+
* Subscribe to camera position changes.
|
|
33
|
+
* Also fires when limits are applied via applyLimits() so components
|
|
34
|
+
* can re-evaluate disabled states without a separate callback.
|
|
35
|
+
*/
|
|
36
|
+
onChange(callback: (position: CameraPositionState) => void): void;
|
|
37
|
+
/**
|
|
38
|
+
* Current camera movement limits (set from CONFIG message).
|
|
39
|
+
* Undefined until the server sends limits in its CONFIG payload.
|
|
40
|
+
*/
|
|
41
|
+
get limits(): CameraLimits | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Apply camera limits received from the server CONFIG message.
|
|
44
|
+
* Fires onChange callbacks so button disabled states update immediately.
|
|
45
|
+
*/
|
|
46
|
+
applyLimits(limits: CameraLimits | undefined): void;
|
|
47
|
+
/**
|
|
48
|
+
* Handle incoming camera position message from server
|
|
49
|
+
*/
|
|
50
|
+
handlePositionUpdate(message: CameraPositionMessage): void;
|
|
51
|
+
/**
|
|
52
|
+
* Update camera position from server transforms
|
|
53
|
+
*/
|
|
54
|
+
update(transforms: CameraParameter[]): void;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=position.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../../src/camera/position.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAEzG;;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,WAAW,CAA2B;IAE9C,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;;;;OAIG;IACI,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,GAAG,IAAI;IAIxE;;;OAGG;IACH,IAAW,MAAM,IAAI,YAAY,GAAG,SAAS,CAE5C;IAED;;;OAGG;IACI,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,GAAG,IAAI;IAM1D;;OAEG;IACI,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAIjE;;OAEG;IACI,MAAM,CAAC,UAAU,EAAE,eAAe,EAAE,GAAG,IAAI;CAmCnD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ClientOptions } from './options';
|
|
2
|
+
import { MutationFailedEvent, VirtualdisplayUiEventMap, VirtualdisplayUiEventType } from './types';
|
|
3
|
+
import { Annotations } from '../annotations';
|
|
4
|
+
import { Attribute } from '../attributes/attribute';
|
|
5
|
+
import { AttributeValue } from '../attributes/value';
|
|
6
|
+
import { Camera, CameraPosition } from '../camera';
|
|
7
|
+
import { ViewerSettings } from '@virtualdisplay.io/messaging';
|
|
8
|
+
import { Snapshot } from '../snapshot';
|
|
9
|
+
/**
|
|
10
|
+
* Main Virtualdisplay Client — composition root.
|
|
11
|
+
* Wires all services together and exposes the public API.
|
|
12
|
+
*/
|
|
13
|
+
export declare class VirtualdisplayClient {
|
|
14
|
+
private readonly attributes;
|
|
15
|
+
private readonly readyStateTracker;
|
|
16
|
+
private readonly messenger;
|
|
17
|
+
private readonly cameraApi;
|
|
18
|
+
private readonly cameraPositionApi;
|
|
19
|
+
private readonly snapshotApi;
|
|
20
|
+
private readonly annotationsApi;
|
|
21
|
+
private readonly eventBus;
|
|
22
|
+
private readonly ui;
|
|
23
|
+
private readonly qrModal;
|
|
24
|
+
private readonly options;
|
|
25
|
+
private iframe;
|
|
26
|
+
private container;
|
|
27
|
+
private readyCallbacks;
|
|
28
|
+
private readonly mutationFailedCallbacks;
|
|
29
|
+
constructor(options: ClientOptions);
|
|
30
|
+
private registerHandlers;
|
|
31
|
+
private handleConfig;
|
|
32
|
+
private activateAr;
|
|
33
|
+
private initializeLogging;
|
|
34
|
+
private createAndConnectIframe;
|
|
35
|
+
select(name: string, value: string): void;
|
|
36
|
+
getValues(name: string): AttributeValue[];
|
|
37
|
+
getValue(name: string, value: string): AttributeValue | undefined;
|
|
38
|
+
onChange(name: string, callback: (selectedValue: AttributeValue) => void): void;
|
|
39
|
+
getAttribute(name: string): Attribute | undefined;
|
|
40
|
+
get isReady(): boolean;
|
|
41
|
+
onReady(callback: (client: VirtualdisplayClient) => void): void;
|
|
42
|
+
onMutationFailed(callback: (event: MutationFailedEvent) => void): void;
|
|
43
|
+
on<T extends VirtualdisplayUiEventType>(type: T, callback: (event: VirtualdisplayUiEventMap[T]) => void): void;
|
|
44
|
+
get annotations(): Annotations;
|
|
45
|
+
get camera(): Camera;
|
|
46
|
+
get cameraPosition(): CameraPosition;
|
|
47
|
+
get snapshot(): Snapshot;
|
|
48
|
+
get viewerSettings(): ViewerSettings;
|
|
49
|
+
destroy(): void;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACxG,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,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;AACnD,OAAO,EAWL,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAOvC;;;GAGG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAoB;IACtD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkB;IAC5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAiB;IACnD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAW;IACvC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAc;IAC7C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAa;IACtC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAoB;IACvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IAExC,OAAO,CAAC,MAAM,CAAgC;IAC9C,OAAO,CAAC,SAAS,CAA0B;IAC3C,OAAO,CAAC,cAAc,CAAqD;IAC3E,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAmD;gBAE/E,OAAO,EAAE,aAAa;IA6ClC,OAAO,CAAC,gBAAgB;IAuDxB,OAAO,CAAC,YAAY;IAyBpB,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,sBAAsB;IAiBvB,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;IAIjE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,aAAa,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;IAI/E,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAIxD,IAAW,OAAO,IAAI,OAAO,CAE5B;IAEM,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,GAAG,IAAI;IAK/D,gBAAgB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,GAAG,IAAI;IAItE,EAAE,CAAC,CAAC,SAAS,yBAAyB,EAC3C,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAC,CAAC,KAAK,IAAI,GACrD,IAAI;IAIP,IAAW,WAAW,IAAI,WAAW,CAAgC;IACrE,IAAW,MAAM,IAAI,MAAM,CAA2B;IACtD,IAAW,cAAc,IAAI,cAAc,CAAmC;IAC9E,IAAW,QAAQ,IAAI,QAAQ,CAA6B;IAE5D,IAAW,cAAc,IAAI,cAAc,CAE1C;IAEM,OAAO,IAAI,IAAI;CAavB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;WAM9B,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"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ClientOptions } from './options';
|
|
2
|
+
export interface IframeResult {
|
|
3
|
+
container: HTMLElement;
|
|
4
|
+
iframe: HTMLIFrameElement;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Builds the container + iframe structure for Virtualdisplay.
|
|
8
|
+
*
|
|
9
|
+
* Creates a vd-container div inside the parent element, then places the
|
|
10
|
+
* iframe inside. UI overlays are layered on top of the iframe within the container.
|
|
11
|
+
*/
|
|
12
|
+
export declare class IframeBuilder {
|
|
13
|
+
private readonly defaultServer;
|
|
14
|
+
private readonly options;
|
|
15
|
+
constructor(options: ClientOptions);
|
|
16
|
+
/**
|
|
17
|
+
* Create container and iframe, attach to parent element
|
|
18
|
+
*/
|
|
19
|
+
create(): IframeResult;
|
|
20
|
+
private createContainer;
|
|
21
|
+
private createIframe;
|
|
22
|
+
private attachToParent;
|
|
23
|
+
private buildUrl;
|
|
24
|
+
private getServerUrl;
|
|
25
|
+
private getParentElement;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=iframe-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,WAAW,CAAC;IACvB,MAAM,EAAE,iBAAiB,CAAC;CAC3B;AAED;;;;;GAKG;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,YAAY;IAS7B,OAAO,CAAC,eAAe;IAcvB,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,QAAQ;IAsBhB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,gBAAgB;CAYzB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ViewerSettings } 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
|
+
/** W3C traceparent string to propagate to the viewer iframe for end-to-end tracing. */
|
|
12
|
+
readonly traceparent?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Override viewer settings from metadata. Omitted fields use the metadata value.
|
|
15
|
+
* A warning is logged when an override differs from the metadata value.
|
|
16
|
+
*/
|
|
17
|
+
readonly viewerSettings?: Partial<ViewerSettings>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/client/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE;;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;IAC3B,uFAAuF;IACvF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CACnD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracks when the client is ready for use.
|
|
3
|
+
* Ready fires when the server sends the MAPPING message.
|
|
4
|
+
*/
|
|
5
|
+
export declare class ReadyStateTracker {
|
|
6
|
+
private ready;
|
|
7
|
+
private readonly onReady;
|
|
8
|
+
constructor(onReady?: () => void);
|
|
9
|
+
handleMappingReceived(): void;
|
|
10
|
+
get isReady(): boolean;
|
|
11
|
+
clear(): void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=ready-state-tracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ready-state-tracker.d.ts","sourceRoot":"","sources":["../../../src/client/ready-state-tracker.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,KAAK,CAAS;IAEtB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA2B;gBAEvC,OAAO,CAAC,EAAE,MAAM,IAAI;IAIzB,qBAAqB,IAAI,IAAI;IAOpC,IAAW,OAAO,IAAI,OAAO,CAE5B;IAEM,KAAK,IAAI,IAAI;CAGrB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface MutationFailedEvent {
|
|
2
|
+
attribute: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
export interface VirtualdisplaySelectEvent {
|
|
6
|
+
readonly attribute: string;
|
|
7
|
+
readonly value: string;
|
|
8
|
+
preventDefault(): void;
|
|
9
|
+
}
|
|
10
|
+
export interface VirtualdisplaySelectedEvent {
|
|
11
|
+
readonly attribute: string;
|
|
12
|
+
readonly value: string;
|
|
13
|
+
}
|
|
14
|
+
export type VirtualdisplayUiEventMap = {
|
|
15
|
+
'ui:select': VirtualdisplaySelectEvent;
|
|
16
|
+
'ui:selected': VirtualdisplaySelectedEvent;
|
|
17
|
+
};
|
|
18
|
+
export type VirtualdisplayUiEventType = keyof VirtualdisplayUiEventMap;
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,cAAc,IAAI,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,WAAW,EAAE,yBAAyB,CAAC;IACvC,aAAa,EAAE,2BAA2B,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
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, VirtualdisplaySelectEvent, VirtualdisplaySelectedEvent, VirtualdisplayUiEventMap, VirtualdisplayUiEventType, } from './client/types';
|
|
5
|
+
export { Attribute } from './attributes/attribute';
|
|
6
|
+
export { AttributeValue } from './attributes/value';
|
|
7
|
+
export { Annotations } from './annotations';
|
|
8
|
+
export { Camera } from './camera';
|
|
9
|
+
export { Snapshot, Photo, type PhotoData } from './snapshot';
|
|
10
|
+
export type { ViewerSettings, AnnotationPosition } from '@virtualdisplay.io/messaging';
|
|
11
|
+
export { logger, enableDebugMode, isDebugMode } from './utils/logger';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,EACV,mBAAmB,EACnB,yBAAyB,EACzB,2BAA2B,EAC3B,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAG7D,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGvF,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ViewerSettings } from '@virtualdisplay.io/messaging';
|
|
2
|
+
export interface ActionBarOptions {
|
|
3
|
+
onAr?: () => void;
|
|
4
|
+
onFullscreen?: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare class ActionBar {
|
|
7
|
+
private readonly options;
|
|
8
|
+
readonly element: HTMLElement;
|
|
9
|
+
private arBtn;
|
|
10
|
+
private fullscreenBtn;
|
|
11
|
+
private readonly onFullscreenChange;
|
|
12
|
+
constructor(options: ActionBarOptions);
|
|
13
|
+
private setFullscreenIcon;
|
|
14
|
+
private syncButton;
|
|
15
|
+
applySettings(settings: ViewerSettings): void;
|
|
16
|
+
destroy(): void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=action-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-bar.d.ts","sourceRoot":"","sources":["../../../src/ui/action-bar.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,qBAAa,SAAS;IAMR,OAAO,CAAC,QAAQ,CAAC,OAAO;IALpC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAa;gBAEnB,OAAO,EAAE,gBAAgB;IAWtD,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,UAAU;IAalB,aAAa,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAgB7C,OAAO,IAAI,IAAI;CAGhB"}
|