@types/three 0.138.0 → 0.141.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.
Files changed (60) hide show
  1. three/README.md +2 -2
  2. three/examples/jsm/controls/OrbitControls.d.ts +1 -1
  3. three/examples/jsm/controls/TransformControls.d.ts +41 -1
  4. three/examples/jsm/exporters/EXRExporter.d.ts +2 -1
  5. three/examples/jsm/exporters/GLTFExporter.d.ts +102 -5
  6. three/examples/jsm/exporters/KTX2Exporter.d.ts +5 -0
  7. three/examples/jsm/geometries/LightningStrike.d.ts +3 -3
  8. three/examples/jsm/loaders/GLTFLoader.d.ts +6 -1
  9. three/examples/jsm/loaders/NRRDLoader.d.ts +2 -2
  10. three/examples/jsm/misc/MorphAnimMesh.d.ts +1 -1
  11. three/examples/jsm/objects/LightningStorm.d.ts +3 -3
  12. three/examples/jsm/objects/Reflector.d.ts +11 -1
  13. three/examples/jsm/objects/Refractor.d.ts +11 -1
  14. three/examples/jsm/postprocessing/SSAARenderPass.d.ts +1 -1
  15. three/examples/jsm/postprocessing/SavePass.d.ts +1 -1
  16. three/examples/jsm/utils/BufferGeometryUtils.d.ts +8 -0
  17. three/examples/jsm/utils/SceneUtils.d.ts +3 -1
  18. three/examples/jsm/utils/SkeletonUtils.d.ts +15 -11
  19. three/examples/jsm/webxr/ARButton.d.ts +5 -1
  20. three/examples/jsm/webxr/OculusHandModel.d.ts +3 -2
  21. three/examples/jsm/webxr/OculusHandPointerModel.d.ts +6 -2
  22. three/examples/jsm/webxr/XRControllerModelFactory.d.ts +2 -0
  23. three/examples/jsm/webxr/XREstimatedLight.d.ts +5 -5
  24. three/examples/jsm/webxr/XRHandModelFactory.d.ts +1 -1
  25. three/index.d.ts +6 -5
  26. three/package.json +5 -3
  27. three/src/Three.d.ts +2 -1
  28. three/src/animation/AnimationUtils.d.ts +1 -1
  29. three/src/constants.d.ts +6 -2
  30. three/src/core/BufferGeometry.d.ts +0 -2
  31. three/src/core/InstancedBufferGeometry.d.ts +0 -4
  32. three/src/core/Uniform.d.ts +0 -1
  33. three/src/extras/DataUtils.d.ts +1 -0
  34. three/src/extras/Earcut.d.ts +4 -0
  35. three/src/geometries/CapsuleGeometry.d.ts +27 -0
  36. three/src/geometries/Geometries.d.ts +1 -0
  37. three/src/materials/Material.d.ts +0 -15
  38. three/src/materials/MeshBasicMaterial.d.ts +7 -0
  39. three/src/materials/MeshLambertMaterial.d.ts +7 -0
  40. three/src/materials/MeshMatcapMaterial.d.ts +7 -1
  41. three/src/materials/MeshPhongMaterial.d.ts +7 -1
  42. three/src/materials/MeshPhysicalMaterial.d.ts +20 -0
  43. three/src/materials/MeshStandardMaterial.d.ts +7 -7
  44. three/src/materials/MeshToonMaterial.d.ts +7 -0
  45. three/src/materials/PointsMaterial.d.ts +7 -0
  46. three/src/materials/ShadowMaterial.d.ts +7 -0
  47. three/src/materials/SpriteMaterial.d.ts +7 -0
  48. three/src/math/Color.d.ts +22 -10
  49. three/src/math/ColorManagement.d.ts +18 -0
  50. three/src/math/Euler.d.ts +2 -0
  51. three/src/math/Plane.d.ts +0 -1
  52. three/src/math/Quaternion.d.ts +2 -0
  53. three/src/renderers/WebGLRenderTarget.d.ts +6 -1
  54. three/src/renderers/WebGLRenderer.d.ts +2 -3
  55. three/src/renderers/webgl/WebGLUtils.d.ts +2 -2
  56. three/src/renderers/webxr/WebXRController.d.ts +31 -5
  57. three/src/renderers/webxr/WebXRManager.d.ts +23 -7
  58. three/src/scenes/Scene.d.ts +0 -15
  59. three/examples/jsm/postprocessing/SSRrPass.d.ts +0 -121
  60. three/src/renderers/webxr/WebXR.d.ts +0 -328
three/README.md CHANGED
@@ -8,8 +8,8 @@ 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: Wed, 02 Mar 2022 16:01:44 GMT
12
- * Dependencies: none
11
+ * Last updated: Tue, 31 May 2022 18:31:37 GMT
12
+ * Dependencies: [@types/webxr](https://npmjs.com/package/@types/webxr)
13
13
  * Global values: `THREE`
14
14
 
15
15
  # Credits
@@ -52,7 +52,7 @@ export class OrbitControls {
52
52
 
53
53
  update(): boolean;
54
54
 
55
- listenToKeyEvents(domElement: HTMLElement): void;
55
+ listenToKeyEvents(domElement: HTMLElement | Window): void;
56
56
 
57
57
  saveState(): void;
58
58
 
@@ -1,4 +1,4 @@
1
- import { Object3D, Camera, MOUSE, Raycaster } from '../../../src/Three';
1
+ import { Object3D, Camera, MOUSE, Raycaster, Mesh, Vector3, Quaternion } from '../../../src/Three';
2
2
 
3
3
  export class TransformControls extends Object3D {
4
4
  constructor(object: Camera, domElement?: HTMLElement);
@@ -40,3 +40,43 @@ export class TransformControls extends Object3D {
40
40
  reset(): void;
41
41
  dispose(): void;
42
42
  }
43
+
44
+ export class TransformControlsGizmo extends Object3D {
45
+ type: 'TransformControlsGizmo';
46
+ isTransformControlsGizmo: true;
47
+
48
+ gizmo: {
49
+ translate: Object3D;
50
+ rotate: Object3D;
51
+ scale: Object3D;
52
+ };
53
+ helper: {
54
+ translate: Object3D;
55
+ rotate: Object3D;
56
+ scale: Object3D;
57
+ };
58
+ picker: {
59
+ translate: Object3D;
60
+ rotate: Object3D;
61
+ scale: Object3D;
62
+ };
63
+
64
+ constructor();
65
+ }
66
+
67
+ export class TransformControlsPlane extends Mesh {
68
+ type: 'TransformControlsPlane';
69
+ isTransformControlsPlane: true;
70
+
71
+ constructor();
72
+
73
+ mode: 'translate' | 'scale' | 'rotate';
74
+
75
+ axis: 'X' | 'Y' | 'Z' | 'XY' | 'YZ' | 'XZ' | 'XYZ' | 'E';
76
+
77
+ space: 'local' | 'world';
78
+
79
+ eye: Vector3;
80
+ worldPosition: Vector3;
81
+ worldQuaternion: Quaternion;
82
+ }
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * @author sciecode / https://github.com/sciecode
3
3
  *
4
- * EXR format references: https://www.openexr.com/documentation/openexrfilelayout.pdf
4
+ * EXR format references:
5
+ * https://www.openexr.com/documentation/openexrfilelayout.pdf
5
6
  */
6
7
 
7
8
  import { WebGLRenderer, WebGLRenderTarget, TextureDataType } from '../../../src/Three';
@@ -1,20 +1,117 @@
1
- import { Object3D, AnimationClip } from '../../../src/Three';
1
+ import { Object3D, AnimationClip, Texture, Material, Mesh } from '../../../src/Three';
2
2
 
3
3
  export interface GLTFExporterOptions {
4
- binary?: boolean;
4
+ /**
5
+ * Export position, rotation and scale instead of matrix per node. Default is false
6
+ */
5
7
  trs?: boolean;
8
+
9
+ /**
10
+ * Export only visible objects. Default is true.
11
+ */
6
12
  onlyVisible?: boolean;
13
+
14
+ /**
15
+ * Export just the attributes within the drawRange, if defined, instead of exporting the whole array. Default is true.
16
+ */
7
17
  truncateDrawRange?: boolean;
18
+
19
+ /**
20
+ * Export in binary (.glb) format, returning an ArrayBuffer. Default is false.
21
+ */
22
+ binary?: boolean;
23
+
24
+ /**
25
+ * Export with images embedded into the glTF asset. Default is true.
26
+ */
8
27
  embedImages?: boolean;
28
+
29
+ /**
30
+ * Restricts the image maximum size (both width and height) to the given value. This option works only if embedImages is true. Default is Infinity.
31
+ */
32
+ maxTextureSize?: number;
33
+
34
+ /**
35
+ * List of animations to be included in the export.
36
+ */
9
37
  animations?: AnimationClip[];
38
+
39
+ /**
40
+ * Generate indices for non-index geometry and export with them. Default is false.
41
+ */
10
42
  forceIndices?: boolean;
11
- forcePowerOfTwoTextures?: boolean;
43
+
44
+ /**
45
+ * Export custom glTF extensions defined on an object's userData.gltfExtensions property. Default is false.
46
+ */
12
47
  includeCustomExtensions?: boolean;
13
48
  }
14
49
 
15
50
  export class GLTFExporter {
16
51
  constructor();
17
52
 
18
- parse(input: Object3D, onCompleted: (gltf: object) => void, options: GLTFExporterOptions): void;
19
- parseAsync(input: Object3D, options: GLTFExporterOptions): Promise<void>;
53
+ register(callback: (writer: GLTFWriter) => GLTFExporterPlugin): this;
54
+ unregister(callback: (writer: GLTFWriter) => GLTFExporterPlugin): this;
55
+
56
+ /**
57
+ * Generates a .gltf (JSON) or .glb (binary) output from the input (Scenes or Objects)
58
+ *
59
+ * @param input Scenes or objects to export. Valid options:
60
+ * - Export scenes
61
+ * ```js
62
+ * exporter.parse( scene1, ... )
63
+ * exporter.parse( [ scene1, scene2 ], ... )
64
+ * ```
65
+ * - Export objects (It will create a new Scene to hold all the objects)
66
+ * ```js
67
+ * exporter.parse( object1, ... )
68
+ * exporter.parse( [ object1, object2 ], ... )
69
+ * ```
70
+ * - Mix scenes and objects (It will export the scenes as usual but it will create a new scene to hold all the single objects).
71
+ * ```js
72
+ * exporter.parse( [ scene1, object1, object2, scene2 ], ... )
73
+ * ```
74
+ * @param onDone Will be called when the export completes. The argument will be the generated glTF JSON or binary ArrayBuffer.
75
+ * @param onError Will be called if there are any errors during the gltf generation.
76
+ * @param options Export options
77
+ */
78
+ parse(
79
+ input: Object3D | Object3D[],
80
+ onDone: (gltf: ArrayBuffer | { [key: string]: any }) => void,
81
+ onError: (error: ErrorEvent) => void,
82
+ options?: GLTFExporterOptions,
83
+ ): void;
84
+
85
+ parseAsync(
86
+ input: Object3D | Object3D[],
87
+ options?: GLTFExporterOptions,
88
+ ): Promise<ArrayBuffer | { [key: string]: any }>;
89
+ }
90
+
91
+ export class GLTFWriter {
92
+ constructor();
93
+
94
+ setPlugins(plugins: GLTFExporterPlugin[]): void;
95
+
96
+ /**
97
+ * Parse scenes and generate GLTF output
98
+ *
99
+ * @param input Scene or Array of THREE.Scenes
100
+ * @param onDone Callback on completed
101
+ * @param options options
102
+ */
103
+ write(
104
+ input: Object3D | Object3D[],
105
+ onDone: (gltf: ArrayBuffer | { [key: string]: any }) => void,
106
+ options?: GLTFExporterOptions,
107
+ ): Promise<void>;
108
+ }
109
+
110
+ export interface GLTFExporterPlugin {
111
+ writeTexture?: (map: Texture, textureDef: { [key: string]: any }) => void;
112
+ writeMaterial?: (material: Material, materialDef: { [key: string]: any }) => void;
113
+ writeMesh?: (mesh: Mesh, meshDef: { [key: string]: any }) => void;
114
+ writeNode?: (object: Object3D, nodeDef: { [key: string]: any }) => void;
115
+ beforeParse?: (input: Object3D | Object3D[]) => void;
116
+ afterParse?: (input: Object3D | Object3D[]) => void;
20
117
  }
@@ -0,0 +1,5 @@
1
+ import { Data3DTexture, DataTexture, WebGLRenderer, WebGLRenderTarget } from '../../../src/Three';
2
+
3
+ export class KTX2Exporter {
4
+ parse(arg1: Data3DTexture | DataTexture | WebGLRenderer, arg2?: WebGLRenderTarget): Uint8Array;
5
+ }
@@ -1,4 +1,4 @@
1
- import { Vector3 } from '../../../src/Three';
1
+ import { BufferGeometry, Vector3 } from '../../../src/Three';
2
2
 
3
3
  export interface RandomGenerator {
4
4
  random(): number;
@@ -87,7 +87,7 @@ export interface RayParameters {
87
87
  ) => void;
88
88
  }
89
89
 
90
- export class LightningStrike {
90
+ export class LightningStrike extends BufferGeometry {
91
91
  constructor(rayParameters?: RayParameters);
92
92
  copyParameters(dest?: RayParameters, source?: RayParameters): RayParameters;
93
93
 
@@ -103,6 +103,6 @@ export class LightningStrike {
103
103
 
104
104
  update(time: number): void;
105
105
 
106
- copy(source: LightningStrike): LightningStrike;
106
+ copy(source: LightningStrike): this;
107
107
  clone(): this;
108
108
  }
@@ -91,10 +91,15 @@ export class GLTFParser {
91
91
 
92
92
  fileLoader: FileLoader;
93
93
  textureLoader: TextureLoader | ImageBitmapLoader;
94
- plugins: GLTFLoaderPlugin;
94
+ plugins: { [name: string]: GLTFLoaderPlugin };
95
95
  extensions: { [name: string]: any };
96
96
  associations: Map<Object3D | Material | Texture, GLTFReference>;
97
97
 
98
+ setExtensions(extensions: { [name: string]: any }): void;
99
+ setPlugins(plugins: { [name: string]: GLTFLoaderPlugin }): void;
100
+
101
+ parse(onLoad: (gltf: GLTF) => void, onError?: (event: ErrorEvent) => void): void;
102
+
98
103
  getDependency: (type: string, index: number) => Promise<any>;
99
104
  getDependencies: (type: string) => Promise<any[]>;
100
105
  loadBuffer: (bufferIndex: number) => Promise<ArrayBuffer>;
@@ -1,8 +1,8 @@
1
- import { LoadingManager } from '../../../src/Three';
1
+ import { Loader, LoadingManager } from '../../../src/Three';
2
2
 
3
3
  import { Volume } from '../misc/Volume';
4
4
 
5
- export class NRRDLoader {
5
+ export class NRRDLoader extends Loader {
6
6
  constructor(manager?: LoadingManager);
7
7
  manager: LoadingManager;
8
8
  path: string;
@@ -9,5 +9,5 @@ export class MorphAnimMesh extends Mesh {
9
9
  setDirectionBackward(): void;
10
10
  playAnimation(label: string, fps: number): void;
11
11
  updateAnimation(delta: number): void;
12
- copy(source: MorphAnimMesh): this;
12
+ copy(source: MorphAnimMesh, recursive?: boolean): this;
13
13
  }
@@ -1,4 +1,4 @@
1
- import { Material, Vector3 } from '../../../src/Three';
1
+ import { Material, Object3D, Vector3 } from '../../../src/Three';
2
2
 
3
3
  import { LightningStrike, RayParameters } from '../geometries/LightningStrike';
4
4
 
@@ -24,9 +24,9 @@ export interface StormParams {
24
24
  onLightningDown?: (lightning: LightningStrike) => void;
25
25
  }
26
26
 
27
- export class LightningStorm {
27
+ export class LightningStorm extends Object3D {
28
28
  constructor(stormParams?: StormParams);
29
29
  update(time: number): void;
30
- copy(source: LightningStorm): LightningStorm;
30
+ copy(source: LightningStorm, recursive?: boolean): this;
31
31
  clone(): this;
32
32
  }
@@ -1,4 +1,11 @@
1
- import { Mesh, BufferGeometry, ColorRepresentation, TextureEncoding, WebGLRenderTarget } from '../../../src/Three';
1
+ import {
2
+ Mesh,
3
+ BufferGeometry,
4
+ ColorRepresentation,
5
+ TextureEncoding,
6
+ WebGLRenderTarget,
7
+ PerspectiveCamera,
8
+ } from '../../../src/Three';
2
9
 
3
10
  export interface ReflectorOptions {
4
11
  color?: ColorRepresentation;
@@ -11,6 +18,9 @@ export interface ReflectorOptions {
11
18
  }
12
19
 
13
20
  export class Reflector extends Mesh {
21
+ type: 'Reflector';
22
+ camera: PerspectiveCamera;
23
+
14
24
  constructor(geometry?: BufferGeometry, options?: ReflectorOptions);
15
25
 
16
26
  getRenderTarget(): WebGLRenderTarget;
@@ -1,4 +1,11 @@
1
- import { Mesh, BufferGeometry, ColorRepresentation, TextureEncoding, WebGLRenderTarget } from '../../../src/Three';
1
+ import {
2
+ Mesh,
3
+ BufferGeometry,
4
+ ColorRepresentation,
5
+ TextureEncoding,
6
+ WebGLRenderTarget,
7
+ PerspectiveCamera,
8
+ } from '../../../src/Three';
2
9
 
3
10
  export interface RefractorOptions {
4
11
  color?: ColorRepresentation;
@@ -11,6 +18,9 @@ export interface RefractorOptions {
11
18
  }
12
19
 
13
20
  export class Refractor extends Mesh {
21
+ type: 'Refractor';
22
+ camera: PerspectiveCamera;
23
+
14
24
  constructor(geometry?: BufferGeometry, options?: RefractorOptions);
15
25
 
16
26
  getRenderTarget(): WebGLRenderTarget;
@@ -3,7 +3,7 @@ import { Scene, Camera, ColorRepresentation, ShaderMaterial, WebGLRenderTarget }
3
3
  import { Pass } from './Pass';
4
4
 
5
5
  export class SSAARenderPass extends Pass {
6
- constructor(scene: Scene, camera: Camera, clearColor: ColorRepresentation, clearAlpha: number);
6
+ constructor(scene: Scene, camera: Camera, clearColor?: ColorRepresentation, clearAlpha?: number);
7
7
  scene: Scene;
8
8
  camera: Camera;
9
9
  sampleLevel: number;
@@ -3,7 +3,7 @@ import { ShaderMaterial, WebGLRenderTarget } from '../../../src/Three';
3
3
  import { Pass } from './Pass';
4
4
 
5
5
  export class SavePass extends Pass {
6
- constructor(renderTarget: WebGLRenderTarget);
6
+ constructor(renderTarget?: WebGLRenderTarget);
7
7
  textureID: string;
8
8
  renderTarget: WebGLRenderTarget;
9
9
  uniforms: object;
@@ -15,3 +15,11 @@ export function estimateBytesUsed(geometry: BufferGeometry): number;
15
15
  export function mergeVertices(geometry: BufferGeometry, tolerance?: number): BufferGeometry;
16
16
  export function toTrianglesDrawMode(geometry: BufferGeometry, drawMode: TrianglesDrawModes): BufferGeometry;
17
17
  export function computeMorphedAttributes(object: Mesh | Line | Points): object;
18
+ export function computeMikkTSpaceTangents(
19
+ geometry: BufferGeometry,
20
+ MikkTSpace: unknown,
21
+ negateSign?: boolean,
22
+ ): BufferGeometry;
23
+ export function mergeGroups(geometry: BufferGeometry): BufferGeometry;
24
+ export function deinterleaveAttribute(geometry: BufferGeometry): void;
25
+ export function deinterleaveGeometry(geometry: BufferGeometry): void;
@@ -1,4 +1,4 @@
1
- import { BufferGeometry, Group, InstancedMesh, Material, Object3D, Scene } from '../../../src/Three';
1
+ import { BufferGeometry, Group, InstancedMesh, Material, Object3D, Scene, Mesh } from '../../../src/Three';
2
2
 
3
3
  export function createMeshesFromInstancedMesh(instancedMesh: InstancedMesh): Group;
4
4
  export function createMultiMaterialObject(geometry: BufferGeometry, materials: Material[]): Group;
@@ -10,3 +10,5 @@ export function detach(child: Object3D, parent: Object3D, scene: Scene): void;
10
10
  * @deprecated Use parent.attach( child ) instead.
11
11
  */
12
12
  export function attach(child: Object3D, scene: Scene, parent: Object3D): void;
13
+
14
+ export function createMeshesFromMultiMaterialMesh(mesh: Mesh): Group;
@@ -1,30 +1,34 @@
1
1
  import { AnimationClip, Bone, Matrix4, Object3D, Skeleton, SkeletonHelper } from '../../../src/Three';
2
2
 
3
3
  export namespace SkeletonUtils {
4
- function retarget(target: Object3D | Skeleton, source: Object3D | Skeleton, options: {}): void;
4
+ export function retarget(target: Object3D | Skeleton, source: Object3D | Skeleton, options: {}): void;
5
5
 
6
- function retargetClip(
6
+ export function retargetClip(
7
7
  target: Skeleton | Object3D,
8
8
  source: Skeleton | Object3D,
9
9
  clip: AnimationClip,
10
10
  options: {},
11
11
  ): AnimationClip;
12
12
 
13
- function getHelperFromSkeleton(skeleton: Skeleton): SkeletonHelper;
13
+ export function getHelperFromSkeleton(skeleton: Skeleton): SkeletonHelper;
14
14
 
15
- function getSkeletonOffsets(target: Object3D | Skeleton, source: Object3D | Skeleton, options: {}): Matrix4[];
15
+ export function getSkeletonOffsets(
16
+ target: Object3D | Skeleton,
17
+ source: Object3D | Skeleton,
18
+ options: {},
19
+ ): Matrix4[];
16
20
 
17
- function renameBones(skeleton: Skeleton, names: {}): any;
21
+ export function renameBones(skeleton: Skeleton, names: {}): any;
18
22
 
19
- function getBones(skeleton: Skeleton | Bone[]): Bone[];
23
+ export function getBones(skeleton: Skeleton | Bone[]): Bone[];
20
24
 
21
- function getBoneByName(name: string, skeleton: Skeleton): Bone;
25
+ export function getBoneByName(name: string, skeleton: Skeleton): Bone;
22
26
 
23
- function getNearestBone(bone: Bone, names: {}): Bone;
27
+ export function getNearestBone(bone: Bone, names: {}): Bone;
24
28
 
25
- function findBoneTrackData(name: string, tracks: any[]): {};
29
+ export function findBoneTrackData(name: string, tracks: any[]): {};
26
30
 
27
- function getEqualsBonesNames(skeleton: Skeleton, targetSkeleton: Skeleton): string[];
31
+ export function getEqualsBonesNames(skeleton: Skeleton, targetSkeleton: Skeleton): string[];
28
32
 
29
- function clone(source: Object3D): Object3D;
33
+ export function clone(source: Object3D): Object3D;
30
34
  }
@@ -1,5 +1,9 @@
1
1
  import { WebGLRenderer } from '../../../src/Three';
2
2
 
3
+ export interface ARButtonSessionInit extends XRSessionInit {
4
+ domOverlay: { root: HTMLElement };
5
+ }
6
+
3
7
  export namespace ARButton {
4
- function createButton(renderer: WebGLRenderer, sessionInit?: any): HTMLElement;
8
+ function createButton(renderer: WebGLRenderer, sessionInit?: Partial<ARButtonSessionInit>): HTMLElement;
5
9
  }
@@ -1,8 +1,9 @@
1
- import { Object3D, Sphere, Box3, Mesh, Texture, Vector3 } from '../../../src/Three';
1
+ import { Mesh, Object3D, Texture, Vector3 } from '../../../src/Three';
2
+ import { XRHandMeshModel } from './XRHandMeshModel';
2
3
 
3
4
  export class OculusHandModel extends Object3D {
4
5
  controller: Object3D;
5
- motionController: Object3D | null;
6
+ motionController: XRHandMeshModel | null;
6
7
  envMap: Texture | null;
7
8
 
8
9
  mesh: Mesh | null;
@@ -1,3 +1,5 @@
1
+ import 'webxr';
2
+
1
3
  import {
2
4
  BufferGeometry,
3
5
  Intersection,
@@ -10,10 +12,12 @@ import {
10
12
  Vector3,
11
13
  } from '../../../src/Three';
12
14
 
15
+ import { XRHandMeshModel } from './XRHandMeshModel';
16
+
13
17
  export class OculusHandPointerModel extends Object3D {
14
18
  hand: Object3D;
15
19
  controller: Object3D;
16
- motionController: Object3D | null;
20
+ motionController: XRHandMeshModel | null;
17
21
 
18
22
  envMap: Texture | null;
19
23
 
@@ -31,7 +35,7 @@ export class OculusHandPointerModel extends Object3D {
31
35
  raycaster: Raycaster;
32
36
 
33
37
  visible: boolean;
34
- xrInputSource: unknown;
38
+ xrInputSource: XRInputSource;
35
39
 
36
40
  constructor(hand: Object3D, controller: Object3D);
37
41
 
@@ -7,6 +7,8 @@ export class XRControllerModel extends Object3D {
7
7
 
8
8
  motionController: any;
9
9
 
10
+ envMap: Texture;
11
+
10
12
  setEnvironmentMap(envMap: Texture): XRControllerModel;
11
13
  }
12
14
 
@@ -1,24 +1,24 @@
1
- import { DirectionalLight, Group, LightProbe, XRFrame, WebGLRenderer, Texture } from '../../../src/Three';
1
+ import { DirectionalLight, Group, LightProbe, Texture, WebGLRenderer } from '../../../src/Three';
2
2
 
3
3
  export class SessionLightProbe {
4
4
  xrLight: XREstimatedLight;
5
5
  renderer: WebGLRenderer;
6
- lightProbe: unknown;
7
- xrWebGLBinding: unknown | null;
6
+ lightProbe: LightProbe;
7
+ xrWebGLBinding: XRWebGLBinding | null;
8
8
  estimationStartCallback: () => void;
9
9
  frameCallback: (this: SessionLightProbe, time: number, xrFrame: XRFrame) => void;
10
10
 
11
11
  constructor(
12
12
  xrLight: XREstimatedLight,
13
13
  renderer: WebGLRenderer,
14
- lightProbe: unknown,
14
+ lightProbe: LightProbe,
15
15
  environmentEstimation: boolean,
16
16
  estimationStartCallback: () => void,
17
17
  );
18
18
 
19
19
  updateReflection: () => void;
20
20
 
21
- onXRFrame: (time: number, xrFrame: XRFrame) => void;
21
+ onXRFrame: XRFrameRequestCallback;
22
22
 
23
23
  dispose: () => void;
24
24
  }
@@ -19,7 +19,7 @@ export class XRHandModelFactory {
19
19
 
20
20
  createHandModel(
21
21
  controller: Group,
22
- profile?: 'spheres' | 'boxes' | 'oculus',
22
+ profile?: 'spheres' | 'boxes' | 'mesh',
23
23
  options?: XRHandPrimitiveModelOptions,
24
24
  ): XRHandModel;
25
25
  }
three/index.d.ts CHANGED
@@ -1,14 +1,15 @@
1
- // Type definitions for three 0.138
1
+ // Type definitions for three 0.141
2
2
  // Project: https://threejs.org/
3
3
  // Definitions by: Josh Ellis <https://github.com/joshuaellis>
4
4
  // Nathan Bierema <https://github.com/Methuselah96>
5
5
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6
6
  // Minimum TypeScript Version: 3.6
7
7
 
8
+ // To update three.js type definition, please make changes to the repository at:
9
+ // https://github.com/three-types/three-ts-types.
10
+ // Periodically, the updates from the repository are pushed to DefinitelyTyped
11
+ // and released in the @types/three npm package.
12
+
8
13
  export * from './src/Three';
9
14
 
10
- /*~ If this module is a UMD module that exposes a global variable 'myLib' when
11
- *~ loaded outside a module loader environment, declare that global here.
12
- *~ Otherwise, delete this declaration.
13
- */
14
15
  export as namespace THREE;
three/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/three",
3
- "version": "0.138.0",
3
+ "version": "0.141.0",
4
4
  "description": "TypeScript definitions for three",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
6
6
  "license": "MIT",
@@ -24,7 +24,9 @@
24
24
  "directory": "types/three"
25
25
  },
26
26
  "scripts": {},
27
- "dependencies": {},
28
- "typesPublisherContentHash": "7873774346bfbeaa8143902909709f9b2a5154afc0017f590bff41e5d3e5e0b7",
27
+ "dependencies": {
28
+ "@types/webxr": "*"
29
+ },
30
+ "typesPublisherContentHash": "f2cb59cf51914baac1f0032481e5702cdf38ace7e83148c7e0faefc44ed80745",
29
31
  "typeScriptVersion": "3.9"
30
32
  }
three/src/Three.d.ts CHANGED
@@ -65,6 +65,7 @@ export * from './extras/core/ShapePath';
65
65
  export * from './extras/core/CurvePath';
66
66
  export * from './extras/core/Curve';
67
67
  export * from './extras/DataUtils';
68
+ export * from './extras/Earcut';
68
69
  export * from './extras/ImageUtils';
69
70
  export * from './extras/ShapeUtils';
70
71
  export * from './extras/PMREMGenerator';
@@ -206,9 +207,9 @@ export * from './renderers/webgl/WebGLShadowMap';
206
207
  export * from './renderers/webgl/WebGLState';
207
208
  export * from './renderers/webgl/WebGLTextures';
208
209
  export * from './renderers/webgl/WebGLUniforms';
209
- export * from './renderers/webxr/WebXR';
210
210
  export * from './renderers/webxr/WebXRController';
211
211
  export * from './renderers/webxr/WebXRManager';
212
+ export { WebGLUtils } from './renderers/webgl/WebGLUtils.js';
212
213
  /**
213
214
  * Scenes
214
215
  */
@@ -4,7 +4,7 @@ export namespace AnimationUtils {
4
4
  function arraySlice(array: any, from: number, to: number): any;
5
5
  function convertArray(array: any, type: any, forceClone: boolean): any;
6
6
  function isTypedArray(object: any): boolean;
7
- function getKeyFrameOrder(times: number[]): number[];
7
+ function getKeyframeOrder(times: number[]): number[];
8
8
  function sortedArray(values: any[], stride: number, order: number[]): any[];
9
9
  function flattenJSON(jsonKeys: string[], times: any[], values: any[], valuePropertyName: string): void;
10
10
 
three/src/constants.d.ts CHANGED
@@ -115,7 +115,6 @@ export const CubeRefractionMapping: Mapping;
115
115
  export const EquirectangularReflectionMapping: Mapping;
116
116
  export const EquirectangularRefractionMapping: Mapping;
117
117
  export const CubeUVReflectionMapping: Mapping;
118
- export const CubeUVRefractionMapping: Mapping;
119
118
 
120
119
  // Wrapping modes
121
120
  export enum Wrapping {}
@@ -153,6 +152,7 @@ export const UnsignedInt248Type: TextureDataType;
153
152
  // Pixel formats
154
153
  export enum PixelFormat {}
155
154
  export const AlphaFormat: PixelFormat;
155
+ export const RGBFormat: PixelFormat;
156
156
  export const RGBAFormat: PixelFormat;
157
157
  export const LuminanceFormat: PixelFormat;
158
158
  export const LuminanceAlphaFormat: PixelFormat;
@@ -301,7 +301,6 @@ export const TriangleFanDrawMode: TrianglesDrawModes;
301
301
  export enum TextureEncoding {}
302
302
  export const LinearEncoding: TextureEncoding;
303
303
  export const sRGBEncoding: TextureEncoding;
304
- export const LogLuvEncoding: TextureEncoding;
305
304
 
306
305
  // Depth packing strategies
307
306
  export enum DepthPackingStrategies {}
@@ -313,6 +312,11 @@ export enum NormalMapTypes {}
313
312
  export const TangentSpaceNormalMap: NormalMapTypes;
314
313
  export const ObjectSpaceNormalMap: NormalMapTypes;
315
314
 
315
+ export type ColorSpace = NoColorSpace | SRGBColorSpace | LinearSRGBColorSpace;
316
+ export type NoColorSpace = '';
317
+ export type SRGBColorSpace = 'srgb';
318
+ export type LinearSRGBColorSpace = 'srgb-linear';
319
+
316
320
  // Stencil Op types
317
321
  export enum StencilOp {}
318
322
  export const ZeroStencilOp: StencilOp;
@@ -22,8 +22,6 @@ export class BufferGeometry extends EventDispatcher {
22
22
  */
23
23
  constructor();
24
24
 
25
- static MaxIndex: number;
26
-
27
25
  /**
28
26
  * Unique number of this buffergeometry instance
29
27
  */