Skip to content

Commit 1b0f247

Browse files
authored
🤖 Merge PR DefinitelyTyped#72309 [three] r175 by @Methuselah96
1 parent 5de1894 commit 1b0f247

File tree

67 files changed

+1595
-382
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1595
-382
lines changed

types/three/examples/jsm/Addons.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export * from "./exporters/USDZExporter.js";
4646
export * from "./geometries/BoxLineGeometry.js";
4747
export * from "./geometries/ConvexGeometry.js";
4848
export * from "./geometries/DecalGeometry.js";
49-
export * from "./geometries/ParametricGeometries.js";
49+
export * from "./geometries/ParametricFunctions.js";
5050
export * from "./geometries/ParametricGeometry.js";
5151
export * from "./geometries/RoundedBoxGeometry.js";
5252
export * from "./geometries/TeapotGeometry.js";

types/three/examples/jsm/controls/PointerLockControls.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,11 @@ declare class PointerLockControls extends Controls<PointerLockControlsEventMap>
7474

7575
/**
7676
* Activates the pointer lock.
77+
*
78+
* @param {boolean} [unadjustedMovement=false] - Disables OS-level adjustment for mouse acceleration, and accesses raw mouse input instead.
79+
* Setting it to true will disable mouse acceleration.
7780
*/
78-
lock(): void;
81+
lock(unadjustedMovement?: boolean): void;
7982

8083
/**
8184
* Exits the pointer lock.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Vector3 } from "three";
2+
3+
declare function klein(v: number, u: number, target: Vector3): void;
4+
declare function plane(u: number, v: number, target: Vector3): void;
5+
declare function mobius(u: number, t: number, target: Vector3): void;
6+
declare function mobius3d(u: number, t: number, target: Vector3): void;
7+
8+
export { klein, mobius, mobius3d, plane };

types/three/examples/jsm/geometries/ParametricGeometries.d.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
import { Mesh, MeshBasicMaterial, PlaneGeometry } from "three";
1+
import { Mesh, MeshBasicMaterial, Object3DEventMap, PlaneGeometry } from "three";
22

3-
export class HTMLMesh extends Mesh<PlaneGeometry, MeshBasicMaterial> {
3+
export interface HTMLMeshEventMap extends Object3DEventMap {
4+
mousedown: { data: { x: number; y: number } };
5+
mousemove: { data: { x: number; y: number } };
6+
mouseup: { data: { x: number; y: number } };
7+
click: { data: { x: number; y: number } };
8+
}
9+
10+
export class HTMLMesh extends Mesh<PlaneGeometry, MeshBasicMaterial, HTMLMeshEventMap> {
411
constructor(dom: HTMLElement);
512
dispose(): void;
613
}

types/three/examples/jsm/loaders/LUTImageLoader.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Data3DTexture, Loader, Texture } from "three";
1+
import { Data3DTexture, Loader, LoadingManager, Texture } from "three";
22

33
export interface LUTImageResult {
44
size: number;
@@ -8,7 +8,7 @@ export interface LUTImageResult {
88
export class LUTImageLoader extends Loader<LUTImageResult> {
99
flip: boolean;
1010

11-
constructor(flipVertical?: boolean);
11+
constructor(manager?: LoadingManager);
1212

1313
getImageData(texture: Texture): ImageData;
1414

types/three/examples/jsm/postprocessing/HalftonePass.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export interface HalftonePassParameters {
1616
}
1717

1818
export class HalftonePass extends Pass {
19-
constructor(width: number, height: number, params: HalftonePassParameters);
19+
constructor(params: HalftonePassParameters);
2020
uniforms: {
2121
tDiffuse: IUniform;
2222
shape: IUniform<number>;

types/three/examples/jsm/postprocessing/LUTPass.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ export interface LUTPassParameters {
99
export class LUTPass extends ShaderPass {
1010
lut?: DataTexture | Data3DTexture;
1111
intensity?: number;
12-
constructor(params: LUTPassParameters);
12+
constructor(params?: LUTPassParameters);
1313
}

types/three/examples/jsm/postprocessing/SMAAPass.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ShaderMaterial, Texture, WebGLRenderTarget } from "three";
33
import { FullScreenQuad, Pass } from "./Pass.js";
44

55
export class SMAAPass extends Pass {
6-
constructor(width: number, height: number);
6+
constructor();
77
edgesRT: WebGLRenderTarget;
88
weightsRT: WebGLRenderTarget;
99
areaTexture: Texture;
Lines changed: 218 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,224 @@
11
export class Program {
2-
body: unknown[];
2+
constructor();
3+
4+
body: Statement[];
35

46
isProgram: true;
7+
}
8+
9+
// Boolean seems to be handled as a Unary
10+
export type Statement =
11+
| VariableDeclaration
12+
| Uniform
13+
| Varying
14+
| FunctionParameter
15+
| FunctionDeclaration
16+
| Expression
17+
| Ternary
18+
| Operator
19+
| Unary
20+
| Number
21+
| String
22+
| Conditional
23+
| FunctionCall
24+
| Return
25+
| Discard
26+
| Accessor
27+
| StaticElement
28+
| DynamicElement
29+
| AccessorElements
30+
| For
31+
| null;
32+
33+
export class VariableDeclaration {
34+
constructor(
35+
type: string,
36+
name: string,
37+
value?: Accessor | null,
38+
next?: VariableDeclaration | null,
39+
immutable?: boolean,
40+
);
41+
42+
type: string;
43+
name: string;
44+
value: Accessor | null;
45+
next: VariableDeclaration | null;
46+
47+
immutable: boolean;
48+
49+
isVariableDeclaration: true;
50+
}
51+
52+
export class Uniform {
53+
constructor(type: string, name: string);
54+
55+
type: string;
56+
name: string;
57+
58+
isUniform: true;
59+
}
60+
61+
export class Varying {
62+
constructor(type: string, name: string);
63+
64+
type: string;
65+
name: string;
66+
67+
isVarying: true;
68+
}
69+
70+
export class FunctionParameter {
71+
constructor(type: string, name: string, qualifier?: string | null, immutable?: boolean);
72+
73+
type: string;
74+
name: string;
75+
qualifier: string | null;
76+
immutable: boolean;
77+
78+
isFunctionParameter: true;
79+
}
80+
81+
export class FunctionDeclaration {
82+
constructor(type: string, name: string, params?: FunctionParameter[]);
83+
84+
type: string;
85+
name: string;
86+
params: FunctionParameter[];
87+
body: Statement[];
88+
89+
isFunctionDeclaration: true;
90+
}
91+
92+
export class Expression {
93+
constructor(expression: string);
94+
95+
expression: string;
96+
97+
isExpression: true;
98+
}
99+
100+
export class Ternary {
101+
constructor(cond: Statement, left: Statement, right: Statement);
102+
103+
cond: Statement;
104+
left: Statement;
105+
right: Statement;
106+
107+
isTernary: true;
108+
}
109+
110+
export class Operator {
111+
constructor(type: string, left: Statement, right: Statement);
112+
113+
type: string;
114+
left: Statement;
115+
right: Statement;
116+
117+
isOperator: true;
118+
}
119+
120+
export class Unary {
121+
constructor(type: string, expression: Statement, after?: boolean);
122+
123+
type: string;
124+
expression: Statement;
125+
after: boolean;
126+
127+
isUnary: true;
128+
}
129+
130+
export class Number {
131+
constructor(value: string, type?: string);
5132

133+
type: string;
134+
value: string;
135+
136+
isNumber: true;
137+
}
138+
139+
export class String {
140+
constructor(value: string);
141+
142+
value: string;
143+
144+
isString: true;
145+
}
146+
147+
export class Conditional {
148+
constructor(cond?: Conditional | null);
149+
150+
cond: Conditional | null;
151+
152+
body: Statement[];
153+
elseConditional: Conditional | null;
154+
155+
isConditional: true;
156+
}
157+
158+
export class FunctionCall {
159+
constructor(name: string, params?: Statement[]);
160+
161+
name: string;
162+
params: Statement[];
163+
164+
isFunctionCall: true;
165+
}
166+
167+
export class Return {
168+
constructor(value: Statement);
169+
170+
value: Statement;
171+
172+
isReturn: true;
173+
}
174+
175+
export class Discard {
6176
constructor();
177+
178+
isDiscard: true;
179+
}
180+
181+
export class Accessor {
182+
constructor(property: string);
183+
184+
property: string;
185+
186+
isAccessor: true;
187+
}
188+
189+
export class StaticElement {
190+
constructor(value: Statement);
191+
192+
value: Statement;
193+
194+
isStaticElement: true;
195+
}
196+
197+
export class DynamicElement {
198+
constructor(value: Statement);
199+
200+
value: Statement;
201+
202+
isDynamicElement: true;
203+
}
204+
205+
export class AccessorElements {
206+
constructor(object: FunctionCall | Accessor, elements?: (StaticElement | DynamicElement)[]);
207+
208+
object: FunctionCall | Accessor;
209+
elements: (StaticElement | DynamicElement)[];
210+
211+
isAccessorElements: true;
212+
}
213+
214+
export class For {
215+
constructor(initialization: Statement, condition: Statement, afterthought: Statement);
216+
217+
initialization: Statement;
218+
condition: Statement;
219+
afterthought: Statement;
220+
221+
body: Statement[];
222+
223+
isFor: true;
7224
}

0 commit comments

Comments
 (0)