@types/three 0.157.1 → 0.157.2

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 (193) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/animation/CCDIKSolver.d.ts +30 -0
  3. three/examples/jsm/animation/MMDAnimationHelper.d.ts +105 -0
  4. three/examples/jsm/animation/MMDPhysics.d.ts +124 -0
  5. three/examples/jsm/cameras/CinematicCamera.d.ts +41 -0
  6. three/examples/jsm/capabilities/WebGL.d.ts +9 -0
  7. three/examples/jsm/controls/FirstPersonControls.d.ts +31 -0
  8. three/examples/jsm/controls/OrbitControls.d.ts +286 -0
  9. three/examples/jsm/controls/TrackballControls.d.ts +58 -0
  10. three/examples/jsm/effects/OutlineEffect.d.ts +36 -0
  11. three/examples/jsm/environments/RoomEnvironment.d.ts +6 -0
  12. three/examples/jsm/exporters/PLYExporter.d.ts +30 -0
  13. three/examples/jsm/exporters/STLExporter.d.ts +21 -0
  14. three/examples/jsm/geometries/TextGeometry.d.ts +115 -0
  15. three/examples/jsm/helpers/RectAreaLightHelper.d.ts +10 -0
  16. three/examples/jsm/helpers/ViewHelper.d.ts +15 -0
  17. three/examples/jsm/libs/fflate.module.d.ts +1 -0
  18. three/examples/jsm/libs/lil-gui.module.min.d.ts +609 -0
  19. three/examples/jsm/libs/tween.module.d.ts +219 -0
  20. three/examples/jsm/lights/RectAreaLightUniformsLib.d.ts +3 -0
  21. three/examples/jsm/lines/Line2.d.ts +11 -0
  22. three/examples/jsm/lines/LineGeometry.d.ts +10 -0
  23. three/examples/jsm/lines/LineMaterial.d.ts +31 -0
  24. three/examples/jsm/lines/LineSegments2.d.ts +14 -0
  25. three/examples/jsm/lines/LineSegmentsGeometry.d.ts +23 -0
  26. three/examples/jsm/loaders/DDSLoader.d.ts +16 -0
  27. three/examples/jsm/loaders/DRACOLoader.d.ts +19 -0
  28. three/examples/jsm/loaders/FontLoader.d.ts +27 -0
  29. three/examples/jsm/loaders/GLTFLoader.d.ts +147 -0
  30. three/examples/jsm/loaders/HDRCubeTextureLoader.d.ts +18 -0
  31. three/examples/jsm/loaders/KTX2Loader.d.ts +16 -0
  32. three/examples/jsm/loaders/LDrawLoader.d.ts +19 -0
  33. three/examples/jsm/loaders/MMDLoader.d.ts +56 -0
  34. three/examples/jsm/loaders/MTLLoader.d.ts +104 -0
  35. three/examples/jsm/loaders/OBJLoader.d.ts +10 -0
  36. three/examples/jsm/loaders/PCDLoader.d.ts +8 -0
  37. three/examples/jsm/loaders/RGBELoader.d.ts +19 -0
  38. three/examples/jsm/loaders/RGBMLoader.d.ts +32 -0
  39. three/examples/jsm/loaders/SVGLoader.d.ts +68 -0
  40. three/examples/jsm/loaders/TGALoader.d.ts +7 -0
  41. three/examples/jsm/loaders/TTFLoader.d.ts +8 -0
  42. three/examples/jsm/loaders/USDZLoader.d.ts +11 -0
  43. three/examples/jsm/materials/MeshGouraudMaterial.d.ts +17 -0
  44. three/examples/jsm/modifiers/TessellateModifier.d.ts +9 -0
  45. three/examples/jsm/nodes/Nodes.d.ts +149 -0
  46. three/examples/jsm/nodes/accessors/BitangentNode.d.ts +18 -0
  47. three/examples/jsm/nodes/accessors/BufferNode.d.ts +11 -0
  48. three/examples/jsm/nodes/accessors/CameraNode.d.ts +12 -0
  49. three/examples/jsm/nodes/accessors/CubeTextureNode.d.ts +13 -0
  50. three/examples/jsm/nodes/accessors/InstanceNode.d.ts +9 -0
  51. three/examples/jsm/nodes/accessors/MaterialNode.d.ts +23 -0
  52. three/examples/jsm/nodes/accessors/MaterialReferenceNode.d.ts +6 -0
  53. three/examples/jsm/nodes/accessors/ModelNode.d.ts +9 -0
  54. three/examples/jsm/nodes/accessors/ModelViewProjectionNode.d.ts +6 -0
  55. three/examples/jsm/nodes/accessors/NormalNode.d.ts +12 -0
  56. three/examples/jsm/nodes/accessors/Object3DNode.d.ts +22 -0
  57. three/examples/jsm/nodes/accessors/PointUVNode.d.ts +7 -0
  58. three/examples/jsm/nodes/accessors/PositionNode.d.ts +21 -0
  59. three/examples/jsm/nodes/accessors/ReferenceNode.d.ts +13 -0
  60. three/examples/jsm/nodes/accessors/ReflectVectorNode.d.ts +8 -0
  61. three/examples/jsm/nodes/accessors/SkinningNode.d.ts +13 -0
  62. three/examples/jsm/nodes/accessors/StorageBufferNode.d.ts +6 -0
  63. three/examples/jsm/nodes/accessors/TangentNode.d.ts +18 -0
  64. three/examples/jsm/nodes/accessors/TextureNode.d.ts +14 -0
  65. three/examples/jsm/nodes/accessors/UVNode.d.ts +8 -0
  66. three/examples/jsm/nodes/accessors/UserDataNode.d.ts +7 -0
  67. three/examples/jsm/nodes/code/CodeNode.d.ts +15 -0
  68. three/examples/jsm/nodes/code/ExpressionNode.d.ts +7 -0
  69. three/examples/jsm/nodes/code/FunctionCallNode.d.ts +13 -0
  70. three/examples/jsm/nodes/code/FunctionNode.d.ts +17 -0
  71. three/examples/jsm/nodes/core/ArrayUniformNode.d.ts +8 -0
  72. three/examples/jsm/nodes/core/AttributeNode.d.ts +9 -0
  73. three/examples/jsm/nodes/core/BypassNode.d.ts +9 -0
  74. three/examples/jsm/nodes/core/CacheNode.d.ts +10 -0
  75. three/examples/jsm/nodes/core/ConstNode.d.ts +10 -0
  76. three/examples/jsm/nodes/core/ContextNode.d.ts +10 -0
  77. three/examples/jsm/nodes/core/InputNode.d.ts +16 -0
  78. three/examples/jsm/nodes/core/Node.d.ts +31 -0
  79. three/examples/jsm/nodes/core/NodeAttribute.d.ts +6 -0
  80. three/examples/jsm/nodes/core/NodeBuilder.d.ts +138 -0
  81. three/examples/jsm/nodes/core/NodeCache.d.ts +9 -0
  82. three/examples/jsm/nodes/core/NodeCode.d.ts +4 -0
  83. three/examples/jsm/nodes/core/NodeFrame.d.ts +19 -0
  84. three/examples/jsm/nodes/core/NodeFunction.d.ts +13 -0
  85. three/examples/jsm/nodes/core/NodeFunctionInput.d.ts +7 -0
  86. three/examples/jsm/nodes/core/NodeKeywords.d.ts +14 -0
  87. three/examples/jsm/nodes/core/NodeParser.d.ts +5 -0
  88. three/examples/jsm/nodes/core/NodeUniform.d.ts +13 -0
  89. three/examples/jsm/nodes/core/NodeUtils.d.ts +13 -0
  90. three/examples/jsm/nodes/core/NodeVar.d.ts +6 -0
  91. three/examples/jsm/nodes/core/NodeVarying.d.ts +8 -0
  92. three/examples/jsm/nodes/core/PropertyNode.d.ts +6 -0
  93. three/examples/jsm/nodes/core/StackNode.d.ts +11 -0
  94. three/examples/jsm/nodes/core/TempNode.d.ts +11 -0
  95. three/examples/jsm/nodes/core/UniformNode.d.ts +10 -0
  96. three/examples/jsm/nodes/core/VarNode.d.ts +16 -0
  97. three/examples/jsm/nodes/core/VaryingNode.d.ts +8 -0
  98. three/examples/jsm/nodes/core/constants.d.ts +78 -0
  99. three/examples/jsm/nodes/display/BlendModeNode.d.ts +32 -0
  100. three/examples/jsm/nodes/display/ColorAdjustmentNode.d.ts +20 -0
  101. three/examples/jsm/nodes/display/ColorSpaceNode.d.ts +18 -0
  102. three/examples/jsm/nodes/display/FrontFacingNode.d.ts +6 -0
  103. three/examples/jsm/nodes/display/NormalMapNode.d.ts +12 -0
  104. three/examples/jsm/nodes/display/PosterizeNode.d.ts +8 -0
  105. three/examples/jsm/nodes/display/ToneMappingNode.d.ts +14 -0
  106. three/examples/jsm/nodes/display/ViewportNode.d.ts +23 -0
  107. three/examples/jsm/nodes/fog/FogExp2Node.d.ts +9 -0
  108. three/examples/jsm/nodes/fog/FogNode.d.ts +10 -0
  109. three/examples/jsm/nodes/fog/FogRangeNode.d.ts +10 -0
  110. three/examples/jsm/nodes/functions/BSDF/BRDF_GGX.d.ts +6 -0
  111. three/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.d.ts +6 -0
  112. three/examples/jsm/nodes/functions/BSDF/DFGApprox.d.ts +10 -0
  113. three/examples/jsm/nodes/functions/BSDF/D_GGX.d.ts +9 -0
  114. three/examples/jsm/nodes/functions/BSDF/F_Schlick.d.ts +6 -0
  115. three/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +6 -0
  116. three/examples/jsm/nodes/functions/PhysicalLightingModel.d.ts +11 -0
  117. three/examples/jsm/nodes/functions/material/getGeometryRoughness.d.ts +5 -0
  118. three/examples/jsm/nodes/functions/material/getRoughness.d.ts +6 -0
  119. three/examples/jsm/nodes/geometry/RangeNode.d.ts +13 -0
  120. three/examples/jsm/nodes/gpgpu/ComputeNode.d.ts +11 -0
  121. three/examples/jsm/nodes/lighting/AONode.d.ts +8 -0
  122. three/examples/jsm/nodes/lighting/AnalyticLightNode.d.ts +10 -0
  123. three/examples/jsm/nodes/lighting/EnvironmentNode.d.ts +8 -0
  124. three/examples/jsm/nodes/lighting/HemisphereLightNode.d.ts +13 -0
  125. three/examples/jsm/nodes/lighting/LightUtils.d.ts +4 -0
  126. three/examples/jsm/nodes/lighting/LightingContextNode.d.ts +15 -0
  127. three/examples/jsm/nodes/lighting/LightingNode.d.ts +5 -0
  128. three/examples/jsm/nodes/lighting/LightsNode.d.ts +19 -0
  129. three/examples/jsm/nodes/lighting/PointLightNode.d.ts +10 -0
  130. three/examples/jsm/nodes/lighting/SpotLightNode.d.ts +15 -0
  131. three/examples/jsm/nodes/loaders/NodeLoader.d.ts +14 -0
  132. three/examples/jsm/nodes/loaders/NodeMaterialLoader.d.ts +8 -0
  133. three/examples/jsm/nodes/loaders/NodeObjectLoader.d.ts +9 -0
  134. three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +9 -0
  135. three/examples/jsm/nodes/materials/Materials.d.ts +17 -0
  136. three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +10 -0
  137. three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +22 -0
  138. three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +18 -0
  139. three/examples/jsm/nodes/materials/NodeMaterial.d.ts +38 -0
  140. three/examples/jsm/nodes/materials/PointsNodeMaterial.d.ts +15 -0
  141. three/examples/jsm/nodes/materials/SpriteNodeMaterial.d.ts +23 -0
  142. three/examples/jsm/nodes/materialx/MaterialXNodes.d.ts +94 -0
  143. three/examples/jsm/nodes/materialx/lib/mx_hsv.d.ts +4 -0
  144. three/examples/jsm/nodes/materialx/lib/mx_noise.d.ts +6 -0
  145. three/examples/jsm/nodes/math/CondNode.d.ts +9 -0
  146. three/examples/jsm/nodes/math/MathNode.d.ts +115 -0
  147. three/examples/jsm/nodes/math/OperatorNode.d.ts +31 -0
  148. three/examples/jsm/nodes/procedural/CheckerNode.d.ts +6 -0
  149. three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +156 -0
  150. three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +310 -0
  151. three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +166 -0
  152. three/examples/jsm/nodes/utils/ArrayElementNode.d.ts +9 -0
  153. three/examples/jsm/nodes/utils/ConvertNode.d.ts +8 -0
  154. three/examples/jsm/nodes/utils/EquirectUVNode.d.ts +6 -0
  155. three/examples/jsm/nodes/utils/JoinNode.d.ts +10 -0
  156. three/examples/jsm/nodes/utils/MatcapUVNode.d.ts +5 -0
  157. three/examples/jsm/nodes/utils/MaxMipLevelNode.d.ts +11 -0
  158. three/examples/jsm/nodes/utils/OscNode.d.ts +19 -0
  159. three/examples/jsm/nodes/utils/RemapNode.d.ts +13 -0
  160. three/examples/jsm/nodes/utils/RotateUVNode.d.ts +10 -0
  161. three/examples/jsm/nodes/utils/SpecularMIPLevelNode.d.ts +8 -0
  162. three/examples/jsm/nodes/utils/SplitNode.d.ts +16 -0
  163. three/examples/jsm/nodes/utils/SpriteSheetUVNode.d.ts +9 -0
  164. three/examples/jsm/nodes/utils/TimerNode.d.ts +19 -0
  165. three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +22 -0
  166. three/examples/jsm/objects/GroundProjectedSkybox.d.ts +13 -0
  167. three/examples/jsm/objects/MarchingCubes.d.ts +76 -0
  168. three/examples/jsm/objects/Reflector.d.ts +29 -0
  169. three/examples/jsm/postprocessing/EffectComposer.d.ts +31 -0
  170. three/examples/jsm/postprocessing/Pass.d.ts +31 -0
  171. three/examples/jsm/postprocessing/SavePass.d.ts +12 -0
  172. three/examples/jsm/postprocessing/ShaderPass.d.ts +11 -0
  173. three/examples/jsm/renderers/CSS3DRenderer.d.ts +26 -0
  174. three/examples/jsm/renderers/webgl/nodes/SlotNode.d.ts +17 -0
  175. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +37 -0
  176. three/examples/jsm/renderers/webgl/nodes/WebGLNodes.d.ts +3 -0
  177. three/examples/jsm/shaders/ACESFilmicToneMappingShader.d.ts +10 -0
  178. three/examples/jsm/shaders/BokehShader2.d.ts +42 -0
  179. three/examples/jsm/shaders/ToonShader.d.ts +54 -0
  180. three/examples/jsm/shaders/VelocityShader.d.ts +13 -0
  181. three/examples/jsm/textures/FlakesTexture.d.ts +3 -0
  182. three/examples/jsm/utils/CameraUtils.d.ts +9 -0
  183. three/examples/jsm/utils/GeometryUtils.d.ts +25 -0
  184. three/examples/jsm/utils/LDrawUtils.d.ts +5 -0
  185. three/examples/jsm/utils/ShadowMapViewer.d.ts +24 -0
  186. three/examples/jsm/webxr/VRButton.d.ts +5 -0
  187. three/examples/jsm/webxr/XRButton.d.ts +6 -0
  188. three/examples/jsm/webxr/XRControllerModelFactory.d.ts +21 -0
  189. three/examples/jsm/webxr/XRHandMeshModel.d.ts +11 -0
  190. three/examples/jsm/webxr/XRHandModelFactory.d.ts +25 -0
  191. three/examples/jsm/webxr/XRHandPrimitiveModel.d.ts +24 -0
  192. three/package.json +2 -2
  193. three/src/extras/Earcut.d.ts +15 -0
@@ -0,0 +1,76 @@
1
+ import { BufferGeometry, Material, Mesh, Color } from '../../../src/Three.js';
2
+
3
+ export class MarchingCubes extends Mesh {
4
+ constructor(
5
+ resolution: number,
6
+ material: Material,
7
+ enableUvs?: boolean,
8
+ enableColors?: boolean,
9
+ maxPolyCount?: number,
10
+ );
11
+
12
+ enableUvs: boolean;
13
+ enableColors: boolean;
14
+
15
+ resolution: number;
16
+
17
+ // parameters
18
+
19
+ isolation: number;
20
+
21
+ // size of field, 32 is pushing it in Javascript :)
22
+
23
+ size: number;
24
+ size2: number;
25
+ size3: number;
26
+ halfsize: number;
27
+
28
+ // deltas
29
+
30
+ delta: number;
31
+ yd: number;
32
+ zd: number;
33
+
34
+ field: Float32Array;
35
+ normal_cache: Float32Array;
36
+ palette: Float32Array;
37
+
38
+ maxCount: number;
39
+ count: number;
40
+
41
+ hasPositions: boolean;
42
+ hasNormals: boolean;
43
+ hasColors: boolean;
44
+ hasUvs: boolean;
45
+
46
+ positionArray: Float32Array;
47
+ normalArray: Float32Array;
48
+
49
+ uvArray: Float32Array;
50
+ colorArray: Float32Array;
51
+
52
+ begin(): void;
53
+ end(): void;
54
+
55
+ init(resolution: number): void;
56
+
57
+ addBall(ballx: number, bally: number, ballz: number, strength: number, subtract: number, colors?: Color): void;
58
+
59
+ addPlaneX(strength: number, subtract: number): void;
60
+ addPlaneY(strength: number, subtract: number): void;
61
+ addPlaneZ(strength: number, subtract: number): void;
62
+
63
+ setCell(x: number, y: number, z: number, value: number): void;
64
+ getCell(x: number, y: number, z: number): number;
65
+
66
+ blur(intensity: number): void;
67
+
68
+ reset(): void;
69
+ update(): void;
70
+ render(renderCallback: any): void;
71
+ generateGeometry(): BufferGeometry;
72
+ generateBufferGeometry(): BufferGeometry;
73
+ }
74
+
75
+ export const edgeTable: Int32Array[];
76
+ export const triTable: Int32Array[];
@@ -0,0 +1,29 @@
1
+ import {
2
+ Mesh,
3
+ BufferGeometry,
4
+ ColorRepresentation,
5
+ TextureEncoding,
6
+ WebGLRenderTarget,
7
+ PerspectiveCamera,
8
+ } from '../../../src/Three.js';
9
+
10
+ export interface ReflectorOptions {
11
+ color?: ColorRepresentation;
12
+ textureWidth?: number;
13
+ textureHeight?: number;
14
+ clipBias?: number;
15
+ shader?: object;
16
+ encoding?: TextureEncoding;
17
+ multisample?: number;
18
+ }
19
+
20
+ export class Reflector extends Mesh {
21
+ type: 'Reflector';
22
+ camera: PerspectiveCamera;
23
+
24
+ constructor(geometry?: BufferGeometry, options?: ReflectorOptions);
25
+
26
+ getRenderTarget(): WebGLRenderTarget;
27
+
28
+ dispose(): void;
29
+ }
@@ -0,0 +1,31 @@
1
+ import { Clock, WebGLRenderer, WebGLRenderTarget } from '../../../src/Three.js';
2
+
3
+ import { Pass, FullScreenQuad } from './Pass.js';
4
+ import { ShaderPass } from './ShaderPass.js';
5
+
6
+ export { FullScreenQuad } from './Pass.js';
7
+ export { Pass };
8
+
9
+ export class EffectComposer {
10
+ constructor(renderer: WebGLRenderer, renderTarget?: WebGLRenderTarget);
11
+ renderer: WebGLRenderer;
12
+ renderTarget1: WebGLRenderTarget;
13
+ renderTarget2: WebGLRenderTarget;
14
+ writeBuffer: WebGLRenderTarget;
15
+ readBuffer: WebGLRenderTarget;
16
+ passes: Pass[];
17
+ copyPass: ShaderPass;
18
+ clock: Clock;
19
+ renderToScreen: boolean;
20
+
21
+ swapBuffers(): void;
22
+ addPass(pass: Pass): void;
23
+ insertPass(pass: Pass, index: number): void;
24
+ removePass(pass: Pass): void;
25
+ isLastEnabledPass(passIndex: number): boolean;
26
+ render(deltaTime?: number): void;
27
+ reset(renderTarget?: WebGLRenderTarget): void;
28
+ setSize(width: number, height: number): void;
29
+ setPixelRatio(pixelRatio: number): void;
30
+ dispose(): void;
31
+ }
@@ -0,0 +1,31 @@
1
+ import { Material, WebGLRenderer, WebGLRenderTarget } from '../../../src/Three.js';
2
+
3
+ export class Pass {
4
+ constructor();
5
+
6
+ isPass: boolean;
7
+ enabled: boolean;
8
+ needsSwap: boolean;
9
+ clear: boolean;
10
+ renderToScreen: boolean;
11
+
12
+ setSize(width: number, height: number): void;
13
+ render(
14
+ renderer: WebGLRenderer,
15
+ writeBuffer: WebGLRenderTarget,
16
+ readBuffer: WebGLRenderTarget,
17
+ deltaTime: number,
18
+ maskActive: boolean,
19
+ ): void;
20
+
21
+ dispose(): void;
22
+ }
23
+
24
+ export class FullScreenQuad {
25
+ constructor(material?: Material);
26
+
27
+ render(renderer: WebGLRenderer): void;
28
+ dispose(): void;
29
+
30
+ material: Material;
31
+ }
@@ -0,0 +1,12 @@
1
+ import { ShaderMaterial, WebGLRenderTarget } from '../../../src/Three.js';
2
+
3
+ import { Pass, FullScreenQuad } from './Pass.js';
4
+
5
+ export class SavePass extends Pass {
6
+ constructor(renderTarget?: WebGLRenderTarget);
7
+ textureID: string;
8
+ renderTarget: WebGLRenderTarget;
9
+ uniforms: object;
10
+ material: ShaderMaterial;
11
+ fsQuad: FullScreenQuad;
12
+ }
@@ -0,0 +1,11 @@
1
+ import { ShaderMaterial } from '../../../src/Three.js';
2
+
3
+ import { Pass, FullScreenQuad } from './Pass.js';
4
+
5
+ export class ShaderPass extends Pass {
6
+ constructor(shader: object, textureID?: string);
7
+ textureID: string;
8
+ uniforms: { [name: string]: { value: any } };
9
+ material: ShaderMaterial;
10
+ fsQuad: FullScreenQuad;
11
+ }
@@ -0,0 +1,26 @@
1
+ import { Object3D, Scene, Camera } from '../../../src/Three.js';
2
+
3
+ export class CSS3DObject extends Object3D {
4
+ constructor(element: HTMLElement);
5
+ element: HTMLElement;
6
+
7
+ onBeforeRender: (renderer: unknown, scene: Scene, camera: Camera) => void;
8
+ onAfterRender: (renderer: unknown, scene: Scene, camera: Camera) => void;
9
+ }
10
+
11
+ export class CSS3DSprite extends CSS3DObject {
12
+ constructor(element: HTMLElement);
13
+ }
14
+
15
+ export interface CSS3DParameters {
16
+ element?: HTMLElement;
17
+ }
18
+
19
+ export class CSS3DRenderer {
20
+ constructor(parameters?: CSS3DParameters);
21
+ domElement: HTMLElement;
22
+
23
+ getSize(): { width: number; height: number };
24
+ setSize(width: number, height: number): void;
25
+ render(scene: Scene, camera: Camera): void;
26
+ }
@@ -0,0 +1,17 @@
1
+ import Node from '../../../nodes/core/Node.js';
2
+
3
+ export interface SlotNodeParameters<TNode extends Node = Node> {
4
+ node?: TNode;
5
+ nodeType?: string;
6
+ source?: string | null;
7
+ target?: string | null;
8
+ }
9
+
10
+ export default class SlotNode<TNode extends Node = Node> extends Node {
11
+ inclusionType: 'replace';
12
+ node: TNode | null;
13
+ source: null;
14
+ target: null;
15
+
16
+ constructor(params: SlotNodeParameters<TNode>);
17
+ }
@@ -0,0 +1,37 @@
1
+ import NodeBuilder from '../../../nodes/core/NodeBuilder.js';
2
+ import { Renderer, Object3D } from '../../../../../src/Three.js';
3
+ import Node from '../../../nodes/core/Node.js';
4
+ import SlotNode from './SlotNode.js';
5
+ import { NodeShaderStageOption } from '../../../nodes/core/constants.js';
6
+
7
+ export class WebGLNodeBuilder extends NodeBuilder {
8
+ constructor(
9
+ object: Object3D,
10
+ renderer: Renderer,
11
+ shader: { uniforms: any; vertexShader: any; fragmentShader: any },
12
+ );
13
+
14
+ addSlot(shaderStage: NodeShaderStageOption, slotNode: SlotNode): Node;
15
+
16
+ getUniforms(shaderStage: string): string;
17
+
18
+ getAttributes(shaderStage: string): string;
19
+
20
+ getVarys(shaderStage: string): string;
21
+
22
+ addCode(shaderStage: string, source: string, code: string, scope?: this): string;
23
+ addCodeAfterInclude(shaderStage: string, snippet: string, code: string): string;
24
+
25
+ replaceCode(shaderStage: string, source: string, target: string, scope?: this): void;
26
+ parseInclude(shaderStage: string, ...includes: string[]): void;
27
+
28
+ getInstanceIndex(): string;
29
+ getFrontFacing(): string;
30
+ getFragCoord(): 'gl_FragCoord';
31
+ isFlipY(): true;
32
+
33
+ buildCode(): void;
34
+ build(): this;
35
+
36
+ getSlot(shaderStage: string, name: string): Node;
37
+ }
@@ -0,0 +1,3 @@
1
+ import NodeFrame from '../../../nodes/core/NodeFrame.js';
2
+
3
+ export const nodeFrame: NodeFrame;
@@ -0,0 +1,10 @@
1
+ import { IUniform, Texture } from '../../../src/Three.js';
2
+
3
+ export const ACESFilmicToneMappingShader: {
4
+ uniforms: {
5
+ tDiffuse: IUniform<Texture>;
6
+ exposure: IUniform<number>;
7
+ };
8
+ vertexShader: string;
9
+ fragmentShader: string;
10
+ };
@@ -0,0 +1,42 @@
1
+ import { IUniform } from '../../../src/Three.js';
2
+
3
+ export interface BokehShaderUniforms {
4
+ textureWidth: IUniform;
5
+ textureHeight: IUniform;
6
+ focalDepth: IUniform;
7
+ focalLength: IUniform;
8
+ fstop: IUniform;
9
+ tColor: IUniform;
10
+ tDepth: IUniform;
11
+ maxblur: IUniform;
12
+ showFocus: IUniform;
13
+ manualdof: IUniform;
14
+ vignetting: IUniform;
15
+ depthblur: IUniform;
16
+ threshold: IUniform;
17
+ gain: IUniform;
18
+ bias: IUniform;
19
+ fringe: IUniform;
20
+ znear: IUniform;
21
+ zfar: IUniform;
22
+ noise: IUniform;
23
+ dithering: IUniform;
24
+ pentagon: IUniform;
25
+ shaderFocus: IUniform;
26
+ focusCoords: IUniform;
27
+ }
28
+
29
+ export const BokehShader: {
30
+ uniforms: BokehShaderUniforms;
31
+ vertexShader: string;
32
+ fragmentShader: string;
33
+ };
34
+
35
+ export const BokehDepthShader: {
36
+ uniforms: {
37
+ mNear: IUniform;
38
+ mFar: IUniform;
39
+ };
40
+ vertexShader: string;
41
+ fragmentShader: string;
42
+ };
@@ -0,0 +1,54 @@
1
+ import { IUniform } from '../../../src/Three.js';
2
+
3
+ export const ToonShader1: {
4
+ uniforms: {
5
+ uDirLightPos: IUniform;
6
+ uDirLightColor: IUniform;
7
+ uAmbientLightColor: IUniform;
8
+ uBaseColor: IUniform;
9
+ };
10
+ vertexShader: string;
11
+ fragmentShader: string;
12
+ };
13
+
14
+ export const ToonShader2: {
15
+ uniforms: {
16
+ uDirLightPos: IUniform;
17
+ uDirLightColor: IUniform;
18
+ uAmbientLightColor: IUniform;
19
+ uBaseColor: IUniform;
20
+ uLineColor1: IUniform;
21
+ uLineColor2: IUniform;
22
+ uLineColor3: IUniform;
23
+ uLineColor4: IUniform;
24
+ };
25
+ vertexShader: string;
26
+ fragmentShader: string;
27
+ };
28
+
29
+ export const ToonShaderHatching: {
30
+ uniforms: {
31
+ uDirLightPos: IUniform;
32
+ uDirLightColor: IUniform;
33
+ uAmbientLightColor: IUniform;
34
+ uBaseColor: IUniform;
35
+ uLineColor1: IUniform;
36
+ uLineColor2: IUniform;
37
+ uLineColor3: IUniform;
38
+ uLineColor4: IUniform;
39
+ };
40
+ vertexShader: string;
41
+ fragmentShader: string;
42
+ };
43
+
44
+ export const ToonShaderDotted: {
45
+ uniforms: {
46
+ uDirLightPos: IUniform;
47
+ uDirLightColor: IUniform;
48
+ uAmbientLightColor: IUniform;
49
+ uBaseColor: IUniform;
50
+ uLineColor1: IUniform;
51
+ };
52
+ vertexShader: string;
53
+ fragmentShader: string;
54
+ };
@@ -0,0 +1,13 @@
1
+ import { IUniform, UniformsLib } from '../../../src/Three.js';
2
+
3
+ export const VelocityShader: {
4
+ uniforms: (typeof UniformsLib)['common'] &
5
+ (typeof UniformsLib)['displacementmap'] & {
6
+ modelMatrixPrev: IUniform;
7
+ currentProjectionViewMatrix: IUniform;
8
+ previousProjectionViewMatrix: IUniform;
9
+ };
10
+
11
+ fragmentShader: string;
12
+ vertexShader: string;
13
+ };
@@ -0,0 +1,3 @@
1
+ export class FlakesTexture extends HTMLCanvasElement {
2
+ constructor(width?: number, height?: number);
3
+ }
@@ -0,0 +1,9 @@
1
+ import { PerspectiveCamera, Vector3 } from '../../../src/Three.js';
2
+
3
+ export function frameCorners(
4
+ camera: PerspectiveCamera,
5
+ bottomLeftCorner: Vector3,
6
+ bottomRightCorner: Vector3,
7
+ topLeftCorner: Vector3,
8
+ estimateViewFrustum?: boolean,
9
+ ): void;
@@ -0,0 +1,25 @@
1
+ import { Vector3 } from '../../../src/Three.js';
2
+
3
+ export function hilbert2D(
4
+ center?: Vector3,
5
+ size?: number,
6
+ iterations?: number,
7
+ v0?: number,
8
+ v1?: number,
9
+ v2?: number,
10
+ v3?: number,
11
+ ): Vector3[];
12
+ export function hilbert3D(
13
+ center?: Vector3,
14
+ size?: number,
15
+ iterations?: number,
16
+ v0?: number,
17
+ v1?: number,
18
+ v2?: number,
19
+ v3?: number,
20
+ v4?: number,
21
+ v5?: number,
22
+ v6?: number,
23
+ v7?: number,
24
+ ): Vector3[];
25
+ export function gosper(size?: number): number[];
@@ -0,0 +1,5 @@
1
+ import { Group, Object3D } from '../../../src/Three.js';
2
+
3
+ export namespace LDrawUtils {
4
+ function mergeObject(object: Object3D): Group;
5
+ }
@@ -0,0 +1,24 @@
1
+ import { Light, Renderer } from '../../../src/Three.js';
2
+
3
+ export interface Size {
4
+ width: number;
5
+ height: number;
6
+ set: (width: number, height: number) => void;
7
+ }
8
+
9
+ export interface Position {
10
+ x: number;
11
+ y: number;
12
+ set: (x: number, y: number) => void;
13
+ }
14
+
15
+ export class ShadowMapViewer {
16
+ constructor(light: Light);
17
+
18
+ enabled: boolean;
19
+ size: Size;
20
+ position: Position;
21
+ render(renderer: Renderer): void;
22
+ updateForWindowResize(): void;
23
+ update(): void;
24
+ }
@@ -0,0 +1,5 @@
1
+ import { WebGLRenderer } from '../../../src/Three.js';
2
+
3
+ export namespace VRButton {
4
+ function createButton(renderer: WebGLRenderer): HTMLElement;
5
+ }
@@ -0,0 +1,6 @@
1
+ import { WebGLRenderer } from '../../../src/Three.js';
2
+
3
+ // tslint:disable-next-line:no-unnecessary-class
4
+ export class XRButton {
5
+ static createButton(renderer: WebGLRenderer): HTMLElement;
6
+ }
@@ -0,0 +1,21 @@
1
+ import { Group, Object3D, Texture } from '../../../src/Three.js';
2
+
3
+ import { GLTFLoader } from '../loaders/GLTFLoader.js';
4
+
5
+ export class XRControllerModel extends Object3D {
6
+ constructor();
7
+
8
+ motionController: any;
9
+
10
+ envMap: Texture;
11
+
12
+ setEnvironmentMap(envMap: Texture): XRControllerModel;
13
+ }
14
+
15
+ export class XRControllerModelFactory {
16
+ constructor(gltfLoader?: GLTFLoader);
17
+ gltfLoader: GLTFLoader | null;
18
+ path: string;
19
+
20
+ createControllerModel(controller: Group): XRControllerModel;
21
+ }
@@ -0,0 +1,11 @@
1
+ import { Object3D } from '../../../src/Three.js';
2
+
3
+ export class XRHandMeshModel {
4
+ controller: Object3D;
5
+ handModel: Object3D;
6
+ bones: Object3D[];
7
+
8
+ constructor(handModel: Object3D, controller: Object3D, path: string, handedness: string);
9
+
10
+ updateMesh(): void;
11
+ }
@@ -0,0 +1,25 @@
1
+ import { Group, Object3D } from '../../../src/Three.js';
2
+
3
+ import { XRHandPrimitiveModel, XRHandPrimitiveModelOptions } from './XRHandPrimitiveModel.js';
4
+ import { XRHandMeshModel } from './XRHandMeshModel.js';
5
+
6
+ export type XRHandModelHandedness = 'left' | 'right';
7
+
8
+ export class XRHandModel extends Object3D {
9
+ constructor();
10
+
11
+ motionController: XRHandPrimitiveModel | XRHandMeshModel;
12
+ }
13
+
14
+ export class XRHandModelFactory {
15
+ constructor();
16
+ path: string;
17
+
18
+ setPath(path: string): XRHandModelFactory;
19
+
20
+ createHandModel(
21
+ controller: Group,
22
+ profile?: 'spheres' | 'boxes' | 'mesh',
23
+ options?: XRHandPrimitiveModelOptions,
24
+ ): XRHandModel;
25
+ }
@@ -0,0 +1,24 @@
1
+ import { Group, Texture } from '../../../src/Three.js';
2
+
3
+ import { XRHandModel, XRHandModelHandedness } from './XRHandModelFactory.js';
4
+
5
+ export interface XRHandPrimitiveModelOptions {
6
+ primitive?: 'sphere' | 'box' | undefined;
7
+ }
8
+
9
+ export class XRHandPrimitiveModel {
10
+ controller: Group;
11
+ handModel: XRHandModel;
12
+ envMap: Texture | null;
13
+ handMesh: Group;
14
+
15
+ constructor(
16
+ handModel: XRHandModel,
17
+ controller: Group,
18
+ path: string,
19
+ handedness: XRHandModelHandedness,
20
+ options: XRHandPrimitiveModelOptions,
21
+ );
22
+
23
+ updateMesh: () => void;
24
+ }
three/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/three",
3
- "version": "0.157.1",
3
+ "version": "0.157.2",
4
4
  "description": "TypeScript definitions for three",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
6
6
  "license": "MIT",
@@ -43,6 +43,6 @@
43
43
  "fflate": "~0.6.10",
44
44
  "meshoptimizer": "~0.18.1"
45
45
  },
46
- "typesPublisherContentHash": "d9388a18bbcf88aa18fface6fb06534b21e5cbb2b9d6df028f4c585cfc72e00c",
46
+ "typesPublisherContentHash": "793c51304c26c918dd5ee5b103fbcbcf8155af7cb9cceb2837b49309565f40d6",
47
47
  "typeScriptVersion": "4.5"
48
48
  }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * An implementation of the {@link Earcut} polygon triangulation algorithm
3
+ * @remarks
4
+ * The code is a port of {@link https://github.com/mapbox/earcut | mapbox/earcut}.
5
+ * @see {@link https://threejs.org/docs/index.html#api/en/extras/Earcut | Official Documentation}
6
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/Earcut.js | Source}
7
+ */
8
+ export const Earcut: {
9
+ /**
10
+ * Triangulates the given shape definition by returning an array of triangles
11
+ * @remarks
12
+ * A triangle is defined by three consecutive integers representing vertex indices.
13
+ */
14
+ triangulate(data: number[], holeIndices?: number[], dim?: number): number[];
15
+ };