@types/three 0.136.1 → 0.137.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 +1 -1
- three/examples/jsm/controls/OrbitControls.d.ts +4 -0
- three/examples/jsm/geometries/ConvexGeometry.d.ts +1 -1
- three/examples/jsm/loaders/LDrawLoader.d.ts +6 -0
- three/examples/jsm/nodes/utils/ColorSpaceNode.d.ts +1 -1
- three/examples/jsm/utils/LDrawUtils.d.ts +5 -0
- three/examples/jsm/utils/PackedPhongMaterial.d.ts +10 -0
- three/examples/jsm/utils/SceneUtils.d.ts +10 -12
- three/index.d.ts +1 -1
- three/package.json +2 -2
- three/src/constants.d.ts +4 -17
- three/src/core/Raycaster.d.ts +1 -0
- three/src/extras/ImageUtils.d.ts +2 -0
- three/src/extras/PMREMGenerator.d.ts +2 -2
- three/src/materials/Material.d.ts +5 -6
- three/src/math/Box3.d.ts +2 -2
- three/src/math/Color.d.ts +2 -0
- three/src/renderers/webgl/WebGLUtils.d.ts +3 -1
- three/src/renderers/webxr/WebXRManager.d.ts +1 -1
- three/src/textures/CubeTexture.d.ts +1 -1
- three/src/textures/VideoTexture.d.ts +1 -1
- three/examples/jsm/utils/RoughnessMipmapper.d.ts +0 -7
three/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for three (https://threejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Thu, 27 Jan 2022 22:31:34 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: `THREE`
|
|
14
14
|
|
|
@@ -47,6 +47,10 @@ export class OrbitControls {
|
|
|
47
47
|
mouseButtons: { LEFT: MOUSE; MIDDLE: MOUSE; RIGHT: MOUSE };
|
|
48
48
|
touches: { ONE: TOUCH; TWO: TOUCH };
|
|
49
49
|
|
|
50
|
+
target0: Vector3;
|
|
51
|
+
position0: Vector3;
|
|
52
|
+
zoomO: number;
|
|
53
|
+
|
|
50
54
|
update(): boolean;
|
|
51
55
|
|
|
52
56
|
listenToKeyEvents(domElement: HTMLElement): void;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { Loader, LoadingManager, Group, Material } from '../../../src/Three';
|
|
2
2
|
|
|
3
3
|
export class LDrawLoader extends Loader {
|
|
4
|
+
materials: Material[];
|
|
5
|
+
materialsLibrary: Record<string, Material>;
|
|
6
|
+
fileMap: Record<string, string>;
|
|
7
|
+
smoothNormals: boolean;
|
|
8
|
+
|
|
4
9
|
constructor(manager?: LoadingManager);
|
|
5
10
|
|
|
6
11
|
load(
|
|
@@ -10,6 +15,7 @@ export class LDrawLoader extends Loader {
|
|
|
10
15
|
onError?: (event: ErrorEvent) => void,
|
|
11
16
|
): void;
|
|
12
17
|
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<Group>;
|
|
18
|
+
preloadMaterials(url: string): Promise<void>;
|
|
13
19
|
setFileMap(fileMap: Record<string, string>): void;
|
|
14
20
|
setMaterials(materials: Material[]): void;
|
|
15
21
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `PackedPhongMaterial` inherited from THREE.MeshPhongMaterial
|
|
3
|
+
*
|
|
4
|
+
* @param {Object} parameters
|
|
5
|
+
*/
|
|
6
|
+
import { MeshPhongMaterial, MeshPhongMaterialParameters } from '../../../src/Three';
|
|
7
|
+
|
|
8
|
+
export class PackedPhongMaterial extends MeshPhongMaterial {
|
|
9
|
+
constructor(parameters: MeshPhongMaterialParameters);
|
|
10
|
+
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { BufferGeometry, Group, InstancedMesh, Material, Object3D, Scene } from '../../../src/Three';
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function attach(child: Object3D, scene: Scene, parent: Object3D): void;
|
|
14
|
-
}
|
|
3
|
+
export function createMeshesFromInstancedMesh(instancedMesh: InstancedMesh): Group;
|
|
4
|
+
export function createMultiMaterialObject(geometry: BufferGeometry, materials: Material[]): Group;
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use scene.attach( child ) instead.
|
|
7
|
+
*/
|
|
8
|
+
export function detach(child: Object3D, parent: Object3D, scene: Scene): void;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use parent.attach( child ) instead.
|
|
11
|
+
*/
|
|
12
|
+
export function attach(child: Object3D, scene: Scene, parent: Object3D): void;
|
three/index.d.ts
CHANGED
three/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/three",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.137.0",
|
|
4
4
|
"description": "TypeScript definitions for three",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
},
|
|
26
26
|
"scripts": {},
|
|
27
27
|
"dependencies": {},
|
|
28
|
-
"typesPublisherContentHash": "
|
|
28
|
+
"typesPublisherContentHash": "dad1fe1dce939480949b1f93552d8ca03cab08b655aca66703302855e9fb414d",
|
|
29
29
|
"typeScriptVersion": "3.8"
|
|
30
30
|
}
|
three/src/constants.d.ts
CHANGED
|
@@ -105,6 +105,7 @@ export const LinearToneMapping: ToneMapping;
|
|
|
105
105
|
export const ReinhardToneMapping: ToneMapping;
|
|
106
106
|
export const CineonToneMapping: ToneMapping;
|
|
107
107
|
export const ACESFilmicToneMapping: ToneMapping;
|
|
108
|
+
export const CustomToneMapping: ToneMapping;
|
|
108
109
|
|
|
109
110
|
// Mapping modes
|
|
110
111
|
export enum Mapping {}
|
|
@@ -147,13 +148,11 @@ export const FloatType: TextureDataType;
|
|
|
147
148
|
export const HalfFloatType: TextureDataType;
|
|
148
149
|
export const UnsignedShort4444Type: TextureDataType;
|
|
149
150
|
export const UnsignedShort5551Type: TextureDataType;
|
|
150
|
-
export const UnsignedShort565Type: TextureDataType;
|
|
151
151
|
export const UnsignedInt248Type: TextureDataType;
|
|
152
152
|
|
|
153
153
|
// Pixel formats
|
|
154
154
|
export enum PixelFormat {}
|
|
155
155
|
export const AlphaFormat: PixelFormat;
|
|
156
|
-
export const RGBFormat: PixelFormat;
|
|
157
156
|
export const RGBAFormat: PixelFormat;
|
|
158
157
|
export const LuminanceFormat: PixelFormat;
|
|
159
158
|
export const LuminanceAlphaFormat: PixelFormat;
|
|
@@ -163,8 +162,9 @@ export const RedFormat: PixelFormat;
|
|
|
163
162
|
export const RedIntegerFormat: PixelFormat;
|
|
164
163
|
export const RGFormat: PixelFormat;
|
|
165
164
|
export const RGIntegerFormat: PixelFormat;
|
|
166
|
-
export const RGBIntegerFormat: PixelFormat;
|
|
167
165
|
export const RGBAIntegerFormat: PixelFormat;
|
|
166
|
+
export const _SRGBFormat: PixelFormat; // fallback for WebGL 1
|
|
167
|
+
export const _SRGBAFormat: PixelFormat; // fallback for WebGL 1
|
|
168
168
|
|
|
169
169
|
// Internal Pixel Formats
|
|
170
170
|
export type PixelFormatGPU =
|
|
@@ -223,6 +223,7 @@ export type PixelFormatGPU =
|
|
|
223
223
|
| 'RGB10_A2'
|
|
224
224
|
| 'RGB10_A2UI'
|
|
225
225
|
| 'SRGB8_ALPHA8'
|
|
226
|
+
| 'SRGB8'
|
|
226
227
|
| 'DEPTH_COMPONENT16'
|
|
227
228
|
| 'DEPTH_COMPONENT24'
|
|
228
229
|
| 'DEPTH_COMPONENT32F'
|
|
@@ -263,20 +264,6 @@ export const RGBA_ASTC_10x8_Format: CompressedPixelFormat;
|
|
|
263
264
|
export const RGBA_ASTC_10x10_Format: CompressedPixelFormat;
|
|
264
265
|
export const RGBA_ASTC_12x10_Format: CompressedPixelFormat;
|
|
265
266
|
export const RGBA_ASTC_12x12_Format: CompressedPixelFormat;
|
|
266
|
-
export const SRGB8_ALPHA8_ASTC_4x4_Format: CompressedPixelFormat;
|
|
267
|
-
export const SRGB8_ALPHA8_ASTC_5x4_Format: CompressedPixelFormat;
|
|
268
|
-
export const SRGB8_ALPHA8_ASTC_5x5_Format: CompressedPixelFormat;
|
|
269
|
-
export const SRGB8_ALPHA8_ASTC_6x5_Format: CompressedPixelFormat;
|
|
270
|
-
export const SRGB8_ALPHA8_ASTC_6x6_Format: CompressedPixelFormat;
|
|
271
|
-
export const SRGB8_ALPHA8_ASTC_8x5_Format: CompressedPixelFormat;
|
|
272
|
-
export const SRGB8_ALPHA8_ASTC_8x6_Format: CompressedPixelFormat;
|
|
273
|
-
export const SRGB8_ALPHA8_ASTC_8x8_Format: CompressedPixelFormat;
|
|
274
|
-
export const SRGB8_ALPHA8_ASTC_10x5_Format: CompressedPixelFormat;
|
|
275
|
-
export const SRGB8_ALPHA8_ASTC_10x6_Format: CompressedPixelFormat;
|
|
276
|
-
export const SRGB8_ALPHA8_ASTC_10x8_Format: CompressedPixelFormat;
|
|
277
|
-
export const SRGB8_ALPHA8_ASTC_10x10_Format: CompressedPixelFormat;
|
|
278
|
-
export const SRGB8_ALPHA8_ASTC_12x10_Format: CompressedPixelFormat;
|
|
279
|
-
export const SRGB8_ALPHA8_ASTC_12x12_Format: CompressedPixelFormat;
|
|
280
267
|
|
|
281
268
|
// BPTC compressed texture formats
|
|
282
269
|
export const RGBA_BPTC_Format: CompressedPixelFormat;
|
three/src/core/Raycaster.d.ts
CHANGED
three/src/extras/ImageUtils.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ import { Scene } from '../scenes/Scene';
|
|
|
7
7
|
export class PMREMGenerator {
|
|
8
8
|
constructor(renderer: WebGLRenderer);
|
|
9
9
|
fromScene(scene: Scene, sigma?: number, near?: number, far?: number): WebGLRenderTarget;
|
|
10
|
-
fromEquirectangular(equirectangular: Texture): WebGLRenderTarget;
|
|
11
|
-
fromCubemap(cubemap: CubeTexture): WebGLRenderTarget;
|
|
10
|
+
fromEquirectangular(equirectangular: Texture, renderTarget?: WebGLRenderTarget | null): WebGLRenderTarget;
|
|
11
|
+
fromCubemap(cubemap: CubeTexture, renderTarget?: WebGLRenderTarget | null): WebGLRenderTarget;
|
|
12
12
|
compileCubemapShader(): void;
|
|
13
13
|
compileEquirectangularShader(): void;
|
|
14
14
|
dispose(): void;
|
|
@@ -80,6 +80,11 @@ export class Material extends EventDispatcher {
|
|
|
80
80
|
*/
|
|
81
81
|
alphaToCoverage: boolean;
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
alphaWrite: boolean;
|
|
87
|
+
|
|
83
88
|
/**
|
|
84
89
|
* Blending destination. It's one of the blending mode constants defined in Three.js. Default is {@link OneMinusSrcAlphaFactor}.
|
|
85
90
|
* @default THREE.OneMinusSrcAlphaFactor
|
|
@@ -181,12 +186,6 @@ export class Material extends EventDispatcher {
|
|
|
181
186
|
*/
|
|
182
187
|
fog: boolean;
|
|
183
188
|
|
|
184
|
-
/**
|
|
185
|
-
* When this property is set to THREE.RGBFormat, the material is considered to be opaque and alpha values are ignored.
|
|
186
|
-
* @default THREE.RGBAFormat
|
|
187
|
-
*/
|
|
188
|
-
format: PixelFormat;
|
|
189
|
-
|
|
190
189
|
/**
|
|
191
190
|
* Unique number of this material instance.
|
|
192
191
|
*/
|
three/src/math/Box3.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export class Box3 {
|
|
|
25
25
|
setFromBufferAttribute(bufferAttribute: BufferAttribute): this;
|
|
26
26
|
setFromPoints(points: Vector3[]): this;
|
|
27
27
|
setFromCenterAndSize(center: Vector3, size: Vector3): this;
|
|
28
|
-
setFromObject(object: Object3D): this;
|
|
28
|
+
setFromObject(object: Object3D, precise?: boolean): this;
|
|
29
29
|
clone(): this;
|
|
30
30
|
copy(box: Box3): this;
|
|
31
31
|
makeEmpty(): this;
|
|
@@ -35,7 +35,7 @@ export class Box3 {
|
|
|
35
35
|
expandByPoint(point: Vector3): this;
|
|
36
36
|
expandByVector(vector: Vector3): this;
|
|
37
37
|
expandByScalar(scalar: number): this;
|
|
38
|
-
expandByObject(object: Object3D): this;
|
|
38
|
+
expandByObject(object: Object3D, precise?: boolean): this;
|
|
39
39
|
containsPoint(point: Vector3): boolean;
|
|
40
40
|
containsBox(box: Box3): boolean;
|
|
41
41
|
getParameter(point: Vector3, target: Vector3): Vector3;
|
three/src/math/Color.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { CompressedPixelFormat, TextureEncoding } from '../../constants';
|
|
2
|
+
|
|
1
3
|
export class WebGLUtils {
|
|
2
4
|
constructor(gl: WebGLRenderingContext | WebGL2RenderingContext, extensions: any, capabilities: any);
|
|
3
5
|
|
|
4
|
-
convert(p:
|
|
6
|
+
convert(p: CompressedPixelFormat, encoding?: TextureEncoding | null): void;
|
|
5
7
|
}
|
|
@@ -25,7 +25,7 @@ export class WebXRManager extends EventDispatcher {
|
|
|
25
25
|
getSession(): XRSession | null;
|
|
26
26
|
setSession(value: XRSession): Promise<void>;
|
|
27
27
|
getCamera(camera: Camera): Camera;
|
|
28
|
-
setAnimationLoop(callback: XRFrameRequestCallback): void;
|
|
28
|
+
setAnimationLoop(callback: XRFrameRequestCallback | null): void;
|
|
29
29
|
getFoveation(): number | undefined;
|
|
30
30
|
setFoveation(foveation: number): void;
|
|
31
31
|
dispose(): void;
|
|
@@ -9,7 +9,7 @@ export class CubeTexture extends Texture {
|
|
|
9
9
|
* @param [wrapT=THREE.ClampToEdgeWrapping]
|
|
10
10
|
* @param [magFilter=THREE.LinearFilter]
|
|
11
11
|
* @param [minFilter=THREE.LinearMipmapLinearFilter]
|
|
12
|
-
* @param [format=THREE.
|
|
12
|
+
* @param [format=THREE.RGBAFormat]
|
|
13
13
|
* @param [type=THREE.UnsignedByteType]
|
|
14
14
|
* @param [anisotropy=1]
|
|
15
15
|
* @param [encoding=THREE.LinearEncoding]
|
|
@@ -9,7 +9,7 @@ export class VideoTexture extends Texture {
|
|
|
9
9
|
* @param [wrapT=THREE.ClampToEdgeWrapping]
|
|
10
10
|
* @param [magFilter=THREE.LinearFilter]
|
|
11
11
|
* @param [minFilter=THREE.LinearFilter]
|
|
12
|
-
* @param [format=THREE.
|
|
12
|
+
* @param [format=THREE.RGBAFormat]
|
|
13
13
|
* @param [type=THREE.UnsignedByteType]
|
|
14
14
|
* @param [anisotropy=1]
|
|
15
15
|
*/
|