@tscircuit/3d-viewer 0.0.624 → 0.0.625

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.
package/dist/index.d.ts CHANGED
@@ -159,8 +159,17 @@ declare const useManifoldBoardBuilder: (manifoldJSModule: ManifoldToplevel | nul
159
159
 
160
160
  declare function applyJsdomShim(jsdom: JSDOM): void;
161
161
 
162
- declare const saveCameraToSession: (camera: THREE.Camera, controls: any) => void;
163
- declare const loadCameraFromSession: (camera: THREE.Camera, controls: any) => boolean;
162
+ type CameraControls = Pick<OrbitControls, "target"> & {
163
+ update: () => unknown;
164
+ };
165
+ type CameraSessionContext = {
166
+ controls: CameraControls;
167
+ cameraSessionScope?: string;
168
+ };
169
+
170
+ type CameraSessionContextInput = CameraControls | CameraSessionContext;
171
+ declare const saveCameraToSession: (camera: THREE.Camera, cameraSessionContext: CameraSessionContextInput) => void;
172
+ declare const loadCameraFromSession: (camera: THREE.Camera, cameraSessionContext: CameraSessionContextInput) => boolean;
164
173
  interface CameraControllerContextValue {
165
174
  controlsRef: React$1.MutableRefObject<OrbitControls | null>;
166
175
  mainCameraRef: React$1.MutableRefObject<THREE.Camera | null>;
@@ -176,8 +185,8 @@ interface CameraControllerContextValue {
176
185
  setCameraPosition: (position: readonly [number, number, number]) => void;
177
186
  cameraRotation: THREE.Euler;
178
187
  setCameraRotation: (rotation: THREE.Euler) => void;
179
- saveCameraToSession: (camera: THREE.Camera, controls: any) => void;
180
- loadCameraFromSession: (camera: THREE.Camera, controls: any) => boolean;
188
+ saveCameraToSession: typeof saveCameraToSession;
189
+ loadCameraFromSession: typeof loadCameraFromSession;
181
190
  }
182
191
  interface CameraControllerProviderProps {
183
192
  children: React$1.ReactNode;
@@ -188,7 +197,9 @@ interface CameraControllerProviderProps {
188
197
  declare const CameraControllerProvider: React$1.FC<CameraControllerProviderProps>;
189
198
  declare const useCameraController: () => CameraControllerContextValue;
190
199
 
191
- declare const useCameraSession: () => {
200
+ declare const useCameraSession: ({ cameraSessionScope, }?: {
201
+ cameraSessionScope?: string;
202
+ }) => {
192
203
  handleCameraCreated: (camera: THREE.Camera) => void;
193
204
  handleControlsChange: () => void;
194
205
  };