import * as react_jsx_runtime from 'react/jsx-runtime'; import * as _sparkjsdev_spark from '@sparkjsdev/spark'; import { o as SplatEnvironmentProps, r as PairedSplatEnvironmentConfig, S as SceneConfig, u as SplatEnvironmentReadiness, p as VisualScenarioConfig } from './types-Bu8Aki_j.js'; import 'react'; import '@react-three/fiber'; import 'three'; type SparkModule = typeof _sparkjsdev_spark; type SparkSplatMeshInstance = InstanceType; type SparkSplatStatus = 'idle' | 'loading' | 'ready' | 'error'; interface SparkSplatRenderTuning { /** Scale Spark's LoD splat budget for the live viewport. */ lodSplatScale?: number; /** Minimum rendered LoD splat size. Higher values trade detail for speed. */ lodRenderScale?: number; /** Minimum delay between Spark sort passes for the live viewport. */ minSortIntervalMs?: number; } interface SparkSplatCaptureTuning extends SparkSplatRenderTuning { /** Maximum animation frames to wait for first-capture Spark warm-up. Default: 4. */ maxWarmupFrames?: number; /** Number of pixels sampled when deciding whether a capture is blank. Default: 512. */ blankSampleCount?: number; /** Alpha threshold used by the blank-capture detector. Default: 8. */ blankAlphaThreshold?: number; /** Minimum visible sampled-pixel ratio before retrying capture. Default: 0.02. */ blankVisibleRatio?: number; /** Minimum average sampled RGB sum before retrying capture. Default: 3. */ blankAverageColor?: number; } interface SparkSplatLifecycle { status: SparkSplatStatus; error: Error | null; isLoading: boolean; isReady: boolean; isError: boolean; props: Pick; reset: () => void; } interface SparkSplatEnvironmentState { environment: PairedSplatEnvironmentConfig | undefined; sceneConfig: SceneConfig; readiness: SplatEnvironmentReadiness; lifecycle: SparkSplatLifecycle; props: Pick; enabled: boolean; } interface SparkSplatEnvironmentProps extends SplatEnvironmentProps { /** Enable Spark LoD handling for large splat assets. Default: true. */ lod?: boolean | 'quality'; /** Tune Spark's live viewport renderer. Defaults favor interactive FPS. */ renderTuning?: SparkSplatRenderTuning; /** Tune Spark camera-frame capture. Defaults favor sharper snapshots. */ captureTuning?: SparkSplatCaptureTuning; /** * Hide meshes whose names include floor, ground, or plane while the splat is * active. This mirrors the common hybrid-rendering setup where MJCF keeps * collision geometry but the splat owns the visual environment. */ hideGroundMeshes?: boolean; onStatusChange?: (status: SparkSplatStatus) => void; onLoad?: (mesh: SparkSplatMeshInstance) => void; onError?: (error: Error) => void; } /** * Resolve a visual scenario's paired splat environment, compose its MJCF * collision proxy into the MuJoCo scene config, and expose Spark lifecycle * props for ``. */ declare function useSparkSplatEnvironment({ sceneConfig, scenario, environment, enabled, renderer, onError, onStatusChange, }: { sceneConfig: SceneConfig; scenario?: VisualScenarioConfig; environment?: PairedSplatEnvironmentConfig; enabled?: boolean; renderer?: 'spark'; onError?: (error: Error) => void; onStatusChange?: (status: SparkSplatStatus) => void; }): SparkSplatEnvironmentState; /** * Tracks Spark 3DGS loading state for UI that wraps `SparkSplatEnvironment`. * * Use the returned `props` with `` * to avoid repeating status/error state in app code. */ declare function useSparkSplatLifecycle({ enabled, initialStatus, onError, onStatusChange, }?: { enabled?: boolean; initialStatus?: SparkSplatStatus; onError?: (error: Error) => void; onStatusChange?: (status: SparkSplatStatus) => void; }): SparkSplatLifecycle; /** * Optional SparkJS-backed Gaussian splat renderer for React Three Fiber scenes. * * Import from `mujoco-react/spark` and install `@sparkjsdev/spark` in the app * that uses it. The core `mujoco-react` entrypoint does not depend on Spark. */ declare function SparkSplatEnvironment({ environment, scenario, renderer, src, format, collisionProxy, collisionProxyMetadata, showPlaceholder, children, lod, renderTuning, captureTuning, hideGroundMeshes, onStatusChange, onLoad, onError, ...groupProps }: SparkSplatEnvironmentProps): react_jsx_runtime.JSX.Element; export { type SparkSplatCaptureTuning, SparkSplatEnvironment, type SparkSplatEnvironmentProps, type SparkSplatEnvironmentState, type SparkSplatLifecycle, type SparkSplatRenderTuning, type SparkSplatStatus, useSparkSplatEnvironment, useSparkSplatLifecycle };