@tscircuit/3d-viewer 0.0.433 → 0.0.435
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 +50 -1
- package/dist/index.js +1280 -1034
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import * as THREE from 'three';
|
|
|
5
5
|
import { GLTFExporterOptions } from 'three-stdlib';
|
|
6
6
|
import { ManifoldToplevel } from 'manifold-3d/manifold.d.ts';
|
|
7
7
|
import { JSDOM } from 'jsdom';
|
|
8
|
+
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
|
|
8
9
|
|
|
9
10
|
declare const CadViewer: (props: any) => react_jsx_runtime.JSX.Element;
|
|
10
11
|
|
|
@@ -48,6 +49,7 @@ interface ManifoldGeoms {
|
|
|
48
49
|
geometry: THREE.BufferGeometry;
|
|
49
50
|
color: THREE.Color;
|
|
50
51
|
material: PcbBoard["material"];
|
|
52
|
+
isFaux?: boolean;
|
|
51
53
|
};
|
|
52
54
|
platedHoles?: Array<{
|
|
53
55
|
key: string;
|
|
@@ -83,9 +85,56 @@ interface UseManifoldBoardBuilderResult {
|
|
|
83
85
|
error: string | null;
|
|
84
86
|
isLoading: boolean;
|
|
85
87
|
boardData: PcbBoard | null;
|
|
88
|
+
isFauxBoard: boolean;
|
|
86
89
|
}
|
|
87
90
|
declare const useManifoldBoardBuilder: (manifoldJSModule: ManifoldToplevel | null, circuitJson: AnyCircuitElement[]) => UseManifoldBoardBuilderResult;
|
|
88
91
|
|
|
89
92
|
declare function applyJsdomShim(jsdom: JSDOM): void;
|
|
90
93
|
|
|
91
|
-
|
|
94
|
+
type CameraPreset = "Custom" | "Top Down" | "Top Left Corner" | "Top Right Corner" | "Left Sideview" | "Right Sideview" | "Front" | "Top Center Angled";
|
|
95
|
+
interface CameraAnimationConfig {
|
|
96
|
+
position: readonly [number, number, number];
|
|
97
|
+
target?: readonly [number, number, number];
|
|
98
|
+
up?: readonly [number, number, number];
|
|
99
|
+
durationMs?: number;
|
|
100
|
+
}
|
|
101
|
+
interface CameraController {
|
|
102
|
+
animateTo: (config: CameraAnimationConfig) => void;
|
|
103
|
+
animateToPreset: (preset: CameraPreset) => void;
|
|
104
|
+
}
|
|
105
|
+
declare const CameraAnimatorWithContext: React.FC;
|
|
106
|
+
|
|
107
|
+
declare const saveCameraToSession: (camera: THREE.Camera, controls: any) => void;
|
|
108
|
+
declare const loadCameraFromSession: (camera: THREE.Camera, controls: any) => boolean;
|
|
109
|
+
interface CameraControllerContextValue {
|
|
110
|
+
controlsRef: React.MutableRefObject<OrbitControls | null>;
|
|
111
|
+
mainCameraRef: React.MutableRefObject<THREE.Camera | null>;
|
|
112
|
+
defaultTarget: THREE.Vector3;
|
|
113
|
+
baseDistance: number;
|
|
114
|
+
controller: CameraController | null;
|
|
115
|
+
setController: (controller: CameraController | null) => void;
|
|
116
|
+
getPresetConfig: (preset: CameraPreset) => CameraAnimationConfig | null;
|
|
117
|
+
handleControlsChange: (controls: OrbitControls | null) => void;
|
|
118
|
+
cameraType: "perspective" | "orthographic";
|
|
119
|
+
setCameraType: (type: "perspective" | "orthographic") => void;
|
|
120
|
+
cameraPosition: readonly [number, number, number] | null;
|
|
121
|
+
setCameraPosition: (position: readonly [number, number, number]) => void;
|
|
122
|
+
cameraRotation: THREE.Euler;
|
|
123
|
+
setCameraRotation: (rotation: THREE.Euler) => void;
|
|
124
|
+
saveCameraToSession: (camera: THREE.Camera, controls: any) => void;
|
|
125
|
+
loadCameraFromSession: (camera: THREE.Camera, controls: any) => boolean;
|
|
126
|
+
}
|
|
127
|
+
interface CameraControllerProviderProps {
|
|
128
|
+
children: React.ReactNode;
|
|
129
|
+
defaultTarget: THREE.Vector3;
|
|
130
|
+
initialCameraPosition?: readonly [number, number, number];
|
|
131
|
+
}
|
|
132
|
+
declare const CameraControllerProvider: React.FC<CameraControllerProviderProps>;
|
|
133
|
+
declare const useCameraController: () => CameraControllerContextValue;
|
|
134
|
+
|
|
135
|
+
declare const useCameraSession: () => {
|
|
136
|
+
handleCameraCreated: (camera: THREE.Camera) => void;
|
|
137
|
+
handleControlsChange: () => void;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export { CadViewer, CameraAnimatorWithContext, CameraControllerProvider, type ManifoldGeoms, type ManifoldTextures, applyJsdomShim, convertCircuitJsonTo3dSvg, loadCameraFromSession, saveCameraToSession, useCameraController, useCameraSession, useExportGltfUrl, useManifoldBoardBuilder, useSaveGltfAs };
|