瀏覽代碼

Solved all d.ts issues.

Mr.doob 4 年之前
父節點
當前提交
8c4ff573de

+ 0 - 1
src/Three.d.ts

@@ -92,7 +92,6 @@ export * from './animation/AnimationAction';
 export * from './core/Uniform';
 export * from './core/InstancedBufferGeometry';
 export * from './core/BufferGeometry';
-export * from './core/Geometry';
 export * from './core/InterleavedBufferAttribute';
 export * from './core/InstancedInterleavedBuffer';
 export * from './core/InterleavedBuffer';

+ 1 - 0
src/animation/AnimationClip.d.ts

@@ -1,4 +1,5 @@
 import { KeyframeTrack } from './KeyframeTrack';
+import { Vector3 } from './../math/Vector3';
 import { Bone } from './../objects/Bone';
 import { AnimationBlendMode } from '../constants';
 

+ 0 - 1
src/core/BufferGeometry.d.ts

@@ -4,7 +4,6 @@ import { Sphere } from './../math/Sphere';
 import { Matrix4 } from './../math/Matrix4';
 import { Vector2 } from './../math/Vector2';
 import { Vector3 } from './../math/Vector3';
-import { Object3D } from './Object3D';
 import { EventDispatcher } from './EventDispatcher';
 import { InterleavedBufferAttribute } from './InterleavedBufferAttribute';
 

+ 2 - 5
src/objects/InstancedMesh.d.ts

@@ -5,14 +5,11 @@ import { Mesh } from './Mesh';
 import { Matrix4 } from './../math/Matrix4';
 import { Color } from './../math/Color';
 
-export class InstancedMesh <
-	BufferGeometry,
-	TMaterial extends Material | Material[] = Material | Material[]
-> extends Mesh<BufferGeometry, TMaterial> {
+export class InstancedMesh extends Mesh {
 
 	constructor(
 		geometry: BufferGeometry,
-		material: TMaterial,
+		material: Material | Material[],
 		count: number
 	);
 

+ 4 - 7
src/objects/Line.d.ts

@@ -4,18 +4,15 @@ import { Object3D } from './../core/Object3D';
 import { BufferGeometry } from '../core/BufferGeometry';
 import { Intersection } from '../core/Raycaster';
 
-export class Line <
-	BufferGeometry,
-	TMaterial extends Material | Material[] = Material | Material[]
-> extends Object3D {
+export class Line extends Object3D {
 
 	constructor(
 		geometry?: BufferGeometry,
-		material?: TMaterial
+		material?: Material | Material[]
 	);
 
-	geometry: TGeometry;
-	material: TMaterial;
+	geometry: BufferGeometry;
+	material: Material | Material[];
 
 	type: 'Line' | 'LineLoop' | 'LineSegments' | string;
 	readonly isLine: true;

+ 2 - 5
src/objects/LineLoop.d.ts

@@ -2,14 +2,11 @@ import { Line } from './Line';
 import { Material } from './../materials/Material';
 import { BufferGeometry } from '../core/BufferGeometry';
 
-export class LineLoop <
-	BufferGeometry,
-	TMaterial extends Material | Material[] = Material | Material[]
-> extends Line<BufferGeometry, TMaterial> {
+export class LineLoop extends Line {
 
 	constructor(
 		geometry?: BufferGeometry,
-		material?: TMaterial
+		material?: Material | Material[]
 	);
 
 	type: 'LineLoop';

+ 2 - 5
src/objects/LineSegments.d.ts

@@ -11,14 +11,11 @@ export const LineStrip: number;
  */
 export const LinePieces: number;
 
-export class LineSegments <
-	BufferGeometry,
-	TMaterial extends Material | Material[] = Material | Material[]
-> extends Line<BufferGeometry, TMaterial> {
+export class LineSegments extends Line {
 
 	constructor(
 		geometry?: BufferGeometry,
-		material?: TMaterial
+		material?: Material | Material[]
 	);
 
 	/**

+ 3 - 6
src/objects/Mesh.d.ts

@@ -4,18 +4,15 @@ import { Object3D } from './../core/Object3D';
 import { BufferGeometry } from '../core/BufferGeometry';
 import { Intersection } from '../core/Raycaster';
 
-export class Mesh <
-	BufferGeometry,
-	TMaterial extends Material | Material[] = Material | Material[]
-> extends Object3D {
+export class Mesh extends Object3D {
 
 	constructor(
 		geometry?: BufferGeometry,
-		material?: TMaterial
+		material?: Material | Material[]
 	);
 
 	geometry: BufferGeometry;
-	material: TMaterial;
+	material: Material | Material[];
 	morphTargetInfluences?: number[];
 	morphTargetDictionary?: { [key: string]: number };
 	readonly isMesh: true;

+ 3 - 6
src/objects/Points.d.ts

@@ -7,10 +7,7 @@ import { Intersection } from '../core/Raycaster';
 /**
  * A class for displaying points. The points are rendered by the WebGLRenderer using gl.POINTS.
  */
-export class Points <
-	BufferGeometry,
-	TMaterial extends Material | Material[] = Material | Material[]
-> extends Object3D {
+export class Points extends Object3D {
 
 	/**
 	 * @param geometry An instance of BufferGeometry.
@@ -18,7 +15,7 @@ export class Points <
 	 */
 	constructor(
 		geometry?: BufferGeometry,
-		material?: TMaterial
+		material?: Material | Material[]
 	);
 
 	type: 'Points';
@@ -34,7 +31,7 @@ export class Points <
 	/**
 	 * An instance of Material, defining the object's appearance. Default is a PointsMaterial with randomised colour.
 	 */
-	material: TMaterial;
+	material: Material | Material[];
 
 	raycast( raycaster: Raycaster, intersects: Intersection[] ): void;
 	updateMorphTargets(): void;

+ 2 - 5
src/objects/SkinnedMesh.d.ts

@@ -4,14 +4,11 @@ import { Skeleton } from './Skeleton';
 import { Mesh } from './Mesh';
 import { BufferGeometry } from '../core/BufferGeometry';
 
-export class SkinnedMesh <
-	BufferGeometry,
-	TMaterial extends Material | Material[] = Material | Material[]
-> extends Mesh<BufferGeometry, TMaterial> {
+export class SkinnedMesh extends Mesh {
 
 	constructor(
 		geometry?: BufferGeometry,
-		material?: TMaterial,
+		material?: Material | Material[],
 		useVertexTexture?: boolean
 	);
 

+ 2 - 2
src/renderers/webgl/WebGLGeometries.d.ts

@@ -8,8 +8,8 @@ export class WebGLGeometries {
 
 	constructor( gl: WebGLRenderingContext, attributes: WebGLAttributes, info: WebGLInfo );
 
-	get( object: Object3D, geometry: Geometry | BufferGeometry ): BufferGeometry;
+	get( object: Object3D, geometry: BufferGeometry ): BufferGeometry;
 	update( geometry: BufferGeometry ): void;
-	getWireframeAttribute( geometry: Geometry | BufferGeometry ): BufferAttribute;
+	getWireframeAttribute( geometry: BufferGeometry ): BufferAttribute;
 
 }