@combeenation/3d-viewer 9.0.0 → 9.0.1

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 (107) hide show
  1. package/README.md +111 -111
  2. package/dist/lib-cjs/api/classes/animationInterface.d.ts +8 -8
  3. package/dist/lib-cjs/api/classes/animationInterface.js +2 -2
  4. package/dist/lib-cjs/api/classes/dottedPath.d.ts +79 -79
  5. package/dist/lib-cjs/api/classes/dottedPath.js +166 -166
  6. package/dist/lib-cjs/api/classes/element.d.ts +153 -153
  7. package/dist/lib-cjs/api/classes/element.js +667 -667
  8. package/dist/lib-cjs/api/classes/event.d.ts +401 -401
  9. package/dist/lib-cjs/api/classes/event.js +424 -424
  10. package/dist/lib-cjs/api/classes/eventBroadcaster.d.ts +26 -26
  11. package/dist/lib-cjs/api/classes/eventBroadcaster.js +49 -49
  12. package/dist/lib-cjs/api/classes/fuzzyMap.d.ts +7 -7
  13. package/dist/lib-cjs/api/classes/fuzzyMap.js +21 -21
  14. package/dist/lib-cjs/api/classes/parameter.d.ts +410 -397
  15. package/dist/lib-cjs/api/classes/parameter.js +642 -627
  16. package/dist/lib-cjs/api/classes/parameter.js.map +1 -1
  17. package/dist/lib-cjs/api/classes/parameterObservable.d.ts +36 -36
  18. package/dist/lib-cjs/api/classes/parameterObservable.js +72 -72
  19. package/dist/lib-cjs/api/classes/parameterizable.d.ts +15 -15
  20. package/dist/lib-cjs/api/classes/parameterizable.js +102 -102
  21. package/dist/lib-cjs/api/classes/placementAnimation.d.ts +45 -45
  22. package/dist/lib-cjs/api/classes/placementAnimation.js +176 -176
  23. package/dist/lib-cjs/api/classes/variant.d.ts +261 -261
  24. package/dist/lib-cjs/api/classes/variant.js +870 -870
  25. package/dist/lib-cjs/api/classes/variantInstance.d.ts +53 -53
  26. package/dist/lib-cjs/api/classes/variantInstance.js +125 -125
  27. package/dist/lib-cjs/api/classes/variantParameterizable.d.ts +17 -17
  28. package/dist/lib-cjs/api/classes/variantParameterizable.js +86 -86
  29. package/dist/lib-cjs/api/classes/viewer.d.ts +213 -213
  30. package/dist/lib-cjs/api/classes/viewer.js +717 -717
  31. package/dist/lib-cjs/api/classes/viewerError.d.ts +43 -43
  32. package/dist/lib-cjs/api/classes/viewerError.js +55 -55
  33. package/dist/lib-cjs/api/classes/viewerLight.d.ts +66 -66
  34. package/dist/lib-cjs/api/classes/viewerLight.js +348 -348
  35. package/dist/lib-cjs/api/internal/lensRendering.d.ts +8 -8
  36. package/dist/lib-cjs/api/internal/lensRendering.js +11 -11
  37. package/dist/lib-cjs/api/internal/sceneSetup.d.ts +13 -13
  38. package/dist/lib-cjs/api/internal/sceneSetup.js +226 -226
  39. package/dist/lib-cjs/api/manager/animationManager.d.ts +30 -30
  40. package/dist/lib-cjs/api/manager/animationManager.js +126 -126
  41. package/dist/lib-cjs/api/manager/gltfExportManager.d.ts +103 -103
  42. package/dist/lib-cjs/api/manager/gltfExportManager.js +325 -325
  43. package/dist/lib-cjs/api/manager/sceneManager.d.ts +33 -33
  44. package/dist/lib-cjs/api/manager/sceneManager.js +128 -128
  45. package/dist/lib-cjs/api/manager/tagManager.d.ts +118 -118
  46. package/dist/lib-cjs/api/manager/tagManager.js +522 -522
  47. package/dist/lib-cjs/api/manager/tagManager.js.map +1 -1
  48. package/dist/lib-cjs/api/manager/textureLoadManager.d.ts +22 -22
  49. package/dist/lib-cjs/api/manager/textureLoadManager.js +97 -97
  50. package/dist/lib-cjs/api/manager/variantInstanceManager.d.ts +106 -106
  51. package/dist/lib-cjs/api/manager/variantInstanceManager.js +290 -290
  52. package/dist/lib-cjs/api/store/specStorage.d.ts +32 -32
  53. package/dist/lib-cjs/api/store/specStorage.js +65 -65
  54. package/dist/lib-cjs/api/util/babylonHelper.d.ts +237 -237
  55. package/dist/lib-cjs/api/util/babylonHelper.js +825 -790
  56. package/dist/lib-cjs/api/util/babylonHelper.js.map +1 -1
  57. package/dist/lib-cjs/api/util/globalTypes.d.ts +479 -479
  58. package/dist/lib-cjs/api/util/globalTypes.js +1 -1
  59. package/dist/lib-cjs/api/util/resourceHelper.d.ts +58 -58
  60. package/dist/lib-cjs/api/util/resourceHelper.js +211 -211
  61. package/dist/lib-cjs/api/util/sceneLoaderHelper.d.ts +44 -44
  62. package/dist/lib-cjs/api/util/sceneLoaderHelper.js +175 -175
  63. package/dist/lib-cjs/api/util/stringHelper.d.ts +13 -13
  64. package/dist/lib-cjs/api/util/stringHelper.js +32 -32
  65. package/dist/lib-cjs/api/util/structureHelper.d.ts +9 -9
  66. package/dist/lib-cjs/api/util/structureHelper.js +60 -60
  67. package/dist/lib-cjs/buildinfo.json +3 -3
  68. package/dist/lib-cjs/commonjs.tsconfig.tsbuildinfo +1 -1
  69. package/dist/lib-cjs/index.d.ts +54 -54
  70. package/dist/lib-cjs/index.js +117 -117
  71. package/package.json +82 -82
  72. package/src/api/classes/animationInterface.ts +10 -10
  73. package/src/api/classes/dottedPath.ts +181 -181
  74. package/src/api/classes/element.ts +723 -723
  75. package/src/api/classes/event.ts +457 -457
  76. package/src/api/classes/eventBroadcaster.ts +52 -52
  77. package/src/api/classes/fuzzyMap.ts +21 -21
  78. package/src/api/classes/parameter.ts +686 -670
  79. package/src/api/classes/parameterObservable.ts +73 -73
  80. package/src/api/classes/parameterizable.ts +87 -87
  81. package/src/api/classes/placementAnimation.ts +162 -162
  82. package/src/api/classes/variant.ts +963 -963
  83. package/src/api/classes/variantInstance.ts +123 -123
  84. package/src/api/classes/variantParameterizable.ts +83 -83
  85. package/src/api/classes/viewer.ts +770 -770
  86. package/src/api/classes/viewerError.ts +63 -63
  87. package/src/api/classes/viewerLight.ts +339 -339
  88. package/src/api/internal/debugViewer.ts +90 -90
  89. package/src/api/internal/lensRendering.ts +9 -9
  90. package/src/api/internal/sceneSetup.ts +205 -205
  91. package/src/api/manager/animationManager.ts +143 -143
  92. package/src/api/manager/gltfExportManager.ts +302 -302
  93. package/src/api/manager/sceneManager.ts +134 -134
  94. package/src/api/manager/tagManager.ts +564 -564
  95. package/src/api/manager/textureLoadManager.ts +95 -95
  96. package/src/api/manager/variantInstanceManager.ts +306 -306
  97. package/src/api/store/specStorage.ts +68 -68
  98. package/src/api/util/babylonHelper.ts +913 -870
  99. package/src/api/util/globalTypes.ts +555 -555
  100. package/src/api/util/resourceHelper.ts +198 -198
  101. package/src/api/util/sceneLoaderHelper.ts +170 -170
  102. package/src/api/util/stringHelper.ts +30 -30
  103. package/src/api/util/structureHelper.ts +60 -60
  104. package/src/buildinfo.json +3 -3
  105. package/src/dev.ts +62 -62
  106. package/src/index.ts +103 -103
  107. package/src/types.d.ts +38 -38
@@ -1,479 +1,479 @@
1
- /// <reference types="gsap" />
2
- declare type Viewer = import('../classes/viewer').Viewer;
3
- declare type Variant = import('../classes/variant').Variant;
4
- declare type VariantInstance = import('../classes/variantInstance').VariantInstance;
5
- declare type VariantParameterizable = import('../classes/variantParameterizable').VariantParameterizable;
6
- /**
7
- * Alias for {@link Element} which can be used to prevent name clashes with the web APIs
8
- * [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) class
9
- */
10
- declare type VariantElement = import('../classes/element').Element;
11
- declare type DottedPath = import('../classes/dottedPath').DottedPath;
12
- declare type ViewerLight = import('../classes/viewerLight').ViewerLight;
13
- declare type SceneManager = import('../manager/sceneManager').SceneManager;
14
- declare type FuzzyMap<K, V> = import('../classes/fuzzyMap').FuzzyMap<K, V>;
15
- declare type Scene = import('@babylonjs/core/scene').Scene;
16
- declare type Vector3 = import('@babylonjs/core/Maths/math.vector').Vector3;
17
- declare type Color3 = import('@babylonjs/core/Maths/math.color').Color3;
18
- declare type Color4 = import('@babylonjs/core/Maths/math.color').Color4;
19
- declare type Material = import('@babylonjs/core/Materials/material').Material;
20
- declare type PBRMaterial = import('@babylonjs/core/Materials/PBR/pbrMaterial').PBRMaterial;
21
- declare type StandardMaterial = import('@babylonjs/core/Materials/standardMaterial').StandardMaterial;
22
- declare type DynamicTexture = import('@babylonjs/core/Materials/Textures/dynamicTexture').DynamicTexture;
23
- declare type Mesh = import('@babylonjs/core/Meshes/mesh').Mesh;
24
- declare type AbstractMesh = import('@babylonjs/core/Meshes/abstractMesh').AbstractMesh;
25
- declare type InstancedMesh = import('@babylonjs/core/Meshes/instancedMesh').InstancedMesh;
26
- declare type TransformNode = import('@babylonjs/core/Meshes/transformNode').TransformNode;
27
- declare type Engine = import('@babylonjs/core/Engines/engine').Engine;
28
- /**
29
- * See Babylon JS docs for more information about available [EngineOptions](https://doc.babylonjs.com/typedoc/interfaces/babylon.engineoptions).
30
- */
31
- declare type EngineOptions = import('@babylonjs/core/Engines/thinEngine').EngineOptions;
32
- declare type ArcRotateCamera = import('@babylonjs/core/Cameras/arcRotateCamera').ArcRotateCamera;
33
- declare type IScreenshotSize = import('@babylonjs/core/Misc/interfaces/screenshotSize').IScreenshotSize;
34
- declare type BabylonAnimation = import('@babylonjs/core/Animations/animation').Animation;
35
- declare type CubeTexture = import('@babylonjs/core/Materials/Textures/cubeTexture').CubeTexture;
36
- declare type MeshBuilder = typeof import('@babylonjs/core/Meshes/meshBuilder').MeshBuilder;
37
- declare type Texture = import('@babylonjs/core/Materials/Textures/texture').Texture;
38
- declare type HemisphericLight = import('@babylonjs/core/Lights/hemisphericLight').HemisphericLight;
39
- declare type DirectionalLight = import('@babylonjs/core/Lights/directionalLight').DirectionalLight;
40
- declare type IInspectorOptions = import('@babylonjs/core/Debug').IInspectorOptions;
41
- declare type IExportOptions = import('@babylonjs/serializers/glTF/2.0').IExportOptions;
42
- declare type EventEmitter = import('eventemitter3');
43
- declare type Undefinable<T> = T | undefined;
44
- declare type Nullable<T> = T | null;
45
- declare type PathDefinitions = {
46
- include: string[];
47
- exclude?: string[];
48
- };
49
- declare type TraceableDefinition = {
50
- path: string;
51
- };
52
- declare type TraceableDefinitions = {
53
- [name: string]: TraceableDefinition;
54
- };
55
- declare type PaintableDefinition = {
56
- path: string;
57
- textureOptions: {
58
- width: number;
59
- height: number;
60
- } | number;
61
- };
62
- declare type PaintableDefinitions = {
63
- [name: string]: PaintableDefinition;
64
- };
65
- declare type PaintableValue = {
66
- src: string;
67
- options?: PaintableOptions;
68
- };
69
- declare type PaintableOptions = {
70
- uScale?: number;
71
- uOffset?: number;
72
- vScale?: number;
73
- vOffset?: number;
74
- };
75
- declare type Asset = {
76
- rootUrl: string;
77
- fileName: string | undefined;
78
- };
79
- declare type ElementDefinitions = {
80
- [name: string]: ElementDefinition | string[];
81
- };
82
- declare type ElementDefinition = {
83
- paths: PathDefinitions;
84
- traceables?: TraceableDefinitions;
85
- paintables?: PaintableDefinitions;
86
- };
87
- declare type TransformationDefinition = {
88
- scaling: Vector3;
89
- position: Vector3;
90
- rotation: Vector3;
91
- };
92
- declare type EnvironmentDefinition = {
93
- environmentColor?: Color3;
94
- environmentIntensity?: number;
95
- environment?: string;
96
- environmentBackground?: string;
97
- environmentRotation?: number;
98
- environmentUseDefault?: boolean;
99
- };
100
- declare type StructureJson = {
101
- /**
102
- * `scene` describes the visualisation of the babylon `scene` such as the incidence of light and camera position. If a
103
- * string is given, the {@link Viewer} will resolve the URL or path and pass the parsed JSON to this property.
104
- */
105
- scene?: string | SceneJson;
106
- /**
107
- * `setup` is a kind of construction plan for the {@link Viewer}. You can pass a {@link SetupJson} or a string, which
108
- * must represent a valid URL or path. If a string is given, the {@link Viewer} will resolve the URL or path and pass
109
- * the parsed JSON to this property. The {@link SetupJson} is responsible for managing a list of
110
- * {@link VariantInstanceDefinition}s. These definitions define the instances that should be instantiated during the
111
- * bootstrapping process. Each instance has a name and a reference to it's {@link Variant}.
112
- */
113
- setup?: string | SetupJson;
114
- file?: string;
115
- glTF?: Asset | string;
116
- parameterDeclaration?: ParameterDeclarations;
117
- parameters?: ParameterBag;
118
- elements?: ElementDefinitions;
119
- lights?: LightDefinitions;
120
- grounds?: GroundDefinitions;
121
- /**
122
- * `variants` is a declarative description of 3D-model variations in the configurator. Each variant itself is a
123
- * {@link StructureJson} which must at least define a `name` in the key of the list and the properties `glTF` and
124
- * `elements` in the value. FYI: Babylon.js's sandbox can show you the path of the 3D-model to properly define the
125
- * `paths`.
126
- *
127
- * Example Code
128
- * ```js
129
- * variants: {
130
- * 'My Pretty Variant' {
131
- * glTF: {
132
- * rootUrl: 'https:/my.awesome.domain/path/to/my/project/',
133
- * fileName: 'my_3d_model_file.glb',
134
- * },
135
- * elements: {
136
- * 'My Little Element': {
137
- * paths: {
138
- * includes: ['__root__.MeshName']
139
- * }
140
- * }
141
- * }
142
- * }
143
- * }
144
- * ```
145
- * `MeshName` has to be identical to the path in the glb-file of the 3D-model.
146
- */
147
- variants?: {
148
- [id: string]: StructureJson;
149
- };
150
- };
151
- /**
152
- * Extends the `StructureJson` by removing the optional flag from some properties which surely exist in the auto
153
- * generated spec
154
- */
155
- declare type AutoSpecStructureJson = StructureJson & {
156
- scene: AutoSpecSceneJson;
157
- setup: SetupJson;
158
- variants: {
159
- [id: string]: StructureJson;
160
- };
161
- };
162
- declare type SceneJson = {
163
- parameterDeclaration?: ParameterDeclarations;
164
- parameters?: ParameterBag;
165
- meshPicking?: boolean;
166
- engine?: {
167
- antialiasing?: boolean;
168
- options?: EngineOptions;
169
- };
170
- scene: SceneDefinition;
171
- animations?: AnimationDefinitions;
172
- placements?: PlacementDefinitions;
173
- /**
174
- * Information about [material cloning](pages/Release%20Notes/releases/4-3-0.html#material-cloning-on-mutation).
175
- * Default value is `false`.
176
- */
177
- cloneMaterialsOnMutation?: boolean;
178
- };
179
- /**
180
- * Extends the `SceneJson` by removing the optional flag from some properties which surely exist in the auto generated
181
- * spec
182
- */
183
- declare type AutoSpecSceneJson = SceneJson & {
184
- engine: {
185
- antialiasing: boolean;
186
- options: EngineOptions;
187
- };
188
- };
189
- declare type SceneDefinition = {
190
- globals: SceneGlobals;
191
- cameras?: CameraDefinitions;
192
- };
193
- declare type SceneGlobals = {
194
- 'shadows'?: {
195
- enabled: boolean;
196
- type: 'contact';
197
- settings: [];
198
- generator: [];
199
- receiver: [];
200
- };
201
- /**
202
- * `aa` or anti aliasing is not needed if hard edges are desired.\
203
- * FYI: aa smooths edges and avoids stairs-effects.
204
- */
205
- 'aa'?: 'fxaa';
206
- 'tone-mapping'?: boolean;
207
- /**
208
- * @bloom is widely known as glow. There you can define it’s size (Specifies the size of the bloom blur kernel,
209
- * relative to the final output size) and threshold (The luminance threshold to find bright areas of the image to
210
- * bloom).
211
- * Further Information under [BloomEffect](https://doc.babylonjs.com/typedoc/classes/babylon.bloomeffect).
212
- *
213
- * @dof short for "depth-of-field" defines the focus in the view. Parameters in settings are listed in [Depth of Field and Other Lens Effects link](https://doc.babylonjs.com/divingDeeper/postProcesses/dofLenseEffects).
214
- * @exposure specifies the intensity of the lightning of the view (not 3D-Model).
215
- * @sharpen´s parameter `settings` are listed in [Default Rendering Pipeline Sharpening link](https://doc.babylonjs.com/divingDeeper/postProcesses/defaultRenderingPipeline#sharpening).
216
- */
217
- 'camera-settings'?: {
218
- contrast: number;
219
- exposure: number;
220
- bloom?: {
221
- enabled: boolean;
222
- size?: number;
223
- threshold?: number;
224
- };
225
- dof?: {
226
- enabled: boolean;
227
- settings: {};
228
- };
229
- sharpen?: {
230
- enabled: boolean;
231
- settings: {};
232
- };
233
- };
234
- };
235
- /**
236
- * {@link Viewer.screenshot} internally uses Babylon.js [ScreenshotTools.CreateScreenshotUsingRenderTarget](https://doc.babylonjs.com/typedoc/classes/babylon.screenshottools#createscreenshotusingrendertarget). \
237
- * See this link for additional info about the properties.
238
- */
239
- declare type ScreenshotSettings = {
240
- /** Defaults to canvas width & height */
241
- size?: IScreenshotSize;
242
- /**
243
- * Default `image/png`
244
- *
245
- * **Info regarding JPEG:** \
246
- * Use mimeType `image/jpeg` (**not** `image/jpg`) when creating jpeg's. \
247
- * Also ensure that {@link Scene.clearColor | viewer.scene.clearColor} has an alpha value of `1` as jpeg's don't
248
- * support transparency. Otherwise background will always be black for jpeg's.
249
- */
250
- mimeType?: string;
251
- /** Default `1` */
252
- samples?: number;
253
- /** Default `false` */
254
- antialiasing?: boolean;
255
- /** Default `screenshot.png` */
256
- fileName?: string;
257
- /** Default `false` */
258
- renderSprites?: boolean;
259
- };
260
- /**
261
- * Use this to define geometry to be excluded from autofocus, GLB export, etc.
262
- */
263
- declare type ExcludedGeometry = TransformNode | VariantInstance | Variant | VariantElement | TagManagerSubject;
264
- declare type ExcludedGeometryList = ExcludedGeometry[];
265
- declare type AutofocusSettings = {
266
- /**
267
- * Can be used to customize the margins shown around the 3d model when calling {@link Viewer.autofocusActiveCamera}.\
268
- * Defaults to 1.5 when not set explicitly.
269
- */
270
- radiusFactor?: number;
271
- adjustWheelPrecision?: boolean;
272
- adjustPanningSensibility?: boolean;
273
- adjustPinchPrecision?: boolean;
274
- /** Desired horizontal camera angle, this won't be overwritten by the autofocus function */
275
- alpha?: number;
276
- /** Desired vertical camera angle, this won't be overwritten by the autofocus function */
277
- beta?: number;
278
- /** Optional animation for the focusing camera movement */
279
- animation?: string | AnimationDefinition;
280
- /** Optional list of geometry to be excluded from consideration */
281
- exclude?: ExcludedGeometryList;
282
- };
283
- declare type LightDefinitions = {
284
- [name: string]: LightDefinition | string;
285
- };
286
- declare type LightDefinition = {
287
- type: 'baked' | 'hemispheric' | 'point' | 'directional' | 'spot';
288
- path?: string;
289
- shadowGenerator?: ShadowGeneratorDefinition;
290
- };
291
- declare type ShadowGeneratorDefinition = {
292
- mapSize: number;
293
- [others: string]: any;
294
- };
295
- declare type GroundDefinitions = {
296
- [ground: string]: GroundDefinition;
297
- };
298
- declare type GroundDefinition = {
299
- type: 'baked' | 'ground' | 'heightmap';
300
- meshId?: string;
301
- url?: string;
302
- width?: number;
303
- height?: number;
304
- subdivisions?: number;
305
- receiveShadows?: boolean;
306
- minHeight?: number;
307
- maxHeight?: number;
308
- alphaFilter?: number;
309
- onReady?: any;
310
- };
311
- declare type CameraDefinitions = {
312
- [camera: string]: CameraDefinition;
313
- };
314
- declare type CameraDefinition = {
315
- /**
316
- * `fov` or "Field Of View" defines as it says the view of the scene. Further information about its [theory](https://en.wikipedia.org/wiki/Field_of_view) and [implementation](https://doc.babylonjs.com/typedoc/classes/babylon.camera#fov).
317
- */
318
- fov?: number;
319
- active?: boolean;
320
- /**
321
- * `arc` is a default camera position where the 3D-model is the center and the camera rotates around the 3D-model.
322
- * More Information about `arc` in [ArcRotateCamera](https://doc.babylonjs.com/typedoc/classes/babylon.arcrotatecamera).
323
- *
324
- * NOTE: While "baked" camera definitions from a GLB or babylon file can currently not be instatiated within the
325
- * `Specification`, it's still possible to use them in the viewer.\
326
- * For the moment all camera definitions inside these files are automatically added to the scene and can be actived
327
- * using the {@link Viewer.switchCamera} function.\
328
- * The `newCamera` input has to match the name of the camera node inside the GLB/babylon file.
329
- */
330
- type: 'arc';
331
- /**
332
- * `target` overrides `arc`´s position and repositions the camera. The string has the syntax (x?: number, y?: number, z?: number) like [Vector3](https://doc.babylonjs.com/typedoc/classes/babylon.vector3).
333
- */
334
- target?: string;
335
- };
336
- declare type VariantInstanceDefinition = {
337
- name?: string;
338
- variant: DottedPathArgument;
339
- parameters?: ParameterBag;
340
- lazy?: boolean;
341
- };
342
- declare type SetupJson = {
343
- instances: VariantInstanceDefinition[];
344
- };
345
- declare type ParameterDeclarations = {
346
- [name: string]: ParameterDeclaration;
347
- };
348
- declare type ParameterDeclaration = {
349
- type: 'string' | 'boolean' | 'number' | 'color' | 'select' | 'vector' | 'csl';
350
- parser?: any;
351
- options?: ParameterValue[];
352
- };
353
- declare type ParameterValue = string | number | boolean;
354
- declare type ParameterBag = {
355
- [name: string]: ParameterValue;
356
- };
357
- declare type ParsedParameterBag = {
358
- [name: string]: any;
359
- };
360
- declare type DottedPathArgument = string | string[] | DottedPath;
361
- declare type ParameterObserverResult = boolean | void;
362
- declare type ParameterObserver = (object: any, oldValue: Undefinable<ParameterValue>, newValue: ParameterValue) => Promise<ParameterObserverResult>;
363
- declare type PlacementDefinitions = {
364
- [name: string]: PlacementDefinition;
365
- };
366
- declare type PlacementDefinition = {
367
- position?: string | Vector3;
368
- alpha?: number;
369
- beta?: number;
370
- radius?: number;
371
- target?: string | Vector3;
372
- };
373
- declare type AnimationDefinitions = {
374
- [name: string]: AnimationDefinition;
375
- };
376
- /**
377
- * See [GSAP API Docs](https://greensock.com/docs/v3/GSAP/Tween/vars) for description of `GSAPTWeenVars`.
378
- *
379
- * You can use the [GreenSock Ease Visualizer](https://greensock.com/ease-visualizer/) to create an animation of your
380
- * liking and simply copy the `ease` function shown at the bottom of the visualizer into the `ease` property of your
381
- * {@link AnimationDefinition}.
382
- *
383
- * The `GSAPTWeenVars` are extended by the `shortestWay` property.\
384
- * This property defines if the camera should move to the target position within the shortest possible distance.\
385
- * If `shortestWay` is `false`, the camera moves the whole difference between the current camera position and the target
386
- * position and that could be > 360, which can appear very unconvenient to the operator.\
387
- * The default value of this flag is `true`.
388
- *
389
- * Example usage in {@link SceneJson | SceneJson.animations}:
390
- *
391
- * ```js
392
- * // ...
393
- * scene: {
394
- * // ...
395
- * animations: {
396
- * DefaultCameraAnimation: {
397
- * ease: 'Power3.easeInOut',
398
- * duration: 0.8,
399
- * },
400
- * },
401
- * // ...
402
- * }
403
- * // ...
404
- * ```
405
- */
406
- declare type AnimationDefinition = GSAPTweenVars & {
407
- shortestWay?: boolean;
408
- };
409
- /**
410
- * Extends Babylon.js's {@link IExportOptions} by some viewer specific settings
411
- */
412
- interface IExportOptionsExtended extends IExportOptions {
413
- /**
414
- * Refraction textures get lost when exporting the scene to GLB.\
415
- * The short explanation is that refraction is calculated by "RenderTargetTexture", which is created in real time from
416
- * the camera perspective. This data is not available in the GLB export, therefore the texture gets removed.\
417
- * However if `exchangeRefractionMaterials` is set, a fallback material with a similar look is exported instead. This
418
- * fallback material solves the refraction with a combination of certain color, roughness, metallic and transparency
419
- * mode settings.
420
- */
421
- exchangeRefractionMaterials?: boolean;
422
- }
423
- declare type SpecGenerationData = {
424
- name: string;
425
- url: string;
426
- };
427
- /**
428
- * Key = Old tag name\
429
- * Value = New tag name
430
- */
431
- declare type TagMapping = {
432
- [tagName: string]: string;
433
- };
434
- declare type TagManagerSubject = {
435
- tagName?: string;
436
- nodeName?: string;
437
- materialName?: string;
438
- };
439
- declare type TagManagerParameterObserverResult = ParameterObserverResult;
440
- /**
441
- * The observer should return `false` in cases where the given value was not actually applied. E.g. when wanting to
442
- * apply a property on the given `node`s material which doesn't exist at the time the observer is called etc.
443
- */
444
- declare type TagManagerParameterObserver = (payload: TagManagerParameterObserverPayload) => Promise<TagManagerParameterObserverResult>;
445
- declare type TagManagerParameterBag = FuzzyMap<TagManagerSubject, ParameterBag>;
446
- declare type TagManagerParameterObserverBag = Map<string, TagManagerParameterObserver>;
447
- declare type TagManagerParameterObserverPayload = {
448
- subject: TagManagerSubject;
449
- nodes: TransformNode[];
450
- materials: Material[];
451
- newValue: ParameterValue;
452
- oldValue: Undefinable<ParameterValue>;
453
- };
454
- declare type TagManagerParameterValue = {
455
- tagName?: string;
456
- nodeName?: string;
457
- materialName?: string;
458
- parameterName: string;
459
- value: ParameterValue;
460
- };
461
- declare type TagManagerParameterObserverResultBag = {
462
- subject: TagManagerSubject;
463
- parameter: string;
464
- nodes: TransformNode[];
465
- materials: Material[];
466
- oldValue: ParameterValue;
467
- newValue: ParameterValue;
468
- parameterObserverResult: TagManagerParameterObserverResult;
469
- };
470
- declare type NodeNamingStrategyPayload = {
471
- variantInstance: VariantInstance;
472
- variant: Variant;
473
- variantParameterizable: VariantParameterizable;
474
- };
475
- declare type NodeNamingStrategyHandler = (node: TransformNode, payload: NodeNamingStrategyPayload) => string;
476
- declare type NodeNamingStrategy = {
477
- handler: NodeNamingStrategyHandler;
478
- payload: NodeNamingStrategyPayload;
479
- };
1
+ /// <reference types="gsap" />
2
+ declare type Viewer = import('../classes/viewer').Viewer;
3
+ declare type Variant = import('../classes/variant').Variant;
4
+ declare type VariantInstance = import('../classes/variantInstance').VariantInstance;
5
+ declare type VariantParameterizable = import('../classes/variantParameterizable').VariantParameterizable;
6
+ /**
7
+ * Alias for {@link Element} which can be used to prevent name clashes with the web APIs
8
+ * [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) class
9
+ */
10
+ declare type VariantElement = import('../classes/element').Element;
11
+ declare type DottedPath = import('../classes/dottedPath').DottedPath;
12
+ declare type ViewerLight = import('../classes/viewerLight').ViewerLight;
13
+ declare type SceneManager = import('../manager/sceneManager').SceneManager;
14
+ declare type FuzzyMap<K, V> = import('../classes/fuzzyMap').FuzzyMap<K, V>;
15
+ declare type Scene = import('@babylonjs/core/scene').Scene;
16
+ declare type Vector3 = import('@babylonjs/core/Maths/math.vector').Vector3;
17
+ declare type Color3 = import('@babylonjs/core/Maths/math.color').Color3;
18
+ declare type Color4 = import('@babylonjs/core/Maths/math.color').Color4;
19
+ declare type Material = import('@babylonjs/core/Materials/material').Material;
20
+ declare type PBRMaterial = import('@babylonjs/core/Materials/PBR/pbrMaterial').PBRMaterial;
21
+ declare type StandardMaterial = import('@babylonjs/core/Materials/standardMaterial').StandardMaterial;
22
+ declare type DynamicTexture = import('@babylonjs/core/Materials/Textures/dynamicTexture').DynamicTexture;
23
+ declare type Mesh = import('@babylonjs/core/Meshes/mesh').Mesh;
24
+ declare type AbstractMesh = import('@babylonjs/core/Meshes/abstractMesh').AbstractMesh;
25
+ declare type InstancedMesh = import('@babylonjs/core/Meshes/instancedMesh').InstancedMesh;
26
+ declare type TransformNode = import('@babylonjs/core/Meshes/transformNode').TransformNode;
27
+ declare type Engine = import('@babylonjs/core/Engines/engine').Engine;
28
+ /**
29
+ * See Babylon JS docs for more information about available [EngineOptions](https://doc.babylonjs.com/typedoc/interfaces/babylon.engineoptions).
30
+ */
31
+ declare type EngineOptions = import('@babylonjs/core/Engines/thinEngine').EngineOptions;
32
+ declare type ArcRotateCamera = import('@babylonjs/core/Cameras/arcRotateCamera').ArcRotateCamera;
33
+ declare type IScreenshotSize = import('@babylonjs/core/Misc/interfaces/screenshotSize').IScreenshotSize;
34
+ declare type BabylonAnimation = import('@babylonjs/core/Animations/animation').Animation;
35
+ declare type CubeTexture = import('@babylonjs/core/Materials/Textures/cubeTexture').CubeTexture;
36
+ declare type MeshBuilder = typeof import('@babylonjs/core/Meshes/meshBuilder').MeshBuilder;
37
+ declare type Texture = import('@babylonjs/core/Materials/Textures/texture').Texture;
38
+ declare type HemisphericLight = import('@babylonjs/core/Lights/hemisphericLight').HemisphericLight;
39
+ declare type DirectionalLight = import('@babylonjs/core/Lights/directionalLight').DirectionalLight;
40
+ declare type IInspectorOptions = import('@babylonjs/core/Debug').IInspectorOptions;
41
+ declare type IExportOptions = import('@babylonjs/serializers/glTF/2.0').IExportOptions;
42
+ declare type EventEmitter = import('eventemitter3');
43
+ declare type Undefinable<T> = T | undefined;
44
+ declare type Nullable<T> = T | null;
45
+ declare type PathDefinitions = {
46
+ include: string[];
47
+ exclude?: string[];
48
+ };
49
+ declare type TraceableDefinition = {
50
+ path: string;
51
+ };
52
+ declare type TraceableDefinitions = {
53
+ [name: string]: TraceableDefinition;
54
+ };
55
+ declare type PaintableDefinition = {
56
+ path: string;
57
+ textureOptions: {
58
+ width: number;
59
+ height: number;
60
+ } | number;
61
+ };
62
+ declare type PaintableDefinitions = {
63
+ [name: string]: PaintableDefinition;
64
+ };
65
+ declare type PaintableValue = {
66
+ src: string;
67
+ options?: PaintableOptions;
68
+ };
69
+ declare type PaintableOptions = {
70
+ uScale?: number;
71
+ uOffset?: number;
72
+ vScale?: number;
73
+ vOffset?: number;
74
+ };
75
+ declare type Asset = {
76
+ rootUrl: string;
77
+ fileName: string | undefined;
78
+ };
79
+ declare type ElementDefinitions = {
80
+ [name: string]: ElementDefinition | string[];
81
+ };
82
+ declare type ElementDefinition = {
83
+ paths: PathDefinitions;
84
+ traceables?: TraceableDefinitions;
85
+ paintables?: PaintableDefinitions;
86
+ };
87
+ declare type TransformationDefinition = {
88
+ scaling: Vector3;
89
+ position: Vector3;
90
+ rotation: Vector3;
91
+ };
92
+ declare type EnvironmentDefinition = {
93
+ environmentColor?: Color3;
94
+ environmentIntensity?: number;
95
+ environment?: string;
96
+ environmentBackground?: string;
97
+ environmentRotation?: number;
98
+ environmentUseDefault?: boolean;
99
+ };
100
+ declare type StructureJson = {
101
+ /**
102
+ * `scene` describes the visualisation of the babylon `scene` such as the incidence of light and camera position. If a
103
+ * string is given, the {@link Viewer} will resolve the URL or path and pass the parsed JSON to this property.
104
+ */
105
+ scene?: string | SceneJson;
106
+ /**
107
+ * `setup` is a kind of construction plan for the {@link Viewer}. You can pass a {@link SetupJson} or a string, which
108
+ * must represent a valid URL or path. If a string is given, the {@link Viewer} will resolve the URL or path and pass
109
+ * the parsed JSON to this property. The {@link SetupJson} is responsible for managing a list of
110
+ * {@link VariantInstanceDefinition}s. These definitions define the instances that should be instantiated during the
111
+ * bootstrapping process. Each instance has a name and a reference to it's {@link Variant}.
112
+ */
113
+ setup?: string | SetupJson;
114
+ file?: string;
115
+ glTF?: Asset | string;
116
+ parameterDeclaration?: ParameterDeclarations;
117
+ parameters?: ParameterBag;
118
+ elements?: ElementDefinitions;
119
+ lights?: LightDefinitions;
120
+ grounds?: GroundDefinitions;
121
+ /**
122
+ * `variants` is a declarative description of 3D-model variations in the configurator. Each variant itself is a
123
+ * {@link StructureJson} which must at least define a `name` in the key of the list and the properties `glTF` and
124
+ * `elements` in the value. FYI: Babylon.js's sandbox can show you the path of the 3D-model to properly define the
125
+ * `paths`.
126
+ *
127
+ * Example Code
128
+ * ```js
129
+ * variants: {
130
+ * 'My Pretty Variant' {
131
+ * glTF: {
132
+ * rootUrl: 'https:/my.awesome.domain/path/to/my/project/',
133
+ * fileName: 'my_3d_model_file.glb',
134
+ * },
135
+ * elements: {
136
+ * 'My Little Element': {
137
+ * paths: {
138
+ * includes: ['__root__.MeshName']
139
+ * }
140
+ * }
141
+ * }
142
+ * }
143
+ * }
144
+ * ```
145
+ * `MeshName` has to be identical to the path in the glb-file of the 3D-model.
146
+ */
147
+ variants?: {
148
+ [id: string]: StructureJson;
149
+ };
150
+ };
151
+ /**
152
+ * Extends the `StructureJson` by removing the optional flag from some properties which surely exist in the auto
153
+ * generated spec
154
+ */
155
+ declare type AutoSpecStructureJson = StructureJson & {
156
+ scene: AutoSpecSceneJson;
157
+ setup: SetupJson;
158
+ variants: {
159
+ [id: string]: StructureJson;
160
+ };
161
+ };
162
+ declare type SceneJson = {
163
+ parameterDeclaration?: ParameterDeclarations;
164
+ parameters?: ParameterBag;
165
+ meshPicking?: boolean;
166
+ engine?: {
167
+ antialiasing?: boolean;
168
+ options?: EngineOptions;
169
+ };
170
+ scene: SceneDefinition;
171
+ animations?: AnimationDefinitions;
172
+ placements?: PlacementDefinitions;
173
+ /**
174
+ * Information about [material cloning](pages/Release%20Notes/releases/4-3-0.html#material-cloning-on-mutation).
175
+ * Default value is `false`.
176
+ */
177
+ cloneMaterialsOnMutation?: boolean;
178
+ };
179
+ /**
180
+ * Extends the `SceneJson` by removing the optional flag from some properties which surely exist in the auto generated
181
+ * spec
182
+ */
183
+ declare type AutoSpecSceneJson = SceneJson & {
184
+ engine: {
185
+ antialiasing: boolean;
186
+ options: EngineOptions;
187
+ };
188
+ };
189
+ declare type SceneDefinition = {
190
+ globals: SceneGlobals;
191
+ cameras?: CameraDefinitions;
192
+ };
193
+ declare type SceneGlobals = {
194
+ 'shadows'?: {
195
+ enabled: boolean;
196
+ type: 'contact';
197
+ settings: [];
198
+ generator: [];
199
+ receiver: [];
200
+ };
201
+ /**
202
+ * `aa` or anti aliasing is not needed if hard edges are desired.\
203
+ * FYI: aa smooths edges and avoids stairs-effects.
204
+ */
205
+ 'aa'?: 'fxaa';
206
+ 'tone-mapping'?: boolean;
207
+ /**
208
+ * @bloom is widely known as glow. There you can define it’s size (Specifies the size of the bloom blur kernel,
209
+ * relative to the final output size) and threshold (The luminance threshold to find bright areas of the image to
210
+ * bloom).
211
+ * Further Information under [BloomEffect](https://doc.babylonjs.com/typedoc/classes/babylon.bloomeffect).
212
+ *
213
+ * @dof short for "depth-of-field" defines the focus in the view. Parameters in settings are listed in [Depth of Field and Other Lens Effects link](https://doc.babylonjs.com/divingDeeper/postProcesses/dofLenseEffects).
214
+ * @exposure specifies the intensity of the lightning of the view (not 3D-Model).
215
+ * @sharpen´s parameter `settings` are listed in [Default Rendering Pipeline Sharpening link](https://doc.babylonjs.com/divingDeeper/postProcesses/defaultRenderingPipeline#sharpening).
216
+ */
217
+ 'camera-settings'?: {
218
+ contrast: number;
219
+ exposure: number;
220
+ bloom?: {
221
+ enabled: boolean;
222
+ size?: number;
223
+ threshold?: number;
224
+ };
225
+ dof?: {
226
+ enabled: boolean;
227
+ settings: {};
228
+ };
229
+ sharpen?: {
230
+ enabled: boolean;
231
+ settings: {};
232
+ };
233
+ };
234
+ };
235
+ /**
236
+ * {@link Viewer.screenshot} internally uses Babylon.js [ScreenshotTools.CreateScreenshotUsingRenderTarget](https://doc.babylonjs.com/typedoc/classes/babylon.screenshottools#createscreenshotusingrendertarget). \
237
+ * See this link for additional info about the properties.
238
+ */
239
+ declare type ScreenshotSettings = {
240
+ /** Defaults to canvas width & height */
241
+ size?: IScreenshotSize;
242
+ /**
243
+ * Default `image/png`
244
+ *
245
+ * **Info regarding JPEG:** \
246
+ * Use mimeType `image/jpeg` (**not** `image/jpg`) when creating jpeg's. \
247
+ * Also ensure that {@link Scene.clearColor | viewer.scene.clearColor} has an alpha value of `1` as jpeg's don't
248
+ * support transparency. Otherwise background will always be black for jpeg's.
249
+ */
250
+ mimeType?: string;
251
+ /** Default `1` */
252
+ samples?: number;
253
+ /** Default `false` */
254
+ antialiasing?: boolean;
255
+ /** Default `screenshot.png` */
256
+ fileName?: string;
257
+ /** Default `false` */
258
+ renderSprites?: boolean;
259
+ };
260
+ /**
261
+ * Use this to define geometry to be excluded from autofocus, GLB export, etc.
262
+ */
263
+ declare type ExcludedGeometry = TransformNode | VariantInstance | Variant | VariantElement | TagManagerSubject;
264
+ declare type ExcludedGeometryList = ExcludedGeometry[];
265
+ declare type AutofocusSettings = {
266
+ /**
267
+ * Can be used to customize the margins shown around the 3d model when calling {@link Viewer.autofocusActiveCamera}.\
268
+ * Defaults to 1.5 when not set explicitly.
269
+ */
270
+ radiusFactor?: number;
271
+ adjustWheelPrecision?: boolean;
272
+ adjustPanningSensibility?: boolean;
273
+ adjustPinchPrecision?: boolean;
274
+ /** Desired horizontal camera angle, this won't be overwritten by the autofocus function */
275
+ alpha?: number;
276
+ /** Desired vertical camera angle, this won't be overwritten by the autofocus function */
277
+ beta?: number;
278
+ /** Optional animation for the focusing camera movement */
279
+ animation?: string | AnimationDefinition;
280
+ /** Optional list of geometry to be excluded from consideration */
281
+ exclude?: ExcludedGeometryList;
282
+ };
283
+ declare type LightDefinitions = {
284
+ [name: string]: LightDefinition | string;
285
+ };
286
+ declare type LightDefinition = {
287
+ type: 'baked' | 'hemispheric' | 'point' | 'directional' | 'spot';
288
+ path?: string;
289
+ shadowGenerator?: ShadowGeneratorDefinition;
290
+ };
291
+ declare type ShadowGeneratorDefinition = {
292
+ mapSize: number;
293
+ [others: string]: any;
294
+ };
295
+ declare type GroundDefinitions = {
296
+ [ground: string]: GroundDefinition;
297
+ };
298
+ declare type GroundDefinition = {
299
+ type: 'baked' | 'ground' | 'heightmap';
300
+ meshId?: string;
301
+ url?: string;
302
+ width?: number;
303
+ height?: number;
304
+ subdivisions?: number;
305
+ receiveShadows?: boolean;
306
+ minHeight?: number;
307
+ maxHeight?: number;
308
+ alphaFilter?: number;
309
+ onReady?: any;
310
+ };
311
+ declare type CameraDefinitions = {
312
+ [camera: string]: CameraDefinition;
313
+ };
314
+ declare type CameraDefinition = {
315
+ /**
316
+ * `fov` or "Field Of View" defines as it says the view of the scene. Further information about its [theory](https://en.wikipedia.org/wiki/Field_of_view) and [implementation](https://doc.babylonjs.com/typedoc/classes/babylon.camera#fov).
317
+ */
318
+ fov?: number;
319
+ active?: boolean;
320
+ /**
321
+ * `arc` is a default camera position where the 3D-model is the center and the camera rotates around the 3D-model.
322
+ * More Information about `arc` in [ArcRotateCamera](https://doc.babylonjs.com/typedoc/classes/babylon.arcrotatecamera).
323
+ *
324
+ * NOTE: While "baked" camera definitions from a GLB or babylon file can currently not be instatiated within the
325
+ * `Specification`, it's still possible to use them in the viewer.\
326
+ * For the moment all camera definitions inside these files are automatically added to the scene and can be actived
327
+ * using the {@link Viewer.switchCamera} function.\
328
+ * The `newCamera` input has to match the name of the camera node inside the GLB/babylon file.
329
+ */
330
+ type: 'arc';
331
+ /**
332
+ * `target` overrides `arc`´s position and repositions the camera. The string has the syntax (x?: number, y?: number, z?: number) like [Vector3](https://doc.babylonjs.com/typedoc/classes/babylon.vector3).
333
+ */
334
+ target?: string;
335
+ };
336
+ declare type VariantInstanceDefinition = {
337
+ name?: string;
338
+ variant: DottedPathArgument;
339
+ parameters?: ParameterBag;
340
+ lazy?: boolean;
341
+ };
342
+ declare type SetupJson = {
343
+ instances: VariantInstanceDefinition[];
344
+ };
345
+ declare type ParameterDeclarations = {
346
+ [name: string]: ParameterDeclaration;
347
+ };
348
+ declare type ParameterDeclaration = {
349
+ type: 'string' | 'boolean' | 'number' | 'color' | 'select' | 'vector' | 'csl' | 'paintable';
350
+ parser?: any;
351
+ options?: ParameterValue[];
352
+ };
353
+ declare type ParameterValue = string | number | boolean;
354
+ declare type ParameterBag = {
355
+ [name: string]: ParameterValue;
356
+ };
357
+ declare type ParsedParameterBag = {
358
+ [name: string]: any;
359
+ };
360
+ declare type DottedPathArgument = string | string[] | DottedPath;
361
+ declare type ParameterObserverResult = boolean | void;
362
+ declare type ParameterObserver = (object: any, oldValue: Undefinable<ParameterValue>, newValue: ParameterValue) => Promise<ParameterObserverResult>;
363
+ declare type PlacementDefinitions = {
364
+ [name: string]: PlacementDefinition;
365
+ };
366
+ declare type PlacementDefinition = {
367
+ position?: string | Vector3;
368
+ alpha?: number;
369
+ beta?: number;
370
+ radius?: number;
371
+ target?: string | Vector3;
372
+ };
373
+ declare type AnimationDefinitions = {
374
+ [name: string]: AnimationDefinition;
375
+ };
376
+ /**
377
+ * See [GSAP API Docs](https://greensock.com/docs/v3/GSAP/Tween/vars) for description of `GSAPTWeenVars`.
378
+ *
379
+ * You can use the [GreenSock Ease Visualizer](https://greensock.com/ease-visualizer/) to create an animation of your
380
+ * liking and simply copy the `ease` function shown at the bottom of the visualizer into the `ease` property of your
381
+ * {@link AnimationDefinition}.
382
+ *
383
+ * The `GSAPTWeenVars` are extended by the `shortestWay` property.\
384
+ * This property defines if the camera should move to the target position within the shortest possible distance.\
385
+ * If `shortestWay` is `false`, the camera moves the whole difference between the current camera position and the target
386
+ * position and that could be > 360, which can appear very unconvenient to the operator.\
387
+ * The default value of this flag is `true`.
388
+ *
389
+ * Example usage in {@link SceneJson | SceneJson.animations}:
390
+ *
391
+ * ```js
392
+ * // ...
393
+ * scene: {
394
+ * // ...
395
+ * animations: {
396
+ * DefaultCameraAnimation: {
397
+ * ease: 'Power3.easeInOut',
398
+ * duration: 0.8,
399
+ * },
400
+ * },
401
+ * // ...
402
+ * }
403
+ * // ...
404
+ * ```
405
+ */
406
+ declare type AnimationDefinition = GSAPTweenVars & {
407
+ shortestWay?: boolean;
408
+ };
409
+ /**
410
+ * Extends Babylon.js's {@link IExportOptions} by some viewer specific settings
411
+ */
412
+ interface IExportOptionsExtended extends IExportOptions {
413
+ /**
414
+ * Refraction textures get lost when exporting the scene to GLB.\
415
+ * The short explanation is that refraction is calculated by "RenderTargetTexture", which is created in real time from
416
+ * the camera perspective. This data is not available in the GLB export, therefore the texture gets removed.\
417
+ * However if `exchangeRefractionMaterials` is set, a fallback material with a similar look is exported instead. This
418
+ * fallback material solves the refraction with a combination of certain color, roughness, metallic and transparency
419
+ * mode settings.
420
+ */
421
+ exchangeRefractionMaterials?: boolean;
422
+ }
423
+ declare type SpecGenerationData = {
424
+ name: string;
425
+ url: string;
426
+ };
427
+ /**
428
+ * Key = Old tag name\
429
+ * Value = New tag name
430
+ */
431
+ declare type TagMapping = {
432
+ [tagName: string]: string;
433
+ };
434
+ declare type TagManagerSubject = {
435
+ tagName?: string;
436
+ nodeName?: string;
437
+ materialName?: string;
438
+ };
439
+ declare type TagManagerParameterObserverResult = ParameterObserverResult;
440
+ /**
441
+ * The observer should return `false` in cases where the given value was not actually applied. E.g. when wanting to
442
+ * apply a property on the given `node`s material which doesn't exist at the time the observer is called etc.
443
+ */
444
+ declare type TagManagerParameterObserver = (payload: TagManagerParameterObserverPayload) => Promise<TagManagerParameterObserverResult>;
445
+ declare type TagManagerParameterBag = FuzzyMap<TagManagerSubject, ParameterBag>;
446
+ declare type TagManagerParameterObserverBag = Map<string, TagManagerParameterObserver>;
447
+ declare type TagManagerParameterObserverPayload = {
448
+ subject: TagManagerSubject;
449
+ nodes: TransformNode[];
450
+ materials: Material[];
451
+ newValue: ParameterValue;
452
+ oldValue: Undefinable<ParameterValue>;
453
+ };
454
+ declare type TagManagerParameterValue = {
455
+ tagName?: string;
456
+ nodeName?: string;
457
+ materialName?: string;
458
+ parameterName: string;
459
+ value: ParameterValue;
460
+ };
461
+ declare type TagManagerParameterObserverResultBag = {
462
+ subject: TagManagerSubject;
463
+ parameter: string;
464
+ nodes: TransformNode[];
465
+ materials: Material[];
466
+ oldValue: ParameterValue;
467
+ newValue: ParameterValue;
468
+ parameterObserverResult: TagManagerParameterObserverResult;
469
+ };
470
+ declare type NodeNamingStrategyPayload = {
471
+ variantInstance: VariantInstance;
472
+ variant: Variant;
473
+ variantParameterizable: VariantParameterizable;
474
+ };
475
+ declare type NodeNamingStrategyHandler = (node: TransformNode, payload: NodeNamingStrategyPayload) => string;
476
+ declare type NodeNamingStrategy = {
477
+ handler: NodeNamingStrategyHandler;
478
+ payload: NodeNamingStrategyPayload;
479
+ };