import * as react from 'react'; import { l as ModelViewerProps, r as ViewerCameraProps, t as ViewerReadyState, b as CaptureImageOptions, c as CaptureVideoOptions, U as UseViewerCameraOptions } from './modelViewerProps-CIZ2R_Fv.js'; export { A as AnnotationMarker, C as CameraControllerType, a as CameraLimits, d as CinematicConfig, e as CinematicWaypoint, f as CustomObjectBindingDataPanelProps, g as CustomSceneObjectsPanelProps, D as DecalMoveTarget, G as GroupedModelViewerProps, H as HomeCameraState, M as MODEL_VIEWER_PRESETS, h as ModelViewerControlsOptions, i as ModelViewerDecoderOptions, j as ModelViewerPerfOptions, k as ModelViewerPreset, m as ModelViewerTilesOptions, n as ModelViewerToolsOptions, o as ModelViewerUiOptions, p as ModelViewerXrOptions, q as MouseControllerPosition, O as ObjectTransformSpace, P as PerformanceProfile, T as TexturePositioningControls, V as ViewerCameraPreset, s as ViewerEngagementEvent, X as XRScaleMode, u as useViewerCamera } from './modelViewerProps-CIZ2R_Fv.js'; import { o as ObjectBinding, z as ObjectBindingTarget, v as ObjectBindingPatch, B as BindingEdit, s as ObjectBindingMaterial, H as ObjectBindingTextureSlot, F as ObjectBindingTextureChannel, J as ObjectBindingTransform, r as ObjectBindingDecal, a1 as SceneConfig, a3 as SceneConfigPatch, a6 as SceneLight, a7 as SceneLightAttachment, aq as ViewerIsolation, p as ObjectBindingAction, n as ObjectActionEvent, an as ViewerAnimationsProps, ar as ViewerObjectInfo, ap as ViewerCameraState } from './rendererBackend-QwMzISTn.js'; export { A as AnimationAction, a as AnimationActionEffect, b as AnimationClipInfo, c as AnimationClipState, d as AnimationClipStatus, e as AnimationControls, f as AnimationLoopMode, g as AnimationPlayOptions, h as AnimationPlaybackState, C as CameraAction, i as CameraActionEffect, D as DEFAULT_SCENE_CONFIG, j as DEFAULT_SECTION_CONFIG, k as DeepPartial, E as EnvironmentPreset, G as GlitchModeName, I as IsolatedObjectBindings, l as IsolationActionEffect, K as KernelSizeName, M as MATERIAL_BLENDING_MODES, m as MATERIAL_SIDES, O as ObjectActionEffect, q as ObjectBindingCameraState, t as ObjectBindingMaterialBlendingMode, u as ObjectBindingMaterialSide, w as ObjectBindingSelector, x as ObjectBindingStatus, y as ObjectBindingStyle, L as ObjectBindingType, N as ObjectBindingsActionEffect, P as ObjectPointerEvent, Q as ObjectSurfacePoint, R as RampTypeName, S as RendererBackend, T as SceneAnimationClipConfig, U as SceneAnimationConfig, V as SceneAnnotationCameraView, W as SceneAnnotationImage, X as SceneAnnotationLink, Y as SceneAnnotationMarker, Z as SceneBackgroundConfig, _ as SceneCameraConfig, $ as SceneCinematicConfig, a0 as SceneCinematicWaypoint, a2 as SceneConfigActionEffect, a4 as SceneEnvironmentConfig, a5 as SceneGroundShadowConfig, a8 as SceneLightType, a9 as SceneLightingConfig, aa as SceneModelConfig, ab as SceneModelRenderer, ac as ScenePostProcessingConfig, ad as SceneSectionAxis, ae as SceneSectionConfig, af as SceneShadowConfig, ag as SceneStyleColorScale, ah as SceneStyleCondition, ai as SceneStylePulse, aj as SceneStyleRule, ak as SceneWireframeConfig, al as StyledObjectBindings, am as StyledObjectPulse, ao as ViewerCameraConfig, as as VisibilityActionEffect, at as applyIsolation, au as applyStyleRules, av as colorScaleValue, aw as isolatedBindingKeys, ax as material, ay as patchBindings, az as patchSceneConfig, aA as selectBindingKeys, aB as selectBindings, aC as useViewerAnimations } from './rendererBackend-QwMzISTn.js'; import { SceneLightInput } from './utils.js'; export { ACTION_CATALOG, ActionCatalogEntry, ActionHandling, ObjectBindingActionId, ObjectBindingKey, buildBindingsFromNodes, createDefaultBinding, defineObjectBindings, findCatalogAction, inferType, sceneLight } from './utils.js'; import { a as ViewerModelBounds, b as ViewerModelInfo } from './modelInfo-XfUQO7C_.js'; export { M as ModelFormat, V as ViewerLoading, c as ViewerReveal } from './modelInfo-XfUQO7C_.js'; import { M as MaterialVariantGroup } from './materialVariants-DnZe9eMC.js'; export { D as DEFAULT_MODEL_VIEWER_LABELS, a as MaterialVariantOption, b as ModelViewerLabelKey, c as ModelViewerLabels, R as ReducedMotionSetting, d as chooseMaterialVariant } from './materialVariants-DnZe9eMC.js'; import '@react-three/drei'; import 'three'; declare function PublicModelViewer(props: ModelViewerProps): react.JSX.Element; /** One side of a comparison: any ModelViewer props, over the shared ones. */ type CompareViewerSide = Partial & { /** Shown over this side. Defaults to "Before" and "After". */ label?: string; }; type CompareViewerProps = Partial & { licenseKey: string; /** The left side: the shared props with these on top. */ before: CompareViewerSide; /** The right side. */ after: CompareViewerSide; /** * `"slider"` lays the two views over each other with a divider to drag * across; `"side-by-side"` shows them next to each other. Default * `"slider"`. */ layout?: "slider" | "side-by-side"; /** Where the slider's divider is, from 0 (left edge) to 1. Default 0.5. */ split?: number; onSplitChange?: (split: number) => void; }; /** * Two ModelViewers showing two configurations of a model (or two models) with * one camera: moving either view moves both. */ declare function CompareViewer(props: CompareViewerProps): react.JSX.Element; type HiddenObjectsState = Record; type ObjectBindingsController = { objectBindings: Record; setObjectBindings: React.Dispatch>>; updateObjectBindings: { (target: ObjectBindingTarget, patch: ObjectBindingPatch): void; (edits: BindingEdit[]): void; }; setMaterial: (target: ObjectBindingTarget, material: ObjectBindingMaterial) => void; setBaseColor: (target: ObjectBindingTarget, color: string) => void; setTexture: (target: ObjectBindingTarget, texture: string | ObjectBindingTextureSlot, channel?: ObjectBindingTextureChannel) => void; clearTexture: (target: ObjectBindingTarget, channel?: ObjectBindingTextureChannel) => void; copyMaterial: (source: string, target: ObjectBindingTarget) => void; resetMaterial: (target: ObjectBindingTarget) => void; getMaterial: (objectId: string) => ObjectBindingMaterial | null; setTransform: (target: ObjectBindingTarget, transform: ObjectBindingTransform) => void; resetTransform: (target: ObjectBindingTarget) => void; updateMetadata: (target: ObjectBindingTarget, metadata: Record) => void; /** * Prints an image or text on the target objects and returns the decal's id * (the one passed, or a generated one). */ addDecal: (target: ObjectBindingTarget, decal: Omit & { id?: string; }) => string; updateDecal: (target: ObjectBindingTarget, decalId: string, patch: Partial>) => void; removeDecal: (target: ObjectBindingTarget, decalId: string) => void; selectObjectBindings: (target: ObjectBindingTarget) => ObjectBinding[]; selectObjectBindingIds: (target: ObjectBindingTarget) => string[]; hiddenObjects: HiddenObjectsState; hiddenObjectIds: string[]; hideObject: (target: ObjectBindingTarget) => void; showObject: (target: ObjectBindingTarget) => void; toggleObjectVisibility: (target: ObjectBindingTarget) => void; isObjectHidden: (objectId: string) => boolean; clearHiddenObjects: () => void; }; /** * Owns object-binding state and exposes field-level, material, and visibility * operations over the same functional state updater. * * Consecutive calls in the same tick compose instead of overwriting each other, * including calls across material and visibility concerns. */ declare function useObjectBindings(initialBindings: Record | (() => Record)): ObjectBindingsController; type SceneConfigUpdate = SceneConfigPatch | ((current: SceneConfig) => SceneConfigPatch); type SceneConfigController = { sceneConfig: SceneConfig; setSceneConfig: React.Dispatch>; updateSceneConfig: (update: SceneConfigUpdate) => void; resetSceneConfig: () => void; lights: SceneLightsController; }; type SceneLightPatch = Partial>; type SceneLightsController = { items: SceneLight[]; get: (id: string) => SceneLight | undefined; add: (light: SceneLightInput) => void; update: (id: string, patch: SceneLightPatch) => void; remove: (id: string) => void; setIntensity: (id: string, intensity: number) => void; setColor: (id: string, color: string) => void; show: (id: string) => void; hide: (id: string) => void; toggle: (id: string) => void; attach: (id: string, attachment: SceneLightAttachment) => void; detach: (id: string) => void; }; /** * Owns scene-config state and applies nested patches through functional React * updates, so consecutive calls in the same tick compose safely. */ declare function useSceneConfig(initialSceneConfig: SceneConfig | (() => SceneConfig)): SceneConfigController; type ViewerIsolationProps = { /** The current isolation, or `null` when every object shows normally. */ isolation: ViewerIsolation | null; /** Focuses on the target's objects, ghosting (or hiding) the rest. */ isolate: (target: ObjectBindingTarget, options?: Omit) => void; clearIsolation: () => void; /** Pass to `ModelViewer`'s `onIsolationChange`. */ handleIsolationChange: (isolation: ViewerIsolation | null) => void; }; /** * State for `ModelViewer`'s `isolation` prop: * * ```tsx * const isolation = useViewerIsolation(); * ; * isolation.isolate({ group: "engine" }); * ``` */ declare function useViewerIsolation(initialIsolation?: ViewerIsolation | null): ViewerIsolationProps; type ViewerActionBindingsController = Pick; type ViewerActionSceneController = Pick; type ViewerActionCameraController = Pick; type ViewerActionAnimationController = Pick; type ViewerActionIsolationController = Pick; type ViewerActionsOptions = { bindings: ViewerActionBindingsController; scene?: ViewerActionSceneController; camera?: ViewerActionCameraController; animations?: ViewerActionAnimationController; isolation?: ViewerActionIsolationController; onAction?: (event: ObjectActionEvent) => void | Promise; }; type ViewerActionsProps = { getActionsForObject: (objectId: string) => ObjectBindingAction[]; handleAction: (event: ObjectActionEvent) => Promise; runAction: (objectId: string, actionId: string) => Promise; }; /** * Resolves object actions and executes their declarative binding, scene, * visibility, camera, and animation effects in declaration order. */ declare function useViewerActions({ bindings, scene, camera, animations, isolation, onAction, }: ViewerActionsOptions): ViewerActionsProps; type ViewerReadyHandler = (viewer: ViewerReadyState) => void; type ViewerReadyConsumer = ViewerReadyHandler | { handleViewerReady: ViewerReadyHandler; } | null | undefined; type ViewerConnectionController = { /** The single callback to pass to ModelViewer's onViewerReady prop. */ handleViewerReady: ViewerReadyHandler; /** Returns the latest live viewer without causing camera-change rerenders. */ getViewer: () => ViewerReadyState | null; /** Captures the connected viewer, or rejects when it is not ready yet. */ captureImage: (options?: CaptureImageOptions) => Promise; /** Records the connected viewer, or rejects when not ready/unsupported. */ captureVideo: (options?: CaptureVideoOptions) => Promise; /** Requests a frame from the connected viewer. */ invalidate: () => boolean; }; /** * Composes camera, effects, and custom viewer-ready consumers into one typed * ModelViewer connection. Pass the returned handleViewerReady to ModelViewer. */ declare function useViewerConnection(...consumers: readonly ViewerReadyConsumer[]): ViewerConnectionController; type ViewerEffectTarget = ObjectBindingTarget; type ViewerVector3 = readonly [number, number, number]; type ViewerEffectRange = readonly [number, number]; type RuntimeMaterialPatch = { baseColor?: string; emissive?: string; emissiveIntensity?: number; opacity?: number; metalness?: number; roughness?: number; transmission?: number; clearcoat?: number; clearcoatRoughness?: number; ior?: number; thickness?: number; transparent?: boolean; }; type RuntimeTransformPatch = { position?: ViewerVector3; rotation?: ViewerVector3; scale?: ViewerVector3 | number; visible?: boolean; }; type RuntimeMaterialRanges = Partial>; type RuntimeTransformRanges = { position?: readonly [ViewerVector3, ViewerVector3]; rotation?: readonly [ViewerVector3, ViewerVector3]; scale?: readonly [ViewerVector3, ViewerVector3]; }; type ViewerMaterialEffectChannel = { targets: ViewerEffectTarget; values: RuntimeMaterialRanges; }; type ViewerTransformEffectChannel = { targets: ViewerEffectTarget; values: RuntimeTransformRanges; }; type ViewerLightEffectChannel = { lights: string | readonly string[]; intensity: ViewerEffectRange; }; type ViewerEffectChannels = { materials?: ViewerMaterialEffectChannel[]; transforms?: ViewerTransformEffectChannel[]; lights?: ViewerLightEffectChannel[]; }; type ViewerEffectEasing = "linear" | "ease-in" | "ease-out" | "ease-in-out"; type ViewerTransitionOptions = { id?: string; duration?: number; easing?: ViewerEffectEasing; onComplete?: () => void; }; type ViewerTimelineStep = { channels: ViewerEffectChannels; duration: number; hold?: number; easing?: ViewerEffectEasing; }; type ViewerTimelineOptions = { id?: string; repeat?: number; onComplete?: () => void; }; type ViewerPulseOptions = { id?: string; duration?: number; minLevel?: number; maxLevel?: number; repeat?: number; synchronized?: boolean; onComplete?: () => void; }; type ViewerFlickerOptions = { id?: string; minLevel?: number; maxLevel?: number; interval?: number | ViewerEffectRange; response?: number; blackoutChance?: number; flashChance?: number; flashLevel?: number; synchronized?: boolean; duration?: number; onComplete?: () => void; }; type RuntimePointLightOptions = { id: string; target: string; color?: string; intensity?: number; distance?: number; decay?: number; offset?: ViewerVector3; castShadow?: boolean; }; type RuntimePointLightPatch = Partial>; type UseViewerEffectsOptions = { onViewerReady?: (viewer: ViewerReadyState) => void; }; type ViewerEffectsController = { handleViewerReady: (viewer: ViewerReadyState) => void; setMaterial: (target: ViewerEffectTarget, patch: RuntimeMaterialPatch) => boolean; setTransform: (target: ViewerEffectTarget, patch: RuntimeTransformPatch) => boolean; getWorldPosition: (target: string) => ViewerVector3 | null; addPointLight: (options: RuntimePointLightOptions) => boolean; updatePointLight: (id: string, patch: RuntimePointLightPatch) => boolean; removePointLight: (id: string) => boolean; transition: (channels: ViewerEffectChannels, options?: ViewerTransitionOptions) => string; timeline: (steps: readonly ViewerTimelineStep[], options?: ViewerTimelineOptions) => string; pulse: (channels: ViewerEffectChannels, options?: ViewerPulseOptions) => string; flicker: (channels: ViewerEffectChannels, options?: ViewerFlickerOptions) => string; overrideEffect: (id: string, level: number, duration: number) => boolean; stopEffect: (id: string) => boolean; stopAllEffects: () => void; resetRuntime: () => void; }; /** * Applies live material, transform, and point-light effects without putting * frame-by-frame values in React state or exposing Three.js objects to the app. */ declare function useViewerEffects(options?: UseViewerEffectsOptions): ViewerEffectsController; type ViewerHoverProps = { hoveredObjectBinding: ObjectBinding | null; handleHoveredObject: (binding: ObjectBinding | null) => void; }; declare function useViewerHover(): ViewerHoverProps; type ViewerModelProps = { isLoading: boolean; isReady: boolean; error: unknown; bounds: ViewerModelBounds | null; objectCount: number; /** * The model's glTF material variants, by name; empty when it has none. Show * them by setting `sceneConfig.model.activeVariants`. */ materialVariants: string[]; /** The same variants as option groups, with labels and swatches. */ materialVariantGroups: MaterialVariantGroup[]; /** * Every bindable object in the model (see `ViewerObjectInfo`). Filled by * `handleObjectCatalog`, so pass that to `ModelViewer`'s `onObjectCatalog`. */ objects: ViewerObjectInfo[]; handleModelLoaded: (model: ViewerModelInfo) => void; handleObjectCatalog: (objects: ViewerObjectInfo[]) => void; handleLoadError: (error: unknown) => void; resetModelState: () => void; }; declare function useViewerModel(): ViewerModelProps; type ViewerSelectionProps = { selectedObjectBinding: ObjectBinding | null; setSelectedObjectBinding: (binding: ObjectBinding | null) => void; handleObjectSelect: (binding: ObjectBinding | null) => void; clearSelection: () => void; }; declare function useViewerSelection(initialSelectedObjectBinding?: ObjectBinding | null): ViewerSelectionProps; type UseViewerOptions = { /** * The starting bindings. Defaults to `"auto"`: a binding for every mesh, * generated when the model loads. */ bindings?: Record | (() => Record) | "auto"; /** The starting scene config (lighting, environment, post-processing, ...). */ sceneConfig?: SceneConfig | (() => SceneConfig); /** Initial camera position, target and named presets. */ camera?: UseViewerCameraOptions; /** Called for every action button, after built-in behavior and effects. */ onAction?: (event: ObjectActionEvent) => void | Promise; onObjectSelect?: (binding: ObjectBinding | null) => void; onObjectHover?: (binding: ObjectBinding | null) => void; onLoadError?: (error: unknown) => void; }; /** The ModelViewer props that connect it to `useViewer`; spread them onto it. */ type UseViewerProps = Required> & { isolation: ModelViewerProps["isolation"]; objectBindings: Record; sceneConfig?: SceneConfig; onSceneConfigChange: (config: SceneConfig) => void; }; type UseViewerResult = { /** Spread onto ModelViewer: ``. */ props: UseViewerProps; bindings: ObjectBindingsController; selection: ViewerSelectionProps; hover: ViewerHoverProps; camera: ViewerCameraProps; model: ViewerModelProps; animations: ViewerAnimationsProps; actions: ViewerActionsProps; scene: SceneConfigController; /** Focus on some objects, ghosting or hiding the rest. */ isolation: ViewerIsolationProps; effects: ViewerEffectsController; /** The live viewer, image/video capture and redraw requests. */ connection: ViewerConnectionController; }; /** * All of the viewer hooks in one, already connected to each other and to * ModelViewer: * * ```tsx * const viewer = useViewer(); * ; * viewer.bindings.setBaseColor({ group: "paint" }, "#b91c1c"); * ``` * * Each part is the result of the hook it's named after (`viewer.camera` is * `useViewerCamera()`'s result, and so on), so everything those hooks offer is * available here too. */ declare function useViewer(options?: UseViewerOptions): UseViewerResult; declare function useObjectBinding(objectBindings: Record, objectId: string | null | undefined): ObjectBinding | null; declare function useObjectBindingIds(objectBindings: Record): string[]; type UseShareableViewerStateOptions = { cameraState: ViewerCameraState | null; setCameraState: (state: ViewerCameraState, enableTransition?: boolean) => Promise; objectBindings: Record; onObjectBindingsChange: (next: Record) => void; selectedObjectBinding: ObjectBinding | null; setSelectedObjectBinding: (binding: ObjectBinding | null) => void; paramKey?: string; debounceMs?: number; autoSync?: boolean; }; type ShareableViewerStateProps = { getShareUrl: () => string; syncUrl: () => void; restoreFromUrl: () => Promise; }; declare function useShareableViewerState({ cameraState, setCameraState, objectBindings, onObjectBindingsChange, selectedObjectBinding, setSelectedObjectBinding, paramKey, debounceMs, autoSync, }: UseShareableViewerStateOptions): ShareableViewerStateProps; export { BindingEdit, CaptureImageOptions, CaptureVideoOptions, CompareViewer, type CompareViewerProps, type CompareViewerSide, type HiddenObjectsState, MaterialVariantGroup, PublicModelViewer as ModelViewer, ModelViewerProps, ObjectActionEvent, ObjectBinding, ObjectBindingAction, ObjectBindingDecal, ObjectBindingMaterial, ObjectBindingPatch, ObjectBindingTarget, ObjectBindingTextureChannel, ObjectBindingTextureSlot, ObjectBindingTransform, type ObjectBindingsController, type RuntimeMaterialPatch, type RuntimeMaterialRanges, type RuntimePointLightOptions, type RuntimePointLightPatch, type RuntimeTransformPatch, type RuntimeTransformRanges, SceneConfig, type SceneConfigController, SceneConfigPatch, type SceneConfigUpdate, SceneLight, SceneLightAttachment, SceneLightInput, type SceneLightPatch, type SceneLightsController, type ShareableViewerStateProps, type UseShareableViewerStateOptions, UseViewerCameraOptions, type UseViewerEffectsOptions, type UseViewerOptions, type UseViewerProps, type UseViewerResult, type ViewerActionAnimationController, type ViewerActionBindingsController, type ViewerActionCameraController, type ViewerActionIsolationController, type ViewerActionSceneController, type ViewerActionsOptions, type ViewerActionsProps, ViewerAnimationsProps, ViewerCameraProps, ViewerCameraState, type ViewerConnectionController, type ViewerEffectChannels, type ViewerEffectEasing, type ViewerEffectRange, type ViewerEffectTarget, type ViewerEffectsController, type ViewerFlickerOptions, type ViewerHoverProps, ViewerIsolation, type ViewerIsolationProps, type ViewerLightEffectChannel, type ViewerMaterialEffectChannel, ViewerModelBounds, ViewerModelInfo, type ViewerModelProps, ViewerObjectInfo, type ViewerPulseOptions, type ViewerReadyConsumer, type ViewerReadyHandler, ViewerReadyState, type ViewerSelectionProps, type ViewerTimelineOptions, type ViewerTimelineStep, type ViewerTransformEffectChannel, type ViewerTransitionOptions, type ViewerVector3, useObjectBinding, useObjectBindingIds, useObjectBindings, useSceneConfig, useShareableViewerState, useViewer, useViewerActions, useViewerConnection, useViewerEffects, useViewerHover, useViewerIsolation, useViewerModel, useViewerSelection };