import * as react from 'react'; import { MutableRefObject, ReactNode } from 'react'; import { P as ObjectBinding, aE as SceneConfig } from './modelFileResolver-An1aQ0D3.js'; import { P as ModelViewerProps, Y as SceneComposition, K as ModelViewerModelEntry } from './modelViewerProps-H_K454u_.js'; import { B as BindingBuilderProps } from './publicProps-AdNUI06n.js'; import { Object3D } from 'three'; import '@react-three/drei'; declare const TEXTURE_KEYS: readonly ["texture", "metalnessMap", "roughnessMap", "emissiveMap", "alphaMap", "normalMap", "bumpMap", "aoMap", "displacementMap", "clearcoatMap", "clearcoatRoughnessMap", "clearcoatNormalMap", "anisotropyMap", "transmissionMap", "thicknessMap", "sheenColorMap", "sheenRoughnessMap", "specularIntensityMap", "specularColorMap"]; type MaterialTextureKey = (typeof TEXTURE_KEYS)[number]; /** * The full viewer's props: the public ones plus those only Liveroom's project * editor passes, through the "/hosted" entry. The published ModelViewer * (PublicModelViewer.tsx) drops the rest; publicProps.ts lists them. */ type ProjectModelViewerProps = ModelViewerProps & { /** * Validates the licence against this deployment's own API rather than the * licence service. The response must carry a grant signed by the licence * service, so this cannot approve a licence by itself. */ licenseValidationUrl?: string; /** A phone handoff page with one action to start AR. */ arLanding?: boolean; /** An explicit clear command, distinct from clicking empty canvas space. */ onSelectionClear?: () => void; /** A click on empty canvas space, away from the model. */ onEmptyCanvasClick?: () => void; /** Reports transform-gizmo edit leases for collaborative hosts. */ /** In the editor: a reference floor under the model. */ showFloorGrid?: boolean; /** In the editor: show only move or only rotate handles. */ gizmoTool?: "move" | "rotate"; onObjectEditLeaseChange?: (binding: ObjectBinding, editing: boolean) => void; /** The loaded three.js scene, which the editor builds bindings from. */ onSceneLoaded?: (scene: Object3D) => void; /** * Reports the object and texture slot being repositioned in Move/Zoom mode * (double-click a textured object), or null once it ends, so the editor's * texture fields know positioning is live. */ onTexturePositioningChange?: (target: { objectKey: string; textureKey: MaterialTextureKey; } | null) => void; /** * Receives a function that ends Move/Zoom mode the way a plain canvas click * does, for the editor's own "Done positioning" button. */ endTexturePositioningRef?: MutableRefObject<(() => void) | null>; }; declare function ProjectModelViewer(props: ProjectModelViewerProps): react.JSX.Element; /** Settings whose names or positions belong to a particular model. */ type ModelSettings = Pick & { activeVariants?: string[]; }; /** Where a model's files are: what an upload returns. */ type BindingBuilderModelSource = { url: string; name?: string; assetId?: string | null; /** * Optional streamable model manifest. The current viewer uses `url`; large * model renderers can use this value without changing the saved project * shape. */ tilesetUrl?: string | null; assetVersion?: string | null; }; /** One model of a project. Its `url` identifies it within the project. */ type BindingBuilderProjectModel = BindingBuilderModelSource & { objectBindings: Record; /** Files whose nodes were spliced into this model. */ mergeModels?: { url: string; assetId?: string | null; namePrefix: string; }[]; /** The scene settings that belong to this model, such as its annotations. */ modelSettings?: ModelSettings; }; type BindingBuilderProject = { id: string; revision: number; /** In display order. A removed model stays, marked deleted in `composition`. */ models: BindingBuilderProjectModel[]; /** Each model's placement, keyed by `url:`. */ composition: SceneComposition; /** The settings all the models share. */ sceneConfig: SceneConfig; }; type BindingBuilderProjectSnapshot = { projectId: string; baseRevision: number; models: BindingBuilderProjectModel[]; composition: SceneComposition; sceneConfig: SceneConfig; }; type BindingBuilderProjectChangeOrigin = "local" | "remote"; /** * The full editor's props: the public ones plus those only Liveroom's project * editor passes, through the "/hosted" entry. The published BindingBuilder * (BindingBuilder.tsx) neither declares nor forwards the rest. */ type ProjectBindingBuilderProps = BindingBuilderProps & { /** The host's own status (collaboration, sharing), shown in the top bar. */ topBarStart?: ReactNode; /** The host's own way to publish, such as its share dialog, in Configure's last step. */ configurePublish?: ReactNode; /** * Validates the licence against this deployment's own API rather than the * licence service, so the public demo licence works on local and preview * deployments. The response must carry a grant signed by the licence * service, so this cannot approve a licence by itself. */ licenseValidationUrl?: string; /** * Optional server-backed project. When supplied, the editor hydrates from * this snapshot and applies newer revisions without remounting. */ project?: BindingBuilderProject | null; /** * Reports debounced, serializable editor snapshots. Persistence and * collaboration transports remain owned by the host application. */ onProjectChange?: (snapshot: BindingBuilderProjectSnapshot, origin: BindingBuilderProjectChangeOrigin) => void; /** Delay before reporting local project changes. Defaults to 350ms. */ projectChangeDebounceMs?: number; /** * Lets a hosted editor upload a selected model before it is loaded. Return * the durable model URL/version that should be saved with the project. */ onModelUpload?: (file: File) => Promise; /** * Saves an image chosen in the editor and returns its durable URL. With a * `project`, every image goes through this before it is reported. */ onTextureUpload?: (file: File, objectId: string) => Promise; /** * Receives a 640x360 JPEG of the scene for a projects list: once the model * has loaded if `hasThumbnail` is false, then after local edits, whenever the * editor has gone quiet. Rejecting tries again later. */ onThumbnailCapture?: (image: Blob) => Promise; /** Whether the project already has a picture. Defaults to false. */ hasThumbnail?: boolean; /** Requests/releases a short collaborative lease around gizmo edits. */ onEditLeaseChange?: (featureId: string, editing: boolean) => void; /** * Whether models may be replaced, added or removed. False hides those * controls and ignores picked or dropped files; bindings and scene settings * stay editable. Defaults to true. */ allowModelChange?: boolean; }; declare function ProjectBindingBuilder({ topBarStart, configurePublish, licenseKey, licenseValidationUrl, onLicenseStatusChange, arHandoff, mobileHandoffUrl, dracoDecoderPath, ktx2TranscoderPath, meshopt, project, onProjectChange, projectChangeDebounceMs, onModelUpload, onTextureUpload, onThumbnailCapture, hasThumbnail, onEditLeaseChange, allowModelChange, hideLicenseCheckingOverlay, }: ProjectBindingBuilderProps): react.JSX.Element; /** A model's view of the scene: the shared settings plus its own. */ declare function sceneConfigForModel(sceneConfig: SceneConfig, model: BindingBuilderProjectModel): SceneConfig; /** The models to hand ModelViewer, or undefined for a project of one. */ declare function viewerModelsFromProject(project: Pick): ModelViewerModelEntry[] | undefined; export { type BindingBuilderModelSource, type BindingBuilderProject, type BindingBuilderProjectChangeOrigin, type BindingBuilderProjectModel, type BindingBuilderProjectSnapshot, ProjectBindingBuilder, type ProjectBindingBuilderProps, ProjectModelViewer, type ProjectModelViewerProps, sceneConfigForModel, viewerModelsFromProject };