@liveroom-tech/react-immersive 6.2.0 → 6.2.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 (61) hide show
  1. package/dist/DownloadedEnvironment-NHM4U2LJ.mjs +1 -0
  2. package/dist/{SequencesTab-ODR5IGDX.mjs → SequencesTab-VZKEKAUG.mjs} +1 -1
  3. package/dist/StreamingTilesModel-6Z7SIC2J.mjs +16 -0
  4. package/dist/binding-builder.css +1 -1
  5. package/dist/binding-builder.d.mts +3 -3
  6. package/dist/binding-builder.d.ts +3 -3
  7. package/dist/binding-builder.js +59 -58
  8. package/dist/binding-builder.mjs +1 -1
  9. package/dist/chunk-25WC5KDO.mjs +50 -0
  10. package/dist/chunk-2AJK643D.mjs +1 -0
  11. package/dist/chunk-3OCHN3CA.mjs +1 -0
  12. package/dist/{chunk-3XZKDTB2.mjs → chunk-7OVEHDDE.mjs} +1 -1
  13. package/dist/chunk-KFLS7GI6.mjs +1 -0
  14. package/dist/{chunk-EWNN4BBR.mjs → chunk-KYXJG3TX.mjs} +1 -1
  15. package/dist/{chunk-2CUPPOBW.mjs → chunk-LD7QWHB4.mjs} +2 -2
  16. package/dist/{chunk-GXY3VML4.mjs → chunk-NMRTI3NQ.mjs} +1 -1
  17. package/dist/chunk-RKDATTUM.mjs +1 -0
  18. package/dist/chunk-RXZ4Q7CY.mjs +1 -0
  19. package/dist/chunk-TUYVYSN5.mjs +1 -0
  20. package/dist/{chunk-IOLT2VXU.mjs → chunk-UAZ6I25Y.mjs} +1 -1
  21. package/dist/chunk-UCD76KQ6.mjs +1 -0
  22. package/dist/chunk-UHRJ2RBF.mjs +1 -0
  23. package/dist/chunk-UTVFRMYW.mjs +47 -0
  24. package/dist/chunk-YKDDNX2D.mjs +69 -0
  25. package/dist/exportSceneMesh-YJFOLFHS.mjs +1 -0
  26. package/dist/hosted.css +1 -1
  27. package/dist/hosted.d.mts +3 -3
  28. package/dist/hosted.d.ts +3 -3
  29. package/dist/hosted.js +58 -57
  30. package/dist/hosted.mjs +1 -1
  31. package/dist/index.css +1 -1
  32. package/dist/index.d.mts +4 -4
  33. package/dist/index.d.ts +4 -4
  34. package/dist/index.js +52 -51
  35. package/dist/index.mjs +1 -1
  36. package/dist/meshFormats-4C6NHYOA.mjs +1 -0
  37. package/dist/modelFileResolver-CVmON8hg.d.mts +1724 -0
  38. package/dist/modelFileResolver-CVmON8hg.d.ts +1724 -0
  39. package/dist/modelViewerProps-BBnZTFO-.d.ts +949 -0
  40. package/dist/modelViewerProps-CIY4nsNY.d.mts +949 -0
  41. package/dist/{publicProps-Cmh9JtzJ.d.ts → publicProps-BARVwXu7.d.ts} +1 -1
  42. package/dist/{publicProps-TMARX628.d.mts → publicProps-n0Yvr_Km.d.mts} +1 -1
  43. package/dist/simple-model-viewer.css +1 -1
  44. package/dist/simple-model-viewer.d.mts +22 -4
  45. package/dist/simple-model-viewer.d.ts +22 -4
  46. package/dist/simple-model-viewer.js +5 -5
  47. package/dist/simple-model-viewer.mjs +1 -1
  48. package/dist/utils.d.mts +4 -4
  49. package/dist/utils.d.ts +4 -4
  50. package/dist/utils.js +2 -2
  51. package/dist/utils.mjs +1 -1
  52. package/dist/xrRuntime-5S7KYUVB.mjs +1 -0
  53. package/package.json +1 -1
  54. package/dist/chunk-3MIILDHB.mjs +0 -83
  55. package/dist/chunk-6Q6YZ7O5.mjs +0 -1
  56. package/dist/chunk-7MN2TMY6.mjs +0 -47
  57. package/dist/chunk-X4WRTDO6.mjs +0 -50
  58. package/dist/modelFileResolver-ChKYsF21.d.mts +0 -495
  59. package/dist/modelFileResolver-ChKYsF21.d.ts +0 -495
  60. package/dist/modelViewerProps-Ch6pIZIE.d.ts +0 -2159
  61. package/dist/modelViewerProps-HazR2IE_.d.mts +0 -2159
@@ -1,2159 +0,0 @@
1
- import { Object3D, Material } from 'three';
2
- import { e as ViewerModelBounds, R as ReducedMotionSetting, C as CameraLimits, d as ModelViewerLabels, V as ViewerLoading, g as ViewerReveal, b as ModelFormat, f as ViewerModelInfo } from './modelFileResolver-ChKYsF21.js';
3
- import { ReactNode } from 'react';
4
- import { CameraControls } from '@react-three/drei';
5
-
6
- type ViewerCameraState = {
7
- position: [number, number, number];
8
- target: [number, number, number];
9
- fov: number | null;
10
- zoom: number;
11
- /**
12
- * The camera's orbit angles, in radians, captured so setCameraState can
13
- * restore the exact rotation (position and target alone are ambiguous
14
- * straight above or below the target). Pass the state back as-is; to move
15
- * the camera to angles you choose, use orbitTo, which takes degrees.
16
- */
17
- azimuthAngle?: number;
18
- polarAngle?: number;
19
- };
20
- /** Where ModelViewer's camera starts. Setting it skips the automatic fit. */
21
- type ViewerCameraConfig = {
22
- position?: [number, number, number];
23
- /** Vertical field of view in degrees. */
24
- fov?: number;
25
- near?: number;
26
- far?: number;
27
- zoom?: number;
28
- };
29
-
30
- type DeepPartial<T> = T extends readonly unknown[] ? T : T extends object ? {
31
- [K in keyof T]?: DeepPartial<T[K]>;
32
- } : T;
33
-
34
- type ObjectBindingSelector = {
35
- group: string;
36
- } | {
37
- tag: string;
38
- } | {
39
- type: ObjectBindingType;
40
- };
41
- type ObjectBindingTarget = string | readonly string[] | ObjectBindingSelector;
42
- /**
43
- * Resolves IDs and selectors to binding-map keys in stable record order.
44
- * Explicit ID arrays keep their supplied order. Duplicate matches are removed.
45
- */
46
- declare function selectBindingKeys(bindings: Record<string, ObjectBinding>, target: ObjectBindingTarget): string[];
47
- /** Selects bindings by ID, group, tag, or binding type. */
48
- declare function selectBindings(bindings: Record<string, ObjectBinding>, target: ObjectBindingTarget): ObjectBinding[];
49
-
50
- type ObjectBindingPatch = DeepPartial<ObjectBinding>;
51
- type BindingEdit = {
52
- ids: ObjectBindingTarget;
53
- patch: ObjectBindingPatch;
54
- };
55
- /**
56
- * Applies field-level patches to object bindings and returns the updated
57
- * record. Pure — nothing is mutated, and the original reference comes back
58
- * untouched when no id matched, so React can skip the re-render.
59
- *
60
- * Ids resolve the same way everywhere else in the library: binding key first,
61
- * then `binding.id`, then `binding.modelObjectId`.
62
- */
63
- declare function patchBindings(bindings: Record<string, ObjectBinding>, target: ObjectBindingTarget, patch: ObjectBindingPatch): Record<string, ObjectBinding>;
64
- declare function patchBindings(bindings: Record<string, ObjectBinding>, edits: BindingEdit[]): Record<string, ObjectBinding>;
65
- /** Shorthand for the common `{ style: { material: … } }` nesting. */
66
- declare function material(value: ObjectBindingMaterial): ObjectBindingPatch;
67
-
68
- type SequenceVector3 = [number, number, number];
69
- type SequenceEasing = "linear" | "ease-in" | "ease-out" | "ease-in-out" | "step";
70
- type SequenceCameraView = {
71
- position: SequenceVector3;
72
- target: SequenceVector3;
73
- fov: number | null;
74
- zoom: number;
75
- };
76
- type SequenceValue = number | boolean | string | SequenceVector3 | SequenceCameraView;
77
- type SequenceKeyframe = {
78
- id: string;
79
- /** Seconds on the sequence timeline. */
80
- time: number;
81
- value: SequenceValue;
82
- /** Interpolation from this keyframe to the next. Default ease-in-out. */
83
- easing?: SequenceEasing;
84
- };
85
- type SequenceObjectProperty = "position" | "rotation" | "scale" | "visible" | "baseColor" | "emissive" | "opacity" | "roughness" | "metalness" | "emissiveIntensity";
86
- type SequenceTarget = {
87
- kind: "object";
88
- objectId: string;
89
- property: SequenceObjectProperty;
90
- } | {
91
- kind: "camera";
92
- } | {
93
- kind: "clip";
94
- clip: string;
95
- };
96
- type SequenceTrack = {
97
- id: string;
98
- name: string;
99
- target: SequenceTarget;
100
- muted?: boolean;
101
- keyframes: SequenceKeyframe[];
102
- };
103
- /** All object/clip ids are scoped to the model that owns this scene config. */
104
- type SceneSequence = {
105
- id: string;
106
- name: string;
107
- duration: number;
108
- loop: boolean;
109
- autoPlay: boolean;
110
- tracks: SequenceTrack[];
111
- };
112
- type SequencePlaybackState = {
113
- sequenceId: string | null;
114
- time: number;
115
- duration: number;
116
- status: "stopped" | "playing" | "paused" | "finished";
117
- previewing: boolean;
118
- ready: boolean;
119
- issues: string[];
120
- };
121
- type SequenceControls = {
122
- /** Stable snapshot for useSyncExternalStore. UI updates are throttled during playback. */
123
- getState: () => SequencePlaybackState;
124
- subscribe: (listener: () => void) => () => void;
125
- select: (sequenceId: string) => boolean;
126
- play: (sequenceId?: string) => boolean;
127
- pause: () => void;
128
- /** Restore the authored object, material, clip and camera state. */
129
- stop: () => void;
130
- /** Deterministic scrubbing, including backwards, without changing authored bindings. */
131
- seek: (time: number) => boolean;
132
- /** Read the live value for capture in the authoring UI. */
133
- capture: (target: SequenceTarget) => SequenceValue | null;
134
- };
135
-
136
- type MeasurementUnit = "m" | "cm" | "mm" | "in" | "ft";
137
- type MeasurementTool = "distance" | "angle" | "area" | "pointToPlane" | "wrap" | "wrapHorizontal";
138
- type MeasurementPosition = [number, number, number];
139
- type MeasurementSettings = {
140
- /** Authored model units. Default metres. Changing this should clear calibration. */
141
- sourceUnit?: MeasurementUnit;
142
- /** Unit used for lengths and areas. Default metres (or measurementUnit). */
143
- displayUnit?: MeasurementUnit;
144
- /** Calibration override: metres represented by one model unit. */
145
- metersPerUnit?: number;
146
- };
147
- type MeasurementAnchor = {
148
- nodeId: string;
149
- localPosition: MeasurementPosition;
150
- localNormal?: MeasurementPosition;
151
- localFaceVertices?: MeasurementPosition[];
152
- instanceId?: number;
153
- /** Deterministic fingerprint of source geometry, independent of rigid transforms. */
154
- geometrySignature: string;
155
- /** Posed measurements are snapshots; a different pose requires remeasurement. */
156
- poseSignature: string;
157
- };
158
- type MeasurementPoint = {
159
- id: number;
160
- position: MeasurementPosition;
161
- normal?: MeasurementPosition;
162
- faceVertices?: MeasurementPosition[];
163
- snapped?: "vertex" | "edge";
164
- anchor?: MeasurementAnchor;
165
- };
166
- type SavedMeasurement = {
167
- id: string;
168
- name: string;
169
- /** Stable model identity; defaults to the canonical model URL. */
170
- modelId: string;
171
- tilesetUrl?: string | null;
172
- tool: MeasurementTool;
173
- points: MeasurementPoint[];
174
- createdAt: string;
175
- visible?: boolean;
176
- /** Streamed geometry may represent a coarser LOD than the source model. */
177
- approximate?: boolean;
178
- };
179
- /** Stored with sceneConfig, JSON exports, and shareable configurations. */
180
- type MeasurementCollection = {
181
- settings: MeasurementSettings;
182
- items: SavedMeasurement[];
183
- };
184
- type MeasurementStatus = "ready" | "approximate" | "model-changed" | "missing-object" | "geometry-changed" | "pose-changed" | "hidden-object" | "invalid";
185
- type MeasurementResult = {
186
- id: string;
187
- status: MeasurementStatus;
188
- rawValue: number | null;
189
- value: number | null;
190
- unit: string;
191
- };
192
-
193
- type SceneSelectionSet = {
194
- id: string;
195
- name: string;
196
- /** Stable modelObjectId values, scoped to this model. */
197
- objectIds: string[];
198
- };
199
- /** Validate saved selections from scene JSON, shared state, or browser storage. */
200
- declare function parseSelectionSets(input: unknown): SceneSelectionSet[];
201
-
202
- type ProductSelections = Record<string, string | null>;
203
- type ProductOptionRef = {
204
- groupId: string;
205
- optionId: string;
206
- };
207
- type ProductAppearance = {
208
- target: ObjectBindingTarget;
209
- material?: ObjectBindingMaterial;
210
- visible?: boolean;
211
- };
212
- type ProductOption = {
213
- id: string;
214
- label: string;
215
- sku?: string;
216
- /** Shown under the label. */
217
- description?: string;
218
- /** A hex color, shown as this option's swatch. */
219
- swatch?: string;
220
- /** Added to the price, in the currency's smallest unit. Can be negative. */
221
- priceDeltaMinor?: number;
222
- appearance?: ProductAppearance[];
223
- variants?: string[];
224
- };
225
- /** Single-choice group. Optional groups may have no selected option. */
226
- type ProductOptionGroup = {
227
- id: string;
228
- label: string;
229
- required?: boolean;
230
- defaultOptionId?: string;
231
- display?: ProductGroupDisplay;
232
- options: ProductOption[];
233
- };
234
- type ProductGroupDisplay = "list" | "chips" | "swatches";
235
- /** A price worked out from the definition, for products without a pricing service. */
236
- type ProductPricing = {
237
- currency: string;
238
- basePriceMinor: number;
239
- };
240
- /**
241
- * A link to buy this configuration, with no code. The URL can use {sku},
242
- * {quantity}, {productId}, {revision} and {selections}.
243
- */
244
- type ProductCheckoutLink = {
245
- urlTemplate: string;
246
- label?: string;
247
- };
248
- type ProductOptionRule = {
249
- id: string;
250
- when: ProductOptionRef;
251
- requires?: ProductOptionRef[];
252
- excludes?: ProductOptionRef[];
253
- message?: string;
254
- };
255
- /** Exact combination-to-SKU mapping, including null for unselected optional groups. */
256
- type ProductSku = {
257
- sku: string;
258
- selections: ProductSelections;
259
- };
260
- type ProductDefinition = {
261
- id: string;
262
- label: string;
263
- revision: string;
264
- groups: ProductOptionGroup[];
265
- pricing?: ProductPricing;
266
- checkout?: ProductCheckoutLink;
267
- rules?: ProductOptionRule[];
268
- skus?: ProductSku[];
269
- };
270
- type SceneProductConfig = {
271
- definition: ProductDefinition;
272
- selections: ProductSelections;
273
- };
274
- type ProductConfigurationIssue = {
275
- code: "required" | "unknown-group" | "unknown-option" | "requires" | "excludes" | "sku";
276
- message: string;
277
- groupIds: string[];
278
- ruleId?: string;
279
- };
280
- type ProductConfiguration = {
281
- version: 1;
282
- productId: string;
283
- revision: string;
284
- /** Canonical JSON identity of product, revision, quantity, and sorted selections. */
285
- key: string;
286
- quantity: number;
287
- selections: ProductSelections;
288
- sku: string | null;
289
- items: Array<{
290
- groupId: string;
291
- optionId: string;
292
- label: string;
293
- sku?: string;
294
- }>;
295
- valid: boolean;
296
- issues: ProductConfigurationIssue[];
297
- };
298
- type ProductOptionState = {
299
- groupId: string;
300
- optionId: string;
301
- selected: boolean;
302
- available: boolean;
303
- reasons: string[];
304
- /** For a choice blocked by a rule: the other choices that would have to change to allow it. */
305
- fix?: ProductOptionRef[];
306
- };
307
- /** Something in a definition that won't work as its author expects. */
308
- type ProductDefinitionWarning = {
309
- code: "missing-sku" | "no-objects" | "missing-variant" | "invalid-default" | "unreachable" | "nothing-changes";
310
- message: string;
311
- groupId?: string;
312
- optionId?: string;
313
- };
314
- type ProductAvailability = {
315
- available: boolean;
316
- message?: string;
317
- options?: Array<ProductOptionRef & {
318
- available: boolean;
319
- reason?: string;
320
- }>;
321
- };
322
- /** Display-only price supplied by the host's pricing service. */
323
- type ProductPrice = {
324
- amountMinor: number;
325
- currency: string;
326
- expiresAt?: string;
327
- label?: string;
328
- };
329
- type ProductCommerceResult = {
330
- id?: string;
331
- message?: string;
332
- };
333
- type ProductCommerceContext = {
334
- signal: AbortSignal;
335
- };
336
- type ProductCheckoutContext = ProductCommerceContext & {
337
- idempotencyKey: string;
338
- price: ProductPrice | null;
339
- };
340
- /** Implement these methods in your application; validate/reprice again on your server. */
341
- type ProductCommerceAdapter = {
342
- /** Stable backend/pricing-context identity; change when provider, currency, or customer context changes. */
343
- key: string;
344
- resolveSku?: (configuration: ProductConfiguration, context: ProductCommerceContext) => string | null | Promise<string | null>;
345
- getAvailability?: (configuration: ProductConfiguration, context: ProductCommerceContext) => ProductAvailability | Promise<ProductAvailability>;
346
- getPrice?: (configuration: ProductConfiguration, context: ProductCommerceContext) => ProductPrice | Promise<ProductPrice>;
347
- addToCart?: (configuration: ProductConfiguration, context: ProductCheckoutContext) => ProductCommerceResult | Promise<ProductCommerceResult>;
348
- requestQuote?: (configuration: ProductConfiguration, context: ProductCheckoutContext) => ProductCommerceResult | Promise<ProductCommerceResult>;
349
- };
350
-
351
- declare const LIGHT_TYPES: readonly ["none", "directional", "point", "spot", "hemisphere"];
352
- type SceneLightType = (typeof LIGHT_TYPES)[number];
353
- type SceneLightAttachment = {
354
- /** Binding key, binding id, modelObjectId, or raw model node name. */
355
- objectId: string;
356
- /** Local-space offset from the attached model object. */
357
- offset: [number, number, number];
358
- };
359
- type SceneLight = {
360
- id: string;
361
- type: SceneLightType;
362
- color: string;
363
- intensity: number;
364
- position: [number, number, number];
365
- rotation?: [number, number, number];
366
- /** Point-light range. Zero means no distance limit. */
367
- distance?: number;
368
- /** Point-light physically correct decay. */
369
- decay?: number;
370
- angle?: number;
371
- penumbra?: number;
372
- /** Spot/directional aim point; unset aims at the origin (model centre with shadows). */
373
- target?: [number, number, number];
374
- attachedToCamera: boolean;
375
- /** Follow a model object instead of using the world-space position. */
376
- attachment?: SceneLightAttachment;
377
- castShadow: boolean;
378
- shadowBias: number;
379
- visible: boolean;
380
- };
381
- type SceneLightingConfig = {
382
- ambient: {
383
- intensity: number;
384
- color: string;
385
- };
386
- lights: SceneLight[];
387
- };
388
- declare const SCENE_MODEL_RENDERERS: readonly ["pbr", "matcap", "uv-checker"];
389
- type SceneModelRenderer = (typeof SCENE_MODEL_RENDERERS)[number];
390
- type SceneModelConfig = {
391
- rotation: [number, number, number];
392
- showAdvancedRotation: boolean;
393
- renderer: SceneModelRenderer;
394
- shading: "lit" | "unlit" | "normals";
395
- autoRotate?: boolean;
396
- autoRotateSpeed?: number;
397
- /**
398
- * The glTF material variants (KHR_materials_variants) to show, by name: at
399
- * most one from each option group (see `MaterialVariantGroup`). Empty, or
400
- * left out, for the model's default materials.
401
- */
402
- activeVariants?: string[];
403
- };
404
- type SceneCameraConfig = {
405
- fieldOfView: number;
406
- showAdvancedSettings: boolean;
407
- };
408
- type SceneShadowConfig = {
409
- enabled: boolean;
410
- mapSize: number;
411
- bias: number;
412
- normalBias: number;
413
- radius: number;
414
- };
415
- declare const ENVIRONMENT_PRESETS: readonly ["apartment", "city", "dawn", "forest", "lobby", "night", "park", "studio", "sunset", "warehouse"];
416
- type EnvironmentPreset = (typeof ENVIRONMENT_PRESETS)[number];
417
- type SceneEnvironmentConfig = {
418
- source: "preset" | "custom";
419
- preset: EnvironmentPreset;
420
- customEnvironmentUrl: string;
421
- intensity: number;
422
- rotation: number;
423
- shadowLight: {
424
- enabled: boolean;
425
- intensity: number;
426
- bias: number;
427
- };
428
- };
429
- type SceneWireframeConfig = {
430
- enabled: boolean;
431
- color: string;
432
- opacity: number;
433
- };
434
- type SceneBackgroundConfig = {
435
- enabled: boolean;
436
- type: "environment" | "image" | "color";
437
- color: string;
438
- imageUrl: string;
439
- };
440
- type SceneGroundShadowConfig = {
441
- enabled: boolean;
442
- mode: "shadowCatcher" | "bakedAO";
443
- intensity: number;
444
- borderFade: number;
445
- height: number;
446
- size: number;
447
- };
448
- declare const ANIMATION_LOOP_MODES: readonly ["repeat", "once", "ping-pong"];
449
- type AnimationLoopMode = (typeof ANIMATION_LOOP_MODES)[number];
450
- type SceneAnimationClipConfig = {
451
- sourceName: string;
452
- displayName: string;
453
- hidden: boolean;
454
- loopMode: AnimationLoopMode;
455
- speed: number;
456
- };
457
- type SceneAnimationConfig = {
458
- clips: SceneAnimationClipConfig[];
459
- autoplayClip: string | null;
460
- };
461
- declare const GLITCH_MODES: readonly ["sporadic", "constantMild", "constantWild"];
462
- type GlitchModeName = (typeof GLITCH_MODES)[number];
463
- declare const RAMP_TYPES: readonly ["linear", "radial", "mirroredLinear"];
464
- type RampTypeName = (typeof RAMP_TYPES)[number];
465
- declare const KERNEL_SIZE_NAMES: readonly ["verySmall", "small", "medium", "large", "veryLarge", "huge"];
466
- type KernelSizeName = (typeof KERNEL_SIZE_NAMES)[number];
467
- type ScenePostProcessingConfig = {
468
- autofocus: {
469
- enabled: boolean;
470
- focusDistance: number;
471
- focusRange: number;
472
- focalLength: number;
473
- bokehScale: number;
474
- target: [number, number, number];
475
- mouse: boolean;
476
- debug: number;
477
- manual: boolean;
478
- smoothTime: number;
479
- };
480
- toneMapping: {
481
- enabled: boolean;
482
- mode: "linear" | "reinhard" | "aces";
483
- exposure: number;
484
- resolution: number;
485
- whitePoint: number;
486
- middleGrey: number;
487
- minLuminance: number;
488
- averageLuminance: number;
489
- adaptationRate: number;
490
- };
491
- brightnessContrast: {
492
- enabled: boolean;
493
- brightness: number;
494
- contrast: number;
495
- };
496
- hueSaturation: {
497
- enabled: boolean;
498
- hue: number;
499
- saturation: number;
500
- };
501
- colorAverage: {
502
- enabled: boolean;
503
- };
504
- dotScreen: {
505
- enabled: boolean;
506
- angle: number;
507
- scale: number;
508
- };
509
- glitch: {
510
- enabled: boolean;
511
- mode: GlitchModeName;
512
- delay: [number, number];
513
- duration: [number, number];
514
- strength: [number, number];
515
- chromaticAberrationOffset: [number, number];
516
- columns: number;
517
- ratio: number;
518
- };
519
- ssao: {
520
- enabled: boolean;
521
- samples: number;
522
- rings: number;
523
- intensity: number;
524
- radius: number;
525
- bias: number;
526
- luminanceInfluence: number;
527
- fade: number;
528
- minRadiusScale: number;
529
- worldDistanceThreshold: number;
530
- worldDistanceFalloff: number;
531
- worldProximityThreshold: number;
532
- worldProximityFalloff: number;
533
- };
534
- bloom: {
535
- enabled: boolean;
536
- intensity: number;
537
- luminanceThreshold: number;
538
- luminanceSmoothing: number;
539
- mipmapBlur: boolean;
540
- radius: number;
541
- levels: number;
542
- };
543
- godRays: {
544
- enabled: boolean;
545
- sunPosition: [number, number, number];
546
- samples: number;
547
- density: number;
548
- decay: number;
549
- weight: number;
550
- exposure: number;
551
- clampMax: number;
552
- blur: boolean;
553
- kernelSize: KernelSizeName;
554
- };
555
- grid: {
556
- enabled: boolean;
557
- scale: number;
558
- lineWidth: number;
559
- };
560
- noise: {
561
- enabled: boolean;
562
- opacity: number;
563
- premultiply: boolean;
564
- };
565
- depthOfField: {
566
- enabled: boolean;
567
- focusDistance: number;
568
- focusRange: number;
569
- focalLength: number;
570
- bokehScale: number;
571
- };
572
- chromaticAberration: {
573
- enabled: boolean;
574
- offsetX: number;
575
- offsetY: number;
576
- radialModulation: boolean;
577
- modulationOffset: number;
578
- };
579
- lensflare: {
580
- enabled: boolean;
581
- lensPosition: [number, number, number];
582
- smoothTime: number;
583
- glareSize: number;
584
- flareSize: number;
585
- flareSpeed: number;
586
- flareShape: number;
587
- animated: boolean;
588
- anamorphic: boolean;
589
- colorGain: string;
590
- haloScale: number;
591
- secondaryGhosts: boolean;
592
- aditionalStreaks: boolean;
593
- ghostScale: number;
594
- opacity: number;
595
- starBurst: boolean;
596
- };
597
- vignette: {
598
- enabled: boolean;
599
- offset: number;
600
- darkness: number;
601
- eskil: boolean;
602
- };
603
- smaa: {
604
- enabled: boolean;
605
- };
606
- sepia: {
607
- enabled: boolean;
608
- intensity: number;
609
- };
610
- scanline: {
611
- enabled: boolean;
612
- density: number;
613
- };
614
- pixelation: {
615
- enabled: boolean;
616
- granularity: number;
617
- };
618
- outline: {
619
- enabled: boolean;
620
- selectionLayer: number;
621
- edgeStrength: number;
622
- pulseSpeed: number;
623
- visibleEdgeColor: string;
624
- hiddenEdgeColor: string;
625
- kernelSize: KernelSizeName;
626
- blur: boolean;
627
- xRay: boolean;
628
- };
629
- selectiveBloom: {
630
- enabled: boolean;
631
- selectionLayer: number;
632
- intensity: number;
633
- luminanceThreshold: number;
634
- luminanceSmoothing: number;
635
- kernelSize: KernelSizeName;
636
- mipmapBlur: boolean;
637
- inverted: boolean;
638
- ignoreBackground: boolean;
639
- };
640
- ramp: {
641
- enabled: boolean;
642
- rampType: RampTypeName;
643
- rampStart: [number, number];
644
- rampEnd: [number, number];
645
- startColor: string;
646
- endColor: string;
647
- opacity?: number;
648
- rampBias: number;
649
- rampGain: number;
650
- rampMask: boolean;
651
- rampInvert: boolean;
652
- };
653
- };
654
- type SceneAnnotationCameraView = {
655
- position: [number, number, number];
656
- target: [number, number, number];
657
- azimuthAngle?: number;
658
- polarAngle?: number;
659
- fov?: number | null;
660
- zoom?: number;
661
- };
662
- type SceneAnnotationImage = {
663
- src: string;
664
- alt?: string;
665
- };
666
- type SceneAnnotationLink = {
667
- href: string;
668
- label: string;
669
- };
670
- type SceneAnnotationMarker = {
671
- id: number;
672
- worldPosition: [number, number, number];
673
- localPosition: [number, number, number];
674
- worldNormal?: [number, number, number];
675
- anchorNodeName?: string;
676
- anchorLocalPosition?: [number, number, number];
677
- title: string;
678
- description: string;
679
- /** World-space camera framing restored on selection and during tours. */
680
- cameraView?: SceneAnnotationCameraView;
681
- images?: SceneAnnotationImage[];
682
- links?: SceneAnnotationLink[];
683
- category?: string;
684
- /** Inclusive camera-to-marker distance bounds, in scene units. */
685
- minDistance?: number;
686
- maxDistance?: number;
687
- };
688
- type SceneCinematicWaypoint = {
689
- position: [number, number, number];
690
- target: [number, number, number];
691
- /**
692
- * Orbit angles in radians, captured with the view in BindingBuilder. They
693
- * keep the rotation when position and target are vertically aligned; older
694
- * scene configs without them still work.
695
- */
696
- azimuthAngle?: number;
697
- polarAngle?: number;
698
- segmentDuration?: number;
699
- };
700
- type SceneCinematicConfig = {
701
- enabled: boolean;
702
- waypoints: SceneCinematicWaypoint[];
703
- duration?: number;
704
- loop: boolean;
705
- autoPlay: boolean;
706
- };
707
- declare const SECTION_AXES: readonly ["x", "y", "z"];
708
- type SceneSectionAxis = (typeof SECTION_AXES)[number];
709
- type SceneSectionPlane = {
710
- id: string;
711
- name: string;
712
- enabled: boolean;
713
- axis: SceneSectionAxis;
714
- position: number;
715
- flip: boolean;
716
- /** Optional world-space normal; normalized when used. Overrides axis. */
717
- normal?: [number, number, number];
718
- };
719
- type SceneSectionSettings = {
720
- enabled: boolean;
721
- /** The world axis the cut runs across; `"y"` gives a floor-plan cut. */
722
- axis: SceneSectionAxis;
723
- /**
724
- * Where the cut is along the axis, as a share of the model's size: 0 at
725
- * its minimum, 1 at its maximum.
726
- */
727
- position: number;
728
- /**
729
- * Keep the part above the cut (the higher side along the axis) instead of
730
- * the part below it.
731
- */
732
- flip: boolean;
733
- /** Default: the original single plane. */
734
- mode?: "plane" | "planes" | "box";
735
- /** Up to six independently enabled cuts. */
736
- planes?: SceneSectionPlane[];
737
- activePlaneId?: string;
738
- /** Custom normal for the single plane. */
739
- normal?: [number, number, number];
740
- /** Normalized bounds within the model bounds. Default: the full model. */
741
- box?: {
742
- min: [number, number, number];
743
- max: [number, number, number];
744
- };
745
- /** Keep the outside of a section box instead of its inside. */
746
- invertBox?: boolean;
747
- };
748
- type SceneSectionPreset = {
749
- id: string;
750
- name: string;
751
- settings: SceneSectionSettings;
752
- };
753
- type SceneSectionConfig = SceneSectionSettings & {
754
- presets?: SceneSectionPreset[];
755
- };
756
- declare const DEFAULT_SECTION_CONFIG: SceneSectionConfig;
757
- /**
758
- * What an object's data must look like for a rule to apply to it. A list
759
- * applies when every condition in it matches.
760
- */
761
- type SceneStyleCondition = {
762
- /** A key of `binding.metrics`. */
763
- metric: string;
764
- /** Applies when the value is greater than this. */
765
- above?: number;
766
- /** Applies when the value is less than this. */
767
- below?: number;
768
- } | {
769
- status: ObjectBindingStatus | ObjectBindingStatus[];
770
- } | {
771
- /** A key of `binding.metadata`; dots reach into nested objects. */
772
- metadata: string;
773
- equals: string | number | boolean | null;
774
- };
775
- type SceneStyleColorScale = {
776
- /** A key of `binding.metrics`. */
777
- metric: string;
778
- /**
779
- * `[value, "#rrggbb"]` pairs. Values between two stops blend their colours;
780
- * values outside the stops take the nearest one.
781
- */
782
- stops: [number, string][];
783
- /** The material colour it sets. Default `"baseColor"`. */
784
- channel?: "baseColor" | "emissive";
785
- };
786
- type SceneStylePulse = {
787
- /** The glow colour at the pulse's peak. Default `"#ff3b30"`. */
788
- color?: string;
789
- /** Pulses per second. Default `1`. */
790
- speed?: number;
791
- };
792
- type SceneStyleRule = {
793
- id: string;
794
- label?: string;
795
- /** The objects the rule considers; every bound object when left out. */
796
- target?: ObjectBindingTarget;
797
- /** When the rule applies; always, when left out. */
798
- when?: SceneStyleCondition | SceneStyleCondition[];
799
- /** Material overrides, over the object's own `style.material`. */
800
- material?: ObjectBindingMaterial;
801
- /** A colour taken from a metric's value. */
802
- colorScale?: SceneStyleColorScale;
803
- /** A glow that fades in and out, to draw attention. */
804
- pulse?: boolean | SceneStylePulse;
805
- };
806
- type SceneConfig = {
807
- model: SceneModelConfig;
808
- camera: SceneCameraConfig;
809
- lighting: SceneLightingConfig;
810
- wireframe: SceneWireframeConfig;
811
- shadows: SceneShadowConfig;
812
- environment: SceneEnvironmentConfig;
813
- background: SceneBackgroundConfig;
814
- groundShadows: SceneGroundShadowConfig;
815
- postProcessing: ScenePostProcessingConfig;
816
- animations: SceneAnimationConfig;
817
- annotations: SceneAnnotationMarker[];
818
- cinematic?: SceneCinematicConfig;
819
- /**
820
- * Data-driven looks for bound objects, applied in order, so a later rule
821
- * wins over an earlier one where both set something.
822
- */
823
- styleRules?: SceneStyleRule[];
824
- /** A cut-away view across the model. Off when left out. */
825
- section?: SceneSectionConfig;
826
- /** Named measurements and model-unit calibration, owned by this model. */
827
- measurements?: MeasurementCollection;
828
- /** Named object selections scoped to this model's stable object ids. */
829
- selectionSets?: SceneSelectionSet[];
830
- /** Product choices, constraints, appearance overrides, and selected options for this model. */
831
- product?: SceneProductConfig;
832
- /** Authored timed camera, object, appearance and clip tracks. Model-local IDs. */
833
- sequences?: SceneSequence[];
834
- };
835
- declare const DEFAULT_SCENE_CONFIG: SceneConfig;
836
-
837
- type SceneConfigPatch = DeepPartial<SceneConfig>;
838
- /**
839
- * Applies a nested scene-config patch without mutating either input. Objects
840
- * are merged recursively, while arrays and tuples are replaced wholesale.
841
- */
842
- declare function patchSceneConfig(sceneConfig: SceneConfig, patch: SceneConfigPatch): SceneConfig;
843
-
844
- type AnimationClipInfo = {
845
- sourceName: string;
846
- duration: number;
847
- };
848
- /** How `play` starts a clip. */
849
- type AnimationPlayOptions = {
850
- /**
851
- * Keep the clips already playing, instead of stopping them, so several
852
- * clips run at once (a left and a right door, say). Default `false`.
853
- */
854
- alongside?: boolean;
855
- /**
856
- * Seconds to fade the clip in, and to fade out the clips it replaces, for a
857
- * smooth blend between them. Default `0`.
858
- */
859
- fade?: number;
860
- /**
861
- * Play backwards, from wherever the clip is, or from its end. Plays a
862
- * "door opens" clip as the door closing. Default `false`.
863
- */
864
- reverse?: boolean;
865
- };
866
- /**
867
- * `"finished"`: a play-once clip that reached its end and holds its last pose
868
- * until it's stopped or played again.
869
- */
870
- type AnimationClipStatus = "playing" | "paused" | "finished";
871
- /** One clip that is playing, paused, or holding its finished pose. */
872
- type AnimationClipState = {
873
- clip: string;
874
- status: AnimationClipStatus;
875
- /** Position in the clip, in seconds. */
876
- time: number;
877
- /** Length of the clip, in seconds. */
878
- duration: number;
879
- speed: number;
880
- reverse: boolean;
881
- };
882
- type AnimationPlaybackState = {
883
- /** Playback intent is preserved while offscreen rendering is suspended. */
884
- isRenderPaused?: boolean;
885
- /** The clip played most recently, while it's active. */
886
- currentClip: string | null;
887
- /** Whether any clip is playing. */
888
- isPlaying: boolean;
889
- speed: number;
890
- time: number;
891
- duration: number;
892
- /** Every active clip, most recently played last. */
893
- active: AnimationClipState[];
894
- };
895
- /**
896
- * Leave out `clip` to act on every active clip; pass one to act on that clip
897
- * alone.
898
- */
899
- type AnimationControls = {
900
- clips: string[];
901
- clipDetails?: AnimationClipInfo[];
902
- play: (clipName: string, options?: AnimationPlayOptions) => void;
903
- pause: (clipName?: string) => void;
904
- /** Stops and resets the pose. */
905
- stop: (clipName?: string) => void;
906
- /** Without a clip, also the speed of clips played later without their own. */
907
- setSpeed: (speed: number, clipName?: string) => void;
908
- seek?: (time: number, clipName?: string) => void;
909
- getState?: () => AnimationPlaybackState;
910
- subscribe?: (listener: (state: AnimationPlaybackState) => void) => () => void;
911
- };
912
- type ViewerAnimationsProps = {
913
- isRenderPaused: boolean;
914
- clips: string[];
915
- clipDetails: AnimationClipInfo[];
916
- currentClip: string | null;
917
- isPlaying: boolean;
918
- speed: number;
919
- time: number;
920
- duration: number;
921
- /** Every active clip, most recently played last. */
922
- active: AnimationClipState[];
923
- play: (clipName: string, options?: AnimationPlayOptions) => void;
924
- pause: (clipName?: string) => void;
925
- stop: (clipName?: string) => void;
926
- setSpeed: (speed: number, clipName?: string) => void;
927
- seek: (time: number, clipName?: string) => void;
928
- handleAnimationsReady: (controls: AnimationControls) => void;
929
- /** Disconnect the previous model while the next one is loading. */
930
- clearAnimations: () => void;
931
- };
932
- declare function useViewerAnimations(): ViewerAnimationsProps;
933
-
934
- /** A glow cycling on one object, from its style rules. */
935
- type StyledObjectPulse = {
936
- color: string;
937
- /** Pulses per second. */
938
- speed: number;
939
- };
940
- type StyledObjectBindings = {
941
- /**
942
- * The bindings as the rules style them. A binding no rule changed is the
943
- * same object as the one passed in.
944
- */
945
- bindings: Record<string, ObjectBinding>;
946
- /** Pulsing objects, by binding key. */
947
- pulses: Record<string, StyledObjectPulse>;
948
- /** The binding a styled one came from (itself when no rule changed it). */
949
- sourceOf: (binding: ObjectBinding) => ObjectBinding;
950
- };
951
- /**
952
- * The colour a colour scale gives a value: a blend of the two stops around it,
953
- * or the nearest stop outside them. Null when there's no usable stop.
954
- */
955
- declare function colorScaleValue(stops: SceneStyleColorScale["stops"], value: number): string | null;
956
- /**
957
- * Styles bindings with scene style rules, for rendering. Rules apply in order
958
- * over each object's own `style.material`, so a later rule wins where two set
959
- * the same thing. The bindings passed in are never changed.
960
- */
961
- declare function applyStyleRules(bindings: Record<string, ObjectBinding>, rules: readonly SceneStyleRule[] | undefined): StyledObjectBindings;
962
-
963
- /**
964
- * Objects to focus on. Everything else is ghosted (drawn faintly) or hidden
965
- * until the isolation is cleared, without changing any binding.
966
- */
967
- type ViewerIsolation = {
968
- /** The objects that stay: an id, a list of ids, `{ group }`, `{ tag }`, or `{ type }`. */
969
- target: ObjectBindingTarget;
970
- /** What happens to everything else. Default `"ghost"`. */
971
- mode?: "ghost" | "hide";
972
- /** How visible ghosted objects are, 0–1. Default `0.12`. */
973
- ghostOpacity?: number;
974
- };
975
- type IsolatedObjectBindings = StyledObjectBindings & {
976
- /** Binding keys that are ghosted or hidden. Pointer picking ignores them. */
977
- setAside: Set<string>;
978
- };
979
- /** The binding keys an isolation keeps; empty when it keeps nothing. */
980
- declare function isolatedBindingKeys(bindings: Record<string, ObjectBinding>, isolation: ViewerIsolation | null | undefined): Set<string>;
981
- /**
982
- * Ghosts or hides every object an isolation doesn't keep, for rendering. The
983
- * bindings passed in are never changed. An isolation that keeps nothing (a
984
- * target matching no object) changes nothing either, rather than fading out
985
- * the whole model.
986
- */
987
- declare function applyIsolation(styled: StyledObjectBindings, isolation: ViewerIsolation | null | undefined): IsolatedObjectBindings;
988
-
989
- type ObjectBindingsActionEffect = {
990
- target: ObjectBindingTarget;
991
- objectBindings: ObjectBindingPatch;
992
- };
993
- type SceneConfigActionEffect = {
994
- sceneConfig: SceneConfigPatch;
995
- };
996
- type VisibilityActionEffect = {
997
- target: ObjectBindingTarget;
998
- visibility: "show" | "hide" | "toggle";
999
- };
1000
- type CameraAction = {
1001
- type: "focus-object";
1002
- objectId?: string;
1003
- } | {
1004
- type: "fit-scene";
1005
- } | {
1006
- type: "reset";
1007
- } | {
1008
- type: "set-target";
1009
- target: [number, number, number];
1010
- transition?: boolean;
1011
- } | {
1012
- type: "set-state";
1013
- state: ViewerCameraState;
1014
- transition?: boolean;
1015
- };
1016
- type CameraActionEffect = {
1017
- camera: CameraAction;
1018
- };
1019
- /**
1020
- * `play` replaces the clips already playing unless `alongside` is set. The
1021
- * others act on `clip`, or on every active clip when it's left out.
1022
- */
1023
- type AnimationAction = ({
1024
- type: "play";
1025
- clip: string;
1026
- } & AnimationPlayOptions) | {
1027
- type: "pause";
1028
- clip?: string;
1029
- } | {
1030
- type: "stop";
1031
- clip?: string;
1032
- } | {
1033
- type: "set-speed";
1034
- speed: number;
1035
- clip?: string;
1036
- } | {
1037
- type: "seek";
1038
- time: number;
1039
- clip?: string;
1040
- };
1041
- type AnimationActionEffect = {
1042
- animation: AnimationAction;
1043
- };
1044
- /** Isolates objects, or with `null` shows everything again. */
1045
- type IsolationActionEffect = {
1046
- isolation: ViewerIsolation | null;
1047
- };
1048
- type ObjectActionEffect = IsolationActionEffect | ObjectBindingsActionEffect | SceneConfigActionEffect | VisibilityActionEffect | CameraActionEffect | AnimationActionEffect;
1049
-
1050
- type ObjectBindingAction = {
1051
- id: "change-color" | "change-material" | "toggle-visibility" | string;
1052
- label: string;
1053
- type: "command";
1054
- effects?: ObjectActionEffect[];
1055
- };
1056
- /**
1057
- * What kind of object a binding is, for grouping and filtering. The listed
1058
- * values are suggestions; any string works.
1059
- */
1060
- type ObjectBindingType = "body" | "other" | "glass" | "windshield" | "rear-windshield" | "window" | "sunroof" | "wheel" | "rim" | "tire" | "brake-caliper" | "brake-disc" | "suspension" | "spring" | "shock-absorber" | "axle" | "control-arm" | "interior" | "seat" | "headrest" | "seatbelt" | "dashboard" | "steering-wheel" | "gear-shift" | "center-console" | "armrest" | "door-panel" | "carpet" | "headliner" | "sun-visor" | "pedal" | "instrument-cluster" | "infotainment" | "glove-box" | "engine" | "gearbox" | "radiator" | "battery" | "fuel-tank" | "air-filter" | "intercooler" | "alternator" | "turbo" | "light" | "headlight" | "taillight" | "fog-light" | "indicator" | "daytime-running-light" | "interior-light" | "ambient-light" | "floor" | "floor-tile" | "floor-board" | "floor-mat" | "ceiling" | "ceiling-tile" | "wall" | "wall-tile" | "wall-panel" | "wall-trim" | "baseboard" | "crown-molding" | "column" | "pillar" | "beam" | "arch" | "stairs" | "step" | "railing" | "balustrade" | "window-frame" | "window-sill" | "blind" | "curtain" | "shutter" | "door" | "door-frame" | "door-knob" | "furniture" | "sofa" | "armchair" | "ottoman" | "bed" | "headboard" | "mattress" | "nightstand" | "dresser" | "wardrobe" | "closet" | "shelf" | "bookcase" | "desk" | "office-chair" | "dining-table" | "dining-chair" | "bar-stool" | "bench" | "cabinet" | "sideboard" | "coffee-table" | "side-table" | "tv-stand" | "kitchen-island" | "countertop" | "sink" | "bathtub" | "shower" | "toilet" | "vanity" | "decor" | "rug" | "cushion" | "throw" | "curtain-rod" | "artwork" | "mirror" | "vase" | "plant" | "pot" | "candle" | "frame" | "sculpture" | "clock" | "lamp" | "floor-lamp" | "table-lamp" | "pendant-light" | "chandelier" | "sconce" | "ceiling-fan" | "electronics" | "tv" | "monitor" | "speaker" | "soundbar" | "projector" | "remote" | "console" | "router" | "smart-hub" | "thermostat" | "appliance" | "refrigerator" | "oven" | "microwave" | "dishwasher" | "washing-machine" | "dryer" | "air-conditioner" | "heater" | "ventilation" | "root" | "bone" | "joint" | "socket" | "pivot" | "head" | "face" | "eye" | "eyelid" | "eyebrow" | "mouth" | "teeth" | "tongue" | "ear" | "nose" | "hair" | "beard" | "neck" | "torso" | "chest" | "abdomen" | "back" | "shoulder" | "upper-arm" | "forearm" | "hand" | "finger" | "thumb" | "hip" | "thigh" | "shin" | "foot" | "toe" | "tail" | "wing" | "tentacle" | "clothing" | "hat" | "helmet" | "visor" | "mask" | "goggles" | "glasses" | "jacket" | "shirt" | "pants" | "skirt" | "shoes" | "boots" | "gloves" | "belt" | "watch" | "bag" | "backpack" | "jewelry" | "necklace" | "ring" | "armor" | "chest-plate" | "pauldron" | "gauntlet" | "greave" | "shield" | "weapon" | "blade" | "edge" | "tip" | "guard" | "grip" | "pommel" | "barrel" | "stock" | "scope" | "trigger" | "magazine" | "muzzle" | "gear" | "piston" | "lever" | "valve" | "pump" | "motor" | "rotor" | "blade-prop" | "nozzle" | "pipe" | "tube" | "cable" | "wire" | "connector" | "panel" | "hatch" | "vent" | "antenna" | "sensor" | "camera" | "screen" | "dial" | "button" | "knob" | "switch" | "gauge" | "terrain" | "ground" | "rock" | "cliff" | "water" | "ocean" | "river" | "lake" | "wave" | "foam" | "sky" | "cloud" | "sun" | "moon" | "star" | "fog" | "foliage" | "tree" | "branch" | "leaf" | "grass" | "bush" | "flower" | "soil" | "sand" | "snow" | "ice" | "facade" | "foundation" | "roof-structure" | "chimney" | "balcony" | "porch" | "pathway" | "fence" | "gate" | "wall-exterior" | (string & {});
1061
- type ObjectBindingStatus = "normal" | "hidden" | "selected" | "disabled";
1062
- type ObjectBindingTextureSlot = {
1063
- path: string;
1064
- /** UV position offset [u, v]. */
1065
- offset?: [number, number];
1066
- /** UV zoom scale. 1 = default, >1 = zoom in, <1 = zoom out. */
1067
- scale?: number;
1068
- rotation?: number;
1069
- };
1070
- type ObjectBindingTextureChannel = "baseColor" | "metalness" | "roughness" | "emissive" | "alpha" | "normal" | "bump" | "ao" | "displacement" | "clearcoat" | "clearcoatRoughness" | "clearcoatNormal" | "anisotropy" | "transmission" | "thickness" | "sheenColor" | "sheenRoughness" | "specularIntensity" | "specularColor";
1071
- type ObjectBindingTransform = {
1072
- /** Local xy/xz/yz shear, applied between rotation and scale. Preserves rigid world edits under non-uniform parents. */
1073
- shear?: [number, number, number];
1074
- /** Local-space node-origin position, or the reference-pose position when pivot is set. */
1075
- position?: [number, number, number];
1076
- /** Local-space Euler rotation in radians. */
1077
- rotation?: [number, number, number];
1078
- /** Local-space scale. */
1079
- scale?: [number, number, number];
1080
- /**
1081
- * Opt-in centered editing. Legacy transforms without this field remain direct
1082
- * local P/R/S. The reference offset keeps position independent of later
1083
- * rotation/scale edits: rendered origin = position + offset - R * H * S * point (H is shear).
1084
- */
1085
- pivot?: {
1086
- point: [number, number, number];
1087
- offset: [number, number, number];
1088
- };
1089
- };
1090
- declare const MATERIAL_SIDES: readonly ["front", "back", "double"];
1091
- type ObjectBindingMaterialSide = (typeof MATERIAL_SIDES)[number];
1092
- declare const MATERIAL_BLENDING_MODES: readonly ["normal", "additive"];
1093
- type ObjectBindingMaterialBlendingMode = (typeof MATERIAL_BLENDING_MODES)[number];
1094
- type ObjectBindingMaterial = {
1095
- texture?: ObjectBindingTextureSlot;
1096
- baseColor?: string;
1097
- metalness?: number;
1098
- metalnessMap?: ObjectBindingTextureSlot;
1099
- roughness?: number;
1100
- roughnessMap?: ObjectBindingTextureSlot;
1101
- emissive?: string;
1102
- emissiveIntensity?: number;
1103
- emissiveMap?: ObjectBindingTextureSlot;
1104
- opacity?: number;
1105
- alphaMap?: ObjectBindingTextureSlot;
1106
- alphaTest?: number;
1107
- alphaHash?: boolean;
1108
- dithering?: boolean;
1109
- blendingMode?: ObjectBindingMaterialBlendingMode;
1110
- side?: ObjectBindingMaterialSide;
1111
- normalMap?: ObjectBindingTextureSlot;
1112
- normalScale?: number;
1113
- flipNormalY?: boolean;
1114
- bumpMap?: ObjectBindingTextureSlot;
1115
- bumpScale?: number;
1116
- aoMap?: ObjectBindingTextureSlot;
1117
- aoMapIntensity?: number;
1118
- displacementMap?: ObjectBindingTextureSlot;
1119
- displacementScale?: number;
1120
- displacementBias?: number;
1121
- clearcoat?: number;
1122
- clearcoatMap?: ObjectBindingTextureSlot;
1123
- clearcoatRoughness?: number;
1124
- clearcoatRoughnessMap?: ObjectBindingTextureSlot;
1125
- clearcoatNormalMap?: ObjectBindingTextureSlot;
1126
- clearcoatNormalScale?: number;
1127
- flipClearcoatNormalY?: boolean;
1128
- sheen?: number;
1129
- sheenColor?: string;
1130
- sheenColorMap?: ObjectBindingTextureSlot;
1131
- sheenRoughness?: number;
1132
- sheenRoughnessMap?: ObjectBindingTextureSlot;
1133
- anisotropy?: number;
1134
- anisotropyRotation?: number;
1135
- anisotropyMap?: ObjectBindingTextureSlot;
1136
- transmission?: number;
1137
- transmissionMap?: ObjectBindingTextureSlot;
1138
- thickness?: number;
1139
- thicknessMap?: ObjectBindingTextureSlot;
1140
- attenuationColor?: string;
1141
- attenuationDistance?: number;
1142
- reflectivity?: number;
1143
- specularIntensity?: number;
1144
- specularIntensityMap?: ObjectBindingTextureSlot;
1145
- specularColor?: string;
1146
- specularColorMap?: ObjectBindingTextureSlot;
1147
- };
1148
- type ObjectBindingCameraState = {
1149
- position?: [number, number, number];
1150
- target?: [number, number, number];
1151
- fov?: number;
1152
- zoom?: number;
1153
- };
1154
- /**
1155
- * An image or a line of text printed onto the object's surface: a logo, a
1156
- * label, a personalisation.
1157
- */
1158
- type ObjectBindingDecal = {
1159
- id: string;
1160
- /** The image to show: a URL or public path. */
1161
- image?: string;
1162
- /** Text to show, when there's no image. */
1163
- text?: string;
1164
- /** Text colour. Default `"#ffffff"`. */
1165
- color?: string;
1166
- /** CSS font family for the text. Default `"sans-serif"`. */
1167
- fontFamily?: string;
1168
- /** Default `"bold"`. */
1169
- fontWeight?: "normal" | "bold";
1170
- /** Where it sits on the object, in the object's own (local) space. */
1171
- position: [number, number, number];
1172
- /** The way the surface faces there, in the object's own space. */
1173
- normal: [number, number, number];
1174
- /** Width, in model units; the height follows the image or text's shape. */
1175
- size: number;
1176
- /** A turn around the surface normal, in radians. Default `0`. */
1177
- rotation?: number;
1178
- /** 0–1. Default `1`. */
1179
- opacity?: number;
1180
- };
1181
- type ObjectBindingStyle = {
1182
- material?: ObjectBindingMaterial;
1183
- };
1184
- type ObjectBinding = {
1185
- id: string;
1186
- /** Defaults to `"other"`. */
1187
- type?: ObjectBindingType;
1188
- modelObjectId: string;
1189
- label?: string;
1190
- group?: string;
1191
- tags?: string[];
1192
- status?: ObjectBindingStatus;
1193
- removed?: boolean;
1194
- visible?: boolean;
1195
- selectable?: boolean;
1196
- hoverable?: boolean;
1197
- transform?: ObjectBindingTransform;
1198
- style?: ObjectBindingStyle;
1199
- /** Images and text printed on the object's surface. */
1200
- decals?: ObjectBindingDecal[];
1201
- actions?: ObjectBindingAction[];
1202
- metrics?: Record<string, number>;
1203
- metadata?: Record<string, unknown>;
1204
- cameraState?: ObjectBindingCameraState;
1205
- };
1206
- type ObjectActionEvent = {
1207
- objectId: string;
1208
- action: ObjectBindingAction;
1209
- binding?: ObjectBinding;
1210
- screenX?: number;
1211
- screenY?: number;
1212
- };
1213
- /** A point on an object's surface, in the object's own (local) space. */
1214
- type ObjectSurfacePoint = {
1215
- position: [number, number, number];
1216
- /** The way the surface faces at that point. */
1217
- normal: [number, number, number];
1218
- };
1219
- /** A double-click, right-click, or long-press on a model object. */
1220
- type ObjectPointerEvent = {
1221
- binding: ObjectBinding;
1222
- /** Viewport coordinates, e.g. to place a menu with `position: fixed`. */
1223
- clientX: number;
1224
- clientY: number;
1225
- /** `"mouse"`, `"pen"`, or `"touch"`. */
1226
- pointerType: string;
1227
- /**
1228
- * Where on the object the pointer was, e.g. to place a decal there. Not
1229
- * reported for streamed (3D Tiles) models.
1230
- */
1231
- surface?: ObjectSurfacePoint;
1232
- };
1233
-
1234
- type LicenseStatus = "checking" | "valid" | "invalid";
1235
- interface LicenseResult {
1236
- status: LicenseStatus;
1237
- reason?: string;
1238
- environment?: "development" | "production";
1239
- tier?: string;
1240
- isLocalDomain: boolean;
1241
- }
1242
-
1243
- type ViewerProductOptions = {
1244
- /** Connects your own pricing, stock, cart and quote services. */
1245
- adapter?: ProductCommerceAdapter;
1246
- /** Keep the choices in this URL parameter, so a link reopens the same configuration. */
1247
- urlParam?: string;
1248
- /** Start with the panel closed. On small screens it always starts closed. */
1249
- defaultClosed?: boolean;
1250
- onConfigurationChange?: (configuration: ProductConfiguration, checkoutUrl: string | null) => void;
1251
- };
1252
-
1253
- type ComparisonCategory = "identity" | "appearance" | "transform" | "visibility" | "data" | "behavior" | "scene";
1254
- type ComparisonStatus = "added" | "removed" | "modified" | "unchanged" | "ambiguous";
1255
- type ConfigurationComparisonInput = {
1256
- objectBindings: Record<string, ObjectBinding>;
1257
- sceneConfig?: SceneConfig;
1258
- };
1259
- type SemanticComparisonOptions = {
1260
- /** Default: modelObjectId. Metadata matching is exact and never guesses duplicates. */
1261
- matchBy?: "modelObjectId" | "id" | {
1262
- metadataKey: string;
1263
- };
1264
- /** Explicit binding-key pairs, before key -> after key. Must be one-to-one. */
1265
- mapping?: Record<string, string>;
1266
- /** Absolute tolerance for numeric properties. Default: 0.000001. */
1267
- tolerance?: number;
1268
- ignoreMetadataKeys?: string[];
1269
- };
1270
- type ComparisonChange = {
1271
- path: string;
1272
- category: ComparisonCategory;
1273
- before?: unknown;
1274
- after?: unknown;
1275
- };
1276
- type ComparisonObject = {
1277
- id: string;
1278
- identity: string;
1279
- label: string;
1280
- status: ComparisonStatus;
1281
- beforeKey?: string;
1282
- afterKey?: string;
1283
- beforeObjectId?: string;
1284
- afterObjectId?: string;
1285
- changes: ComparisonChange[];
1286
- message?: string;
1287
- };
1288
- type ConfigurationComparisonReport = {
1289
- version: 1;
1290
- objects: ComparisonObject[];
1291
- counts: Record<ComparisonStatus, number>;
1292
- sceneChanges: ComparisonChange[];
1293
- };
1294
- type ComparisonHighlight = {
1295
- objectId: string;
1296
- color: string;
1297
- };
1298
- /** Compare authored configuration data. Does not infer geometry changes from meshes or URLs. */
1299
- declare function compareViewerConfigurations(before: ConfigurationComparisonInput, after: ConfigurationComparisonInput, options?: SemanticComparisonOptions): ConfigurationComparisonReport;
1300
-
1301
- /** Serializable, controlled viewer props. Assets stay at their durable URLs. */
1302
- type ViewerConfiguration = Pick<ModelViewerProps, "activeModelId" | "modelUrl" | "modelFormat" | "tilesetUrl" | "models" | "mergeModels" | "sceneConfig" | "isolation" | "multiSelectedKeys" | "activeAnnotation" | "annotationCategories" | "backgroundColor" | "shadows" | "cinematic" | "cameraControllerType" | "objectTransformSpace" | "arScaleMode" | "usdzUrl" | "measurements" | "measurementSettings" | "measurementUnit" | "measurementModelId">;
1303
- /** Unversioned camera/visibility/selection links remain readable. */
1304
- type ShareableViewerState = {
1305
- version?: 1;
1306
- camera?: ViewerCameraState;
1307
- hidden?: string[];
1308
- selected?: string | null;
1309
- /** Full bindings, including materials, decals, transforms and metadata. */
1310
- objectBindings?: Record<string, ObjectBinding>;
1311
- configuration?: ViewerConfiguration;
1312
- };
1313
- /** Application-owned persistence. load may return parsed data or saved JSON. */
1314
- type ViewerStateStorage = {
1315
- save: (state: ShareableViewerState) => Promise<string>;
1316
- load: (id: string) => Promise<unknown>;
1317
- };
1318
- declare const MAX_VIEWER_STATE_BYTES: number;
1319
- /** JSON suitable for a file, database or application-owned storage adapter. */
1320
- declare function serializeViewerState(state: ShareableViewerState, baseUrl?: string): string;
1321
- /** Validate portable data. For live blob images use prepareViewerState first. */
1322
- declare function parseViewerState(input: unknown, baseUrl?: string): ShareableViewerState;
1323
- /**
1324
- * Capture live texture/decal/image blobs as data URLs. Models stay at their
1325
- * original durable URLs; no upload service or network asset scraping is used.
1326
- */
1327
- declare function prepareViewerState(input: unknown, baseUrl?: string): Promise<ShareableViewerState>;
1328
-
1329
- type ARSnapshotSource = {
1330
- scene: Object3D;
1331
- instanceId?: string;
1332
- objectBindings?: NonNullable<ShareableViewerState["objectBindings"]>;
1333
- materialOverrides?: Record<string, Material | Material[]>;
1334
- /** Authored autoplay clips and sequences to include in Quick Look. */
1335
- sceneConfig?: Pick<SceneConfig, "animations" | "sequences">;
1336
- };
1337
- type ARExportOptions = {
1338
- scaleMode?: "normalized" | "real-world";
1339
- /** Longest texture dimension, default 2048; from 256 to 4096. */
1340
- maxTextureSize?: number;
1341
- signal?: AbortSignal;
1342
- };
1343
- type ARSnapshot = {
1344
- blob: Blob;
1345
- meshCount: number;
1346
- triangleCount: number;
1347
- /** Applied scale after centering horizontally and resting on Y=0. */
1348
- scale: number;
1349
- warnings: string[];
1350
- };
1351
- type ARHandoffRequest = {
1352
- /** Stable key for this configuration and application-supplied asset version. */
1353
- configurationKey: string;
1354
- /** Detached live data. Local model URLs may still be temporary. */
1355
- state: ShareableViewerState;
1356
- signal: AbortSignal;
1357
- /** Exports the current geometry and supported authored animation to USDZ. */
1358
- exportUSDZ: () => Promise<ARSnapshot>;
1359
- };
1360
- type ARHandoffStatus = "idle" | "preparing" | "ready" | "error" | "stale";
1361
- type ARHandoffOptions = {
1362
- /** Change this when replacing an asset at the same URL, or after direct scene mutations. */
1363
- assetVersion?: string;
1364
- maxTextureSize?: number;
1365
- /** Store large phone configurations using the same adapter in the receiving viewer. */
1366
- storage?: ViewerStateStorage;
1367
- /** Read this feature's configuration hash on arrival. Default true. */
1368
- autoRestore?: boolean;
1369
- /** Application-owned conversion/cache for assets unsupported by the local exporter. */
1370
- createUSDZ?: (request: ARHandoffRequest) => Promise<Blob | string>;
1371
- /** Application-owned upload/sharing path, including support for local model files. */
1372
- createMobileUrl?: (request: ARHandoffRequest) => Promise<string>;
1373
- onStatusChange?: (status: ARHandoffStatus) => void;
1374
- onError?: (error: Error) => void;
1375
- };
1376
-
1377
- /** Whole-instance placement, outside the asset's authored transforms. Radians, source scene units. */
1378
- type AssetTransform = {
1379
- position?: [number, number, number];
1380
- rotation?: [number, number, number];
1381
- scale?: [number, number, number];
1382
- };
1383
- type AssetPlacement = AssetTransform & {
1384
- label?: string;
1385
- visible?: boolean;
1386
- deleted?: boolean;
1387
- };
1388
- /** Standalone editor placement state, keyed by persistent model identity. */
1389
- type SceneComposition = {
1390
- version: 1;
1391
- placements: Record<string, AssetPlacement>;
1392
- gridSize: number;
1393
- };
1394
- declare function parseAssetTransform(value: unknown): AssetTransform;
1395
- /** Snap the instance origin on the shared X/Z plane. */
1396
- declare function snapAssetToGrid(transform: AssetTransform, size: number): AssetTransform;
1397
- /** Place the transformed asset's lowest bound on the Y=0 ground plane. */
1398
- declare function groundAsset(transform: AssetTransform, bounds: {
1399
- min: [number, number, number];
1400
- max: [number, number, number];
1401
- }): AssetTransform;
1402
-
1403
- type PerformanceProfile = "auto" | "high" | "low";
1404
-
1405
- type AssetDiagnosticIssue = {
1406
- code: string;
1407
- severity: "info" | "warning" | "error";
1408
- title: string;
1409
- detail: string;
1410
- suggestion: string;
1411
- count?: number;
1412
- /** At most twenty names, even when a large asset has thousands of affected objects. */
1413
- objects?: string[];
1414
- };
1415
- type AssetDiagnosticsSource = {
1416
- format?: string;
1417
- name?: string;
1418
- sourceBytes?: number | null;
1419
- loadDurationMs?: number | null;
1420
- extensionsUsed?: string[];
1421
- extensionsRequired?: string[];
1422
- failedResources?: string[];
1423
- };
1424
- type AssetTextureDiagnostic = {
1425
- name: string;
1426
- width: number | null;
1427
- height: number | null;
1428
- compressed: boolean;
1429
- /** RGBA8 with mipmaps for ordinary textures; actual mip bytes for compressed textures. */
1430
- estimatedBytes: number | null;
1431
- };
1432
- type AssetDiagnosticsReport = {
1433
- version: 1;
1434
- status: "ready" | "failed";
1435
- scope: "asset" | "resident-tiles";
1436
- source: AssetDiagnosticsSource;
1437
- /** A format convention, not verification of the model author's physical scale. */
1438
- units: "meters (glTF convention)" | "unknown";
1439
- bounds: ViewerModelBounds | null;
1440
- statistics: {
1441
- meshes: number;
1442
- instances: number;
1443
- geometries: number;
1444
- materials: number;
1445
- textures: number;
1446
- /** Unique geometry data, not repeated instances or per-frame rendered triangles. */
1447
- vertices: number;
1448
- triangles: number;
1449
- geometryBytes: number;
1450
- estimatedTextureBytes: number;
1451
- unknownTextureSizes: number;
1452
- meshesWithoutUvs: number;
1453
- meshesWithoutNormals: number;
1454
- } | null;
1455
- textures: AssetTextureDiagnostic[];
1456
- extensions: {
1457
- name: string;
1458
- required: boolean;
1459
- recognized: boolean;
1460
- }[];
1461
- issues: AssetDiagnosticIssue[];
1462
- };
1463
- type InspectAssetOptions = {
1464
- source?: AssetDiagnosticsSource;
1465
- scope?: AssetDiagnosticsReport["scope"];
1466
- };
1467
- type StreamingDiagnostics = {
1468
- cachedBytes: number | null;
1469
- budgetBytes: number;
1470
- cachedTiles: number | null;
1471
- downloading: number;
1472
- parsing: number;
1473
- cacheFull: boolean;
1474
- /** Existing memory-pressure adaptation's multiplier; 1 is the requested detail. */
1475
- detailFactor: number;
1476
- errorTarget: number;
1477
- };
1478
- type ViewerRuntimeStats = {
1479
- sampledAt: string;
1480
- renderer: "webgl" | "webgpu";
1481
- /** Last completed renderer pass; may be a post-processing or shadow pass. */
1482
- drawCalls: number | null;
1483
- triangles: number | null;
1484
- geometries: number | null;
1485
- textures: number | null;
1486
- /** Spacing of consecutive active frame callbacks, not CPU/GPU execution time. */
1487
- frameIntervalMs: number | null;
1488
- fps: number | null;
1489
- frameSamples: number;
1490
- renderMode: "always" | "demand" | "never";
1491
- quality: {
1492
- profile: PerformanceProfile;
1493
- reducedGpuLoad: boolean;
1494
- dpr: number;
1495
- shadows: boolean;
1496
- /** Whether the quality profile/backend permits the post-processing stack. */
1497
- postProcessing: boolean;
1498
- };
1499
- streaming: StreamingDiagnostics | null;
1500
- };
1501
-
1502
- /** Engagement from deliberate viewer interactions, with model/session context. */
1503
- type ViewerEngagementEvent = {
1504
- /** Ephemeral identifier for this viewer/model session; no persistent storage. */
1505
- sessionId: string;
1506
- /** ISO timestamp of the event. */
1507
- timestamp: string;
1508
- /** Milliseconds since tracking started for this model. */
1509
- elapsedMs: number;
1510
- modelUrl: string;
1511
- tilesetUrl: string | null;
1512
- } & ({
1513
- type: "part-viewed";
1514
- objectId: string;
1515
- objectKey: string;
1516
- label?: string;
1517
- source: "canvas" | "panel" | "keyboard";
1518
- } | {
1519
- type: "variant-chosen";
1520
- /** The variant chosen; null when a group's choice was cleared. */
1521
- variant: string | null;
1522
- /** The group's previous choice. */
1523
- previousVariant: string | null;
1524
- /** The option group's name; null for a group without one. */
1525
- group: string | null;
1526
- } | {
1527
- type: "ar-started";
1528
- } | {
1529
- type: "ar-ended";
1530
- durationMs: number;
1531
- reason: "session-ended" | "interrupted";
1532
- } | {
1533
- type: "ar-launch-requested";
1534
- channel: "quick-look" | "mobile-handoff";
1535
- } | {
1536
- type: "tour-started";
1537
- annotationCount: number;
1538
- } | {
1539
- type: "tour-completed";
1540
- annotationCount: number;
1541
- durationMs: number;
1542
- } | {
1543
- type: "tour-stopped";
1544
- annotationCount: number;
1545
- durationMs: number;
1546
- reason: "stopped" | "restarted" | "annotations-changed" | "interrupted";
1547
- });
1548
-
1549
- type MouseControllerPosition = 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right' | 'center' | 'center-bottom' | 'center-top';
1550
-
1551
- type XRScaleMode = "normalized" | "real-world";
1552
-
1553
- /** A starting set of ModelViewer props for a common kind of page. */
1554
- type ModelViewerPreset = "minimal" | "showcase" | "configurator" | "inspector";
1555
- type ModelViewerUiOptions = {
1556
- /** The left panel for the selected object. Default `true`. */
1557
- objectPanel?: boolean;
1558
- /** The right panel listing the model's objects. Default `true`. */
1559
- sceneObjects?: boolean;
1560
- /** The download button; a string also sets the file name. Default `true`. */
1561
- download?: boolean | string;
1562
- /** The reset-view button. Default `true`. */
1563
- reset?: boolean;
1564
- /** The viewer fullscreen toggle in the action bar. Default `false`. */
1565
- fullscreen?: boolean;
1566
- /** The loading overlay and load-error message. Default `true`. */
1567
- loadingOverlay?: boolean;
1568
- /** The axis gizmo in the top-right corner. Default `false`. */
1569
- viewGizmo?: boolean;
1570
- /** The on-screen movement pad; an object also places it. Default `false`. */
1571
- mouseController?: boolean | {
1572
- position?: MouseControllerPosition;
1573
- opacity?: number;
1574
- };
1575
- /** Previous/Stop/Next controls for annotation tours. Default `true`. */
1576
- annotationNavigation?: boolean;
1577
- /** Show an annotation's details when its marker is hovered. Default `false`. */
1578
- annotationOnHover?: boolean;
1579
- /** Category filter chips. Default `true` when annotations have categories. */
1580
- annotationFilters?: boolean;
1581
- /** Highlight objects under the pointer. Default `true`. */
1582
- highlightOnHover?: boolean;
1583
- /** Swatch rows for the model's glTF material variants, one per option group. Default `true`. */
1584
- materialVariants?: boolean;
1585
- /**
1586
- * A tab stop for moving through and selecting objects with the keyboard,
1587
- * shown only while it has focus. Default `true`.
1588
- */
1589
- objectNavigator?: boolean;
1590
- };
1591
- /**
1592
- * Takes over parts of texture positioning (`texturePositioning`). Fields left
1593
- * out keep the viewer's own behavior, which reads and writes the binding.
1594
- */
1595
- type TexturePositioningControls = {
1596
- /** Shown in the Offset fields instead of the binding's offset. */
1597
- offset?: [number, number];
1598
- /** Shown in the Rotation field instead of the binding's, in degrees (0–360). */
1599
- rotationDegrees?: number;
1600
- /** Replaces the viewer's write when an Offset field changes. */
1601
- onOffsetChange?: (objectId: string, axisIndex: 0 | 1, value: number) => void;
1602
- /** Replaces the viewer's write when the Rotation field changes. */
1603
- onRotationChange?: (objectId: string, degrees: number) => void;
1604
- /** Whether to show "Done positioning" rather than the hint. */
1605
- isPositioning?: boolean;
1606
- /** Called after "Done positioning" ends Move/Zoom mode. */
1607
- onEndPositioning?: () => void;
1608
- };
1609
- type ModelViewerToolsOptions = {
1610
- /** Distance and dimension tools; an object also sets the unit. Default `false`. */
1611
- measure?: boolean | {
1612
- unit?: string;
1613
- };
1614
- /** The UV checker toggle. Default `false`. */
1615
- uvChecker?: boolean;
1616
- /** The exploded-view slider. Default `false`. */
1617
- explode?: boolean;
1618
- /** The section-cut tool, to cut the model open along an axis. Default `false`. */
1619
- section?: boolean;
1620
- /** A compact player for authored scene sequences. Default true. */
1621
- sequences?: boolean;
1622
- /** Isolate buttons in the scene objects panel, and a "Show all" pill. Default `false`. */
1623
- isolate?: boolean;
1624
- /** Texture offset, rotation and Move/Zoom for textured objects. Default `false`. */
1625
- texturePositioning?: boolean | TexturePositioningControls;
1626
- };
1627
- type ModelViewerControlsOptions = {
1628
- /** Orbit, pan and zoom with the pointer. Default `true`. */
1629
- enabled?: boolean;
1630
- /** Move the camera with the keyboard while the canvas has focus. Default `false`. */
1631
- keyboard?: boolean;
1632
- /**
1633
- * Cut motion the viewer starts on its own (auto-rotate, cinematic autoplay,
1634
- * camera glides). `"user"` follows the visitor's reduced-motion setting.
1635
- * Default `"user"`.
1636
- */
1637
- reducedMotion?: ReducedMotionSetting;
1638
- /** Allow zooming. Default `true`. */
1639
- zoom?: boolean;
1640
- /** Zoom to an object when it's selected. Default `true`. */
1641
- zoomOnSelect?: boolean;
1642
- /** Turn the model slowly; a number sets the speed (1 is normal). Default `false`. */
1643
- autoRotate?: boolean | number;
1644
- /** Re-frame the model, or the selected object it zoomed to, when the viewer is resized. Default `true`. */
1645
- refitOnResize?: boolean;
1646
- /** Distance, angle and pan limits for the camera. */
1647
- limits?: CameraLimits;
1648
- /** Movement pad speed. Default `0.08`. */
1649
- moveSensitivity?: number;
1650
- /** Movement pad zoom speed. Default `1`. */
1651
- zoomSensitivity?: number;
1652
- };
1653
- type ModelViewerPerfOptions = {
1654
- /** `"demand"` draws only when something changes. Default `"demand"`. */
1655
- renderMode?: "always" | "demand";
1656
- /** Highest device pixel ratio to render at. Default `2`. */
1657
- maxDpr?: number;
1658
- /** `"low"` trades quality for speed on weak devices. Default `"auto"`. */
1659
- profile?: PerformanceProfile;
1660
- /** Needed for Download PNG and captureImage; costs GPU time. Default `false`. */
1661
- preserveDrawingBuffer?: boolean;
1662
- /**
1663
- * Draw with three's WebGPU renderer where the browser has WebGPU, WebGL
1664
- * elsewhere. Leaves out post-processing effects, contact shadows and WebXR.
1665
- * Default `false`.
1666
- */
1667
- webgpu?: boolean;
1668
- };
1669
- type ModelViewerTilesOptions = {
1670
- /** A 3D Tiles `tileset.json` to stream instead of loading `modelUrl` whole. */
1671
- url?: string | null;
1672
- /** Screen-space error target; lower is sharper. Default `8`. */
1673
- errorTarget?: number;
1674
- /** Most parsed tiles kept in memory. Default `800`. */
1675
- cacheSize?: number;
1676
- };
1677
- type ModelViewerXrOptions = {
1678
- /** "View in your space" (AR) and "Enter VR". Default `false`. */
1679
- enabled?: boolean;
1680
- /** A USDZ file for iOS AR Quick Look. */
1681
- usdzUrl?: string;
1682
- /** How the model is sized in AR. Default `"normalized"`. */
1683
- scaleMode?: XRScaleMode;
1684
- /** The page the desktop QR code opens on a phone. Default: the current page. */
1685
- mobileHandoffUrl?: string;
1686
- /** Prepare the edited configuration for USDZ and phone handoff. Opt-in. */
1687
- arHandoff?: boolean | ARHandoffOptions;
1688
- };
1689
- type ModelViewerDecoderOptions = {
1690
- /** Directory of the DRACO decoder files, or `false`. */
1691
- draco?: string | false;
1692
- /** Directory of the Basis/KTX2 transcoder files, or `false`. */
1693
- ktx2?: string | false;
1694
- /** Enable the bundled Meshopt decoder. Default `true`. */
1695
- meshopt?: boolean;
1696
- };
1697
- type GroupedModelViewerProps = {
1698
- /**
1699
- * A starting set of props for a common kind of page. Anything else you pass
1700
- * overrides it.
1701
- */
1702
- preset?: ModelViewerPreset;
1703
- ui?: ModelViewerUiOptions;
1704
- tools?: ModelViewerToolsOptions;
1705
- controls?: ModelViewerControlsOptions;
1706
- perf?: ModelViewerPerfOptions;
1707
- tiles?: ModelViewerTilesOptions;
1708
- xr?: ModelViewerXrOptions;
1709
- decoders?: ModelViewerDecoderOptions;
1710
- };
1711
- /** What each preset sets. Props that aren't listed keep their defaults. */
1712
- declare const MODEL_VIEWER_PRESETS: Readonly<Record<ModelViewerPreset, Readonly<Partial<ModelViewerProps>>>>;
1713
-
1714
- type DecalMoveTarget = {
1715
- objectId: string;
1716
- decal: ObjectBindingDecal;
1717
- onCommit: (surface: ObjectSurfacePoint) => void;
1718
- onCancel: () => void;
1719
- };
1720
-
1721
- type CameraControllerType = "orbit" | "pointerLock";
1722
-
1723
- /** One bindable object in a model, as reported by `onObjectCatalog`. */
1724
- type ViewerObjectInfo = {
1725
- /** The node identifier bindings are keyed by. */
1726
- name: string;
1727
- triangles: number;
1728
- /**
1729
- * Axis-aligned bounds in the model's own units, in Z-up coordinates (the 3D
1730
- * Tiles convention): a glTF point (x, y, z) is (x, -z, y) here.
1731
- */
1732
- minimum: [number, number, number];
1733
- maximum: [number, number, number];
1734
- };
1735
-
1736
- type CinematicWaypoint = {
1737
- position: [number, number, number];
1738
- target: [number, number, number];
1739
- /**
1740
- * Orbit angles in radians, as BindingBuilder captures them: position and
1741
- * target alone can't represent the rotation straight above or below the
1742
- * target. Leave them out when writing waypoints by hand.
1743
- */
1744
- azimuthAngle?: number;
1745
- polarAngle?: number;
1746
- segmentDuration?: number;
1747
- };
1748
- type CinematicConfig = {
1749
- waypoints?: CinematicWaypoint[];
1750
- duration?: number;
1751
- loop?: boolean;
1752
- autoPlay?: boolean;
1753
- };
1754
-
1755
- /** Which three.js renderer draws a viewer. */
1756
- type RendererBackend = "webgl" | "webgpu";
1757
-
1758
- type CaptureImageOptions = {
1759
- width?: number;
1760
- height?: number;
1761
- transparent?: boolean;
1762
- type?: "image/png" | "image/jpeg";
1763
- quality?: number;
1764
- };
1765
-
1766
- type CaptureVideoOptions = {
1767
- /** Defaults to cinematic when a path is enabled, otherwise turntable. */
1768
- mode?: "cinematic" | "turntable";
1769
- /**
1770
- * Auto prefers WebM, then MP4. `"gif"` makes an animated GIF that loops
1771
- * forever. Explicit formats reject if unsupported.
1772
- */
1773
- format?: "auto" | "webm" | "mp4" | "gif";
1774
- /**
1775
- * Seconds per pass, in (0, 300]. Defaults to path timing, or an orbit of
1776
- * 24s (8s for a GIF).
1777
- */
1778
- duration?: number;
1779
- /** Capture frame rate, from 1 to 60. Default 30 (15 for a GIF). */
1780
- fps?: number;
1781
- /** Encoder target bitrate in bits per second. Default 8,000,000. Not used for GIFs. */
1782
- videoBitsPerSecond?: number;
1783
- /**
1784
- * GIF width in pixels, from 16 to 4096; the height follows the canvas. Never
1785
- * wider than the canvas. Default 480.
1786
- */
1787
- gifWidth?: number;
1788
- /** Aborting discards the recording and restores the viewer. */
1789
- signal?: AbortSignal;
1790
- };
1791
-
1792
- type ViewerCameraPreset = {
1793
- position: [number, number, number];
1794
- target: [number, number, number];
1795
- fov?: number | null;
1796
- zoom?: number;
1797
- azimuthAngle?: number;
1798
- polarAngle?: number;
1799
- };
1800
- type UseViewerCameraOptions = {
1801
- /** Camera position applied once when each model becomes ready. */
1802
- initialPosition?: [number, number, number];
1803
- /** Orbit target applied once when each model becomes ready. */
1804
- initialTarget?: [number, number, number];
1805
- /** Whether the initial position/target should animate. Defaults to false. */
1806
- initialTransition?: boolean;
1807
- /** Initial named views, read once. Use setCameraPresets to load later edits. */
1808
- presets?: Record<string, ViewerCameraPreset>;
1809
- };
1810
- type HomeCameraState = {
1811
- position: [number, number, number];
1812
- target: [number, number, number];
1813
- };
1814
- type ViewerReadyState = {
1815
- objectBindings: Record<string, ObjectBinding>;
1816
- homeCameraState: HomeCameraState | null;
1817
- captureImage: (options?: CaptureImageOptions) => Promise<string>;
1818
- /** Whether a streamed model is still fetching tiles for the current view. */
1819
- isLoadingTiles: () => boolean;
1820
- /** Records one cinematic pass or turntable revolution as a video Blob. */
1821
- captureVideo: (options?: CaptureVideoOptions) => Promise<Blob>;
1822
- invalidate: () => void;
1823
- /**
1824
- * The renderer drawing the viewer: "webgpu" only when ModelViewer's
1825
- * `webgpu` asked for it and the browser has WebGPU.
1826
- */
1827
- rendererBackend: RendererBackend;
1828
- /**
1829
- * The live three.js scene, camera-controls instance, and model nodes, for
1830
- * integrations the rest of the API doesn't cover. Their shapes are those
1831
- * libraries' own and can change with them.
1832
- */
1833
- raw: {
1834
- controls: CameraControls;
1835
- scene: Object3D | null;
1836
- /** Model nodes by binding key and node name. */
1837
- nodes: Record<string, Object3D>;
1838
- };
1839
- };
1840
- type ViewerCameraProps = {
1841
- /**
1842
- * Rendering is suspended because the viewer is offscreen. Camera commands
1843
- * still complete: they jump straight to their end instead of animating.
1844
- */
1845
- isRenderPaused: boolean;
1846
- cameraState: ViewerCameraState | null;
1847
- cameraPresets: Record<string, ViewerCameraPreset>;
1848
- /** Replace named views after loading or editing them; does not move the camera. */
1849
- setCameraPresets: (presets: Record<string, ViewerCameraPreset>) => void;
1850
- resetView: () => Promise<boolean>;
1851
- focusObject: (objectId: string) => Promise<boolean>;
1852
- fitScene: () => Promise<boolean>;
1853
- setCameraTarget: (target: [number, number, number], enableTransition?: boolean) => Promise<boolean>;
1854
- setCameraState: (state: ViewerCameraState, enableTransition?: boolean) => Promise<boolean>;
1855
- lookAt: (position: [number, number, number], target: [number, number, number], enableTransition?: boolean) => Promise<boolean>;
1856
- /**
1857
- * Orbits the camera around its target to the given angles, in degrees.
1858
- * Azimuth is the horizontal angle (0 is the front, +Z; 90 the right, +X);
1859
- * polar is the vertical angle (0 straight down, 90 level, 180 straight up).
1860
- */
1861
- orbitTo: (azimuthDegrees: number, polarDegrees: number, enableTransition?: boolean) => Promise<boolean>;
1862
- dollyTo: (distance: number, enableTransition?: boolean) => Promise<boolean>;
1863
- savePreset: (name: string) => ViewerCameraState | null;
1864
- goToPreset: (name: string, enableTransition?: boolean) => Promise<boolean>;
1865
- handleCameraChange: (state: ViewerCameraState) => void;
1866
- handleViewerReady: (viewer: ViewerReadyState) => void;
1867
- };
1868
- declare function useViewerCamera(options?: UseViewerCameraOptions): ViewerCameraProps;
1869
-
1870
- type ObjectTransformSpace = "local" | "world";
1871
-
1872
- type ModelMergeSource = {
1873
- url: string;
1874
- namePrefix: string;
1875
- };
1876
-
1877
- type AnnotationMarker = SceneAnnotationMarker & {
1878
- markerId?: string;
1879
- };
1880
- type CustomObjectBindingDataPanelProps = {
1881
- isOpen: boolean;
1882
- selectedObject: ObjectBinding | null;
1883
- currentAction: ObjectActionEvent | null;
1884
- onClose: () => void;
1885
- onAction: (event: ObjectActionEvent) => void;
1886
- };
1887
- type CustomSceneObjectsPanelProps = {
1888
- objectBindings: Record<string, ObjectBinding>;
1889
- onAction?: (event: ObjectActionEvent) => void;
1890
- onFocus?: (binding: ObjectBinding) => void;
1891
- onHover?: (binding: ObjectBinding | null) => void;
1892
- };
1893
- type ModelViewerProps = GroupedModelViewerProps & {
1894
- /** Plain-text overrides for built-in UI labels. Missing keys use English. */
1895
- labels?: ModelViewerLabels;
1896
- modelUrl: string;
1897
- /**
1898
- * An image shown in the viewer's place until its 3D view is drawn: a render
1899
- * or photo of the model, best framed as the viewer frames it. Fitted inside
1900
- * the viewer; set the CSS variable `--ri-poster-fit: cover` to fill it.
1901
- */
1902
- poster?: string;
1903
- /**
1904
- * `"lazy"` (default) starts the 3D view when the viewer is on or near the
1905
- * screen. When the page needs room for viewers in view, one scrolled away
1906
- * from goes back to a picture of itself, and comes back as it was. `"eager"`
1907
- * starts at once and keeps its view.
1908
- */
1909
- loading?: ViewerLoading;
1910
- /**
1911
- * `"interaction"` keeps the poster, with a "View in 3D" button, until the
1912
- * visitor asks for the 3D view. Default `"auto"`.
1913
- */
1914
- reveal?: ViewerReveal;
1915
- /** Optional 3D Tiles manifest used instead of loading `modelUrl` monolithically. */
1916
- tilesetUrl?: string | null;
1917
- /** Screen-space error target for streamed 3D Tiles. Lower is sharper. */
1918
- tilesErrorTarget?: number;
1919
- /** Maximum number of parsed tiles retained by the client cache. */
1920
- tilesCacheSize?: number;
1921
- /**
1922
- * Every bindable object in the model: each named mesh, under the identifier
1923
- * bindings are keyed by. Reported each time a model loads; for a streamed
1924
- * model it comes from the catalog beside `tileset.json`, before the tiles
1925
- * that contain those objects have necessarily loaded.
1926
- */
1927
- onObjectCatalog?: (objects: ViewerObjectInfo[]) => void;
1928
- /** Explicit format for extensionless or signed model URLs. */
1929
- modelFormat?: ModelFormat;
1930
- licenseKey: string;
1931
- /** License state for application-owned loading and error interfaces. */
1932
- onLicenseStatusChange?: (result: LicenseResult) => void;
1933
- hideLicenseCheckingOverlay?: boolean;
1934
- /**
1935
- * The model's interactive objects, keyed by node name. Defaults to `"auto"`:
1936
- * a default binding for every mesh, generated when the model loads and
1937
- * reported through `onObjectBindingsChange`.
1938
- */
1939
- objectBindings?: Record<string, ObjectBinding> | "auto";
1940
- /**
1941
- * The selected object's binding (an `ObjectBinding`, not a three.js
1942
- * `Object3D`). Pass `null` to control selection with nothing selected.
1943
- */
1944
- selectedObject?: ObjectBinding | null;
1945
- /** Transient bounds outlines for semantic comparison; never modify authored materials. */
1946
- comparisonHighlights?: readonly ComparisonHighlight[];
1947
- /**
1948
- * Binding keys of several selected objects. Each is outlined in green.
1949
- * While set, the single-selection (blue) outline is hidden.
1950
- */
1951
- multiSelectedKeys?: readonly string[];
1952
- /** Explicit nodes to outline together, overriding multiSelectedKeys. */
1953
- selectedObjectRefs?: Object3D[] | null;
1954
- /** Color of the multi-selection outlines. Defaults to green. */
1955
- selectedObjectOutlineColor?: string;
1956
- panelHoveredObject?: ObjectBinding | null;
1957
- onObjectBindingsChange?: (next: Record<string, ObjectBinding>) => void;
1958
- onObjectSelect?: (binding: ObjectBinding | null) => void;
1959
- onObjectHover?: (binding: ObjectBinding | null) => void;
1960
- /**
1961
- * An object was double-clicked. Return `true` to skip the viewer's own
1962
- * double-click behavior: moving the orbit point to that spot, or starting
1963
- * texture positioning when that's enabled.
1964
- */
1965
- onObjectDoubleClick?: (event: ObjectPointerEvent) => boolean | void;
1966
- /** A decal on the model was double-clicked (the editor uses this to enable Move). */
1967
- onDecalDoubleClick?: (binding: ObjectBinding, decalId: string) => void;
1968
- /**
1969
- * An object was right-clicked or, on touch screens, long-pressed. Use it to
1970
- * open your own menu at `clientX`/`clientY`. A right-drag still pans.
1971
- */
1972
- onObjectContextMenu?: (event: ObjectPointerEvent) => void;
1973
- /** Editor preview: grab this decal and drag it over its object's surface. */
1974
- decalMove?: DecalMoveTarget | null;
1975
- /** The model finished loading: its bounds and mesh count. */
1976
- onModelLoaded?: (model: ViewerModelInfo) => void;
1977
- /** Opt-in inspection of the active loaded asset, including its merged nodes. */
1978
- onAssetDiagnostics?: (report: AssetDiagnosticsReport) => void;
1979
- /** Opt-in sampled statistics for this viewer's entire canvas. Does not force frames. */
1980
- onRuntimeStats?: (stats: ViewerRuntimeStats) => void;
1981
- /** Runtime sampling interval, clamped to 250–10000 ms; default 1000 ms. */
1982
- runtimeStatsIntervalMs?: number;
1983
- onLoadError?: (error: unknown) => void;
1984
- onProgress?: (event: ProgressEvent) => void;
1985
- onCameraControllerChange?: (controller: CameraControllerType) => void;
1986
- cameraControllerType?: CameraControllerType;
1987
- onAction?: (event: ObjectActionEvent) => void;
1988
- onHiddenObjectsChange?: (next: Record<string, boolean>) => void;
1989
- /** Opt-in interaction analytics; no telemetry is sent by the viewer. */
1990
- onEngagement?: (event: ViewerEngagementEvent) => void | Promise<void>;
1991
- /** Log engagement events in the developer console. Default `false`. */
1992
- debugEngagement?: boolean;
1993
- /** The camera moved. Fires often while the user orbits, pans or zooms. */
1994
- onCameraChange?: (state: ViewerCameraState) => void;
1995
- onViewerReady?: (viewer: ViewerReadyState) => void;
1996
- onTextureUpload?: (file: File, objectId: string) => Promise<string>;
1997
- onAnimationsReady?: (controls: AnimationControls) => void;
1998
- onModelAnimationsReady?: (url: string, controls: AnimationControls) => void;
1999
- onAnnotationsChange?: (annotations: AnnotationMarker[]) => void;
2000
- activeAnnotation?: AnnotationMarker | null;
2001
- onActiveAnnotationChange?: (annotation: AnnotationMarker | null) => void;
2002
- camera?: ViewerCameraConfig;
2003
- cameraLimits?: CameraLimits;
2004
- backgroundColor?: string;
2005
- shadows?: boolean;
2006
- showObjectBindingDataPanel?: boolean;
2007
- customObjectBindingDataPanel?: (props: CustomObjectBindingDataPanelProps) => ReactNode;
2008
- customSceneObjectsPanel?: (props: CustomSceneObjectsPanelProps) => ReactNode;
2009
- showSceneObjectsPanel?: boolean;
2010
- showDownloadButton?: boolean;
2011
- downloadFilename?: string;
2012
- showResetButton?: boolean;
2013
- /** Fullscreen action button; grouped form: `ui.fullscreen`. Default `false`. */
2014
- showFullscreenButton?: boolean;
2015
- showLoadingOverlay?: boolean;
2016
- showMouseController?: boolean;
2017
- mouseControllerPosition?: MouseControllerPosition;
2018
- mouseControllerOpacity?: number;
2019
- moveSensitivity?: number;
2020
- zoomSensitivity?: number;
2021
- sceneConfig?: SceneConfig;
2022
- disableZoom?: boolean;
2023
- zoomOnSelected?: boolean;
2024
- highlightOnHover?: boolean;
2025
- onAutoFit?: () => Promise<boolean>;
2026
- enableCameraControls?: boolean;
2027
- moveModeEnabled?: boolean;
2028
- /** Shows a draggable corner handle to resize the selected object, independently of moveModeEnabled. */
2029
- scaleModeEnabled?: boolean;
2030
- /** Aligns PivotControls to the scene or to the selected object. */
2031
- objectTransformSpace?: ObjectTransformSpace;
2032
- /** Enables canvas-focused camera shortcuts. Disabled by default. */
2033
- enableKeyboardNavigation?: boolean;
2034
- /**
2035
- * Cuts motion the viewer starts on its own: auto-rotate and cinematic
2036
- * autoplay don't start, and camera moves jump instead of gliding. `"user"`
2037
- * (default) follows the visitor's `prefers-reduced-motion` setting;
2038
- * `"always"` and `"never"` override it.
2039
- */
2040
- reducedMotion?: ReducedMotionSetting;
2041
- refitOnResize?: boolean;
2042
- renderMode?: "always" | "demand";
2043
- maxDpr?: number;
2044
- preserveDrawingBuffer?: boolean;
2045
- webgpu?: boolean;
2046
- performanceProfile?: PerformanceProfile;
2047
- dracoDecoderPath?: string | false;
2048
- ktx2TranscoderPath?: string | false;
2049
- meshopt?: boolean;
2050
- showMeasureTools?: boolean;
2051
- showUvCheckerButton?: boolean;
2052
- showExplodeControls?: boolean;
2053
- isolation?: ViewerIsolation | null;
2054
- onIsolationChange?: (isolation: ViewerIsolation | null) => void;
2055
- showIsolateControls?: boolean;
2056
- showSectionTools?: boolean;
2057
- /**
2058
- * Lets visitors choose from `sceneConfig.product`, in a panel over the model.
2059
- * `true` uses the defaults; an object connects services, links and callbacks.
2060
- */
2061
- productOptions?: boolean | ViewerProductOptions;
2062
- showMaterialVariants?: boolean;
2063
- showObjectNavigator?: boolean;
2064
- cinematic?: boolean | CinematicConfig;
2065
- measurementUnit?: string;
2066
- /** Controlled named measurements; otherwise sceneConfig.measurements or local state. */
2067
- measurements?: SavedMeasurement[];
2068
- onMeasurementsChange?: (measurements: SavedMeasurement[]) => void;
2069
- /** Authored/display units and optional metres-per-unit calibration. */
2070
- measurementSettings?: MeasurementSettings;
2071
- /** Stable asset id for measurements when uploaded files receive new blob URLs. */
2072
- measurementModelId?: string;
2073
- onMeasurementSettingsChange?: (settings: MeasurementSettings) => void;
2074
- enableXR?: boolean;
2075
- usdzUrl?: string;
2076
- arScaleMode?: XRScaleMode;
2077
- mobileHandoffUrl?: string;
2078
- /** Prepare the edited configuration for USDZ and phone handoff. Opt-in. */
2079
- arHandoff?: boolean | ARHandoffOptions;
2080
- /** Receive sequence controls on load, or null when disconnected. */
2081
- onSequencesReady?: (controls: SequenceControls | null) => void;
2082
- /** Show a compact player when sceneConfig contains sequences. Default true. */
2083
- showSequenceControls?: boolean;
2084
- /** Honor sequence autoPlay flags. Default true; reduced motion disables autoplay. */
2085
- sequenceAutoPlay?: boolean;
2086
- showAnnotationNavigation?: boolean;
2087
- showAnnotationOnHover?: boolean;
2088
- showAnnotationFilters?: boolean;
2089
- annotationCategories?: string[] | null;
2090
- onAnnotationCategoriesChange?: (categories: string[] | null) => void;
2091
- onSceneConfigChange?: (config: SceneConfig) => void;
2092
- showViewGizmo?: boolean;
2093
- /**
2094
- * Your own UI over the 3D view: badges, HUDs, custom panels. It sits above
2095
- * the model and below the viewer's toolbars. The layer lets pointer events
2096
- * through to the model; its direct children receive them, so position them
2097
- * yourself (for example `position: "absolute"`).
2098
- */
2099
- overlay?: ReactNode;
2100
- /**
2101
- * react-three-fiber elements rendered inside the scene, for anything the
2102
- * viewer can't do itself. They work with three.js directly, so they're
2103
- * outside the viewer's own API and can break when three.js or
2104
- * react-three-fiber change.
2105
- */
2106
- unsafe_sceneChildren?: ReactNode;
2107
- autoRotate?: boolean;
2108
- autoRotateSpeed?: number;
2109
- /**
2110
- * Texture positioning for objects with an uploaded texture: Offset and
2111
- * Rotation fields in the Change Material panel, and Move/Zoom mode on
2112
- * double-click (drag to move, scroll to scale). Off by default. Pass `true`,
2113
- * or an object to take over parts of it; changes are written to the
2114
- * binding's `style.material.texture`.
2115
- */
2116
- texturePositioning?: boolean | TexturePositioningControls;
2117
- extraModelUrls?: string[];
2118
- onExtraModelError?: (url: string, error: unknown) => void;
2119
- onExtraModelLoaded?: (url: string, scene: Object3D) => void;
2120
- originalNodePoses?: Record<string, {
2121
- position: [number, number, number];
2122
- rotation?: [number, number, number];
2123
- scale?: [number, number, number];
2124
- }>;
2125
- /** Each entry supplies its own bindings. Uncontrolled edits are kept per instance (id ?? url). */
2126
- models?: ModelViewerModelEntry[];
2127
- /** Select an explicit instance ID, allowing several entries to reuse one URL. */
2128
- activeModelId?: string;
2129
- /** Instance switcher callback; preferred over onModelChange in ID mode. */
2130
- onActiveModelChange?: (id: string) => void;
2131
- mergeModels?: ModelMergeSource[];
2132
- onMergeModelLoaded?: (url: string, mergedRoot: Object3D) => void;
2133
- onMergeModelError?: (url: string, error: unknown) => void;
2134
- /** Selects a model from the switcher. The switcher is hidden when omitted. */
2135
- onModelChange?: (url: string) => void;
2136
- };
2137
- type ModelViewerModelEntry = {
2138
- url: string;
2139
- /** Stable unique instance identity. Required when URLs repeat. Object IDs stay local to each instance. */
2140
- id?: string;
2141
- /** Whole-asset placement; independent of node transforms and scene model rotation. */
2142
- transform?: AssetTransform;
2143
- /** Hide this whole instance without changing its object bindings. */
2144
- visible?: boolean;
2145
- /** Display name for the model switcher; falls back to the URL's filename. */
2146
- label?: string;
2147
- /** Bindings for this model; used in preference to top-level objectBindings. */
2148
- objectBindings: Record<string, ObjectBinding>;
2149
- originalNodePoses?: Record<string, {
2150
- position: [number, number, number];
2151
- rotation?: [number, number, number];
2152
- scale?: [number, number, number];
2153
- }>;
2154
- mergeModels?: ModelMergeSource[];
2155
- /** Scene settings for this slot while parked; the active slot uses the viewer's sceneConfig. */
2156
- sceneConfig?: SceneConfig;
2157
- };
2158
-
2159
- export { MATERIAL_SIDES as $, type ARExportOptions as A, type BindingEdit as B, type CameraAction as C, type ComparisonCategory as D, type ComparisonChange as E, type ComparisonHighlight as F, type ComparisonObject as G, type ComparisonStatus as H, type ConfigurationComparisonInput as I, type ConfigurationComparisonReport as J, type CustomObjectBindingDataPanelProps as K, type CustomSceneObjectsPanelProps as L, DEFAULT_SCENE_CONFIG as M, DEFAULT_SECTION_CONFIG as N, type DecalMoveTarget as O, type DeepPartial as P, type EnvironmentPreset as Q, type GlitchModeName as R, type GroupedModelViewerProps as S, type HomeCameraState as T, type InspectAssetOptions as U, type IsolatedObjectBindings as V, type IsolationActionEffect as W, type KernelSizeName as X, type LicenseResult as Y, type LicenseStatus as Z, MATERIAL_BLENDING_MODES as _, type ARHandoffOptions as a, type ProductPrice as a$, MAX_VIEWER_STATE_BYTES as a0, MODEL_VIEWER_PRESETS as a1, type MeasurementAnchor as a2, type MeasurementCollection as a3, type MeasurementPoint as a4, type MeasurementPosition as a5, type MeasurementResult as a6, type MeasurementSettings as a7, type MeasurementStatus as a8, type MeasurementTool as a9, type ObjectBindingTarget as aA, type ObjectBindingTextureChannel as aB, type ObjectBindingTextureSlot as aC, type ObjectBindingTransform as aD, type ObjectBindingType as aE, type ObjectBindingsActionEffect as aF, type ObjectPointerEvent as aG, type ObjectSurfacePoint as aH, type ObjectTransformSpace as aI, type PerformanceProfile as aJ, type ProductAppearance as aK, type ProductAvailability as aL, type ProductCheckoutContext as aM, type ProductCheckoutLink as aN, type ProductCommerceAdapter as aO, type ProductCommerceContext as aP, type ProductCommerceResult as aQ, type ProductConfiguration as aR, type ProductConfigurationIssue as aS, type ProductDefinition as aT, type ProductDefinitionWarning as aU, type ProductGroupDisplay as aV, type ProductOption as aW, type ProductOptionGroup as aX, type ProductOptionRef as aY, type ProductOptionRule as aZ, type ProductOptionState as a_, type MeasurementUnit as aa, type ModelMergeSource as ab, type ModelViewerControlsOptions as ac, type ModelViewerDecoderOptions as ad, type ModelViewerModelEntry as ae, type ModelViewerPerfOptions as af, type ModelViewerPreset as ag, type ModelViewerProps as ah, type ModelViewerTilesOptions as ai, type ModelViewerToolsOptions as aj, type ModelViewerUiOptions as ak, type ModelViewerXrOptions as al, type MouseControllerPosition as am, type ObjectActionEffect as an, type ObjectActionEvent as ao, type ObjectBinding as ap, type ObjectBindingAction as aq, type ObjectBindingCameraState as ar, type ObjectBindingDecal as as, type ObjectBindingMaterial as at, type ObjectBindingMaterialBlendingMode as au, type ObjectBindingMaterialSide as av, type ObjectBindingPatch as aw, type ObjectBindingSelector as ax, type ObjectBindingStatus as ay, type ObjectBindingStyle as az, type ARHandoffRequest as b, type ViewerCameraProps as b$, type ProductPricing as b0, type ProductSelections as b1, type ProductSku as b2, type RampTypeName as b3, type RendererBackend as b4, type SavedMeasurement as b5, type SceneAnimationClipConfig as b6, type SceneAnimationConfig as b7, type SceneAnnotationCameraView as b8, type SceneAnnotationImage as b9, type SceneSequence as bA, type SceneShadowConfig as bB, type SceneStyleColorScale as bC, type SceneStyleCondition as bD, type SceneStylePulse as bE, type SceneStyleRule as bF, type SceneWireframeConfig as bG, type SemanticComparisonOptions as bH, type SequenceCameraView as bI, type SequenceControls as bJ, type SequenceEasing as bK, type SequenceKeyframe as bL, type SequenceObjectProperty as bM, type SequencePlaybackState as bN, type SequenceTarget as bO, type SequenceTrack as bP, type SequenceValue as bQ, type SequenceVector3 as bR, type ShareableViewerState as bS, type StreamingDiagnostics as bT, type StyledObjectBindings as bU, type StyledObjectPulse as bV, type TexturePositioningControls as bW, type UseViewerCameraOptions as bX, type ViewerAnimationsProps as bY, type ViewerCameraConfig as bZ, type ViewerCameraPreset as b_, type SceneAnnotationLink as ba, type SceneAnnotationMarker as bb, type SceneBackgroundConfig as bc, type SceneCameraConfig as bd, type SceneCinematicConfig as be, type SceneCinematicWaypoint as bf, type SceneComposition as bg, type SceneConfig as bh, type SceneConfigActionEffect as bi, type SceneConfigPatch as bj, type SceneEnvironmentConfig as bk, type SceneGroundShadowConfig as bl, type SceneLight as bm, type SceneLightAttachment as bn, type SceneLightType as bo, type SceneLightingConfig as bp, type SceneModelConfig as bq, type SceneModelRenderer as br, type ScenePostProcessingConfig as bs, type SceneProductConfig as bt, type SceneSectionAxis as bu, type SceneSectionConfig as bv, type SceneSectionPlane as bw, type SceneSectionPreset as bx, type SceneSectionSettings as by, type SceneSelectionSet as bz, type ARHandoffStatus as c, type ViewerCameraState as c0, type ViewerConfiguration as c1, type ViewerEngagementEvent as c2, type ViewerIsolation as c3, type ViewerObjectInfo as c4, type ViewerProductOptions as c5, type ViewerReadyState as c6, type ViewerRuntimeStats as c7, type ViewerStateStorage as c8, type VisibilityActionEffect as c9, type XRScaleMode as ca, applyIsolation as cb, applyStyleRules as cc, colorScaleValue as cd, compareViewerConfigurations as ce, groundAsset as cf, isolatedBindingKeys as cg, material as ch, parseAssetTransform as ci, parseSelectionSets as cj, parseViewerState as ck, patchBindings as cl, patchSceneConfig as cm, prepareViewerState as cn, selectBindingKeys as co, selectBindings as cp, serializeViewerState as cq, snapAssetToGrid as cr, useViewerAnimations as cs, useViewerCamera as ct, type ARSnapshot as d, type ARSnapshotSource as e, type AnimationAction as f, type AnimationActionEffect as g, type AnimationClipInfo as h, type AnimationClipState as i, type AnimationClipStatus as j, type AnimationControls as k, type AnimationLoopMode as l, type AnimationPlayOptions as m, type AnimationPlaybackState as n, type AnnotationMarker as o, type AssetDiagnosticIssue as p, type AssetDiagnosticsReport as q, type AssetDiagnosticsSource as r, type AssetTextureDiagnostic as s, type AssetTransform as t, type CameraActionEffect as u, type CameraControllerType as v, type CaptureImageOptions as w, type CaptureVideoOptions as x, type CinematicConfig as y, type CinematicWaypoint as z };