@types/three 0.164.1 → 0.166.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 (181) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/controls/TransformControls.d.ts +8 -6
  3. three/examples/jsm/exporters/GLTFExporter.d.ts +6 -0
  4. three/examples/jsm/exporters/USDZExporter.d.ts +4 -2
  5. three/examples/jsm/geometries/TeapotGeometry.d.ts +24 -0
  6. three/examples/jsm/helpers/ViewHelper.d.ts +8 -6
  7. three/examples/jsm/lines/LineMaterial.d.ts +2 -4
  8. three/examples/jsm/loaders/DDSLoader.d.ts +8 -2
  9. three/examples/jsm/loaders/FontLoader.d.ts +1 -1
  10. three/examples/jsm/loaders/GLTFLoader.d.ts +12 -7
  11. three/examples/jsm/loaders/KTXLoader.d.ts +8 -2
  12. three/examples/jsm/loaders/LDrawLoader.d.ts +1 -1
  13. three/examples/jsm/loaders/PVRLoader.d.ts +2 -2
  14. three/examples/jsm/modifiers/EdgeSplitModifier.d.ts +17 -10
  15. three/examples/jsm/nodes/Nodes.d.ts +21 -57
  16. three/examples/jsm/nodes/accessors/BitangentNode.d.ts +4 -22
  17. three/examples/jsm/nodes/accessors/BufferAttributeNode.d.ts +50 -0
  18. three/examples/jsm/nodes/accessors/BufferNode.d.ts +3 -4
  19. three/examples/jsm/nodes/accessors/CameraNode.d.ts +11 -20
  20. three/examples/jsm/nodes/accessors/CubeTextureNode.d.ts +1 -1
  21. three/examples/jsm/nodes/accessors/MaterialNode.d.ts +4 -1
  22. three/examples/jsm/nodes/accessors/ModelNode.d.ts +3 -0
  23. three/examples/jsm/nodes/accessors/ModelViewProjectionNode.d.ts +1 -2
  24. three/examples/jsm/nodes/accessors/NormalNode.d.ts +9 -17
  25. three/examples/jsm/nodes/accessors/PositionNode.d.ts +6 -26
  26. three/examples/jsm/nodes/accessors/ReferenceNode.d.ts +3 -4
  27. three/examples/jsm/nodes/accessors/ReflectVectorNode.d.ts +3 -8
  28. three/examples/jsm/nodes/accessors/RendererReferenceNode.d.ts +2 -3
  29. three/examples/jsm/nodes/accessors/StorageBufferNode.d.ts +16 -4
  30. three/examples/jsm/nodes/accessors/StorageTextureNode.d.ts +40 -0
  31. three/examples/jsm/nodes/accessors/TangentNode.d.ts +8 -23
  32. three/examples/jsm/nodes/accessors/Texture3DNode.d.ts +16 -0
  33. three/examples/jsm/nodes/accessors/TextureNode.d.ts +1 -1
  34. three/examples/jsm/nodes/accessors/UVNode.d.ts +1 -8
  35. three/examples/jsm/nodes/accessors/UniformsNode.d.ts +0 -2
  36. three/examples/jsm/nodes/accessors/UserDataNode.d.ts +4 -3
  37. three/examples/jsm/nodes/code/CodeNode.d.ts +0 -1
  38. three/examples/jsm/nodes/code/ExpressionNode.d.ts +2 -3
  39. three/examples/jsm/nodes/core/AttributeNode.d.ts +11 -4
  40. three/examples/jsm/nodes/core/CacheNode.d.ts +4 -5
  41. three/examples/jsm/nodes/core/ConstNode.d.ts +1 -2
  42. three/examples/jsm/nodes/core/InputNode.d.ts +1 -2
  43. three/examples/jsm/nodes/core/LightingModel.d.ts +11 -0
  44. three/examples/jsm/nodes/core/Node.d.ts +102 -42
  45. three/examples/jsm/nodes/core/NodeAttribute.d.ts +7 -4
  46. three/examples/jsm/nodes/core/NodeBuilder.d.ts +30 -26
  47. three/examples/jsm/nodes/core/NodeCache.d.ts +48 -6
  48. three/examples/jsm/nodes/core/NodeFunction.d.ts +2 -2
  49. three/examples/jsm/nodes/core/NodeKeywords.d.ts +10 -7
  50. three/examples/jsm/nodes/core/NodeParser.d.ts +4 -4
  51. three/examples/jsm/nodes/core/NodeUniform.d.ts +8 -11
  52. three/examples/jsm/nodes/core/NodeVar.d.ts +5 -4
  53. three/examples/jsm/nodes/core/NodeVarying.d.ts +5 -6
  54. three/examples/jsm/nodes/core/PropertyNode.d.ts +4 -4
  55. three/examples/jsm/nodes/core/StackNode.d.ts +7 -1
  56. three/examples/jsm/nodes/core/StructTypeNode.d.ts +8 -0
  57. three/examples/jsm/nodes/core/TempNode.d.ts +1 -2
  58. three/examples/jsm/nodes/core/UniformGroup.d.ts +7 -0
  59. three/examples/jsm/nodes/core/UniformGroupNode.d.ts +21 -0
  60. three/examples/jsm/nodes/core/UniformNode.d.ts +16 -11
  61. three/examples/jsm/nodes/core/VarNode.d.ts +2 -0
  62. three/examples/jsm/nodes/core/VaryingNode.d.ts +4 -0
  63. three/examples/jsm/nodes/core/constants.d.ts +27 -79
  64. three/examples/jsm/nodes/display/DepthOfFieldNode.d.ts +30 -0
  65. three/examples/jsm/nodes/display/DotScreenNode.d.ts +32 -0
  66. three/examples/jsm/nodes/display/PassNode.d.ts +1 -1
  67. three/examples/jsm/nodes/display/RGBShiftNode.d.ts +24 -0
  68. three/examples/jsm/nodes/display/SobelOperatorNode.d.ts +17 -0
  69. three/examples/jsm/nodes/display/ViewportDepthNode.d.ts +4 -6
  70. three/examples/jsm/nodes/functions/BSDF/LTC.d.ts +9 -0
  71. three/examples/jsm/nodes/functions/PhysicalLightingModel.d.ts +2 -0
  72. three/examples/jsm/nodes/functions/ToonLightingModel.d.ts +4 -0
  73. three/examples/jsm/nodes/lighting/RectAreaLightNode.d.ts +10 -0
  74. three/examples/jsm/nodes/loaders/NodeLoader.d.ts +3 -3
  75. three/examples/jsm/nodes/loaders/NodeObjectLoader.d.ts +2 -3
  76. three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +2 -0
  77. three/examples/jsm/nodes/materials/Materials.d.ts +3 -0
  78. three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +5 -1
  79. three/examples/jsm/nodes/materials/MeshMatcapNodeMaterial.d.ts +28 -0
  80. three/examples/jsm/nodes/materials/MeshNormalNodeMaterial.d.ts +2 -0
  81. three/examples/jsm/nodes/materials/MeshPhongNodeMaterial.d.ts +7 -4
  82. three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +24 -17
  83. three/examples/jsm/nodes/materials/MeshSSSNodeMaterial.d.ts +6 -7
  84. three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +8 -5
  85. three/examples/jsm/nodes/materials/MeshToonNodeMaterial.d.ts +38 -0
  86. three/examples/jsm/nodes/materials/NodeMaterial.d.ts +41 -37
  87. three/examples/jsm/nodes/materials/PointsNodeMaterial.d.ts +1 -0
  88. three/examples/jsm/nodes/materials/ShadowNodeMaterial.d.ts +1 -0
  89. three/examples/jsm/nodes/materials/SpriteNodeMaterial.d.ts +3 -3
  90. three/examples/jsm/nodes/materials/VolumeNodeMaterial.d.ts +10 -0
  91. three/examples/jsm/nodes/materialx/lib/mx_hsv.d.ts +1 -0
  92. three/examples/jsm/nodes/materialx/lib/mx_noise.d.ts +230 -0
  93. three/examples/jsm/nodes/math/MathNode.d.ts +5 -1
  94. three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +58 -36
  95. three/examples/jsm/nodes/utils/ConvertNode.d.ts +2 -3
  96. three/examples/jsm/nodes/utils/DiscardNode.d.ts +1 -0
  97. three/examples/jsm/nodes/utils/EquirectUVNode.d.ts +2 -2
  98. three/examples/jsm/nodes/utils/SplitNode.d.ts +1 -1
  99. three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +4 -5
  100. three/examples/jsm/objects/Sky.d.ts +18 -0
  101. three/examples/jsm/renderers/common/Animation.d.ts +14 -0
  102. three/examples/jsm/renderers/common/Attributes.d.ts +20 -0
  103. three/examples/jsm/renderers/common/Background.d.ts +22 -0
  104. three/examples/jsm/renderers/common/BindGroup.d.ts +9 -0
  105. three/examples/jsm/renderers/common/Binding.d.ts +8 -0
  106. three/examples/jsm/renderers/common/Bindings.d.ts +42 -0
  107. three/examples/jsm/renderers/common/Buffer.d.ts +11 -0
  108. three/examples/jsm/renderers/common/BufferUtils.d.ts +4 -0
  109. three/examples/jsm/renderers/common/ChainMap.d.ts +9 -0
  110. three/examples/jsm/renderers/common/ClippingContext.d.ts +18 -0
  111. three/examples/jsm/renderers/common/Color4.d.ts +6 -5
  112. three/examples/jsm/renderers/common/ComputePipeline.d.ts +8 -0
  113. three/examples/jsm/renderers/common/Constants.d.ts +9 -0
  114. three/examples/jsm/renderers/common/CubeRenderTarget.d.ts +7 -0
  115. three/examples/jsm/renderers/common/DataMap.d.ts +20 -0
  116. three/examples/jsm/renderers/common/Geometries.d.ts +28 -0
  117. three/examples/jsm/renderers/common/Info.d.ts +25 -13
  118. three/examples/jsm/renderers/common/Pipeline.d.ts +6 -0
  119. three/examples/jsm/renderers/common/Pipelines.d.ts +68 -0
  120. three/examples/jsm/renderers/common/PostProcessing.d.ts +2 -0
  121. three/examples/jsm/renderers/common/ProgrammableStage.d.ts +15 -0
  122. three/examples/jsm/renderers/common/RenderBundle.d.ts +8 -0
  123. three/examples/jsm/renderers/common/RenderBundles.d.ts +10 -0
  124. three/examples/jsm/renderers/common/RenderContext.d.ts +38 -0
  125. three/examples/jsm/renderers/common/RenderContexts.d.ts +13 -0
  126. three/examples/jsm/renderers/common/RenderList.d.ts +62 -0
  127. three/examples/jsm/renderers/common/RenderLists.d.ts +10 -0
  128. three/examples/jsm/renderers/common/RenderObject.d.ts +73 -0
  129. three/examples/jsm/renderers/common/RenderObjects.d.ts +59 -0
  130. three/examples/jsm/renderers/common/RenderPipeline.d.ts +8 -0
  131. three/examples/jsm/renderers/common/Renderer.d.ts +186 -208
  132. three/examples/jsm/renderers/common/SampledTexture.d.ts +27 -0
  133. three/examples/jsm/renderers/common/Sampler.d.ts +11 -0
  134. three/examples/jsm/renderers/common/StorageBufferAttribute.d.ts +7 -0
  135. three/examples/jsm/renderers/common/StorageInstancedBufferAttribute.d.ts +7 -0
  136. three/examples/jsm/renderers/common/Textures.d.ts +64 -0
  137. three/examples/jsm/renderers/common/Uniform.d.ts +40 -0
  138. three/examples/jsm/renderers/common/UniformBuffer.d.ts +6 -0
  139. three/examples/jsm/renderers/common/UniformsGroup.d.ts +32 -0
  140. three/examples/jsm/renderers/common/nodes/NodeBuilderState.d.ts +30 -0
  141. three/examples/jsm/renderers/common/nodes/NodeSampledTexture.d.ts +29 -0
  142. three/examples/jsm/renderers/common/nodes/NodeSampler.d.ts +12 -0
  143. three/examples/jsm/renderers/common/nodes/NodeUniform.d.ts +63 -0
  144. three/examples/jsm/renderers/common/nodes/NodeUniformsGroup.d.ts +11 -0
  145. three/examples/jsm/renderers/common/nodes/Nodes.d.ts +95 -0
  146. three/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +123 -0
  147. three/examples/jsm/renderers/webgpu/nodes/WGSLNodeFunction.d.ts +6 -0
  148. three/examples/jsm/renderers/webgpu/nodes/WGSLNodeParser.d.ts +6 -0
  149. three/examples/jsm/renderers/webgpu/utils/WebGPUConstants.d.ts +328 -0
  150. three/examples/jsm/utils/SceneUtils.d.ts +9 -3
  151. three/package.json +4 -4
  152. three/src/Three.d.ts +1 -0
  153. three/src/animation/tracks/StringKeyframeTrack.d.ts +1 -2
  154. three/src/constants.d.ts +6 -0
  155. three/src/core/BufferGeometry.d.ts +19 -17
  156. three/src/core/InterleavedBuffer.d.ts +2 -0
  157. three/src/extras/ShapeUtils.d.ts +5 -8
  158. three/src/extras/TextureUtils.d.ts +42 -0
  159. three/src/lights/LightShadow.d.ts +5 -0
  160. three/src/loaders/LoaderUtils.d.ts +9 -6
  161. three/src/materials/Material.d.ts +21 -12
  162. three/src/math/Color.d.ts +1 -1
  163. three/src/math/Matrix3.d.ts +2 -0
  164. three/src/math/Matrix4.d.ts +2 -0
  165. three/src/math/Vector4.d.ts +6 -0
  166. three/src/objects/BatchedMesh.d.ts +66 -47
  167. three/src/objects/InstancedMesh.d.ts +3 -3
  168. three/src/renderers/WebGLRenderer.d.ts +41 -19
  169. three/src/renderers/shaders/UniformsLib.d.ts +3 -0
  170. three/src/renderers/webgl/WebGLPrograms.d.ts +1 -1
  171. three/src/renderers/webxr/WebXRDepthSensing.d.ts +3 -1
  172. three/src/renderers/webxr/WebXRManager.d.ts +33 -23
  173. three/src/textures/CompressedArrayTexture.d.ts +36 -19
  174. three/src/textures/CompressedTexture.d.ts +16 -8
  175. three/src/textures/DataArrayTexture.d.ts +37 -20
  176. three/src/textures/FramebufferTexture.d.ts +1 -1
  177. three/src/textures/Texture.d.ts +3 -1
  178. three/src/utils.d.ts +2 -0
  179. three/examples/jsm/renderers/webgl/nodes/SlotNode.d.ts +0 -17
  180. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +0 -37
  181. three/examples/jsm/renderers/webgl/nodes/WebGLNodes.d.ts +0 -3
@@ -0,0 +1,328 @@
1
+ export enum GPUPrimitiveTopology {
2
+ PointList = "point-list",
3
+ LineList = "line-list",
4
+ LineStrip = "line-strip",
5
+ TriangleList = "triangle-list",
6
+ TriangleStrip = "triangle-strip",
7
+ }
8
+
9
+ export enum GPUCompareFunction {
10
+ Never = "never",
11
+ Less = "less",
12
+ Equal = "equal",
13
+ LessEqual = "less-equal",
14
+ Greater = "greater",
15
+ NotEqual = "not-equal",
16
+ GreaterEqual = "greater-equal",
17
+ Always = "always",
18
+ }
19
+
20
+ export enum GPUStoreOp {
21
+ Store = "store",
22
+ Discard = "discard",
23
+ }
24
+
25
+ export enum GPULoadOp {
26
+ Load = "load",
27
+ Clear = "clear",
28
+ }
29
+
30
+ export enum GPUFrontFace {
31
+ CCW = "ccw",
32
+ CW = "cw",
33
+ }
34
+
35
+ export enum GPUCullMode {
36
+ None = "none",
37
+ Front = "front",
38
+ Back = "back",
39
+ }
40
+
41
+ export enum GPUIndexFormat {
42
+ Uint16 = "uint16",
43
+ Uint32 = "uint32",
44
+ }
45
+
46
+ export enum GPUVertexFormat {
47
+ Uint8x2 = "uint8x2",
48
+ Uint8x4 = "uint8x4",
49
+ Sint8x2 = "sint8x2",
50
+ Sint8x4 = "sint8x4",
51
+ Unorm8x2 = "unorm8x2",
52
+ Unorm8x4 = "unorm8x4",
53
+ Snorm8x2 = "snorm8x2",
54
+ Snorm8x4 = "snorm8x4",
55
+ Uint16x2 = "uint16x2",
56
+ Uint16x4 = "uint16x4",
57
+ Sint16x2 = "sint16x2",
58
+ Sint16x4 = "sint16x4",
59
+ Unorm16x2 = "unorm16x2",
60
+ Unorm16x4 = "unorm16x4",
61
+ Snorm16x2 = "snorm16x2",
62
+ Snorm16x4 = "snorm16x4",
63
+ Float16x2 = "float16x2",
64
+ Float16x4 = "float16x4",
65
+ Float32 = "float32",
66
+ Float32x2 = "float32x2",
67
+ Float32x3 = "float32x3",
68
+ Float32x4 = "float32x4",
69
+ Uint32 = "uint32",
70
+ Uint32x2 = "uint32x2",
71
+ Uint32x3 = "uint32x3",
72
+ Uint32x4 = "uint32x4",
73
+ Sint32 = "sint32",
74
+ Sint32x2 = "sint32x2",
75
+ Sint32x3 = "sint32x3",
76
+ Sint32x4 = "sint32x4",
77
+ }
78
+
79
+ export enum GPUTextureFormat {
80
+ // 8-bit formats
81
+
82
+ R8Unorm = "r8unorm",
83
+ R8Snorm = "r8snorm",
84
+ R8Uint = "r8uint",
85
+ R8Sint = "r8sint",
86
+
87
+ // 16-bit formats
88
+
89
+ R16Uint = "r16uint",
90
+ R16Sint = "r16sint",
91
+ R16Float = "r16float",
92
+ RG8Unorm = "rg8unorm",
93
+ RG8Snorm = "rg8snorm",
94
+ RG8Uint = "rg8uint",
95
+ RG8Sint = "rg8sint",
96
+
97
+ // 32-bit formats
98
+
99
+ R32Uint = "r32uint",
100
+ R32Sint = "r32sint",
101
+ R32Float = "r32float",
102
+ RG16Uint = "rg16uint",
103
+ RG16Sint = "rg16sint",
104
+ RG16Float = "rg16float",
105
+ RGBA8Unorm = "rgba8unorm",
106
+ RGBA8UnormSRGB = "rgba8unorm-srgb",
107
+ RGBA8Snorm = "rgba8snorm",
108
+ RGBA8Uint = "rgba8uint",
109
+ RGBA8Sint = "rgba8sint",
110
+ BGRA8Unorm = "bgra8unorm",
111
+ BGRA8UnormSRGB = "bgra8unorm-srgb",
112
+ // Packed 32-bit formats
113
+ RGB9E5UFloat = "rgb9e5ufloat",
114
+ RGB10A2Unorm = "rgb10a2unorm",
115
+ RG11B10uFloat = "rgb10a2unorm",
116
+
117
+ // 64-bit formats
118
+
119
+ RG32Uint = "rg32uint",
120
+ RG32Sint = "rg32sint",
121
+ RG32Float = "rg32float",
122
+ RGBA16Uint = "rgba16uint",
123
+ RGBA16Sint = "rgba16sint",
124
+ RGBA16Float = "rgba16float",
125
+
126
+ // 128-bit formats
127
+
128
+ RGBA32Uint = "rgba32uint",
129
+ RGBA32Sint = "rgba32sint",
130
+ RGBA32Float = "rgba32float",
131
+
132
+ // Depth and stencil formats
133
+
134
+ Stencil8 = "stencil8",
135
+ Depth16Unorm = "depth16unorm",
136
+ Depth24Plus = "depth24plus",
137
+ Depth24PlusStencil8 = "depth24plus-stencil8",
138
+ Depth32Float = "depth32float",
139
+
140
+ // 'depth32float-stencil8' extension
141
+
142
+ Depth32FloatStencil8 = "depth32float-stencil8",
143
+
144
+ // BC compressed formats usable if 'texture-compression-bc' is both
145
+ // supported by the device/user agent and enabled in requestDevice.
146
+
147
+ BC1RGBAUnorm = "bc1-rgba-unorm",
148
+ BC1RGBAUnormSRGB = "bc1-rgba-unorm-srgb",
149
+ BC2RGBAUnorm = "bc2-rgba-unorm",
150
+ BC2RGBAUnormSRGB = "bc2-rgba-unorm-srgb",
151
+ BC3RGBAUnorm = "bc3-rgba-unorm",
152
+ BC3RGBAUnormSRGB = "bc3-rgba-unorm-srgb",
153
+ BC4RUnorm = "bc4-r-unorm",
154
+ BC4RSnorm = "bc4-r-snorm",
155
+ BC5RGUnorm = "bc5-rg-unorm",
156
+ BC5RGSnorm = "bc5-rg-snorm",
157
+ BC6HRGBUFloat = "bc6h-rgb-ufloat",
158
+ BC6HRGBFloat = "bc6h-rgb-float",
159
+ BC7RGBAUnorm = "bc7-rgba-unorm",
160
+ BC7RGBAUnormSRGB = "bc7-rgba-srgb",
161
+
162
+ // ETC2 compressed formats usable if 'texture-compression-etc2' is both
163
+ // supported by the device/user agent and enabled in requestDevice.
164
+
165
+ ETC2RGB8Unorm = "etc2-rgb8unorm",
166
+ ETC2RGB8UnormSRGB = "etc2-rgb8unorm-srgb",
167
+ ETC2RGB8A1Unorm = "etc2-rgb8a1unorm",
168
+ ETC2RGB8A1UnormSRGB = "etc2-rgb8a1unorm-srgb",
169
+ ETC2RGBA8Unorm = "etc2-rgba8unorm",
170
+ ETC2RGBA8UnormSRGB = "etc2-rgba8unorm-srgb",
171
+ EACR11Unorm = "eac-r11unorm",
172
+ EACR11Snorm = "eac-r11snorm",
173
+ EACRG11Unorm = "eac-rg11unorm",
174
+ EACRG11Snorm = "eac-rg11snorm",
175
+
176
+ // ASTC compressed formats usable if 'texture-compression-astc' is both
177
+ // supported by the device/user agent and enabled in requestDevice.
178
+
179
+ ASTC4x4Unorm = "astc-4x4-unorm",
180
+ ASTC4x4UnormSRGB = "astc-4x4-unorm-srgb",
181
+ ASTC5x4Unorm = "astc-5x4-unorm",
182
+ ASTC5x4UnormSRGB = "astc-5x4-unorm-srgb",
183
+ ASTC5x5Unorm = "astc-5x5-unorm",
184
+ ASTC5x5UnormSRGB = "astc-5x5-unorm-srgb",
185
+ ASTC6x5Unorm = "astc-6x5-unorm",
186
+ ASTC6x5UnormSRGB = "astc-6x5-unorm-srgb",
187
+ ASTC6x6Unorm = "astc-6x6-unorm",
188
+ ASTC6x6UnormSRGB = "astc-6x6-unorm-srgb",
189
+ ASTC8x5Unorm = "astc-8x5-unorm",
190
+ ASTC8x5UnormSRGB = "astc-8x5-unorm-srgb",
191
+ ASTC8x6Unorm = "astc-8x6-unorm",
192
+ ASTC8x6UnormSRGB = "astc-8x6-unorm-srgb",
193
+ ASTC8x8Unorm = "astc-8x8-unorm",
194
+ ASTC8x8UnormSRGB = "astc-8x8-unorm-srgb",
195
+ ASTC10x5Unorm = "astc-10x5-unorm",
196
+ ASTC10x5UnormSRGB = "astc-10x5-unorm-srgb",
197
+ ASTC10x6Unorm = "astc-10x6-unorm",
198
+ ASTC10x6UnormSRGB = "astc-10x6-unorm-srgb",
199
+ ASTC10x8Unorm = "astc-10x8-unorm",
200
+ ASTC10x8UnormSRGB = "astc-10x8-unorm-srgb",
201
+ ASTC10x10Unorm = "astc-10x10-unorm",
202
+ ASTC10x10UnormSRGB = "astc-10x10-unorm-srgb",
203
+ ASTC12x10Unorm = "astc-12x10-unorm",
204
+ ASTC12x10UnormSRGB = "astc-12x10-unorm-srgb",
205
+ ASTC12x12Unorm = "astc-12x12-unorm",
206
+ ASTC12x12UnormSRGB = "astc-12x12-unorm-srgb",
207
+ }
208
+
209
+ export enum GPUAddressMode {
210
+ ClampToEdge = "clamp-to-edge",
211
+ Repeat = "repeat",
212
+ MirrorRepeat = "mirror-repeat",
213
+ }
214
+
215
+ export enum GPUFilterMode {
216
+ Linear = "linear",
217
+ Nearest = "nearest",
218
+ }
219
+
220
+ export enum GPUBlendFactor {
221
+ Zero = "zero",
222
+ One = "one",
223
+ Src = "src",
224
+ OneMinusSrc = "one-minus-src",
225
+ SrcAlpha = "src-alpha",
226
+ OneMinusSrcAlpha = "one-minus-src-alpha",
227
+ Dst = "dst",
228
+ OneMinusDstColor = "one-minus-dst",
229
+ DstAlpha = "dst-alpha",
230
+ OneMinusDstAlpha = "one-minus-dst-alpha",
231
+ SrcAlphaSaturated = "src-alpha-saturated",
232
+ Constant = "constant",
233
+ OneMinusConstant = "one-minus-constant",
234
+ }
235
+
236
+ export enum GPUBlendOperation {
237
+ Add = "add",
238
+ Subtract = "subtract",
239
+ ReverseSubtract = "reverse-subtract",
240
+ Min = "min",
241
+ Max = "max",
242
+ }
243
+
244
+ export enum GPUColorWriteFlags {
245
+ None = 0,
246
+ Red = 0x1,
247
+ Green = 0x2,
248
+ Blue = 0x4,
249
+ Alpha = 0x8,
250
+ All = 0xF,
251
+ }
252
+
253
+ export enum GPUStencilOperation {
254
+ Keep = "keep",
255
+ Zero = "zero",
256
+ Replace = "replace",
257
+ Invert = "invert",
258
+ IncrementClamp = "increment-clamp",
259
+ DecrementClamp = "decrement-clamp",
260
+ IncrementWrap = "increment-wrap",
261
+ DecrementWrap = "decrement-wrap",
262
+ }
263
+
264
+ export enum GPUBufferBindingType {
265
+ Uniform = "uniform",
266
+ Storage = "storage",
267
+ ReadOnlyStorage = "read-only-storage",
268
+ }
269
+
270
+ export enum GPUStorageTextureAccess {
271
+ WriteOnly = "write-only",
272
+ ReadOnly = "read-only",
273
+ ReadWrite = "read-write",
274
+ }
275
+
276
+ export enum GPUSamplerBindingType {
277
+ Filtering = "filtering",
278
+ NonFiltering = "non-filtering",
279
+ Comparison = "comparison",
280
+ }
281
+
282
+ export enum GPUTextureSampleType {
283
+ Float = "float",
284
+ UnfilterableFloat = "unfilterable-float",
285
+ Depth = "depth",
286
+ SInt = "sint",
287
+ UInt = "uint",
288
+ }
289
+
290
+ export enum GPUTextureDimension {
291
+ OneD = "1d",
292
+ TwoD = "2d",
293
+ ThreeD = "3d",
294
+ }
295
+
296
+ export enum GPUTextureViewDimension {
297
+ OneD = "1d",
298
+ TwoD = "2d",
299
+ TwoDArray = "2d-array",
300
+ Cube = "cube",
301
+ CubeArray = "cube-array",
302
+ ThreeD = "3d",
303
+ }
304
+
305
+ export enum GPUTextureAspect {
306
+ All = "all",
307
+ StencilOnly = "stencil-only",
308
+ DepthOnly = "depth-only",
309
+ }
310
+
311
+ export enum GPUInputStepMode {
312
+ Vertex = "vertex",
313
+ Instance = "instance",
314
+ }
315
+
316
+ export enum GPUFeatureName {
317
+ DepthClipControl = "depth-clip-control",
318
+ Depth32FloatStencil8 = "depth32float-stencil8",
319
+ TextureCompressionBC = "texture-compression-bc",
320
+ TextureCompressionETC2 = "texture-compression-etc2",
321
+ TextureCompressionASTC = "texture-compression-astc",
322
+ TimestampQuery = "timestamp-query",
323
+ IndirectFirstInstance = "indirect-first-instance",
324
+ ShaderF16 = "shader-f16",
325
+ RG11B10UFloat = "rg11b10ufloat-renderable",
326
+ BGRA8UNormStorage = "bgra8unorm-storage",
327
+ Float32Filterable = "float32-filterable",
328
+ }
@@ -33,19 +33,25 @@ export function reduceVertices<TValue>(
33
33
  ): TValue;
34
34
 
35
35
  /**
36
- * @param object Object to traverse.
36
+ * A generator based version of {@link Object3D.traverse}.
37
+ *
38
+ * @param object The 3D object to traverse.
37
39
  * @yields Objects that passed the filter condition.
38
40
  */
39
41
  export function traverseGenerator(object: Object3D): Generator<Object3D, void, unknown>;
40
42
 
41
43
  /**
42
- * @param object Object to traverse.
44
+ * A generator based version of {@link Object3D.traverseVisible}.
45
+ *
46
+ * @param object The 3D object to traverse.
43
47
  * @yields Objects that passed the filter condition.
44
48
  */
45
49
  export function traverseVisibleGenerator(object: Object3D): Generator<Object3D, void, unknown>;
46
50
 
47
51
  /**
48
- * @param object Object to traverse.
52
+ * A generator based version of {@link Object3D.traverseAncestors}.
53
+ *
54
+ * @param object The 3D object to traverse.
49
55
  * @yields Objects that passed the filter condition.
50
56
  */
51
57
  export function traverseAncestorsGenerator(object: Object3D): Generator<Object3D, void, unknown>;
three/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/three",
3
- "version": "0.164.1",
3
+ "version": "0.166.0",
4
4
  "description": "TypeScript definitions for three",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
6
6
  "license": "MIT",
@@ -39,12 +39,12 @@
39
39
  },
40
40
  "scripts": {},
41
41
  "dependencies": {
42
- "@tweenjs/tween.js": "~23.1.1",
42
+ "@tweenjs/tween.js": "~23.1.2",
43
43
  "@types/stats.js": "*",
44
44
  "@types/webxr": "*",
45
45
  "fflate": "~0.8.2",
46
46
  "meshoptimizer": "~0.18.1"
47
47
  },
48
- "typesPublisherContentHash": "42147108b2703f64304a109b8abded031b3089221669d1c88628dd23d883daf5",
49
- "typeScriptVersion": "4.7"
48
+ "typesPublisherContentHash": "edfaedac592c09ce630dbeba7c12eaa206916e9761f49db67f6e41ba87970203",
49
+ "typeScriptVersion": "4.8"
50
50
  }
three/src/Three.d.ts CHANGED
@@ -71,6 +71,7 @@ export * as DataUtils from "./extras/DataUtils.js";
71
71
  export * from "./extras/ImageUtils.js";
72
72
  export * from "./extras/PMREMGenerator.js";
73
73
  export * from "./extras/ShapeUtils.js";
74
+ export { TextureUtils } from "./extras/TextureUtils.js";
74
75
  /**
75
76
  * Geometries
76
77
  */
@@ -1,8 +1,7 @@
1
- import { InterpolationModes } from "../../constants.js";
2
1
  import { KeyframeTrack } from "../KeyframeTrack.js";
3
2
 
4
3
  export class StringKeyframeTrack extends KeyframeTrack {
5
- constructor(name: string, times: ArrayLike<number>, values: ArrayLike<any>, interpolation?: InterpolationModes);
4
+ constructor(name: string, times: ArrayLike<number>, values: ArrayLike<any>);
6
5
 
7
6
  /**
8
7
  * @default 'string'
three/src/constants.d.ts CHANGED
@@ -419,6 +419,11 @@ export const RGFormat: 1030;
419
419
  */
420
420
  export const RGIntegerFormat: 1031;
421
421
 
422
+ /**
423
+ * {@link RGBIntegerFormat} discrads the alpha components and reads the red, green, and blue components.
424
+ */
425
+ export const RGBIntegerFormat: 1032;
426
+
422
427
  /**
423
428
  * {@link RGBAIntegerFormat} reads the red, green, blue and alpha component
424
429
  * @remarks This is the default for {@link THREE.Texture}.
@@ -443,6 +448,7 @@ export type PixelFormat =
443
448
  | typeof RedIntegerFormat
444
449
  | typeof RGFormat
445
450
  | typeof RGIntegerFormat
451
+ | typeof RGBIntegerFormat
446
452
  | typeof RGBAIntegerFormat;
447
453
 
448
454
  /**
@@ -15,6 +15,24 @@ export type NormalOrGLBufferAttributes = Record<
15
15
  BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute
16
16
  >;
17
17
 
18
+ export interface GeometryGroup {
19
+ /**
20
+ * Specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index.
21
+ * @remarks Expects a `Integer`
22
+ */
23
+ start: number;
24
+ /**
25
+ * Specifies how many vertices (or indices) are included.
26
+ * @remarks Expects a `Integer`
27
+ */
28
+ count: number;
29
+ /**
30
+ * Specifies the material array index to use.
31
+ * @remarks Expects a `Integer`
32
+ */
33
+ materialIndex?: number | undefined;
34
+ }
35
+
18
36
  /**
19
37
  * A representation of mesh, line, or point geometry
20
38
  * Includes vertex positions, face indices, normals, colors, UVs, and custom attributes within buffers, reducing the cost of passing all this data to the GPU.
@@ -144,23 +162,7 @@ export class BufferGeometry<
144
162
  * @remarks Use {@link addGroup | .addGroup} to add groups, rather than modifying this array directly.
145
163
  * @defaultValue `[]`
146
164
  */
147
- groups: Array<{
148
- /**
149
- * Specifies the first element in this draw call – the first vertex for non-indexed geometry, otherwise the first triangle index.
150
- * @remarks Expects a `Integer`
151
- */
152
- start: number;
153
- /**
154
- * Specifies how many vertices (or indices) are included.
155
- * @remarks Expects a `Integer`
156
- */
157
- count: number;
158
- /**
159
- * Specifies the material array index to use.
160
- * @remarks Expects a `Integer`
161
- */
162
- materialIndex?: number | undefined;
163
- }>;
165
+ groups: GeometryGroup[];
164
166
 
165
167
  /**
166
168
  * Bounding box for the {@link THREE.BufferGeometry | BufferGeometry}, which can be calculated with {@link computeBoundingBox | .computeBoundingBox()}.
@@ -10,6 +10,8 @@ import { InterleavedBufferAttribute } from "./InterleavedBufferAttribute.js";
10
10
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/InterleavedBuffer.js | Source}
11
11
  */
12
12
  export class InterleavedBuffer {
13
+ readonly isInterleavedBuffer: true;
14
+
13
15
  /**
14
16
  * Create a new instance of {@link InterleavedBuffer}
15
17
  * @param array A {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray | TypedArray} with a shared buffer. Stores the geometry data.
@@ -1,7 +1,4 @@
1
- export interface Vec2 {
2
- x: number;
3
- y: number;
4
- }
1
+ import { Vector2Like } from "../math/Vector2.js";
5
2
 
6
3
  /**
7
4
  * A class containing utility functions for shapes.
@@ -9,20 +6,20 @@ export interface Vec2 {
9
6
  * @see {@link https://threejs.org/docs/index.html#api/en/extras/ShapeUtils | Official Documentation}
10
7
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/ShapeUtils.js | Source}
11
8
  */
12
- export namespace ShapeUtils {
9
+ export class ShapeUtils {
13
10
  /**
14
11
  * Calculate area of a ( 2D ) contour polygon.
15
12
  */
16
- function area(contour: Vec2[]): number;
13
+ static area(contour: readonly Vector2Like[]): number;
17
14
 
18
15
  /**
19
16
  * Note that this is a linear function so it is necessary to calculate separately for x, y components of a polygon.
20
17
  * @remarks Used internally by {@link THREE.Path | Path}, {@link THREE.ExtrudeGeometry | ExtrudeGeometry} and {@link THREE.ShapeGeometry | ShapeGeometry}.
21
18
  */
22
- function isClockWise(pts: Vec2[]): boolean;
19
+ static isClockWise(pts: readonly Vector2Like[]): boolean;
23
20
 
24
21
  /**
25
22
  * Used internally by {@link THREE.ExtrudeGeometry | ExtrudeGeometry} and {@link THREE.ShapeGeometry | ShapeGeometry} to calculate faces in shapes with holes.
26
23
  */
27
- function triangulateShape(contour: Vec2[], holes: Vec2[][]): number[][];
24
+ static triangulateShape(contour: Vector2Like[], holes: Vector2Like[][]): number[][];
28
25
  }
@@ -0,0 +1,42 @@
1
+ import { CompressedPixelFormat, PixelFormat, TextureDataType } from "../constants.js";
2
+ import { Texture } from "../textures/Texture.js";
3
+
4
+ /**
5
+ * Scales the texture as large as possible within its surface without cropping or stretching the texture. The method
6
+ * preserves the original aspect ratio of the texture. Akin to CSS `object-fit: contain`.
7
+ */
8
+ declare function contain(texture: Texture, aspect: number): Texture;
9
+
10
+ /**
11
+ * Scales the texture to the smallest possible size to fill the surface, leaving no empty space. The method preserves
12
+ * the original aspect ratio of the texture. Akin to CSS `object-fit: cover`.
13
+ */
14
+ declare function cover(texture: Texture, aspect: number): Texture;
15
+
16
+ /**
17
+ * Configures the texture to the default transformation. Akin to CSS `object-fit: fill`.
18
+ */
19
+ declare function fill(texture: Texture): Texture;
20
+
21
+ /**
22
+ * Given the width, height, format, and type of a texture. Determines how many bytes must be used to represent the
23
+ * texture.
24
+ */
25
+ declare function getByteLength(
26
+ width: number,
27
+ height: number,
28
+ format: PixelFormat | CompressedPixelFormat,
29
+ type: TextureDataType,
30
+ ): number;
31
+
32
+ /**
33
+ * A class containing utility functions for textures.
34
+ */
35
+ declare const TextureUtils: {
36
+ contain: typeof contain;
37
+ cover: typeof cover;
38
+ fill: typeof fill;
39
+ getByteLength: typeof getByteLength;
40
+ };
41
+
42
+ export { contain, cover, fill, getByteLength, TextureUtils };
@@ -24,6 +24,11 @@ export class LightShadow<TCamera extends Camera = Camera> {
24
24
  */
25
25
  camera: TCamera;
26
26
 
27
+ /**
28
+ * The intensity of the shadow. The default is `1`. Valid values are in the range `[0, 1]`.
29
+ */
30
+ intensity: number;
31
+
27
32
  /**
28
33
  * Shadow map bias, how much to add or subtract from the normalized depth when deciding whether a surface is in shadow.
29
34
  * @remark The Very tiny adjustments here (in the order of 0.0001) may help reduce artifacts in shadows.
@@ -1,7 +1,10 @@
1
- export interface LoaderUtils {
2
- decodeText(array: BufferSource): string;
3
- extractUrlBase(url: string): string;
4
- resolveURL(url: string, path: string): string;
5
- }
1
+ export class LoaderUtils {
2
+ /**
3
+ * @deprecated decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead.
4
+ */
5
+ static decodeText(array: BufferSource): string;
6
+
7
+ static extractUrlBase(url: string): string;
6
8
 
7
- export const LoaderUtils: LoaderUtils;
9
+ static resolveURL(url: string, path: string): string;
10
+ }
@@ -394,17 +394,6 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
394
394
  */
395
395
  set alphaTest(value: number);
396
396
 
397
- onBuild(object: Object3D, parameters: WebGLProgramParametersWithUniforms, renderer: WebGLRenderer): void;
398
-
399
- onBeforeRender(
400
- renderer: WebGLRenderer,
401
- scene: Scene,
402
- camera: Camera,
403
- geometry: BufferGeometry,
404
- object: Object3D,
405
- group: Group,
406
- ): void;
407
-
408
397
  /**
409
398
  * An optional callback that is executed immediately before the shader program is compiled.
410
399
  * This function is called with the associated WebGL program parameters and renderer.
@@ -443,7 +432,10 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
443
432
  copy(material: Material): this;
444
433
 
445
434
  /**
446
- * This disposes the material. Textures of a material don't get disposed. These needs to be disposed by {@link Texture}.
435
+ * Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer
436
+ * used in your app.
437
+ *
438
+ * Material textures must be disposed of by the dispose() method of {@link Texture}.
447
439
  */
448
440
  dispose(): void;
449
441
 
@@ -453,4 +445,21 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
453
445
  * @default false
454
446
  */
455
447
  set needsUpdate(value: boolean);
448
+
449
+ /**
450
+ * @deprecated onBuild() has been removed.
451
+ */
452
+ onBuild(object: Object3D, parameters: WebGLProgramParametersWithUniforms, renderer: WebGLRenderer): void;
453
+
454
+ /**
455
+ * @deprecated onBeforeRender() has been removed.
456
+ */
457
+ onBeforeRender(
458
+ renderer: WebGLRenderer,
459
+ scene: Scene,
460
+ camera: Camera,
461
+ geometry: BufferGeometry,
462
+ object: Object3D,
463
+ group: Group,
464
+ ): void;
456
465
  }
three/src/math/Color.d.ts CHANGED
@@ -255,7 +255,7 @@ export class Color {
255
255
  * Copies given color.
256
256
  * @param color Color to copy.
257
257
  */
258
- copy(color: this): this;
258
+ copy(color: Color): this;
259
259
 
260
260
  /**
261
261
  * Copies given color making conversion from sRGB to linear space.
@@ -52,6 +52,8 @@ export interface Matrix {
52
52
  * ( class Matrix3 implements Matrix<Matrix3> )
53
53
  */
54
54
  export class Matrix3 implements Matrix {
55
+ readonly isMatrix3: true;
56
+
55
57
  /**
56
58
  * Creates an identity matrix.
57
59
  */
@@ -42,6 +42,8 @@ export type Matrix4Tuple = [
42
42
  * m.multiply( m3 );
43
43
  */
44
44
  export class Matrix4 implements Matrix {
45
+ readonly isMatrix4: true;
46
+
45
47
  /**
46
48
  * Creates an identity matrix.
47
49
  */
@@ -137,6 +137,12 @@ export class Vector4 {
137
137
  */
138
138
  setAxisAngleFromRotationMatrix(m: Matrix4): this;
139
139
 
140
+ /**
141
+ * Sets this vector to the position elements of the
142
+ * [transformation matrix]{@link https://en.wikipedia.org/wiki/Transformation_matrix} m.
143
+ */
144
+ setFromMatrixPosition(m: Matrix4): this;
145
+
140
146
  min(v: Vector4Like): this;
141
147
  max(v: Vector4Like): this;
142
148
  clamp(min: Vector4Like, max: Vector4Like): this;