@variantic/player 0.0.8 → 0.0.10
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/libs/schemas/library-api/src/lib/library-api.d.ts +15 -0
- package/libs/schemas/web-component/api/player/ar/src/lib/ar.d.ts +6 -0
- package/libs/schemas/web-component/api/player/configuration/src/lib/configuration.d.ts +6 -0
- package/libs/schemas/web-component/api/player/documentation/src/lib/documentation.d.ts +9 -0
- package/libs/schemas/web-component/api/player/integration-connector/src/lib/integration-connector.d.ts +6 -0
- package/libs/schemas/web-component/api/player/layout/src/lib/layout.d.ts +3 -0
- package/libs/schemas/web-component/api/player/player/src/lib/player.d.ts +12 -0
- package/libs/schemas/web-component/api/player/snapshot/src/lib/snapshot.d.ts +9 -0
- package/libs/schemas/web-component/api/player/viewer/src/lib/viewer.d.ts +113 -0
- package/package.json +1 -1
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
export interface ILibraryApi {
|
|
2
|
+
/**
|
|
3
|
+
* Returns the URL for the asset with the given ID for current library version.
|
|
4
|
+
*/
|
|
2
5
|
getAssetUrl(id: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Returns the thumbnail URL for the asset with the given ID for current library version.
|
|
8
|
+
*/
|
|
3
9
|
getAssetThumbnailUrl(id: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Retrieves the asset content by ID for current library version, or null if not found.
|
|
12
|
+
*/
|
|
4
13
|
getAssetById(id: string): Promise<Response | null>;
|
|
14
|
+
/**
|
|
15
|
+
* Retrieves the assembly data for current library version.
|
|
16
|
+
*/
|
|
5
17
|
getAssemblyData(): Promise<unknown>;
|
|
18
|
+
/**
|
|
19
|
+
* Retrieves the configuration data for current library version.
|
|
20
|
+
*/
|
|
6
21
|
getConfigurationData(): Promise<unknown>;
|
|
7
22
|
}
|
|
@@ -5,10 +5,16 @@ import type { TWebComponentEvents } from "../../../events/src";
|
|
|
5
5
|
*/
|
|
6
6
|
export type TARApi = {
|
|
7
7
|
events: Emittery<TARApiEvents>;
|
|
8
|
+
/**
|
|
9
|
+
* Generates and uploads the current project for AR viewing, returning a QR image and URL.
|
|
10
|
+
*/
|
|
8
11
|
generateAndUpload(): Promise<{
|
|
9
12
|
qrImage: string;
|
|
10
13
|
url: string;
|
|
11
14
|
}>;
|
|
15
|
+
/**
|
|
16
|
+
* Generates and returns the project data as a Blob for AR viewing.
|
|
17
|
+
*/
|
|
12
18
|
generate(): Promise<Blob>;
|
|
13
19
|
};
|
|
14
20
|
export type TARApiEvents = TWebComponentEvents<{
|
|
@@ -5,7 +5,13 @@ import type { TWebComponentEvents } from "../../../events/src";
|
|
|
5
5
|
*/
|
|
6
6
|
export type TConfigurationApi = {
|
|
7
7
|
events: Emittery<TConfigurationApiEvents>;
|
|
8
|
+
/**
|
|
9
|
+
* Generates and returns the current configuration content
|
|
10
|
+
*/
|
|
8
11
|
generate(): TConfigurationContent;
|
|
12
|
+
/**
|
|
13
|
+
* Generates and uploads the current configuration, returning a URL for later use.
|
|
14
|
+
*/
|
|
9
15
|
generateAndUpload(): Promise<TConfigurationUrl>;
|
|
10
16
|
};
|
|
11
17
|
export type TConfigurationApiEvents = TWebComponentEvents<{
|
|
@@ -6,8 +6,17 @@ export type TPrimitive = bigint | boolean | null | number | string | symbol | un
|
|
|
6
6
|
*/
|
|
7
7
|
export type TDocumentationApi = {
|
|
8
8
|
events: Emittery<TDocumentationApiEvents>;
|
|
9
|
+
/**
|
|
10
|
+
* Checks if documentation generation is available.
|
|
11
|
+
*/
|
|
9
12
|
getDocumentationAvailability(): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Generates the documentation PDF as a Blob using optional source data.
|
|
15
|
+
*/
|
|
10
16
|
generate(sourceData?: Record<string, TPrimitive>): Promise<Blob>;
|
|
17
|
+
/**
|
|
18
|
+
* Generates and triggers download of the documentation PDF using optional source data.
|
|
19
|
+
*/
|
|
11
20
|
generateAndDownload(sourceData?: Record<string, TPrimitive>): Promise<void>;
|
|
12
21
|
};
|
|
13
22
|
export type TDocumentationApiEvents = TWebComponentEvents<{
|
|
@@ -5,7 +5,13 @@ import type { TWebComponentEvents } from "../../../events/src";
|
|
|
5
5
|
*/
|
|
6
6
|
export type TIntegrationConnectorApi = {
|
|
7
7
|
events: Emittery<TIntegrationConnectorApiEvents>;
|
|
8
|
+
/**
|
|
9
|
+
* Executes a flow immediately with the given parameters and returns the response.
|
|
10
|
+
*/
|
|
8
11
|
execute: (params: TExecuteParams) => Promise<TExecutionResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* Hooks specified flows by their IDs to the current project.
|
|
14
|
+
*/
|
|
9
15
|
hookFlowsByIds: (ids: string[]) => Promise<void>;
|
|
10
16
|
};
|
|
11
17
|
export type TIntegrationConnectorApiEvents = TWebComponentEvents<{
|
|
@@ -5,6 +5,9 @@ import type { TWebComponentEvents } from "../../../events/src";
|
|
|
5
5
|
*/
|
|
6
6
|
export type TLayoutApi = {
|
|
7
7
|
events: Emittery<TLayoutApiEvents>;
|
|
8
|
+
/**
|
|
9
|
+
* Enables or disables fullscreen mode based on the given state.
|
|
10
|
+
*/
|
|
8
11
|
toggleFullscreen: (state: boolean) => void;
|
|
9
12
|
};
|
|
10
13
|
export type TLayoutApiEvents = TWebComponentEvents;
|
|
@@ -14,9 +14,21 @@ import type { ILibraryApi } from "../../../../../../library-api/src";
|
|
|
14
14
|
export type TPlayerApi = {
|
|
15
15
|
events: Emittery<TPlayerApiEvents>;
|
|
16
16
|
viewer: TViewerApi;
|
|
17
|
+
/**
|
|
18
|
+
* Returns the current site identifier as a string.
|
|
19
|
+
*/
|
|
17
20
|
getSiteId: () => string;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the current library version as a string.
|
|
23
|
+
*/
|
|
18
24
|
getLibraryVersion: () => string;
|
|
25
|
+
/**
|
|
26
|
+
* Returns the current configuration ID, or null if none is set.
|
|
27
|
+
*/
|
|
19
28
|
getCurrentConfigurationId: () => string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Asynchronously loads a configuration by ID; returns success status and optional error code.
|
|
31
|
+
*/
|
|
20
32
|
loadConfiguration: (id: string | null) => Promise<{
|
|
21
33
|
result: boolean;
|
|
22
34
|
error?: 'INVALID_CONFIGURATION_ID_OR_URL' | 'INVALID_CONFIGURATION' | 'COMPONENT_ID_MISMATCH' | 'LIBRARY_VERSION_MISMATCH';
|
|
@@ -5,8 +5,17 @@ import type { TWebComponentEvents } from "../../../events/src";
|
|
|
5
5
|
*/
|
|
6
6
|
export type TSnapshotApi = {
|
|
7
7
|
events: Emittery<TSnapshotApiEvents>;
|
|
8
|
+
/**
|
|
9
|
+
* Generates a snapshot of current view and returns it as a Blob.
|
|
10
|
+
*/
|
|
8
11
|
generate(): Promise<Blob>;
|
|
12
|
+
/**
|
|
13
|
+
* Generates and triggers download of a snapshot of current view.
|
|
14
|
+
*/
|
|
9
15
|
generateAndDownload(): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Generates and uploads a snapshot of current view, returning its URL.
|
|
18
|
+
*/
|
|
10
19
|
generateAndUpload(): Promise<TSnapshotUrl>;
|
|
11
20
|
};
|
|
12
21
|
export type TSnapshotApiEvents = TWebComponentEvents<{
|
|
@@ -7,47 +7,147 @@ export type TViewerApi = {
|
|
|
7
7
|
events: Emittery<TViewerApiEvents>;
|
|
8
8
|
getPlayerInstance(): any;
|
|
9
9
|
get isLoaded(): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Returns the current configuration formatted for rendering.
|
|
12
|
+
*/
|
|
10
13
|
getConfiguration(options?: TGetConfigurationParams): TConfiguration | null;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the current price value.
|
|
16
|
+
*/
|
|
11
17
|
getPrice(): number;
|
|
18
|
+
/**
|
|
19
|
+
* Returns the current price formatted with the appropriate currency symbol.
|
|
20
|
+
*/
|
|
12
21
|
getPriceWithCurrency(): string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Overrides the current price with the specified value.
|
|
24
|
+
*
|
|
25
|
+
* @param value value to replace price with
|
|
26
|
+
*/
|
|
13
27
|
setPrice(value: number | string): void;
|
|
28
|
+
/** @ignore */
|
|
14
29
|
getScene(): any;
|
|
30
|
+
/** @ignore */
|
|
15
31
|
getModel3D(): any;
|
|
32
|
+
/** @ignore */
|
|
16
33
|
getModelContainer3D(): any;
|
|
34
|
+
/**
|
|
35
|
+
* Returns the WebGL canvas element.
|
|
36
|
+
*/
|
|
17
37
|
getCanvas(): HTMLCanvasElement;
|
|
38
|
+
/**
|
|
39
|
+
* Returns all available material groups.
|
|
40
|
+
*/
|
|
18
41
|
getMaterialGroups(): Promise<TMaterialGroup[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Returns a mapping of group IDs to their selected material IDs.
|
|
44
|
+
*/
|
|
19
45
|
getSelectedMaterialByGroup(): {
|
|
20
46
|
[key: number]: number;
|
|
21
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* Returns the material definition for the specified material ID.
|
|
50
|
+
*/
|
|
22
51
|
getMaterialDataById(materialId: number): TMaterial;
|
|
52
|
+
/**
|
|
53
|
+
* Returns a list of materials matching the given filter ID, optionally grouped by the specified query ID.
|
|
54
|
+
*/
|
|
23
55
|
getMaterialsList(filterId: number, groupingQueryId?: number): Promise<TMaterialsList>;
|
|
56
|
+
/**
|
|
57
|
+
* Returns the current layout settings configuration.
|
|
58
|
+
*/
|
|
24
59
|
getLayoutSettings(): TLayoutSettings;
|
|
60
|
+
/**
|
|
61
|
+
* Assigns the specified material ID to the given group ID.
|
|
62
|
+
*/
|
|
25
63
|
assignMaterial(groupId: number, materialId: number): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Changes the camera projection type to either orthographic or perspective.
|
|
66
|
+
*/
|
|
26
67
|
changeCameraType(type: 'orthographic' | 'perspective'): void;
|
|
68
|
+
/**
|
|
69
|
+
* Applies the specified camera settings.
|
|
70
|
+
*/
|
|
27
71
|
setCameraSettings(settings: TCameraSettings): void;
|
|
72
|
+
/**
|
|
73
|
+
* Moves the camera based on the provided parameters.
|
|
74
|
+
*/
|
|
28
75
|
moveCamera(params: TMoveCameraParams): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Adjusts the camera to fit the current object within view.
|
|
78
|
+
*/
|
|
29
79
|
autoFitCamera(): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Generates a bill of materials for the specified template ID and filter ID.
|
|
82
|
+
*/
|
|
30
83
|
generateBom({ templateId, filterId, }: {
|
|
31
84
|
templateId: number;
|
|
32
85
|
filterId: number;
|
|
33
86
|
}): Promise<TBom>;
|
|
87
|
+
/**
|
|
88
|
+
* Returns the current floor settings.
|
|
89
|
+
*/
|
|
34
90
|
getSetFloorSettings(): TFloorSettings;
|
|
91
|
+
/**
|
|
92
|
+
* Returns the target unit for value transformation.
|
|
93
|
+
*/
|
|
35
94
|
getTargetUnit(): string;
|
|
95
|
+
/**
|
|
96
|
+
* Returns the list of available units.
|
|
97
|
+
*/
|
|
36
98
|
getUnits(): TUnit[];
|
|
99
|
+
/** @ignore */
|
|
37
100
|
getDimensions(filter?: 'default' | 'defaultNotControlledByEvent'): any[];
|
|
101
|
+
/**
|
|
102
|
+
* Changes the current unit to the specified unit.
|
|
103
|
+
*/
|
|
38
104
|
changeUnit(unit: string): void;
|
|
105
|
+
/**
|
|
106
|
+
* Converts a value from millimeters to the current set target unit.
|
|
107
|
+
*/
|
|
39
108
|
convertFromMillimeters(value: number | string, baseUnit: string): number | string;
|
|
109
|
+
/**
|
|
110
|
+
* Converts a value from the current set target unit to millimeters.
|
|
111
|
+
*/
|
|
112
|
+
convertToMillimeters(value: number | string, baseUnit: string): number | string;
|
|
113
|
+
/**
|
|
114
|
+
* Returns the localized string for the given key
|
|
115
|
+
*/
|
|
40
116
|
translate(key: string): string;
|
|
117
|
+
/**
|
|
118
|
+
* Switches the interface view to either preview or edit mode.
|
|
119
|
+
*/
|
|
41
120
|
changeView(view: 'preview' | 'edit'): void;
|
|
121
|
+
/**
|
|
122
|
+
* Updates the parameter identified by the code with the specified value.
|
|
123
|
+
*/
|
|
42
124
|
changeParameter(code: string, value: string | number): void;
|
|
125
|
+
/**
|
|
126
|
+
* Normalizes the given value for a parameter, returning the value and its corresponding label.
|
|
127
|
+
*/
|
|
43
128
|
normalizeParameterValue(parameter: TParameter, value: string | number): {
|
|
44
129
|
value: string | number;
|
|
45
130
|
label: string;
|
|
46
131
|
};
|
|
132
|
+
/**
|
|
133
|
+
* Enables all layers in the current context.
|
|
134
|
+
*/
|
|
47
135
|
enableAllLayers(): void;
|
|
136
|
+
/**
|
|
137
|
+
* Disables all layers in the current context.
|
|
138
|
+
*/
|
|
48
139
|
disableAllLayers(): void;
|
|
140
|
+
/**
|
|
141
|
+
* Enables the layer with the specified ID.
|
|
142
|
+
*/
|
|
49
143
|
enableLayer(id: number): void;
|
|
144
|
+
/**
|
|
145
|
+
* Disables the layer with the specified ID.
|
|
146
|
+
*/
|
|
50
147
|
disableLayer(id: number): void;
|
|
148
|
+
/**
|
|
149
|
+
* Toggles dimension visibility based on the state and optional dimension IDs or presets.
|
|
150
|
+
*/
|
|
51
151
|
toggleDimensions(state: boolean, dimensions?: number[] | 'default' | 'defaultNotControlledByEvent'): void;
|
|
52
152
|
};
|
|
53
153
|
export type TViewerApiEvents = TWebComponentEvents<{
|
|
@@ -81,10 +181,22 @@ export type TViewerApiEvents = TWebComponentEvents<{
|
|
|
81
181
|
};
|
|
82
182
|
}>;
|
|
83
183
|
export type TGetConfigurationParams = {
|
|
184
|
+
/**
|
|
185
|
+
* Specifies whether to include hidden items
|
|
186
|
+
* @defaultValue `true`
|
|
187
|
+
*/
|
|
84
188
|
includeHidden?: boolean;
|
|
85
189
|
};
|
|
86
190
|
export type TMoveCameraParams = {
|
|
191
|
+
/**
|
|
192
|
+
* Target camera angle
|
|
193
|
+
* @defaultValue `default`
|
|
194
|
+
*/
|
|
87
195
|
angle?: TCameraAngle;
|
|
196
|
+
/**
|
|
197
|
+
* Whether to move with animation
|
|
198
|
+
* @defaultValue `true`
|
|
199
|
+
*/
|
|
88
200
|
animation?: boolean;
|
|
89
201
|
};
|
|
90
202
|
export type TCameraAngle = 'default' | '-x+z' | '+x+z' | '-x-z' | '+x-z' | '+z' | '-z' | '+y' | '-y' | '+x' | '-x';
|
|
@@ -225,6 +337,7 @@ export type TParameterNumberRange = TParameterBase<'number-range', {
|
|
|
225
337
|
max: number;
|
|
226
338
|
maxLabel: string;
|
|
227
339
|
preferred?: number[];
|
|
340
|
+
step: number;
|
|
228
341
|
}>;
|
|
229
342
|
type TNumberPredefinedStyleSettings = {
|
|
230
343
|
align?: 'content' | 'responsive';
|