@types/three 0.157.1 → 0.158.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 (246) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +290 -0
  3. three/examples/jsm/animation/CCDIKSolver.d.ts +30 -0
  4. three/examples/jsm/animation/MMDAnimationHelper.d.ts +105 -0
  5. three/examples/jsm/animation/MMDPhysics.d.ts +124 -0
  6. three/examples/jsm/cameras/CinematicCamera.d.ts +41 -0
  7. three/examples/jsm/capabilities/WebGL.d.ts +9 -0
  8. three/examples/jsm/controls/OrbitControls.d.ts +304 -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/helpers/RectAreaLightHelper.d.ts +10 -0
  15. three/examples/jsm/helpers/ViewHelper.d.ts +15 -0
  16. three/examples/jsm/libs/fflate.module.d.ts +1 -0
  17. three/examples/jsm/libs/lil-gui.module.min.d.ts +609 -0
  18. three/examples/jsm/libs/tween.module.d.ts +219 -0
  19. three/examples/jsm/lights/RectAreaLightUniformsLib.d.ts +3 -0
  20. three/examples/jsm/lines/Line2.d.ts +11 -0
  21. three/examples/jsm/lines/LineGeometry.d.ts +10 -0
  22. three/examples/jsm/lines/LineMaterial.d.ts +31 -0
  23. three/examples/jsm/lines/LineSegments2.d.ts +14 -0
  24. three/examples/jsm/lines/LineSegmentsGeometry.d.ts +23 -0
  25. three/examples/jsm/loaders/DDSLoader.d.ts +16 -0
  26. three/examples/jsm/loaders/DRACOLoader.d.ts +19 -0
  27. three/examples/jsm/loaders/GLTFLoader.d.ts +147 -0
  28. three/examples/jsm/loaders/KTX2Loader.d.ts +17 -0
  29. three/examples/jsm/loaders/LDrawLoader.d.ts +19 -0
  30. three/examples/jsm/loaders/LogLuvLoader.d.ts +1 -1
  31. three/examples/jsm/loaders/MMDLoader.d.ts +56 -0
  32. three/examples/jsm/loaders/MTLLoader.d.ts +104 -0
  33. three/examples/jsm/loaders/OBJLoader.d.ts +10 -0
  34. three/examples/jsm/loaders/PCDLoader.d.ts +8 -0
  35. three/examples/jsm/loaders/RGBELoader.d.ts +19 -0
  36. three/examples/jsm/loaders/SVGLoader.d.ts +68 -0
  37. three/examples/jsm/loaders/TGALoader.d.ts +7 -0
  38. three/examples/jsm/loaders/TTFLoader.d.ts +8 -0
  39. three/examples/jsm/loaders/USDZLoader.d.ts +11 -0
  40. three/examples/jsm/materials/MeshGouraudMaterial.d.ts +17 -0
  41. three/examples/jsm/math/Capsule.d.ts +0 -1
  42. three/examples/jsm/misc/MD2CharacterComplex.d.ts +9 -1
  43. three/examples/jsm/nodes/Nodes.d.ts +149 -0
  44. three/examples/jsm/nodes/accessors/BitangentNode.d.ts +18 -0
  45. three/examples/jsm/nodes/accessors/BufferNode.d.ts +11 -0
  46. three/examples/jsm/nodes/accessors/CameraNode.d.ts +12 -0
  47. three/examples/jsm/nodes/accessors/CubeTextureNode.d.ts +13 -0
  48. three/examples/jsm/nodes/accessors/InstanceNode.d.ts +9 -0
  49. three/examples/jsm/nodes/accessors/MaterialNode.d.ts +23 -0
  50. three/examples/jsm/nodes/accessors/MaterialReferenceNode.d.ts +6 -0
  51. three/examples/jsm/nodes/accessors/ModelNode.d.ts +9 -0
  52. three/examples/jsm/nodes/accessors/ModelViewProjectionNode.d.ts +6 -0
  53. three/examples/jsm/nodes/accessors/NormalNode.d.ts +12 -0
  54. three/examples/jsm/nodes/accessors/Object3DNode.d.ts +22 -0
  55. three/examples/jsm/nodes/accessors/PointUVNode.d.ts +7 -0
  56. three/examples/jsm/nodes/accessors/PositionNode.d.ts +21 -0
  57. three/examples/jsm/nodes/accessors/ReferenceNode.d.ts +13 -0
  58. three/examples/jsm/nodes/accessors/ReflectVectorNode.d.ts +8 -0
  59. three/examples/jsm/nodes/accessors/SkinningNode.d.ts +13 -0
  60. three/examples/jsm/nodes/accessors/StorageBufferNode.d.ts +6 -0
  61. three/examples/jsm/nodes/accessors/TangentNode.d.ts +18 -0
  62. three/examples/jsm/nodes/accessors/TextureNode.d.ts +14 -0
  63. three/examples/jsm/nodes/accessors/UVNode.d.ts +8 -0
  64. three/examples/jsm/nodes/accessors/UserDataNode.d.ts +7 -0
  65. three/examples/jsm/nodes/code/CodeNode.d.ts +15 -0
  66. three/examples/jsm/nodes/code/ExpressionNode.d.ts +7 -0
  67. three/examples/jsm/nodes/code/FunctionCallNode.d.ts +13 -0
  68. three/examples/jsm/nodes/code/FunctionNode.d.ts +17 -0
  69. three/examples/jsm/nodes/core/ArrayUniformNode.d.ts +8 -0
  70. three/examples/jsm/nodes/core/AttributeNode.d.ts +9 -0
  71. three/examples/jsm/nodes/core/BypassNode.d.ts +9 -0
  72. three/examples/jsm/nodes/core/CacheNode.d.ts +10 -0
  73. three/examples/jsm/nodes/core/ConstNode.d.ts +10 -0
  74. three/examples/jsm/nodes/core/ContextNode.d.ts +10 -0
  75. three/examples/jsm/nodes/core/InputNode.d.ts +16 -0
  76. three/examples/jsm/nodes/core/Node.d.ts +31 -0
  77. three/examples/jsm/nodes/core/NodeAttribute.d.ts +6 -0
  78. three/examples/jsm/nodes/core/NodeBuilder.d.ts +138 -0
  79. three/examples/jsm/nodes/core/NodeCache.d.ts +9 -0
  80. three/examples/jsm/nodes/core/NodeCode.d.ts +4 -0
  81. three/examples/jsm/nodes/core/NodeFrame.d.ts +19 -0
  82. three/examples/jsm/nodes/core/NodeFunction.d.ts +13 -0
  83. three/examples/jsm/nodes/core/NodeFunctionInput.d.ts +7 -0
  84. three/examples/jsm/nodes/core/NodeKeywords.d.ts +14 -0
  85. three/examples/jsm/nodes/core/NodeParser.d.ts +5 -0
  86. three/examples/jsm/nodes/core/NodeUniform.d.ts +13 -0
  87. three/examples/jsm/nodes/core/NodeUtils.d.ts +13 -0
  88. three/examples/jsm/nodes/core/NodeVar.d.ts +6 -0
  89. three/examples/jsm/nodes/core/NodeVarying.d.ts +8 -0
  90. three/examples/jsm/nodes/core/PropertyNode.d.ts +6 -0
  91. three/examples/jsm/nodes/core/StackNode.d.ts +11 -0
  92. three/examples/jsm/nodes/core/TempNode.d.ts +11 -0
  93. three/examples/jsm/nodes/core/UniformNode.d.ts +10 -0
  94. three/examples/jsm/nodes/core/VarNode.d.ts +16 -0
  95. three/examples/jsm/nodes/core/VaryingNode.d.ts +8 -0
  96. three/examples/jsm/nodes/core/constants.d.ts +78 -0
  97. three/examples/jsm/nodes/display/BlendModeNode.d.ts +32 -0
  98. three/examples/jsm/nodes/display/ColorAdjustmentNode.d.ts +20 -0
  99. three/examples/jsm/nodes/display/ColorSpaceNode.d.ts +18 -0
  100. three/examples/jsm/nodes/display/FrontFacingNode.d.ts +6 -0
  101. three/examples/jsm/nodes/display/NormalMapNode.d.ts +12 -0
  102. three/examples/jsm/nodes/display/PosterizeNode.d.ts +8 -0
  103. three/examples/jsm/nodes/display/ToneMappingNode.d.ts +14 -0
  104. three/examples/jsm/nodes/display/ViewportNode.d.ts +23 -0
  105. three/examples/jsm/nodes/fog/FogExp2Node.d.ts +9 -0
  106. three/examples/jsm/nodes/fog/FogNode.d.ts +10 -0
  107. three/examples/jsm/nodes/fog/FogRangeNode.d.ts +10 -0
  108. three/examples/jsm/nodes/functions/BSDF/BRDF_GGX.d.ts +6 -0
  109. three/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.d.ts +6 -0
  110. three/examples/jsm/nodes/functions/BSDF/DFGApprox.d.ts +10 -0
  111. three/examples/jsm/nodes/functions/BSDF/D_GGX.d.ts +9 -0
  112. three/examples/jsm/nodes/functions/BSDF/F_Schlick.d.ts +6 -0
  113. three/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +6 -0
  114. three/examples/jsm/nodes/functions/PhysicalLightingModel.d.ts +11 -0
  115. three/examples/jsm/nodes/functions/material/getGeometryRoughness.d.ts +5 -0
  116. three/examples/jsm/nodes/functions/material/getRoughness.d.ts +6 -0
  117. three/examples/jsm/nodes/geometry/RangeNode.d.ts +13 -0
  118. three/examples/jsm/nodes/gpgpu/ComputeNode.d.ts +11 -0
  119. three/examples/jsm/nodes/lighting/AONode.d.ts +8 -0
  120. three/examples/jsm/nodes/lighting/AnalyticLightNode.d.ts +10 -0
  121. three/examples/jsm/nodes/lighting/EnvironmentNode.d.ts +8 -0
  122. three/examples/jsm/nodes/lighting/HemisphereLightNode.d.ts +13 -0
  123. three/examples/jsm/nodes/lighting/LightUtils.d.ts +4 -0
  124. three/examples/jsm/nodes/lighting/LightingContextNode.d.ts +15 -0
  125. three/examples/jsm/nodes/lighting/LightingNode.d.ts +5 -0
  126. three/examples/jsm/nodes/lighting/LightsNode.d.ts +19 -0
  127. three/examples/jsm/nodes/lighting/PointLightNode.d.ts +10 -0
  128. three/examples/jsm/nodes/lighting/SpotLightNode.d.ts +15 -0
  129. three/examples/jsm/nodes/loaders/NodeLoader.d.ts +14 -0
  130. three/examples/jsm/nodes/loaders/NodeMaterialLoader.d.ts +8 -0
  131. three/examples/jsm/nodes/loaders/NodeObjectLoader.d.ts +9 -0
  132. three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +9 -0
  133. three/examples/jsm/nodes/materials/Materials.d.ts +17 -0
  134. three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +10 -0
  135. three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +22 -0
  136. three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +18 -0
  137. three/examples/jsm/nodes/materials/NodeMaterial.d.ts +38 -0
  138. three/examples/jsm/nodes/materials/PointsNodeMaterial.d.ts +15 -0
  139. three/examples/jsm/nodes/materials/SpriteNodeMaterial.d.ts +23 -0
  140. three/examples/jsm/nodes/materialx/MaterialXNodes.d.ts +94 -0
  141. three/examples/jsm/nodes/materialx/lib/mx_hsv.d.ts +4 -0
  142. three/examples/jsm/nodes/materialx/lib/mx_noise.d.ts +6 -0
  143. three/examples/jsm/nodes/math/CondNode.d.ts +9 -0
  144. three/examples/jsm/nodes/math/MathNode.d.ts +115 -0
  145. three/examples/jsm/nodes/math/OperatorNode.d.ts +31 -0
  146. three/examples/jsm/nodes/procedural/CheckerNode.d.ts +6 -0
  147. three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +156 -0
  148. three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +310 -0
  149. three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +166 -0
  150. three/examples/jsm/nodes/utils/ArrayElementNode.d.ts +9 -0
  151. three/examples/jsm/nodes/utils/ConvertNode.d.ts +8 -0
  152. three/examples/jsm/nodes/utils/EquirectUVNode.d.ts +6 -0
  153. three/examples/jsm/nodes/utils/JoinNode.d.ts +10 -0
  154. three/examples/jsm/nodes/utils/MatcapUVNode.d.ts +5 -0
  155. three/examples/jsm/nodes/utils/MaxMipLevelNode.d.ts +11 -0
  156. three/examples/jsm/nodes/utils/OscNode.d.ts +19 -0
  157. three/examples/jsm/nodes/utils/RemapNode.d.ts +13 -0
  158. three/examples/jsm/nodes/utils/RotateUVNode.d.ts +10 -0
  159. three/examples/jsm/nodes/utils/SpecularMIPLevelNode.d.ts +8 -0
  160. three/examples/jsm/nodes/utils/SplitNode.d.ts +16 -0
  161. three/examples/jsm/nodes/utils/SpriteSheetUVNode.d.ts +9 -0
  162. three/examples/jsm/nodes/utils/TimerNode.d.ts +19 -0
  163. three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +22 -0
  164. three/examples/jsm/objects/Reflector.d.ts +29 -0
  165. three/examples/jsm/objects/ReflectorForSSRPass.d.ts +1 -0
  166. three/examples/jsm/objects/Refractor.d.ts +2 -1
  167. three/examples/jsm/physics/AmmoPhysics.d.ts +2 -1
  168. three/examples/jsm/physics/RapierPhysics.d.ts +2 -1
  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/SVGRenderer.d.ts +2 -1
  175. three/examples/jsm/renderers/common/Backend.d.ts +15 -0
  176. three/examples/jsm/renderers/common/Info.d.ts +15 -0
  177. three/examples/jsm/renderers/common/Renderer.d.ts +42 -0
  178. three/examples/jsm/renderers/webgl/nodes/SlotNode.d.ts +17 -0
  179. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +37 -0
  180. three/examples/jsm/renderers/webgl/nodes/WebGLNodes.d.ts +3 -0
  181. three/examples/jsm/renderers/webgpu/WebGPURenderer.d.ts +9 -0
  182. three/examples/jsm/shaders/ACESFilmicToneMappingShader.d.ts +11 -0
  183. three/examples/jsm/shaders/AfterimageShader.d.ts +1 -0
  184. three/examples/jsm/shaders/BasicShader.d.ts +1 -0
  185. three/examples/jsm/shaders/BlendShader.d.ts +1 -0
  186. three/examples/jsm/shaders/BokehShader.d.ts +1 -0
  187. three/examples/jsm/shaders/BokehShader2.d.ts +44 -0
  188. three/examples/jsm/shaders/BrightnessContrastShader.d.ts +1 -0
  189. three/examples/jsm/shaders/ColorCorrectionShader.d.ts +1 -0
  190. three/examples/jsm/shaders/DOFMipMapShader.d.ts +1 -0
  191. three/examples/jsm/shaders/DepthLimitedBlurShader.d.ts +1 -0
  192. three/examples/jsm/shaders/FXAAShader.d.ts +1 -0
  193. three/examples/jsm/shaders/FocusShader.d.ts +1 -0
  194. three/examples/jsm/shaders/FreiChenShader.d.ts +1 -0
  195. three/examples/jsm/shaders/GodRaysShader.d.ts +4 -0
  196. three/examples/jsm/shaders/HalftoneShader.d.ts +1 -0
  197. three/examples/jsm/shaders/HorizontalTiltShiftShader.d.ts +1 -0
  198. three/examples/jsm/shaders/HueSaturationShader.d.ts +1 -0
  199. three/examples/jsm/shaders/KaleidoShader.d.ts +1 -0
  200. three/examples/jsm/shaders/LuminosityHighPassShader.d.ts +1 -0
  201. three/examples/jsm/shaders/LuminosityShader.d.ts +1 -0
  202. three/examples/jsm/shaders/MirrorShader.d.ts +1 -0
  203. three/examples/jsm/shaders/NormalMapShader.d.ts +1 -0
  204. three/examples/jsm/shaders/OutputShader.d.ts +1 -0
  205. three/examples/jsm/shaders/SAOShader.d.ts +1 -0
  206. three/examples/jsm/shaders/SMAAShader.d.ts +3 -0
  207. three/examples/jsm/shaders/SSAOShader.d.ts +3 -0
  208. three/examples/jsm/shaders/SSRShader.d.ts +3 -0
  209. three/examples/jsm/shaders/SobelOperatorShader.d.ts +1 -0
  210. three/examples/jsm/shaders/SubsurfaceScatteringShader.d.ts +1 -0
  211. three/examples/jsm/shaders/TechnicolorShader.d.ts +1 -0
  212. three/examples/jsm/shaders/TriangleBlurShader.d.ts +1 -0
  213. three/examples/jsm/shaders/UnpackDepthRGBAShader.d.ts +1 -0
  214. three/examples/jsm/shaders/VelocityShader.d.ts +14 -0
  215. three/examples/jsm/shaders/VerticalTiltShiftShader.d.ts +1 -0
  216. three/examples/jsm/shaders/WaterRefractionShader.d.ts +1 -0
  217. three/examples/jsm/utils/GPUStatsPanel.d.ts +12 -0
  218. three/examples/jsm/utils/GeometryUtils.d.ts +25 -0
  219. three/examples/jsm/utils/LDrawUtils.d.ts +5 -0
  220. three/examples/jsm/webxr/VRButton.d.ts +5 -0
  221. three/examples/jsm/webxr/XRButton.d.ts +6 -0
  222. three/examples/jsm/webxr/XRControllerModelFactory.d.ts +21 -0
  223. three/examples/jsm/webxr/XREstimatedLight.d.ts +32 -0
  224. three/examples/jsm/webxr/XRHandMeshModel.d.ts +11 -0
  225. three/examples/jsm/webxr/XRHandModelFactory.d.ts +25 -0
  226. three/examples/jsm/webxr/XRHandPrimitiveModel.d.ts +24 -0
  227. three/package.json +3 -2
  228. three/src/cameras/CubeCamera.d.ts +1 -2
  229. three/src/constants.d.ts +21 -10
  230. three/src/core/Object3D.d.ts +4 -4
  231. three/src/core/Raycaster.d.ts +1 -0
  232. three/src/extras/Earcut.d.ts +15 -0
  233. three/src/extras/core/Curve.d.ts +1 -1
  234. three/src/geometries/CapsuleGeometry.d.ts +1 -1
  235. three/src/helpers/AxesHelper.d.ts +2 -2
  236. three/src/helpers/Box3Helper.d.ts +2 -2
  237. three/src/lights/Light.d.ts +1 -2
  238. three/src/materials/Material.d.ts +20 -2
  239. three/src/materials/MeshPhysicalMaterial.d.ts +8 -6
  240. three/src/math/ColorManagement.d.ts +1 -1
  241. three/src/math/Matrix4.d.ts +2 -1
  242. three/src/objects/SkinnedMesh.d.ts +9 -8
  243. three/src/renderers/WebGLRenderer.d.ts +12 -2
  244. three/src/scenes/Scene.d.ts +2 -2
  245. three/src/textures/DepthTexture.d.ts +3 -3
  246. three/src/textures/Texture.d.ts +2 -2
@@ -0,0 +1,609 @@
1
+ export type KeyToValueOfType<T, V> = { [K in keyof T]: T[K] extends V ? K : never }[keyof T];
2
+
3
+ export default GUI;
4
+ export class GUI {
5
+ /**
6
+ * Creates a panel that holds controllers.
7
+ * @example
8
+ * new GUI();
9
+ * new GUI( { container: document.getElementById( 'custom' ) } );
10
+ *
11
+ * @param [options]
12
+ * @param [options.autoPlace=true]
13
+ * Adds the GUI to `document.body` and fixes it to the top right of the page.
14
+ *
15
+ * @param [options.container]
16
+ * Adds the GUI to this DOM element. Overrides `autoPlace`.
17
+ *
18
+ * @param [options.width=245]
19
+ * Width of the GUI in pixels, usually set when name labels become too long. Note that you can make
20
+ * name labels wider in CSS with `.lil‑gui { ‑‑name‑width: 55% }`
21
+ *
22
+ * @param [options.title=Controls]
23
+ * Name to display in the title bar.
24
+ *
25
+ * @param [options.injectStyles=true]
26
+ * Injects the default stylesheet into the page if this is the first GUI.
27
+ * Pass `false` to use your own stylesheet.
28
+ *
29
+ * @param [options.touchStyles=true]
30
+ * Makes controllers larger on touch devices. Pass `false` to disable touch styles.
31
+ *
32
+ * @param [options.parent]
33
+ * Adds this GUI as a child in another GUI. Usually this is done for you by `addFolder()`.
34
+ *
35
+ */
36
+ constructor({
37
+ parent,
38
+ autoPlace,
39
+ container,
40
+ width,
41
+ title,
42
+ injectStyles,
43
+ touchStyles,
44
+ }?: {
45
+ autoPlace?: boolean;
46
+ container?: HTMLElement;
47
+ width?: number;
48
+ title?: string;
49
+ injectStyles?: boolean;
50
+ touchStyles?: number;
51
+ parent?: GUI;
52
+ });
53
+ /**
54
+ * The GUI containing this folder, or `undefined` if this is the root GUI.
55
+ */
56
+ parent: GUI;
57
+ /**
58
+ * The top level GUI containing this folder, or `this` if this is the root GUI.
59
+ */
60
+ root: GUI;
61
+ /**
62
+ * The list of controllers and folders contained by this GUI.
63
+ */
64
+ children: Array<GUI | Controller>;
65
+ /**
66
+ * The list of controllers contained by this GUI.
67
+ */
68
+ controllers: Controller[];
69
+ /**
70
+ * The list of folders contained by this GUI.
71
+ */
72
+ folders: GUI[];
73
+ /**
74
+ * Used to determine if the GUI is closed. Use `gui.open()` or `gui.close()` to change this.
75
+ */
76
+ _closed: boolean;
77
+ /**
78
+ * Used to determine if the GUI is hidden. Use `gui.show()` or `gui.hide()` to change this.
79
+ */
80
+ _hidden: boolean;
81
+ /**
82
+ * The outermost container element.
83
+ */
84
+ domElement: HTMLElement;
85
+ /**
86
+ * The DOM element that contains the title.
87
+ */
88
+ $title: HTMLElement;
89
+ /**
90
+ * The DOM element that contains children.
91
+ */
92
+ $children: HTMLElement;
93
+ /**
94
+ * Adds a controller to the GUI, inferring controller type using the `typeof` operator.
95
+ * @example
96
+ * gui.add( object, 'property' );
97
+ * gui.add( object, 'number', 0, 100, 1 );
98
+ * gui.add( object, 'options', [ 1, 2, 3 ] );
99
+ *
100
+ * @param object The object the controller will modify.
101
+ * @param property Name of the property to control.
102
+ * @param [$1] Minimum value for number controllers, or the set of
103
+ * selectable values for a dropdown.
104
+ * @param [max] Maximum value for number controllers.
105
+ * @param [step] Step value for number controllers.
106
+ */
107
+ add<T, K extends keyof T>(
108
+ object: T,
109
+ property: K,
110
+ options: ReadonlyArray<T[K]> | Record<string, T[K]>,
111
+ ): OptionController<T, K>;
112
+ add<T, K extends KeyToValueOfType<T, number>>(
113
+ object: T,
114
+ property: K,
115
+ min?: number,
116
+ max?: number,
117
+ step?: number,
118
+ ): NumberController<T, K>;
119
+ add<T, K extends KeyToValueOfType<T, boolean>>(object: T, property: K, options?: never): BooleanController<T, K>;
120
+ add<T, K extends KeyToValueOfType<T, string>>(object: T, property: K, options?: never): StringController<T, K>;
121
+ add<T, K extends KeyToValueOfType<T, (this: T) => void>>(
122
+ object: T,
123
+ property: K,
124
+ options?: never,
125
+ ): FunctionController<T, K>;
126
+ /**
127
+ * Adds a color controller to the GUI.
128
+ * @example
129
+ * params = {
130
+ * cssColor: '#ff00ff',
131
+ * rgbColor: { r: 0, g: 0.2, b: 0.4 },
132
+ * customRange: [ 0, 127, 255 ],
133
+ * };
134
+ *
135
+ * gui.addColor( params, 'cssColor' );
136
+ * gui.addColor( params, 'rgbColor' );
137
+ * gui.addColor( params, 'customRange', 255 );
138
+ *
139
+ * @param object The object the controller will modify.
140
+ * @param property Name of the property to control.
141
+ * @param rgbScale Maximum value for a color channel when using an RGB color. You may
142
+ * need to set this to 255 if your colors are too bright.
143
+ */
144
+ addColor<T, K extends keyof T>(object: T, property: K, rgbScale?: number): ColorController<T, K>;
145
+ /**
146
+ * Adds a folder to the GUI, which is just another GUI. This method returns
147
+ * the nested GUI so you can add controllers to it.
148
+ * @example
149
+ * const folder = gui.addFolder( 'Position' );
150
+ * folder.add( position, 'x' );
151
+ * folder.add( position, 'y' );
152
+ * folder.add( position, 'z' );
153
+ *
154
+ * @param title Name to display in the folder's title bar.
155
+ */
156
+ addFolder(title: string): GUI;
157
+ /**
158
+ * Recalls values that were saved with `gui.save()`.
159
+ * @param obj
160
+ * @param recursive Pass false to exclude folders descending from this GUI.
161
+ */
162
+ load(obj: object, recursive?: boolean): this;
163
+ /**
164
+ * Returns an object mapping controller names to values. The object can be passed to `gui.load()` to
165
+ * recall these values.
166
+ * @example
167
+ * {
168
+ * controllers: {
169
+ * prop1: 1,
170
+ * prop2: 'value',
171
+ * ...
172
+ * },
173
+ * folders: {
174
+ * folderName1: { controllers, folders },
175
+ * folderName2: { controllers, folders }
176
+ * ...
177
+ * }
178
+ * }
179
+ *
180
+ * @param recursive Pass false to exclude folders descending from this GUI.
181
+ */
182
+ save(recursive?: boolean): object;
183
+ /**
184
+ * Opens a GUI or folder. GUI and folders are open by default.
185
+ * @param open Pass false to close
186
+ * @example
187
+ * gui.open(); // open
188
+ * gui.open( false ); // close
189
+ * gui.open( gui._closed ); // toggle
190
+ */
191
+ open(open?: boolean): this;
192
+ /**
193
+ * Closes the GUI.
194
+ */
195
+ close(): this;
196
+ /**
197
+ * Shows the GUI after it's been hidden.
198
+ * @param show
199
+ * @example
200
+ * gui.show();
201
+ * gui.show( false ); // hide
202
+ * gui.show( gui._hidden ); // toggle
203
+ */
204
+ show(show?: boolean): this;
205
+ /**
206
+ * Hides the GUI.
207
+ */
208
+ hide(): this;
209
+ openAnimated(open?: boolean): GUI;
210
+ /**
211
+ * Change the title of this GUI.
212
+ * @param title
213
+ */
214
+ title(title: string): this;
215
+ /**
216
+ * Current title of the GUI. Use `gui.title( 'Title' )` to modify this value.
217
+ */
218
+ _title: string;
219
+ /**
220
+ * Resets all controllers to their initial values.
221
+ * @param recursive Pass false to exclude folders descending from this GUI.
222
+ */
223
+ reset(recursive?: boolean): this;
224
+ /**
225
+ * Pass a function to be called whenever a controller in this GUI changes.
226
+ * @param callback
227
+ * @example
228
+ * gui.onChange( event => {
229
+ * event.object // object that was modified
230
+ * event.property // string, name of property
231
+ * event.value // new value of controller
232
+ * event.controller // controller that was modified
233
+ * } );
234
+ */
235
+ onChange(
236
+ callback: (arg0: { object: object; property: string; value: unknown; controller: Controller }) => void,
237
+ ): this;
238
+ /**
239
+ * Used to access the function bound to `onChange` events. Don't modify this value
240
+ * directly. Use the `gui.onChange( callback )` method instead.
241
+ */
242
+ _onChange: (arg0: { object: object; property: string; value: unknown; controller: Controller }) => void;
243
+ _callOnChange(controller: Controller): void;
244
+ /**
245
+ * Pass a function to be called whenever a controller in this GUI has finished changing.
246
+ * @param callback
247
+ * @example
248
+ * gui.onFinishChange( event => {
249
+ * event.object // object that was modified
250
+ * event.property // string, name of property
251
+ * event.value // new value of controller
252
+ * event.controller // controller that was modified
253
+ * } );
254
+ */
255
+ onFinishChange(
256
+ callback: (arg0: { object: object; property: string; value: unknown; controller: Controller }) => void,
257
+ ): this;
258
+ /**
259
+ * Used to access the function bound to `onFinishChange` events. Don't modify this value
260
+ * directly. Use the `gui.onFinishChange( callback )` method instead.
261
+ */
262
+ _onFinishChange: (arg0: { object: object; property: string; value: unknown; controller: Controller }) => void;
263
+ _callOnFinishChange(controller: Controller): void;
264
+ /**
265
+ * Destroys all DOM elements and event listeners associated with this GUI
266
+ */
267
+ destroy(): void;
268
+ /**
269
+ * Returns an array of controllers contained by this GUI and its descendents.
270
+ */
271
+ controllersRecursive(): Controller[];
272
+ /**
273
+ * Returns an array of folders contained by this GUI and its descendents.
274
+ */
275
+ foldersRecursive(): GUI[];
276
+ }
277
+ export class BooleanController<
278
+ T = Record<string, unknown>,
279
+ K extends KeyToValueOfType<T, boolean> = KeyToValueOfType<T, boolean>,
280
+ > extends Controller<T, K> {
281
+ constructor(parent: GUI, object: T, property: K);
282
+ $input: HTMLInputElement;
283
+ }
284
+ export class ColorController<T = Record<string, unknown>, K extends keyof T = keyof T> extends Controller<T, K> {
285
+ constructor(parent: GUI, object: T, property: K, rgbScale: number);
286
+ $input: HTMLInputElement;
287
+ $text: HTMLInputElement;
288
+ $display: HTMLDivElement;
289
+ _format:
290
+ | {
291
+ isPrimitive: boolean;
292
+ match: (v: unknown) => boolean;
293
+ fromHexString: typeof normalizeColorString;
294
+ toHexString: typeof normalizeColorString;
295
+ }
296
+ | {
297
+ isPrimitive: boolean;
298
+ match: (arg: unknown) => arg is unknown[];
299
+ fromHexString(string: unknown, target: unknown, rgbScale?: number): void;
300
+ toHexString([r, g, b]: [unknown, unknown, unknown], rgbScale?: number): string;
301
+ }
302
+ | {
303
+ isPrimitive: boolean;
304
+ match: (v: unknown) => boolean;
305
+ fromHexString(string: unknown, target: unknown, rgbScale?: number): void;
306
+ toHexString(
307
+ {
308
+ r,
309
+ g,
310
+ b,
311
+ }: {
312
+ r: unknown;
313
+ g: unknown;
314
+ b: unknown;
315
+ },
316
+ rgbScale?: number,
317
+ ): string;
318
+ };
319
+ _rgbScale: number;
320
+ _initialValueHexString: string | boolean;
321
+ _textFocused: boolean;
322
+ _setValueFromHexString(value: unknown): void;
323
+ }
324
+ /**
325
+ * lil-gui
326
+ * https://lil-gui.georgealways.com
327
+ * @version 0.17.0
328
+ * @author George Michael Brower
329
+ * @license MIT
330
+ */
331
+ /**
332
+ * Base class for all controllers.
333
+ */
334
+ export class Controller<T = Record<string, unknown>, K extends keyof T = keyof T> {
335
+ constructor(parent: GUI, object: T, property: K, className: string, widgetTag?: string);
336
+ /**
337
+ * The GUI that contains this controller.
338
+ */
339
+ parent: GUI;
340
+ /**
341
+ * The object this controller will modify.
342
+ */
343
+ object: T;
344
+ /**
345
+ * The name of the property to control.
346
+ */
347
+ property: string;
348
+ /**
349
+ * Used to determine if the controller is disabled.
350
+ * Use `controller.disable( true|false )` to modify this value
351
+ */
352
+ _disabled: boolean;
353
+ /**
354
+ * Used to determine if the Controller is hidden.
355
+ * Use `controller.show()` or `controller.hide()` to change this.
356
+ */
357
+ _hidden: boolean;
358
+ /**
359
+ * The value of `object[ property ]` when the controller was created.
360
+ */
361
+ initialValue: T[K];
362
+ /**
363
+ * The outermost container DOM element for this controller.
364
+ */
365
+ domElement: HTMLElement;
366
+ /**
367
+ * The DOM element that contains the controller's name.
368
+ */
369
+ $name: HTMLElement;
370
+ /**
371
+ * The DOM element that contains the controller's "widget" (which differs by controller type).
372
+ */
373
+ $widget: HTMLElement;
374
+ /**
375
+ * The DOM element that receives the disabled attribute when using disable()
376
+ */
377
+ $disable: HTMLElement;
378
+ _listenCallback(): void;
379
+ /**
380
+ * Sets the name of the controller and its label in the GUI.
381
+ * @param name
382
+ */
383
+ name(name: string): this;
384
+ /**
385
+ * The controller's name. Use `controller.name( 'Name' )` to modify this value.
386
+ */
387
+ _name: string;
388
+ /**
389
+ * Pass a function to be called whenever the value is modified by this controller.
390
+ * The function receives the new value as its first parameter. The value of `this` will be the
391
+ * controller.
392
+ * @param callback
393
+ * @example
394
+ * const controller = gui.add( object, 'property' );
395
+ *
396
+ * controller.onChange( function( v ) {
397
+ * console.log( 'The value is now ' + v );
398
+ * console.assert( this === controller );
399
+ * } );
400
+ */
401
+ onChange(callback: (this: this, value: T[K]) => void): this;
402
+ /**
403
+ * Used to access the function bound to `onChange` events. Don't modify this value directly.
404
+ * Use the `controller.onChange( callback )` method instead.
405
+ */
406
+ _onChange: (this: this, value: T[K]) => void;
407
+ /**
408
+ * Calls the onChange methods of this controller and its parent GUI.
409
+ */
410
+ protected _callOnChange(): void;
411
+ _changed: boolean;
412
+ /**
413
+ * Pass a function to be called after this controller has been modified and loses focus.
414
+ * @param callback
415
+ * @example
416
+ * const controller = gui.add( object, 'property' );
417
+ *
418
+ * controller.onFinishChange( function( v ) {
419
+ * console.log( 'Changes complete: ' + v );
420
+ * console.assert( this === controller );
421
+ * } );
422
+ */
423
+ onFinishChange(callback: (this: this, value: T[K]) => void): this;
424
+ /**
425
+ * Used to access the function bound to `onFinishChange` events. Don't modify this value
426
+ * directly. Use the `controller.onFinishChange( callback )` method instead.
427
+ */
428
+ _onFinishChange: (this: this, value: T[K]) => void;
429
+ /**
430
+ * Should be called by Controller when its widgets lose focus.
431
+ */
432
+ protected _callOnFinishChange(): void;
433
+ /**
434
+ * Sets the controller back to its initial value.
435
+ */
436
+ reset(): this;
437
+ /**
438
+ * Enables this controller.
439
+ * @param enabled
440
+ * @example
441
+ * controller.enable();
442
+ * controller.enable( false ); // disable
443
+ * controller.enable( controller._disabled ); // toggle
444
+ */
445
+ enable(enabled?: boolean): this;
446
+ /**
447
+ * Disables this controller.
448
+ * @param disabled
449
+ * @example
450
+ * controller.disable();
451
+ * controller.disable( false ); // enable
452
+ * controller.disable( !controller._disabled ); // toggle
453
+ */
454
+ disable(disabled?: boolean): this;
455
+ /**
456
+ * Shows the Controller after it's been hidden.
457
+ * @param show
458
+ * @example
459
+ * controller.show();
460
+ * controller.show( false ); // hide
461
+ * controller.show( controller._hidden ); // toggle
462
+ */
463
+ show(show?: boolean): this;
464
+ /**
465
+ * Hides the Controller.
466
+ */
467
+ hide(): this;
468
+ /**
469
+ * Destroys this controller and replaces it with a new option controller. Provided as a more
470
+ * descriptive syntax for `gui.add`, but primarily for compatibility with dat.gui.
471
+ *
472
+ * Use caution, as this method will destroy old references to this controller. It will also
473
+ * change controller order if called out of sequence, moving the option controller to the end of
474
+ * the GUI.
475
+ * @example
476
+ * // safe usage
477
+ *
478
+ * gui.add( object1, 'property' ).options( [ 'a', 'b', 'c' ] );
479
+ * gui.add( object2, 'property' );
480
+ *
481
+ * // danger
482
+ *
483
+ * const c = gui.add( object1, 'property' );
484
+ * gui.add( object2, 'property' );
485
+ *
486
+ * c.options( [ 'a', 'b', 'c' ] );
487
+ * // controller is now at the end of the GUI even though it was added first
488
+ *
489
+ * assert( c.parent.children.indexOf( c ) === -1 )
490
+ * // c references a controller that no longer exists
491
+ *
492
+ * @param options
493
+ */
494
+ options(options: object | unknown[]): Controller;
495
+ /**
496
+ * Calls `updateDisplay()` every animation frame. Pass `false` to stop listening.
497
+ * @param listen
498
+ */
499
+ listen(listen?: boolean): this;
500
+ /**
501
+ * Used to determine if the controller is currently listening. Don't modify this value
502
+ * directly. Use the `controller.listen( true|false )` method instead.
503
+ */
504
+ _listening: boolean;
505
+ _listenCallbackID: number;
506
+ _listenPrevValue: unknown;
507
+ /**
508
+ * Returns `object[ property ]`.
509
+ */
510
+ getValue(): T[K];
511
+ /**
512
+ * Sets the value of `object[ property ]`, invokes any `onChange` handlers and updates the display.
513
+ * @param value
514
+ */
515
+ setValue(value: T[K]): this;
516
+ /**
517
+ * Updates the display to keep it in sync with the current value. Useful for updating your
518
+ * controllers when their values have been modified outside of the GUI.
519
+ */
520
+ updateDisplay(): this;
521
+ load(value: T[K]): this;
522
+ save(): T[K];
523
+ /**
524
+ * Destroys this controller and removes it from the parent GUI.
525
+ */
526
+ destroy(): void;
527
+ }
528
+ export class FunctionController<
529
+ T = Record<string, unknown>,
530
+ K extends KeyToValueOfType<T, (this: T) => void> = KeyToValueOfType<T, (this: T) => void>,
531
+ > extends Controller<T, K> {
532
+ constructor(parent: GUI, object: T, property: K);
533
+ $button: HTMLButtonElement;
534
+ }
535
+ export class NumberController<
536
+ T = Record<string, unknown>,
537
+ K extends KeyToValueOfType<T, number> = KeyToValueOfType<T, number>,
538
+ > extends Controller<T, K> {
539
+ constructor(
540
+ parent: GUI,
541
+ object: T,
542
+ property: K,
543
+ min: number | undefined,
544
+ max: number | undefined,
545
+ step: number | undefined,
546
+ );
547
+ _decimals: unknown;
548
+ _min: unknown;
549
+ _max: unknown;
550
+ _step: unknown;
551
+ _stepExplicit: boolean;
552
+ _initInput(): void;
553
+ $input: HTMLInputElement;
554
+ _inputFocused: boolean;
555
+ _initSlider(): void;
556
+ _hasSlider: boolean;
557
+ $slider: HTMLDivElement;
558
+ $fill: HTMLDivElement;
559
+ _setDraggingStyle(active: unknown, axis?: string): void;
560
+ _getImplicitStep(): number;
561
+ _onUpdateMinMax(): void;
562
+ _normalizeMouseWheel(e: unknown): unknown;
563
+ _arrowKeyMultiplier(e: unknown): number;
564
+ _snap(value: unknown): number;
565
+ _clamp(value: unknown): unknown;
566
+ _snapClampSetValue(value: unknown): void;
567
+ get _hasScrollBar(): boolean;
568
+ get _hasMin(): boolean;
569
+ get _hasMax(): boolean;
570
+ /**
571
+ * Sets the minimum value. Only works on number controllers.
572
+ * @param min
573
+ */
574
+ min(min: number): this;
575
+ /**
576
+ * Sets the maximum value. Only works on number controllers.
577
+ * @param max
578
+ */
579
+ max(max: number): this;
580
+ /**
581
+ * Values set by this controller will be rounded to multiples of `step`. Only works on number
582
+ * controllers.
583
+ * @param step
584
+ */
585
+ step(step: number): this;
586
+ /**
587
+ * Rounds the displayed value to a fixed number of decimals, without affecting the actual value
588
+ * like `step()`. Only works on number controllers.
589
+ * @example
590
+ * gui.add( object, 'property' ).listen().decimals( 4 );
591
+ * @param decimals
592
+ */
593
+ decimals(decimals: number): this;
594
+ }
595
+ export class OptionController<T = Record<string, unknown>, K extends keyof T = keyof T> extends Controller<T, K> {
596
+ constructor(parent: GUI, object: T, property: K, options: ReadonlyArray<T[K]> | Record<string, T[K]>);
597
+ $select: HTMLSelectElement;
598
+ $display: HTMLDivElement;
599
+ _values: Array<T[K]>;
600
+ _names: unknown[];
601
+ }
602
+ export class StringController<
603
+ T = Record<string, unknown>,
604
+ K extends KeyToValueOfType<T, string> = KeyToValueOfType<T, string>,
605
+ > extends Controller<T, K> {
606
+ constructor(parent: GUI, object: T, property: K);
607
+ $input: HTMLInputElement;
608
+ }
609
+ declare function normalizeColorString(string: unknown): string | false;