Skip to content

Commit

Permalink
Merge pull request #18259 from yomotsu/feature/add-type-isXXX
Browse files Browse the repository at this point in the history
TS: Add missing types: is***
  • Loading branch information
Mugen87 committed Dec 30, 2019
2 parents be1c097 + 9565981 commit 3ba0553
Show file tree
Hide file tree
Showing 65 changed files with 73 additions and 43 deletions.
2 changes: 1 addition & 1 deletion examples/jsm/controls/TransformControls.d.ts
Expand Up @@ -25,7 +25,7 @@ export class TransformControls extends Object3D {
showX: boolean;
showY: boolean;
showZ: boolean;
isTransformControls: boolean;
readonly isTransformControls: true;
mouseButtons: {
LEFT: MOUSE;
MIDDLE: MOUSE;
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/lines/Line2.d.ts
Expand Up @@ -5,6 +5,6 @@ import { LineMaterial } from './LineMaterial';
export class Line2 extends LineSegments2 {

constructor( geometry?: LineGeometry, material?: LineMaterial );
isLine2: boolean;
readonly isLine2: true;

}
2 changes: 1 addition & 1 deletion examples/jsm/lines/LineGeometry.d.ts
Expand Up @@ -7,7 +7,7 @@ import { LineSegmentsGeometry } from './LineSegmentsGeometry';
export class LineGeometry extends LineSegmentsGeometry {

constructor();
isLineGeometry: boolean;
readonly isLineGeometry: true;

fromLine( line: Line ): this;

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/lines/LineMaterial.d.ts
Expand Up @@ -23,7 +23,7 @@ export class LineMaterial extends ShaderMaterial {
dashScale: number;
dashSize: number;
gapSize: number;
isLineMaterial: boolean;
readonly isLineMaterial: true;
linewidth: number;
resolution: Vector2;

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/lines/LineSegments2.d.ts
Expand Up @@ -8,7 +8,7 @@ import { LineSegmentsGeometry } from './LineSegmentsGeometry';
export class LineSegments2 extends Mesh {

constructor( geometry?: LineSegmentsGeometry, material?: LineMaterial );
isLineSegments2: boolean;
readonly isLineSegments2: true;

computeLineDistances(): this;

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/lines/LineSegmentsGeometry.d.ts
Expand Up @@ -10,7 +10,7 @@ import {
export class LineSegmentsGeometry extends InstancedBufferGeometry {

constructor();
isLineSegmentsGeometry: boolean;
readonly isLineSegmentsGeometry: true;

applyMatrix( matrix: Matrix4 ): this;
computeBoundingBox(): void;
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/lines/Wireframe.d.ts
Expand Up @@ -8,7 +8,7 @@ import { LineSegmentsGeometry } from './LineSegmentsGeometry';
export class Wireframe extends Mesh {

constructor( geometry?: LineSegmentsGeometry, material?: LineMaterial );
isWireframe: boolean;
readonly isWireframe: true;

computeLineDistances(): this;

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/lines/WireframeGeometry2.d.ts
Expand Up @@ -8,6 +8,6 @@ import { LineSegmentsGeometry } from './LineSegmentsGeometry';
export class WireframeGeometry2 extends LineSegmentsGeometry {

constructor( geometry: Geometry | BufferGeometry );
isWireframeGeometry2: boolean;
readonly sWireframeGeometry2: boolean;

}
2 changes: 1 addition & 1 deletion examples/jsm/nodes/core/Node.d.ts
Expand Up @@ -8,7 +8,7 @@ export class Node {
name: string;
type: string | undefined;
userData: object;
isNode: boolean;
readonly isNode: true;
frameId: number | undefined;

analyze( builder: NodeBuilder, settings?: object ): void;
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/nodes/materials/NodeMaterial.d.ts
Expand Up @@ -22,7 +22,7 @@ export class NodeMaterial extends ShaderMaterial {

updaters: object[];

isNodeMaterial: boolean;
readonly isNodeMaterial: true;
properties: object;

updateFrame( frame: NodeFrame ): void;
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/objects/Lensflare.d.ts
Expand Up @@ -17,7 +17,7 @@ export class LensflareElement {
export class Lensflare extends Mesh {

constructor();
isLensflare: boolean;
readonly isLensflare: true;

addElement( element: LensflareElement ): void;
dispose(): void;
Expand Down
1 change: 1 addition & 0 deletions src/animation/AnimationObjectGroup.d.ts
Expand Up @@ -10,6 +10,7 @@ export class AnimationObjectGroup {
inUse: number;
};
};
readonly isAnimationObjectGroup: true;

add( ...args: any[] ): void;
remove( ...args: any[] ): void;
Expand Down
2 changes: 1 addition & 1 deletion src/cameras/ArrayCamera.d.ts
Expand Up @@ -5,6 +5,6 @@ export class ArrayCamera extends PerspectiveCamera {
constructor( cameras?: PerspectiveCamera[] );

cameras: PerspectiveCamera[];
isArrayCamera: true;
readonly isArrayCamera: true;

}
2 changes: 1 addition & 1 deletion src/cameras/Camera.d.ts
Expand Up @@ -29,7 +29,7 @@ export class Camera extends Object3D {
*/
projectionMatrixInverse: Matrix4;

isCamera: true;
readonly isCamera: true;

getWorldDirection( target: Vector3 ): Vector3;

Expand Down
2 changes: 1 addition & 1 deletion src/cameras/OrthographicCamera.d.ts
Expand Up @@ -30,7 +30,7 @@ export class OrthographicCamera extends Camera {

type: 'OrthographicCamera';

isOrthographicCamera: true;
readonly isOrthographicCamera: true;

zoom: number;
view: null | {
Expand Down
2 changes: 1 addition & 1 deletion src/cameras/PerspectiveCamera.d.ts
Expand Up @@ -17,7 +17,7 @@ export class PerspectiveCamera extends Camera {

type: 'PerspectiveCamera';

isPerspectiveCamera: true;
readonly isPerspectiveCamera: true;

zoom: number;

Expand Down
2 changes: 1 addition & 1 deletion src/core/BufferAttribute.d.ts
Expand Up @@ -20,7 +20,7 @@ export class BufferAttribute {

set needsUpdate( value: boolean );

isBufferAttribute: true;
readonly isBufferAttribute: true;

onUploadCallback: () => void;
onUpload( callback: () => void ): this;
Expand Down
2 changes: 1 addition & 1 deletion src/core/BufferGeometry.d.ts
Expand Up @@ -46,7 +46,7 @@ export class BufferGeometry extends EventDispatcher {
boundingSphere: Sphere;
drawRange: { start: number; count: number };
userData: {[key: string]: any};
isBufferGeometry: boolean;
readonly isBufferGeometry: true;

getIndex(): BufferAttribute | null;
setIndex( index: BufferAttribute | number[] | null ): void;
Expand Down
2 changes: 1 addition & 1 deletion src/core/Geometry.d.ts
Expand Up @@ -50,7 +50,7 @@ export class Geometry extends EventDispatcher {

uuid: string;

isGeometry: boolean;
readonly isGeometry: true;

/**
* Name for this geometry. Default is an empty string.
Expand Down
2 changes: 1 addition & 1 deletion src/core/InterleavedBufferAttribute.d.ts
Expand Up @@ -20,7 +20,7 @@ export class InterleavedBufferAttribute {
get count(): number;
get array(): ArrayLike<number>;

isInterleavedBufferAttribute: true;
readonly isInterleavedBufferAttribute: true;

applyMatrix4( m: Matrix4 ): this;
getX( index: number ): number;
Expand Down
2 changes: 1 addition & 1 deletion src/core/Object3D.d.ts
Expand Up @@ -148,7 +148,7 @@ export class Object3D extends EventDispatcher {
* Used to check whether this or derived classes are Object3Ds. Default is true.
* You should not change this, as it is used internally for optimisation.
*/
isObject3D: true;
readonly isObject3D: true;

/**
* Calls before rendering object
Expand Down
1 change: 1 addition & 0 deletions src/lights/AmbientLight.d.ts
Expand Up @@ -15,5 +15,6 @@ export class AmbientLight extends Light {
constructor( color?: Color | string | number, intensity?: number );

castShadow: boolean;
readonly isAmbientLight: true;

}
2 changes: 1 addition & 1 deletion src/lights/AmbientLightProbe.d.ts
Expand Up @@ -5,6 +5,6 @@ export class AmbientLightProbe extends LightProbe {

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

isAmbientLightProbe: true;
readonly isAmbientLightProbe: true;

}
1 change: 1 addition & 0 deletions src/lights/DirectionalLight.d.ts
Expand Up @@ -30,5 +30,6 @@ export class DirectionalLight extends Light {
intensity: number;

shadow: DirectionalLightShadow;
readonly isDirectionalLight: true;

}
1 change: 1 addition & 0 deletions src/lights/DirectionalLightShadow.d.ts
Expand Up @@ -4,5 +4,6 @@ import { LightShadow } from './LightShadow';
export class DirectionalLightShadow extends LightShadow {

camera: OrthographicCamera;
readonly isDirectionalLightShadow: true;

}
1 change: 1 addition & 0 deletions src/lights/HemisphereLight.d.ts
Expand Up @@ -12,5 +12,6 @@ export class HemisphereLight extends Light {
skyColor: Color;
groundColor: Color;
intensity: number;
readonly isHemisphereLight: true;

}
2 changes: 1 addition & 1 deletion src/lights/HemisphereLightProbe.d.ts
Expand Up @@ -5,6 +5,6 @@ export class HemisphereLightProbe extends LightProbe {

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

isHemisphereLightProbe: true;
readonly isHemisphereLightProbe: true;

}
2 changes: 1 addition & 1 deletion src/lights/Light.d.ts
Expand Up @@ -13,7 +13,7 @@ export class Light extends Object3D {

color: Color;
intensity: number;
isLight: true;
readonly isLight: true;
receiveShadow: boolean;
shadow: LightShadow;
/**
Expand Down
2 changes: 1 addition & 1 deletion src/lights/LightProbe.d.ts
Expand Up @@ -5,7 +5,7 @@ export class LightProbe extends Light {

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

isLightProbe: true;
readonly isLightProbe: true;
sh: SphericalHarmonics3;

}
1 change: 1 addition & 0 deletions src/lights/RectAreaLight.d.ts
Expand Up @@ -14,5 +14,6 @@ export class RectAreaLight extends Light {
width: number;
height: number;
intensity: number;
readonly isRectAreaLight: true;

}
1 change: 1 addition & 0 deletions src/lights/SpotLight.d.ts
Expand Up @@ -51,5 +51,6 @@ export class SpotLight extends Light {
shadow: SpotLightShadow;
power: number;
penumbra: number;
readonly isSpotLight: true;

}
1 change: 1 addition & 0 deletions src/lights/SpotLightShadow.d.ts
Expand Up @@ -4,5 +4,6 @@ import { LightShadow } from './LightShadow';
export class SpotLightShadow extends LightShadow {

camera: PerspectiveCamera;
readonly isSpotLightShadow: true;

}
2 changes: 1 addition & 1 deletion src/materials/LineDashedMaterial.d.ts
Expand Up @@ -17,7 +17,7 @@ export class LineDashedMaterial extends LineBasicMaterial {
scale: number;
dashSize: number;
gapSize: number;
isLineDashedMaterial: boolean;
readonly isLineDashedMaterial: true;

setValues( parameters: LineDashedMaterialParameters ): void;

Expand Down
2 changes: 1 addition & 1 deletion src/materials/Material.d.ts
Expand Up @@ -198,7 +198,7 @@ export class Material extends EventDispatcher {
* Used to check whether this or derived classes are materials. Default is true.
* You should not change this, as it used internally for optimisation.
*/
isMaterial: boolean;
readonly isMaterial: true;

/**
* Material name. Default is an empty string.
Expand Down
2 changes: 1 addition & 1 deletion src/materials/PointsMaterial.d.ts
Expand Up @@ -11,7 +11,7 @@ export class MultiMaterial extends Material {

constructor( materials?: Material[] );

isMultiMaterial: true;
readonly isMultiMaterial: true;

materials: Material[];

Expand Down
2 changes: 1 addition & 1 deletion src/materials/SpriteMaterial.d.ts
Expand Up @@ -19,7 +19,7 @@ export class SpriteMaterial extends Material {
alphaMap: Texture | null;
rotation: number;
sizeAttenuation: boolean;
isSpriteMaterial: true;
readonly isSpriteMaterial: true;

setValues( parameters: SpriteMaterialParameters ): void;
copy( source: SpriteMaterial ): this;
Expand Down
1 change: 1 addition & 0 deletions src/math/Box3.d.ts
Expand Up @@ -11,6 +11,7 @@ export class Box3 {

max: Vector3;
min: Vector3;
readonly isBox3: true;

set( min: Vector3, max: Vector3 ): this;
setFromArray( array: ArrayLike<number> ): this;
Expand Down
2 changes: 1 addition & 1 deletion src/math/Color.d.ts
Expand Up @@ -21,7 +21,7 @@ export class Color {
constructor( color?: Color | string | number );
constructor( r: number, g: number, b: number );

isColor: boolean;
readonly isColor: true;

/**
* Red channel value between 0 and 1. Default is 1.
Expand Down
2 changes: 2 additions & 0 deletions src/math/Euler.d.ts
Expand Up @@ -10,6 +10,8 @@ export class Euler {
y: number;
z: number;
order: string;
readonly isEuler: true;

_onChangeCallback: Function;

set( x: number, y: number, z: number, order?: string ): Euler;
Expand Down
1 change: 1 addition & 0 deletions src/math/Plane.d.ts
Expand Up @@ -11,6 +11,7 @@ export class Plane {

normal: Vector3;
constant: number;
readonly isPlane: true;

set( normal: Vector3, constant: number ): Plane;
setComponents( x: number, y: number, z: number, w: number ): Plane;
Expand Down
1 change: 1 addition & 0 deletions src/math/Quaternion.d.ts
Expand Up @@ -25,6 +25,7 @@ export class Quaternion {
y: number;
z: number;
w: number;
readonly isQuaternion: true;

/**
* Sets values of this quaternion.
Expand Down
2 changes: 1 addition & 1 deletion src/math/SphericalHarmonics3.d.ts
Expand Up @@ -5,7 +5,7 @@ export class SphericalHarmonics3 {
constructor();

coefficients: Vector3[];
isSphericalHarmonics3: boolean;
readonly isSphericalHarmonics3: true;

set ( coefficients: Vector3[] ): SphericalHarmonics3;
zero(): SphericalHarmonics3;
Expand Down
2 changes: 1 addition & 1 deletion src/math/Vector2.d.ts
Expand Up @@ -138,7 +138,7 @@ export class Vector2 implements Vector {
y: number;
width: number;
height: number;
isVector2: true;
readonly isVector2: true;

/**
* Sets value of this vector.
Expand Down
2 changes: 1 addition & 1 deletion src/math/Vector3.d.ts
Expand Up @@ -27,7 +27,7 @@ export class Vector3 implements Vector {
x: number;
y: number;
z: number;
isVector3: true;
readonly isVector3: true;

/**
* Sets value of this vector.
Expand Down
2 changes: 1 addition & 1 deletion src/math/Vector4.d.ts
Expand Up @@ -19,7 +19,7 @@ export class Vector4 implements Vector {
w: number;
width: number;
height: number;
isVector4: true;
readonly isVector4: true;

/**
* Sets value of this vector.
Expand Down
2 changes: 1 addition & 1 deletion src/objects/Bone.d.ts
Expand Up @@ -5,7 +5,7 @@ import { Object3D } from './../core/Object3D';
export class Bone extends Object3D {

constructor();
isBone: true;
readonly isBone: true;
type: 'Bone';

}
2 changes: 1 addition & 1 deletion src/objects/Group.d.ts
Expand Up @@ -4,6 +4,6 @@ export class Group extends Object3D {

constructor();
type: 'Group';
isGroup: true;
readonly isGroup: true;

}

0 comments on commit 3ba0553

Please sign in to comment.