@combeenation/3d-viewer 7.1.3 → 8.0.0

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