@types/three 0.155.0 → 0.156.0
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.
- three/README.md +2 -2
- three/examples/jsm/animation/CCDIKSolver.d.ts +7 -7
- three/examples/jsm/controls/ArcballControls.d.ts +7 -1
- three/examples/jsm/controls/DragControls.d.ts +9 -1
- three/examples/jsm/controls/FlyControls.d.ts +5 -1
- three/examples/jsm/controls/OrbitControls.d.ts +15 -17
- three/examples/jsm/controls/TrackballControls.d.ts +7 -1
- three/examples/jsm/controls/TransformControls.d.ts +35 -2
- three/examples/jsm/curves/NURBSCurve.d.ts +8 -2
- three/examples/jsm/environments/DebugEnvironment.d.ts +5 -0
- three/examples/jsm/interactive/InteractiveGroup.d.ts +14 -1
- three/examples/jsm/interactive/SelectionHelper.d.ts +1 -0
- three/examples/jsm/libs/lil-gui.module.min.d.ts +609 -1
- three/examples/jsm/libs/tween.module.d.ts +219 -2
- three/examples/jsm/loaders/3DMLoader.d.ts +1 -8
- three/examples/jsm/loaders/3MFLoader.d.ts +1 -8
- three/examples/jsm/loaders/AMFLoader.d.ts +1 -8
- three/examples/jsm/loaders/BVHLoader.d.ts +1 -8
- three/examples/jsm/loaders/ColladaLoader.d.ts +1 -8
- three/examples/jsm/loaders/DRACOLoader.d.ts +1 -8
- three/examples/jsm/loaders/FBXLoader.d.ts +1 -8
- three/examples/jsm/loaders/FontLoader.d.ts +1 -8
- three/examples/jsm/loaders/GCodeLoader.d.ts +1 -8
- three/examples/jsm/loaders/GLTFLoader.d.ts +1 -9
- three/examples/jsm/loaders/HDRCubeTextureLoader.d.ts +5 -5
- three/examples/jsm/loaders/KMZLoader.d.ts +1 -8
- three/examples/jsm/loaders/LDrawLoader.d.ts +1 -8
- three/examples/jsm/loaders/LUT3dlLoader.d.ts +1 -8
- three/examples/jsm/loaders/LUTCubeLoader.d.ts +1 -8
- three/examples/jsm/loaders/LWOLoader.d.ts +1 -8
- three/examples/jsm/loaders/LottieLoader.d.ts +4 -5
- three/examples/jsm/loaders/MD2Loader.d.ts +1 -8
- three/examples/jsm/loaders/MDDLoader.d.ts +1 -8
- three/examples/jsm/loaders/MMDLoader.d.ts +1 -8
- three/examples/jsm/loaders/MTLLoader.d.ts +1 -9
- three/examples/jsm/loaders/NRRDLoader.d.ts +1 -7
- three/examples/jsm/loaders/OBJLoader.d.ts +1 -8
- three/examples/jsm/loaders/PCDLoader.d.ts +1 -8
- three/examples/jsm/loaders/PDBLoader.d.ts +1 -8
- three/examples/jsm/loaders/PLYLoader.d.ts +1 -8
- three/examples/jsm/loaders/STLLoader.d.ts +1 -8
- three/examples/jsm/loaders/SVGLoader.d.ts +1 -8
- three/examples/jsm/loaders/TDSLoader.d.ts +1 -8
- three/examples/jsm/loaders/TGALoader.d.ts +0 -7
- three/examples/jsm/loaders/TTFLoader.d.ts +1 -8
- three/examples/jsm/loaders/TiltLoader.d.ts +1 -8
- three/examples/jsm/loaders/USDZLoader.d.ts +1 -9
- three/examples/jsm/loaders/VOXLoader.d.ts +1 -8
- three/examples/jsm/loaders/VRMLLoader.d.ts +1 -8
- three/examples/jsm/loaders/VTKLoader.d.ts +1 -8
- three/examples/jsm/loaders/XYZLoader.d.ts +1 -8
- three/examples/jsm/nodes/loaders/NodeLoader.d.ts +1 -9
- three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +2 -2
- three/examples/jsm/postprocessing/FilmPass.d.ts +1 -1
- three/examples/jsm/postprocessing/RenderPass.d.ts +15 -5
- three/examples/jsm/postprocessing/SAOPass.d.ts +1 -10
- three/examples/jsm/postprocessing/SSAOPass.d.ts +2 -5
- three/examples/jsm/shaders/FilmShader.d.ts +1 -3
- three/examples/jsm/shaders/SAOShader.d.ts +0 -2
- three/examples/jsm/shaders/SSAOShader.d.ts +0 -1
- three/examples/jsm/webxr/XREstimatedLight.d.ts +7 -2
- three/index.d.ts +1 -2
- three/package.json +4 -6
- three/src/Three.d.ts +4 -0
- three/src/animation/AnimationMixer.d.ts +6 -1
- three/src/constants.d.ts +7 -1
- three/src/core/BufferGeometry.d.ts +1 -1
- three/src/core/EventDispatcher.d.ts +30 -12
- three/src/core/Object3D.d.ts +17 -12
- three/src/core/RenderTarget.d.ts +1 -1
- three/src/core/UniformsGroup.d.ts +1 -1
- three/src/extras/core/Path.d.ts +1 -1
- three/src/loaders/AnimationLoader.d.ts +3 -10
- three/src/loaders/AudioLoader.d.ts +1 -10
- three/src/loaders/BufferGeometryLoader.d.ts +3 -13
- three/src/loaders/CompressedTextureLoader.d.ts +4 -6
- three/src/loaders/CubeTextureLoader.d.ts +5 -7
- three/src/loaders/DataTextureLoader.d.ts +4 -6
- three/src/loaders/FileLoader.d.ts +1 -8
- three/src/loaders/ImageBitmapLoader.d.ts +1 -9
- three/src/loaders/ImageLoader.d.ts +3 -5
- three/src/loaders/Loader.d.ts +8 -6
- three/src/loaders/MaterialLoader.d.ts +4 -11
- three/src/loaders/ObjectLoader.d.ts +15 -29
- three/src/loaders/TextureLoader.d.ts +4 -6
- three/src/materials/Material.d.ts +1 -1
- three/src/objects/Group.d.ts +2 -2
- three/src/objects/InstancedMesh.d.ts +11 -6
- three/src/objects/Mesh.d.ts +4 -5
- three/src/renderers/webxr/WebXRController.d.ts +21 -3
- three/src/renderers/webxr/WebXRManager.d.ts +10 -1
- three/src/textures/Texture.d.ts +4 -4
- three/src/utils.d.ts +1 -0
- three/examples/jsm/loaders/BasisTextureLoader.d.ts +0 -32
- three/examples/jsm/loaders/IFCLoader.d.ts +0 -675
three/src/core/Object3D.d.ts
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import { Vector3 } from '
|
|
2
|
-
import { Euler } from '
|
|
3
|
-
import { Quaternion } from '
|
|
4
|
-
import { Matrix4 } from '
|
|
5
|
-
import { Matrix3 } from '
|
|
1
|
+
import { Vector3 } from '../math/Vector3.js';
|
|
2
|
+
import { Euler } from '../math/Euler.js';
|
|
3
|
+
import { Quaternion } from '../math/Quaternion.js';
|
|
4
|
+
import { Matrix4 } from '../math/Matrix4.js';
|
|
5
|
+
import { Matrix3 } from '../math/Matrix3.js';
|
|
6
6
|
import { Layers } from './Layers.js';
|
|
7
|
-
import { WebGLRenderer } from '
|
|
8
|
-
import { Scene } from '
|
|
9
|
-
import { Camera } from '
|
|
10
|
-
import { Material } from '
|
|
11
|
-
import { Group } from '
|
|
7
|
+
import { WebGLRenderer } from '../renderers/WebGLRenderer.js';
|
|
8
|
+
import { Scene } from '../scenes/Scene.js';
|
|
9
|
+
import { Camera } from '../cameras/Camera.js';
|
|
10
|
+
import { Material } from '../materials/Material.js';
|
|
11
|
+
import { Group } from '../objects/Group.js';
|
|
12
12
|
import { Intersection, Raycaster } from './Raycaster.js';
|
|
13
|
-
import { EventDispatcher
|
|
13
|
+
import { EventDispatcher } from './EventDispatcher.js';
|
|
14
14
|
import { BufferGeometry } from './BufferGeometry.js';
|
|
15
15
|
import { AnimationClip } from '../animation/AnimationClip.js';
|
|
16
16
|
|
|
17
|
+
export interface Object3DEventMap {
|
|
18
|
+
added: {};
|
|
19
|
+
removed: {};
|
|
20
|
+
}
|
|
21
|
+
|
|
17
22
|
/**
|
|
18
23
|
* This is the base class for most objects in three.js and provides a set of properties and methods for manipulating objects in 3D space.
|
|
19
24
|
* @remarks Note that this can be used for grouping objects via the {@link THREE.Object3D.add | .add()} method which adds the object as a child,
|
|
@@ -21,7 +26,7 @@ import { AnimationClip } from '../animation/AnimationClip.js';
|
|
|
21
26
|
* @see {@link https://threejs.org/docs/index.html#api/en/core/Object3D | Official Documentation}
|
|
22
27
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/Object3D.js | Source}
|
|
23
28
|
*/
|
|
24
|
-
export class Object3D<
|
|
29
|
+
export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> extends EventDispatcher<TEventMap> {
|
|
25
30
|
/**
|
|
26
31
|
* This creates a new {@link Object3D} object.
|
|
27
32
|
*/
|
three/src/core/RenderTarget.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export interface RenderTargetOptions {
|
|
|
33
33
|
encoding?: TextureEncoding | undefined;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
export class RenderTarget<TTexture extends Texture | Texture[] = Texture> extends EventDispatcher {
|
|
36
|
+
export class RenderTarget<TTexture extends Texture | Texture[] = Texture> extends EventDispatcher<{ dispose: {} }> {
|
|
37
37
|
constructor(width?: number, height?: number, options?: RenderTargetOptions);
|
|
38
38
|
|
|
39
39
|
readonly isRenderTarget: true;
|
|
@@ -6,7 +6,7 @@ import { Usage } from '../constants.js';
|
|
|
6
6
|
* @see Example: {@link https://threejs.org/examples/#webgl2_ubo | WebGL2 / UBO}
|
|
7
7
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/UniformsGroup.js | Source}
|
|
8
8
|
*/
|
|
9
|
-
export class UniformsGroup extends EventDispatcher {
|
|
9
|
+
export class UniformsGroup extends EventDispatcher<{ dispose: {} }> {
|
|
10
10
|
constructor();
|
|
11
11
|
|
|
12
12
|
readonly isUniformsGroup: true;
|
three/src/extras/core/Path.d.ts
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import { LoadingManager } from './LoadingManager.js';
|
|
2
2
|
import { Loader } from './Loader.js';
|
|
3
|
-
import { AnimationClip } from '
|
|
3
|
+
import { AnimationClip } from '../animation/AnimationClip.js';
|
|
4
4
|
|
|
5
|
-
export class AnimationLoader extends Loader {
|
|
5
|
+
export class AnimationLoader extends Loader<AnimationClip[]> {
|
|
6
6
|
constructor(manager?: LoadingManager);
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
url: string,
|
|
10
|
-
onLoad: (response: AnimationClip[]) => void,
|
|
11
|
-
onProgress?: (request: ProgressEvent) => void,
|
|
12
|
-
onError?: (event: ErrorEvent) => void,
|
|
13
|
-
): void;
|
|
14
|
-
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<AnimationClip[]>;
|
|
15
|
-
parse(json: any): AnimationClip[];
|
|
8
|
+
parse(json: readonly unknown[]): AnimationClip[];
|
|
16
9
|
}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import { Loader } from './Loader.js';
|
|
2
2
|
import { LoadingManager } from './LoadingManager.js';
|
|
3
3
|
|
|
4
|
-
export class AudioLoader extends Loader {
|
|
4
|
+
export class AudioLoader extends Loader<AudioBuffer> {
|
|
5
5
|
constructor(manager?: LoadingManager);
|
|
6
|
-
|
|
7
|
-
load(
|
|
8
|
-
url: string,
|
|
9
|
-
onLoad: (audioBuffer: AudioBuffer) => void,
|
|
10
|
-
onProgress?: (request: ProgressEvent) => void,
|
|
11
|
-
onError?: (event: ErrorEvent) => void,
|
|
12
|
-
): void;
|
|
13
|
-
|
|
14
|
-
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<AudioBuffer>;
|
|
15
6
|
}
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
import { Loader } from './Loader.js';
|
|
2
2
|
import { LoadingManager } from './LoadingManager.js';
|
|
3
|
-
import { BufferGeometry } from '
|
|
3
|
+
import { BufferGeometry } from '../core/BufferGeometry.js';
|
|
4
4
|
import { InstancedBufferGeometry } from '../core/InstancedBufferGeometry.js';
|
|
5
5
|
|
|
6
|
-
export class BufferGeometryLoader extends Loader {
|
|
6
|
+
export class BufferGeometryLoader extends Loader<InstancedBufferGeometry | BufferGeometry> {
|
|
7
7
|
constructor(manager?: LoadingManager);
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
url: string,
|
|
11
|
-
onLoad: (bufferGeometry: InstancedBufferGeometry | BufferGeometry) => void,
|
|
12
|
-
onProgress?: (request: ProgressEvent) => void,
|
|
13
|
-
onError?: (event: ErrorEvent) => void,
|
|
14
|
-
): void;
|
|
15
|
-
loadAsync(
|
|
16
|
-
url: string,
|
|
17
|
-
onProgress?: (event: ProgressEvent) => void,
|
|
18
|
-
): Promise<InstancedBufferGeometry | BufferGeometry>;
|
|
19
|
-
parse(json: any): InstancedBufferGeometry | BufferGeometry;
|
|
9
|
+
parse(json: unknown): InstancedBufferGeometry | BufferGeometry;
|
|
20
10
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { Loader } from './Loader.js';
|
|
2
2
|
import { LoadingManager } from './LoadingManager.js';
|
|
3
|
-
import { CompressedTexture } from '
|
|
3
|
+
import { CompressedTexture } from '../textures/CompressedTexture.js';
|
|
4
4
|
|
|
5
|
-
export class CompressedTextureLoader extends Loader {
|
|
5
|
+
export class CompressedTextureLoader extends Loader<CompressedTexture> {
|
|
6
6
|
constructor(manager?: LoadingManager);
|
|
7
7
|
|
|
8
8
|
load(
|
|
9
9
|
url: string,
|
|
10
|
-
onLoad
|
|
10
|
+
onLoad?: (data: CompressedTexture) => void,
|
|
11
11
|
onProgress?: (event: ProgressEvent) => void,
|
|
12
|
-
onError?: (
|
|
12
|
+
onError?: (err: unknown) => void,
|
|
13
13
|
): CompressedTexture;
|
|
14
|
-
|
|
15
|
-
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<CompressedTexture>;
|
|
16
14
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { Loader } from './Loader.js';
|
|
2
2
|
import { LoadingManager } from './LoadingManager.js';
|
|
3
|
-
import { CubeTexture } from '
|
|
3
|
+
import { CubeTexture } from '../textures/CubeTexture.js';
|
|
4
4
|
|
|
5
|
-
export class CubeTextureLoader extends Loader {
|
|
5
|
+
export class CubeTextureLoader extends Loader<CubeTexture, readonly string[]> {
|
|
6
6
|
constructor(manager?: LoadingManager);
|
|
7
7
|
|
|
8
8
|
load(
|
|
9
|
-
|
|
10
|
-
onLoad?: (
|
|
9
|
+
url: readonly string[],
|
|
10
|
+
onLoad?: (data: CubeTexture) => void,
|
|
11
11
|
onProgress?: (event: ProgressEvent) => void,
|
|
12
|
-
onError?: (
|
|
12
|
+
onError?: (err: unknown) => void,
|
|
13
13
|
): CubeTexture;
|
|
14
|
-
|
|
15
|
-
loadAsync(urls: string[], onProgress?: (event: ProgressEvent) => void): Promise<CubeTexture>;
|
|
16
14
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { Loader } from './Loader.js';
|
|
2
2
|
import { LoadingManager } from './LoadingManager.js';
|
|
3
|
-
import { DataTexture } from '
|
|
3
|
+
import { DataTexture } from '../textures/DataTexture.js';
|
|
4
4
|
|
|
5
|
-
export class DataTextureLoader extends Loader {
|
|
5
|
+
export class DataTextureLoader extends Loader<DataTexture> {
|
|
6
6
|
constructor(manager?: LoadingManager);
|
|
7
7
|
|
|
8
8
|
load(
|
|
9
9
|
url: string,
|
|
10
|
-
onLoad?: (
|
|
10
|
+
onLoad?: (data: DataTexture, texData: object) => void,
|
|
11
11
|
onProgress?: (event: ProgressEvent) => void,
|
|
12
|
-
onError?: (
|
|
12
|
+
onError?: (err: unknown) => void,
|
|
13
13
|
): DataTexture;
|
|
14
|
-
|
|
15
|
-
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<DataTexture>;
|
|
16
14
|
}
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import { Loader } from './Loader.js';
|
|
2
2
|
import { LoadingManager } from './LoadingManager.js';
|
|
3
3
|
|
|
4
|
-
export class FileLoader extends Loader {
|
|
4
|
+
export class FileLoader extends Loader<string | ArrayBuffer> {
|
|
5
5
|
constructor(manager?: LoadingManager);
|
|
6
6
|
|
|
7
7
|
mimeType: undefined | MimeType;
|
|
8
8
|
responseType: undefined | string;
|
|
9
9
|
|
|
10
|
-
load(
|
|
11
|
-
url: string,
|
|
12
|
-
onLoad?: (response: string | ArrayBuffer) => void,
|
|
13
|
-
onProgress?: (request: ProgressEvent) => void,
|
|
14
|
-
onError?: (event: ErrorEvent) => void,
|
|
15
|
-
): any;
|
|
16
|
-
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<string | ArrayBuffer>;
|
|
17
10
|
setMimeType(mimeType: MimeType): FileLoader;
|
|
18
11
|
setResponseType(responseType: string): FileLoader;
|
|
19
12
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Loader } from './Loader.js';
|
|
2
2
|
import { LoadingManager } from './LoadingManager.js';
|
|
3
3
|
|
|
4
|
-
export class ImageBitmapLoader extends Loader {
|
|
4
|
+
export class ImageBitmapLoader extends Loader<ImageBitmap> {
|
|
5
5
|
constructor(manager?: LoadingManager);
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -12,12 +12,4 @@ export class ImageBitmapLoader extends Loader {
|
|
|
12
12
|
readonly isImageBitmapLoader: true;
|
|
13
13
|
|
|
14
14
|
setOptions(options: object): ImageBitmapLoader;
|
|
15
|
-
load(
|
|
16
|
-
url: string,
|
|
17
|
-
onLoad?: (response: ImageBitmap) => void,
|
|
18
|
-
onProgress?: (request: ProgressEvent) => void,
|
|
19
|
-
onError?: (event: ErrorEvent) => void,
|
|
20
|
-
): any;
|
|
21
|
-
|
|
22
|
-
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<ImageBitmap>;
|
|
23
15
|
}
|
|
@@ -5,15 +5,13 @@ import { LoadingManager } from './LoadingManager.js';
|
|
|
5
5
|
* A loader for loading an image.
|
|
6
6
|
* Unlike other loaders, this one emits events instead of using predefined callbacks. So if you're interested in getting notified when things happen, you need to add listeners to the object.
|
|
7
7
|
*/
|
|
8
|
-
export class ImageLoader extends Loader {
|
|
8
|
+
export class ImageLoader extends Loader<HTMLImageElement> {
|
|
9
9
|
constructor(manager?: LoadingManager);
|
|
10
10
|
|
|
11
11
|
load(
|
|
12
12
|
url: string,
|
|
13
|
-
onLoad?: (
|
|
13
|
+
onLoad?: (data: HTMLImageElement) => void,
|
|
14
14
|
onProgress?: (event: ProgressEvent) => void,
|
|
15
|
-
onError?: (
|
|
15
|
+
onError?: (err: unknown) => void,
|
|
16
16
|
): HTMLImageElement;
|
|
17
|
-
|
|
18
|
-
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<HTMLImageElement>;
|
|
19
17
|
}
|
three/src/loaders/Loader.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { LoadingManager } from './LoadingManager.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Base class for implementing loaders.
|
|
5
5
|
*/
|
|
6
|
-
export class Loader {
|
|
6
|
+
export class Loader<TData = unknown, TUrl = string> {
|
|
7
7
|
constructor(manager?: LoadingManager);
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -32,11 +32,13 @@ export class Loader {
|
|
|
32
32
|
*/
|
|
33
33
|
requestHeader: { [header: string]: string };
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
load(
|
|
36
|
+
url: TUrl,
|
|
37
|
+
onLoad?: (data: TData) => void,
|
|
38
|
+
onProgress?: (event: ProgressEvent) => void,
|
|
39
|
+
onError?: (err: unknown) => void,
|
|
40
|
+
): void;
|
|
41
|
+
loadAsync(url: TUrl, onProgress?: (event: ProgressEvent) => void): Promise<TData>;
|
|
40
42
|
|
|
41
43
|
setCrossOrigin(crossOrigin: string): this;
|
|
42
44
|
setWithCredentials(value: boolean): this;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Loader } from './Loader.js';
|
|
2
2
|
import { LoadingManager } from './LoadingManager.js';
|
|
3
|
-
import { Texture } from '
|
|
4
|
-
import { Material } from '
|
|
3
|
+
import { Texture } from '../textures/Texture.js';
|
|
4
|
+
import { Material } from '../materials/Material.js';
|
|
5
5
|
|
|
6
|
-
export class MaterialLoader extends Loader {
|
|
6
|
+
export class MaterialLoader extends Loader<Material> {
|
|
7
7
|
constructor(manager?: LoadingManager);
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -11,13 +11,6 @@ export class MaterialLoader extends Loader {
|
|
|
11
11
|
*/
|
|
12
12
|
textures: { [key: string]: Texture };
|
|
13
13
|
|
|
14
|
-
load(
|
|
15
|
-
url: string,
|
|
16
|
-
onLoad: (material: Material) => void,
|
|
17
|
-
onProgress?: (event: ProgressEvent) => void,
|
|
18
|
-
onError?: (event: Error | ErrorEvent) => void,
|
|
19
|
-
): void;
|
|
20
|
-
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<Material>;
|
|
21
14
|
setTextures(textures: { [key: string]: Texture }): this;
|
|
22
|
-
parse(json:
|
|
15
|
+
parse(json: unknown): Material;
|
|
23
16
|
}
|
|
@@ -8,35 +8,21 @@ import { InstancedBufferGeometry } from '../core/InstancedBufferGeometry.js';
|
|
|
8
8
|
import { BufferGeometry } from '../core/BufferGeometry.js';
|
|
9
9
|
import { Source } from '../textures/Source.js';
|
|
10
10
|
|
|
11
|
-
export class ObjectLoader extends Loader {
|
|
11
|
+
export class ObjectLoader extends Loader<Object3D> {
|
|
12
12
|
constructor(manager?: LoadingManager);
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
):
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
parseAsync<T extends Object3D>(json: any): Promise<T>;
|
|
29
|
-
parseGeometries(json: any): { [key: string]: InstancedBufferGeometry | BufferGeometry };
|
|
30
|
-
parseMaterials(json: any, textures: { [key: string]: Texture }): { [key: string]: Material };
|
|
31
|
-
parseAnimations(json: any): AnimationClip[];
|
|
32
|
-
parseImages(json: any, onLoad?: () => void): { [key: string]: Source };
|
|
33
|
-
parseImagesAsync(json: any): Promise<{ [key: string]: Source }>;
|
|
34
|
-
parseTextures(json: any, images: { [key: string]: Source }): { [key: string]: Texture };
|
|
35
|
-
parseObject<T extends Object3D>(
|
|
36
|
-
data: any,
|
|
37
|
-
geometries: any[],
|
|
38
|
-
materials: Material[],
|
|
39
|
-
animations: AnimationClip[],
|
|
40
|
-
): // tslint:disable-next-line:no-unnecessary-generics
|
|
41
|
-
T;
|
|
14
|
+
parse(json: unknown, onLoad?: (object: Object3D) => void): Object3D;
|
|
15
|
+
parseAsync(json: unknown): Promise<Object3D>;
|
|
16
|
+
parseGeometries(json: unknown): { [key: string]: InstancedBufferGeometry | BufferGeometry };
|
|
17
|
+
parseMaterials(json: unknown, textures: { [key: string]: Texture }): { [key: string]: Material };
|
|
18
|
+
parseAnimations(json: unknown): { [key: string]: AnimationClip };
|
|
19
|
+
parseImages(json: unknown, onLoad?: () => void): { [key: string]: Source };
|
|
20
|
+
parseImagesAsync(json: unknown): Promise<{ [key: string]: Source }>;
|
|
21
|
+
parseTextures(json: unknown, images: { [key: string]: Source }): { [key: string]: Texture };
|
|
22
|
+
parseObject(
|
|
23
|
+
data: unknown,
|
|
24
|
+
geometries: { [key: string]: InstancedBufferGeometry | BufferGeometry },
|
|
25
|
+
materials: { [key: string]: Material },
|
|
26
|
+
animations: { [key: string]: AnimationClip },
|
|
27
|
+
): Object3D;
|
|
42
28
|
}
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { Loader } from './Loader.js';
|
|
2
2
|
import { LoadingManager } from './LoadingManager.js';
|
|
3
|
-
import { Texture } from '
|
|
3
|
+
import { Texture } from '../textures/Texture.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Class for loading a texture.
|
|
7
7
|
* Unlike other loaders, this one emits events instead of using predefined callbacks. So if you're interested in getting notified when things happen, you need to add listeners to the object.
|
|
8
8
|
*/
|
|
9
|
-
export class TextureLoader extends Loader {
|
|
9
|
+
export class TextureLoader extends Loader<Texture> {
|
|
10
10
|
constructor(manager?: LoadingManager);
|
|
11
11
|
|
|
12
12
|
load(
|
|
13
13
|
url: string,
|
|
14
|
-
onLoad?: (
|
|
14
|
+
onLoad?: (data: Texture) => void,
|
|
15
15
|
onProgress?: (event: ProgressEvent) => void,
|
|
16
|
-
onError?: (
|
|
16
|
+
onError?: (err: unknown) => void,
|
|
17
17
|
): Texture;
|
|
18
|
-
|
|
19
|
-
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<Texture>;
|
|
20
18
|
}
|
|
@@ -63,7 +63,7 @@ export interface MaterialParameters {
|
|
|
63
63
|
/**
|
|
64
64
|
* Materials describe the appearance of objects. They are defined in a (mostly) renderer-independent way, so you don't have to rewrite materials if you decide to use a different renderer.
|
|
65
65
|
*/
|
|
66
|
-
export class Material extends EventDispatcher {
|
|
66
|
+
export class Material extends EventDispatcher<{ dispose: {} }> {
|
|
67
67
|
constructor();
|
|
68
68
|
|
|
69
69
|
alphaHash: boolean;
|
three/src/objects/Group.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Object3D } from '
|
|
1
|
+
import { Object3D, Object3DEventMap } from '../core/Object3D.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Its purpose is to make working with groups of objects syntactically clearer.
|
|
@@ -22,7 +22,7 @@ import { Object3D } from './../core/Object3D.js';
|
|
|
22
22
|
* @see {@link https://threejs.org/docs/index.html#api/en/objects/Group | Official Documentation}
|
|
23
23
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/Group.js | Source}
|
|
24
24
|
*/
|
|
25
|
-
export class Group extends Object3D {
|
|
25
|
+
export class Group<TEventMap extends Object3DEventMap = Object3DEventMap> extends Object3D<TEventMap> {
|
|
26
26
|
/**
|
|
27
27
|
* Creates a new {@link Group}.
|
|
28
28
|
*/
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { BufferGeometry } from '../core/BufferGeometry.js';
|
|
2
|
-
import { Material } from '
|
|
3
|
-
import { BufferAttribute } from './../core/BufferAttribute.js';
|
|
2
|
+
import { Material } from '../materials/Material.js';
|
|
4
3
|
import { InstancedBufferAttribute } from '../core/InstancedBufferAttribute.js';
|
|
5
4
|
import { Mesh } from './Mesh.js';
|
|
6
|
-
import { Matrix4 } from '
|
|
7
|
-
import { Color } from '
|
|
8
|
-
import {
|
|
5
|
+
import { Matrix4 } from '../math/Matrix4.js';
|
|
6
|
+
import { Color } from '../math/Color.js';
|
|
7
|
+
import { Object3DEventMap } from '../core/Object3D.js';
|
|
8
|
+
import { Box3 } from '../math/Box3.js';
|
|
9
|
+
import { Sphere } from '../math/Sphere.js';
|
|
10
|
+
|
|
11
|
+
export interface InstancedMeshEventMap extends Object3DEventMap {
|
|
12
|
+
dispose: {};
|
|
13
|
+
}
|
|
9
14
|
|
|
10
15
|
/**
|
|
11
16
|
* A special version of {@link THREE.Mesh | Mesh} with instanced rendering support
|
|
@@ -23,7 +28,7 @@ import { Box3, Sphere } from '../Three.js';
|
|
|
23
28
|
export class InstancedMesh<
|
|
24
29
|
TGeometry extends BufferGeometry = BufferGeometry,
|
|
25
30
|
TMaterial extends Material | Material[] = Material | Material[],
|
|
26
|
-
> extends Mesh<TGeometry, TMaterial> {
|
|
31
|
+
> extends Mesh<TGeometry, TMaterial, InstancedMeshEventMap> {
|
|
27
32
|
/**
|
|
28
33
|
* Create a new instance of {@link InstancedMesh}
|
|
29
34
|
* @param geometry An instance of {@link THREE.BufferGeometry | BufferGeometry}.
|
three/src/objects/Mesh.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { Material } from '
|
|
2
|
-
import {
|
|
3
|
-
import { Object3D } from './../core/Object3D.js';
|
|
1
|
+
import { Material } from '../materials/Material.js';
|
|
2
|
+
import { Object3D, Object3DEventMap } from '../core/Object3D.js';
|
|
4
3
|
import { BufferGeometry } from '../core/BufferGeometry.js';
|
|
5
|
-
import { Intersection } from '../core/Raycaster.js';
|
|
6
4
|
import { Vector3 } from '../math/Vector3.js';
|
|
7
5
|
|
|
8
6
|
/**
|
|
@@ -24,7 +22,8 @@ import { Vector3 } from '../math/Vector3.js';
|
|
|
24
22
|
export class Mesh<
|
|
25
23
|
TGeometry extends BufferGeometry = BufferGeometry,
|
|
26
24
|
TMaterial extends Material | Material[] = Material | Material[],
|
|
27
|
-
|
|
25
|
+
TEventMap extends Object3DEventMap = Object3DEventMap,
|
|
26
|
+
> extends Object3D<TEventMap> {
|
|
28
27
|
/**
|
|
29
28
|
* Create a new instance of {@link Mesh}
|
|
30
29
|
* @param geometry An instance of {@link THREE.BufferGeometry | BufferGeometry}. Default {@link THREE.BufferGeometry | `new THREE.BufferGeometry()`}.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Group } from '../../objects/Group.js';
|
|
2
2
|
import { Vector3 } from '../../math/Vector3.js';
|
|
3
|
+
import { Object3DEventMap } from '../../core/Object3D.js';
|
|
3
4
|
|
|
4
5
|
export type XRControllerEventType = XRSessionEventType | XRInputSourceEventType | 'disconnected' | 'connected';
|
|
5
6
|
|
|
@@ -13,19 +14,36 @@ export interface XRHandInputState {
|
|
|
13
14
|
pinching: boolean;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
export
|
|
17
|
+
export interface WebXRSpaceEventMap extends Object3DEventMap {
|
|
18
|
+
select: { data: XRInputSource };
|
|
19
|
+
selectstart: { data: XRInputSource };
|
|
20
|
+
selectend: { data: XRInputSource };
|
|
21
|
+
squeeze: { data: XRInputSource };
|
|
22
|
+
squeezestart: { data: XRInputSource };
|
|
23
|
+
squeezeend: { data: XRInputSource };
|
|
24
|
+
|
|
25
|
+
connected: { data: XRInputSource };
|
|
26
|
+
disconnected: { data: XRInputSource };
|
|
27
|
+
|
|
28
|
+
pinchend: { handedness: XRHandedness; target: WebXRController }; // This Event break the THREE.EventDispatcher contract, replacing the target to the wrong instance.
|
|
29
|
+
pinchstart: { handedness: XRHandedness; target: WebXRController }; // This Event break the THREE.EventDispatcher contract, replacing the target to the wrong instance.
|
|
30
|
+
|
|
31
|
+
move: {};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export class XRHandSpace extends Group<WebXRSpaceEventMap> {
|
|
17
35
|
readonly joints: Partial<XRHandJoints>;
|
|
18
36
|
readonly inputState: XRHandInputState;
|
|
19
37
|
}
|
|
20
38
|
|
|
21
|
-
export class XRTargetRaySpace extends Group {
|
|
39
|
+
export class XRTargetRaySpace extends Group<WebXRSpaceEventMap> {
|
|
22
40
|
hasLinearVelocity: boolean;
|
|
23
41
|
readonly linearVelocity: Vector3;
|
|
24
42
|
hasAngularVelocity: boolean;
|
|
25
43
|
readonly angularVelocity: Vector3;
|
|
26
44
|
}
|
|
27
45
|
|
|
28
|
-
export class XRGripSpace extends Group {
|
|
46
|
+
export class XRGripSpace extends Group<WebXRSpaceEventMap> {
|
|
29
47
|
hasLinearVelocity: boolean;
|
|
30
48
|
readonly linearVelocity: Vector3;
|
|
31
49
|
hasAngularVelocity: boolean;
|
|
@@ -11,7 +11,16 @@ import { XRTargetRaySpace, XRGripSpace, XRHandSpace } from './WebXRController.js
|
|
|
11
11
|
export type WebXRCamera = PerspectiveCamera & { viewport: Vector4 };
|
|
12
12
|
export type WebXRArrayCamera = Omit<ArrayCamera, 'cameras'> & { cameras: [WebXRCamera, WebXRCamera] };
|
|
13
13
|
|
|
14
|
-
export
|
|
14
|
+
export interface WebXRManagerEventMap {
|
|
15
|
+
sessionstart: {};
|
|
16
|
+
sessionend: {};
|
|
17
|
+
planeadded: { data: XRPlane };
|
|
18
|
+
planeremoved: { data: XRPlane };
|
|
19
|
+
planechanged: { data: XRPlane };
|
|
20
|
+
planesdetected: { data: XRPlaneSet };
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export class WebXRManager extends EventDispatcher<WebXRManagerEventMap> {
|
|
15
24
|
constructor(renderer: any, gl: WebGLRenderingContext);
|
|
16
25
|
|
|
17
26
|
/**
|
three/src/textures/Texture.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Vector2 } from '
|
|
2
|
-
import { Matrix3 } from '
|
|
1
|
+
import { Vector2 } from '../math/Vector2.js';
|
|
2
|
+
import { Matrix3 } from '../math/Matrix3.js';
|
|
3
3
|
import { Source } from './Source.js';
|
|
4
|
-
import { EventDispatcher } from '
|
|
4
|
+
import { EventDispatcher } from '../core/EventDispatcher.js';
|
|
5
5
|
import {
|
|
6
6
|
Mapping,
|
|
7
7
|
Wrapping,
|
|
@@ -38,7 +38,7 @@ export interface OffscreenCanvas extends EventTarget {}
|
|
|
38
38
|
* @see {@link https://threejs.org/docs/index.html#api/en/textures/Texture | Official Documentation}
|
|
39
39
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/Textures/Texture.js | Source}
|
|
40
40
|
*/
|
|
41
|
-
export class Texture extends EventDispatcher {
|
|
41
|
+
export class Texture extends EventDispatcher<{ dispose: {} }> {
|
|
42
42
|
/**
|
|
43
43
|
* This creates a new {@link THREE.Texture | Texture} object.
|
|
44
44
|
* @param image See {@link Texture.image | .image}. Default {@link THREE.Texture.DEFAULT_IMAGE}
|
three/src/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function createCanvasElement(): HTMLCanvasElement;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { CompressedTexture, Loader, LoadingManager, WebGLRenderer } from '../../../src/Three.js';
|
|
2
|
-
|
|
3
|
-
export class BasisTextureLoader extends Loader {
|
|
4
|
-
constructor(manager?: LoadingManager);
|
|
5
|
-
transcoderBinary: ArrayBuffer | null;
|
|
6
|
-
transcoderPath: string;
|
|
7
|
-
transcoderPending: Promise<void> | null;
|
|
8
|
-
|
|
9
|
-
workerConfig: {
|
|
10
|
-
format: number;
|
|
11
|
-
astcSupported: boolean;
|
|
12
|
-
etcSupported: boolean;
|
|
13
|
-
dxtSupported: boolean;
|
|
14
|
-
pvrtcSupported: boolean;
|
|
15
|
-
};
|
|
16
|
-
workerLimit: number;
|
|
17
|
-
workerNextTaskID: number;
|
|
18
|
-
workerPool: object[];
|
|
19
|
-
workerSourceURL: string;
|
|
20
|
-
|
|
21
|
-
detectSupport(renderer: WebGLRenderer): this;
|
|
22
|
-
load(
|
|
23
|
-
url: string,
|
|
24
|
-
onLoad: (texture: CompressedTexture) => void,
|
|
25
|
-
onProgress?: (event: ProgressEvent) => void,
|
|
26
|
-
onError?: (event: ErrorEvent) => void,
|
|
27
|
-
): void;
|
|
28
|
-
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<CompressedTexture>;
|
|
29
|
-
setTranscoderPath(path: string): this;
|
|
30
|
-
setWorkerLimit(workerLimit: number): this;
|
|
31
|
-
dispose(): void;
|
|
32
|
-
}
|