diff --git a/types/qs/index.d.ts b/types/qs/index.d.ts index 506aae88191c60..f833cf3fe914fc 100644 --- a/types/qs/index.d.ts +++ b/types/qs/index.d.ts @@ -2,8 +2,8 @@ export = QueryString; export as namespace qs; declare namespace QueryString { - type defaultEncoder = (str: any, defaultEncoder?: any, charset?: string) => string; - type defaultDecoder = (str: string, decoder?: any, charset?: string) => string; + type defaultEncoder = (str: unknown, defaultEncoder?: unknown, charset?: string) => string; + type defaultDecoder = (str: string, decoder?: unknown, charset?: string) => string; type BooleanOptional = boolean | undefined; diff --git a/types/three/src/math/Matrix2.d.ts b/types/three/src/math/Matrix2.d.ts index 93947447d7c9b1..40ed4c8aac3456 100644 --- a/types/three/src/math/Matrix2.d.ts +++ b/types/three/src/math/Matrix2.d.ts @@ -12,7 +12,7 @@ export type Matrix2Tuple = [ * const m = new Matrix2(); */ export class Matrix2 { - static readonly isMatrix2: boolean; + readonly isMatrix2: true; /** * A {@link https://en.wikipedia.org/wiki/Row-_and_column-major_order column-major} list of matrix values. diff --git a/types/three/src/math/Matrix3.d.ts b/types/three/src/math/Matrix3.d.ts index 2b601198a100cf..0b593fcb81193f 100644 --- a/types/three/src/math/Matrix3.d.ts +++ b/types/three/src/math/Matrix3.d.ts @@ -17,7 +17,7 @@ export type Matrix3Tuple = [ ]; export class Matrix3 { - static readonly isMatrix3: boolean; + readonly isMatrix3: true; /** * Array with matrix values. diff --git a/types/three/src/math/Matrix4.d.ts b/types/three/src/math/Matrix4.d.ts index e624acdf507461..458d7e4d7b2d36 100644 --- a/types/three/src/math/Matrix4.d.ts +++ b/types/three/src/math/Matrix4.d.ts @@ -42,7 +42,7 @@ export type Matrix4Tuple = [ * m.multiply( m3 ); */ export class Matrix4 { - static readonly isMatrix4: boolean; + readonly isMatrix4: true; /** * Array with matrix values. diff --git a/types/three/src/math/Vector2.d.ts b/types/three/src/math/Vector2.d.ts index 7ca5092b85ae95..fd2a84a1d7c756 100644 --- a/types/three/src/math/Vector2.d.ts +++ b/types/three/src/math/Vector2.d.ts @@ -12,8 +12,6 @@ export interface Vector2Like { * 2D vector. */ export class Vector2 { - static readonly isVector2: boolean; - constructor(x?: number, y?: number); /** @@ -27,6 +25,7 @@ export class Vector2 { y: number; width: number; height: number; + readonly isVector2: true; /** * Sets value of this vector. diff --git a/types/three/src/math/Vector3.d.ts b/types/three/src/math/Vector3.d.ts index 6c77a30a167ffc..43dc5629b55127 100644 --- a/types/three/src/math/Vector3.d.ts +++ b/types/three/src/math/Vector3.d.ts @@ -29,8 +29,6 @@ export interface Vector3Like { * c.crossVectors( a, b ); */ export class Vector3 { - static readonly isVector3: boolean; - constructor(x?: number, y?: number, z?: number); /** @@ -47,6 +45,7 @@ export class Vector3 { * @default 0 */ z: number; + readonly isVector3: true; /** * Sets value of this vector. diff --git a/types/three/src/math/Vector4.d.ts b/types/three/src/math/Vector4.d.ts index d04e34630b1859..2e0813d26aecde 100644 --- a/types/three/src/math/Vector4.d.ts +++ b/types/three/src/math/Vector4.d.ts @@ -15,8 +15,6 @@ export interface Vector4Like { * 4D vector. */ export class Vector4 { - static readonly isVector4: boolean; - constructor(x?: number, y?: number, z?: number, w?: number); /** @@ -41,6 +39,7 @@ export class Vector4 { width: number; height: number; + readonly isVector4: true; /** * Sets value of this vector. diff --git a/types/three/test/unit/src/math/Vector3.ts b/types/three/test/unit/src/math/Vector3.ts new file mode 100644 index 00000000000000..f5d7762faa52ea --- /dev/null +++ b/types/three/test/unit/src/math/Vector3.ts @@ -0,0 +1,4 @@ +import * as THREE from "three"; + +const texture = new THREE.Vector3(); +texture.isVector3; // $ExpectType true diff --git a/types/three/tsconfig.json b/types/three/tsconfig.json index b956c7a63ee8c2..d6421e3a1e85c8 100644 --- a/types/three/tsconfig.json +++ b/types/three/tsconfig.json @@ -38,6 +38,7 @@ "test/unit/src/audio/AudioContext.ts", "test/unit/src/core/EventDispatcher.ts", "test/unit/src/core/Uniform.ts", + "test/unit/src/math/Vector3.ts", "test/unit/src/nodes/display/ColorAdjustment.ts", "test/unit/src/nodes/materialx/lib/mx_hsv.ts", "test/unit/src/nodes/materialx/lib/mx_noise.ts",