Files
frontend/src/types/three.d.ts

17 lines
768 B
TypeScript
Raw Normal View History

2025-07-30 02:56:32 +08:00
// src/types/three.d.ts
import * as THREE from 'three';
import { Object3DNode } from '@react-three/fiber';
declare global {
namespace JSX {
interface IntrinsicElements {
// 使用大写开头的类名
mesh: Object3DNode<THREE.Mesh, typeof THREE.Mesh>;
boxGeometry: Object3DNode<THREE.BoxGeometry, typeof THREE.BoxGeometry>;
meshStandardMaterial: Object3DNode<THREE.MeshStandardMaterial, typeof THREE.MeshStandardMaterial>;
ambientLight: Object3DNode<THREE.AmbientLight, typeof THREE.AmbientLight>;
spotLight: Object3DNode<THREE.SpotLight, typeof THREE.SpotLight>;
meshBasicMaterial: Object3DNode<THREE.MeshBasicMaterial, typeof THREE.MeshBasicMaterial>;
}
}
}