import { WebGLRenderTarget, Camera, Texture } from 'three'; import { SparkViewpoint, SparkRenderer } from '@sparkjsdev/spark'; export interface VirtualCameraInfo { key: string; /** Camera object for storing transform and camera parameters */ camera: Camera; ctype: 'perspective' | 'orthographic' | 'fisheye'; aspect?: number; /** Background color for the camera preview */ previewBackgroundColor?: string; /** Background opacity for the camera preview (0-1) */ previewBackgroundOpacity?: number; } /** All store operations (actions) - stable references that never change */ export interface VirtualCameraOps { registerCamera: (info: VirtualCameraInfo) => void; unregisterCamera: (key: string) => void; updateCameraAspect: (key: string, aspect: number) => void; updateCameraBackground: (key: string, backgroundColor?: string, backgroundOpacity?: number) => void; getCamera: (key: string) => VirtualCameraInfo | undefined; setRenderTarget: (key: string, renderTarget: WebGLRenderTarget) => void; removeRenderTarget: (key: string) => void; getRenderTarget: (key: string) => WebGLRenderTarget | undefined; /** * Get the preview texture for a camera. * Prefers SparkViewpoint's internal texture when available (for proper 3DGS rendering), * falls back to WebGLRenderTarget texture (legacy mode). */ getPreviewTexture: (key: string) => Texture | undefined; setOverlayVisibility: (key: string, visible: boolean) => void; setBoundCameraKey: (key: string | null) => void; isCameraBound: (key: string) => boolean; setSparkRenderer: (renderer: SparkRenderer | null) => void; getSparkRenderer: () => SparkRenderer | null; setSparkViewpoint: (key: string, viewpoint: SparkViewpoint) => void; getSparkViewpoint: (key: string) => SparkViewpoint | undefined; removeSparkViewpoint: (key: string) => void; } interface VirtualCameraStore { cameras: Map; /** RenderTargets for legacy mode (useViewpoint=false) */ renderTargets: Map; overlayVisibility: Map; boundCameraKey: string | null; sparkRenderer: SparkRenderer | null; sparkViewpoints: Map; ops: VirtualCameraOps; } export declare const useVirtualCameraStore: import('zustand').UseBoundStore>; export {};