Skip to content

Commit 3ba0553

Browse files
authored
Merge pull request #18259 from yomotsu/feature/add-type-isXXX
TS: Add missing types: is***
2 parents be1c097 + 9565981 commit 3ba0553

Some content is hidden

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

65 files changed

+73
-43
lines changed

examples/jsm/controls/TransformControls.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class TransformControls extends Object3D {
2525
showX: boolean;
2626
showY: boolean;
2727
showZ: boolean;
28-
isTransformControls: boolean;
28+
readonly isTransformControls: true;
2929
mouseButtons: {
3030
LEFT: MOUSE;
3131
MIDDLE: MOUSE;

examples/jsm/lines/Line2.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ import { LineMaterial } from './LineMaterial';
55
export class Line2 extends LineSegments2 {
66

77
constructor( geometry?: LineGeometry, material?: LineMaterial );
8-
isLine2: boolean;
8+
readonly isLine2: true;
99

1010
}

examples/jsm/lines/LineGeometry.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { LineSegmentsGeometry } from './LineSegmentsGeometry';
77
export class LineGeometry extends LineSegmentsGeometry {
88

99
constructor();
10-
isLineGeometry: boolean;
10+
readonly isLineGeometry: true;
1111

1212
fromLine( line: Line ): this;
1313

examples/jsm/lines/LineMaterial.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class LineMaterial extends ShaderMaterial {
2323
dashScale: number;
2424
dashSize: number;
2525
gapSize: number;
26-
isLineMaterial: boolean;
26+
readonly isLineMaterial: true;
2727
linewidth: number;
2828
resolution: Vector2;
2929

examples/jsm/lines/LineSegments2.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { LineSegmentsGeometry } from './LineSegmentsGeometry';
88
export class LineSegments2 extends Mesh {
99

1010
constructor( geometry?: LineSegmentsGeometry, material?: LineMaterial );
11-
isLineSegments2: boolean;
11+
readonly isLineSegments2: true;
1212

1313
computeLineDistances(): this;
1414

examples/jsm/lines/LineSegmentsGeometry.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
export class LineSegmentsGeometry extends InstancedBufferGeometry {
1111

1212
constructor();
13-
isLineSegmentsGeometry: boolean;
13+
readonly isLineSegmentsGeometry: true;
1414

1515
applyMatrix( matrix: Matrix4 ): this;
1616
computeBoundingBox(): void;

examples/jsm/lines/Wireframe.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { LineSegmentsGeometry } from './LineSegmentsGeometry';
88
export class Wireframe extends Mesh {
99

1010
constructor( geometry?: LineSegmentsGeometry, material?: LineMaterial );
11-
isWireframe: boolean;
11+
readonly isWireframe: true;
1212

1313
computeLineDistances(): this;
1414

examples/jsm/lines/WireframeGeometry2.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ import { LineSegmentsGeometry } from './LineSegmentsGeometry';
88
export class WireframeGeometry2 extends LineSegmentsGeometry {
99

1010
constructor( geometry: Geometry | BufferGeometry );
11-
isWireframeGeometry2: boolean;
11+
readonly sWireframeGeometry2: boolean;
1212

1313
}

examples/jsm/nodes/core/Node.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class Node {
88
name: string;
99
type: string | undefined;
1010
userData: object;
11-
isNode: boolean;
11+
readonly isNode: true;
1212
frameId: number | undefined;
1313

1414
analyze( builder: NodeBuilder, settings?: object ): void;

examples/jsm/nodes/materials/NodeMaterial.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class NodeMaterial extends ShaderMaterial {
2222

2323
updaters: object[];
2424

25-
isNodeMaterial: boolean;
25+
readonly isNodeMaterial: true;
2626
properties: object;
2727

2828
updateFrame( frame: NodeFrame ): void;

examples/jsm/objects/Lensflare.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class LensflareElement {
1717
export class Lensflare extends Mesh {
1818

1919
constructor();
20-
isLensflare: boolean;
20+
readonly isLensflare: true;
2121

2222
addElement( element: LensflareElement ): void;
2323
dispose(): void;

src/animation/AnimationObjectGroup.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export class AnimationObjectGroup {
1010
inUse: number;
1111
};
1212
};
13+
readonly isAnimationObjectGroup: true;
1314

1415
add( ...args: any[] ): void;
1516
remove( ...args: any[] ): void;

src/cameras/ArrayCamera.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ export class ArrayCamera extends PerspectiveCamera {
55
constructor( cameras?: PerspectiveCamera[] );
66

77
cameras: PerspectiveCamera[];
8-
isArrayCamera: true;
8+
readonly isArrayCamera: true;
99

1010
}

src/cameras/Camera.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class Camera extends Object3D {
2929
*/
3030
projectionMatrixInverse: Matrix4;
3131

32-
isCamera: true;
32+
readonly isCamera: true;
3333

3434
getWorldDirection( target: Vector3 ): Vector3;
3535

src/cameras/OrthographicCamera.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class OrthographicCamera extends Camera {
3030

3131
type: 'OrthographicCamera';
3232

33-
isOrthographicCamera: true;
33+
readonly isOrthographicCamera: true;
3434

3535
zoom: number;
3636
view: null | {

src/cameras/PerspectiveCamera.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class PerspectiveCamera extends Camera {
1717

1818
type: 'PerspectiveCamera';
1919

20-
isPerspectiveCamera: true;
20+
readonly isPerspectiveCamera: true;
2121

2222
zoom: number;
2323

src/core/BufferAttribute.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class BufferAttribute {
2020

2121
set needsUpdate( value: boolean );
2222

23-
isBufferAttribute: true;
23+
readonly isBufferAttribute: true;
2424

2525
onUploadCallback: () => void;
2626
onUpload( callback: () => void ): this;

src/core/BufferGeometry.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class BufferGeometry extends EventDispatcher {
4646
boundingSphere: Sphere;
4747
drawRange: { start: number; count: number };
4848
userData: {[key: string]: any};
49-
isBufferGeometry: boolean;
49+
readonly isBufferGeometry: true;
5050

5151
getIndex(): BufferAttribute | null;
5252
setIndex( index: BufferAttribute | number[] | null ): void;

src/core/Geometry.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class Geometry extends EventDispatcher {
5050

5151
uuid: string;
5252

53-
isGeometry: boolean;
53+
readonly isGeometry: true;
5454

5555
/**
5656
* Name for this geometry. Default is an empty string.

src/core/InterleavedBufferAttribute.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class InterleavedBufferAttribute {
2020
get count(): number;
2121
get array(): ArrayLike<number>;
2222

23-
isInterleavedBufferAttribute: true;
23+
readonly isInterleavedBufferAttribute: true;
2424

2525
applyMatrix4( m: Matrix4 ): this;
2626
getX( index: number ): number;

src/core/Object3D.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export class Object3D extends EventDispatcher {
148148
* Used to check whether this or derived classes are Object3Ds. Default is true.
149149
* You should not change this, as it is used internally for optimisation.
150150
*/
151-
isObject3D: true;
151+
readonly isObject3D: true;
152152

153153
/**
154154
* Calls before rendering object

src/lights/AmbientLight.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ export class AmbientLight extends Light {
1515
constructor( color?: Color | string | number, intensity?: number );
1616

1717
castShadow: boolean;
18+
readonly isAmbientLight: true;
1819

1920
}

src/lights/AmbientLightProbe.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ export class AmbientLightProbe extends LightProbe {
55

66
constructor( color?: Color | string | number, intensity?: number );
77

8-
isAmbientLightProbe: true;
8+
readonly isAmbientLightProbe: true;
99

1010
}

src/lights/DirectionalLight.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ export class DirectionalLight extends Light {
3030
intensity: number;
3131

3232
shadow: DirectionalLightShadow;
33+
readonly isDirectionalLight: true;
3334

3435
}

src/lights/DirectionalLightShadow.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ import { LightShadow } from './LightShadow';
44
export class DirectionalLightShadow extends LightShadow {
55

66
camera: OrthographicCamera;
7+
readonly isDirectionalLightShadow: true;
78

89
}

src/lights/HemisphereLight.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ export class HemisphereLight extends Light {
1212
skyColor: Color;
1313
groundColor: Color;
1414
intensity: number;
15+
readonly isHemisphereLight: true;
1516

1617
}

src/lights/HemisphereLightProbe.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ export class HemisphereLightProbe extends LightProbe {
55

66
constructor( skyColor?: Color | string | number, groundColor?: Color | string | number, intensity?: number );
77

8-
isHemisphereLightProbe: true;
8+
readonly isHemisphereLightProbe: true;
99

1010
}

src/lights/Light.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class Light extends Object3D {
1313

1414
color: Color;
1515
intensity: number;
16-
isLight: true;
16+
readonly isLight: true;
1717
receiveShadow: boolean;
1818
shadow: LightShadow;
1919
/**

src/lights/LightProbe.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export class LightProbe extends Light {
55

66
constructor( sh?: SphericalHarmonics3, intensity?: number );
77

8-
isLightProbe: true;
8+
readonly isLightProbe: true;
99
sh: SphericalHarmonics3;
1010

1111
}

src/lights/RectAreaLight.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ export class RectAreaLight extends Light {
1414
width: number;
1515
height: number;
1616
intensity: number;
17+
readonly isRectAreaLight: true;
1718

1819
}

src/lights/SpotLight.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,6 @@ export class SpotLight extends Light {
5151
shadow: SpotLightShadow;
5252
power: number;
5353
penumbra: number;
54+
readonly isSpotLight: true;
5455

5556
}

src/lights/SpotLightShadow.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ import { LightShadow } from './LightShadow';
44
export class SpotLightShadow extends LightShadow {
55

66
camera: PerspectiveCamera;
7+
readonly isSpotLightShadow: true;
78

89
}

src/materials/LineDashedMaterial.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class LineDashedMaterial extends LineBasicMaterial {
1717
scale: number;
1818
dashSize: number;
1919
gapSize: number;
20-
isLineDashedMaterial: boolean;
20+
readonly isLineDashedMaterial: true;
2121

2222
setValues( parameters: LineDashedMaterialParameters ): void;
2323

src/materials/Material.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export class Material extends EventDispatcher {
198198
* Used to check whether this or derived classes are materials. Default is true.
199199
* You should not change this, as it used internally for optimisation.
200200
*/
201-
isMaterial: boolean;
201+
readonly isMaterial: true;
202202

203203
/**
204204
* Material name. Default is an empty string.

src/materials/PointsMaterial.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class MultiMaterial extends Material {
1111

1212
constructor( materials?: Material[] );
1313

14-
isMultiMaterial: true;
14+
readonly isMultiMaterial: true;
1515

1616
materials: Material[];
1717

src/materials/SpriteMaterial.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class SpriteMaterial extends Material {
1919
alphaMap: Texture | null;
2020
rotation: number;
2121
sizeAttenuation: boolean;
22-
isSpriteMaterial: true;
22+
readonly isSpriteMaterial: true;
2323

2424
setValues( parameters: SpriteMaterialParameters ): void;
2525
copy( source: SpriteMaterial ): this;

src/math/Box3.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export class Box3 {
1111

1212
max: Vector3;
1313
min: Vector3;
14+
readonly isBox3: true;
1415

1516
set( min: Vector3, max: Vector3 ): this;
1617
setFromArray( array: ArrayLike<number> ): this;

src/math/Color.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class Color {
2121
constructor( color?: Color | string | number );
2222
constructor( r: number, g: number, b: number );
2323

24-
isColor: boolean;
24+
readonly isColor: true;
2525

2626
/**
2727
* Red channel value between 0 and 1. Default is 1.

src/math/Euler.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export class Euler {
1010
y: number;
1111
z: number;
1212
order: string;
13+
readonly isEuler: true;
14+
1315
_onChangeCallback: Function;
1416

1517
set( x: number, y: number, z: number, order?: string ): Euler;

src/math/Plane.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export class Plane {
1111

1212
normal: Vector3;
1313
constant: number;
14+
readonly isPlane: true;
1415

1516
set( normal: Vector3, constant: number ): Plane;
1617
setComponents( x: number, y: number, z: number, w: number ): Plane;

src/math/Quaternion.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export class Quaternion {
2525
y: number;
2626
z: number;
2727
w: number;
28+
readonly isQuaternion: true;
2829

2930
/**
3031
* Sets values of this quaternion.

src/math/SphericalHarmonics3.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export class SphericalHarmonics3 {
55
constructor();
66

77
coefficients: Vector3[];
8-
isSphericalHarmonics3: boolean;
8+
readonly isSphericalHarmonics3: true;
99

1010
set ( coefficients: Vector3[] ): SphericalHarmonics3;
1111
zero(): SphericalHarmonics3;

src/math/Vector2.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export class Vector2 implements Vector {
138138
y: number;
139139
width: number;
140140
height: number;
141-
isVector2: true;
141+
readonly isVector2: true;
142142

143143
/**
144144
* Sets value of this vector.

src/math/Vector3.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class Vector3 implements Vector {
2727
x: number;
2828
y: number;
2929
z: number;
30-
isVector3: true;
30+
readonly isVector3: true;
3131

3232
/**
3333
* Sets value of this vector.

src/math/Vector4.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class Vector4 implements Vector {
1919
w: number;
2020
width: number;
2121
height: number;
22-
isVector4: true;
22+
readonly isVector4: true;
2323

2424
/**
2525
* Sets value of this vector.

src/objects/Bone.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Object3D } from './../core/Object3D';
55
export class Bone extends Object3D {
66

77
constructor();
8-
isBone: true;
8+
readonly isBone: true;
99
type: 'Bone';
1010

1111
}

src/objects/Group.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ export class Group extends Object3D {
44

55
constructor();
66
type: 'Group';
7-
isGroup: true;
7+
readonly isGroup: true;
88

99
}

0 commit comments

Comments
 (0)