未验证 提交 3ba05532 编写于 作者: M Michael Herzog 提交者: GitHub

Merge pull request #18259 from yomotsu/feature/add-type-isXXX

TS: Add missing types: is***
......@@ -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;
......
......@@ -5,6 +5,6 @@ import { LineMaterial } from './LineMaterial';
export class Line2 extends LineSegments2 {
constructor( geometry?: LineGeometry, material?: LineMaterial );
isLine2: boolean;
readonly isLine2: true;
}
......@@ -7,7 +7,7 @@ import { LineSegmentsGeometry } from './LineSegmentsGeometry';
export class LineGeometry extends LineSegmentsGeometry {
constructor();
isLineGeometry: boolean;
readonly isLineGeometry: true;
fromLine( line: Line ): this;
......
......@@ -23,7 +23,7 @@ export class LineMaterial extends ShaderMaterial {
dashScale: number;
dashSize: number;
gapSize: number;
isLineMaterial: boolean;
readonly isLineMaterial: true;
linewidth: number;
resolution: Vector2;
......
......@@ -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;
......
......@@ -10,7 +10,7 @@ import {
export class LineSegmentsGeometry extends InstancedBufferGeometry {
constructor();
isLineSegmentsGeometry: boolean;
readonly isLineSegmentsGeometry: true;
applyMatrix( matrix: Matrix4 ): this;
computeBoundingBox(): void;
......
......@@ -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;
......
......@@ -8,6 +8,6 @@ import { LineSegmentsGeometry } from './LineSegmentsGeometry';
export class WireframeGeometry2 extends LineSegmentsGeometry {
constructor( geometry: Geometry | BufferGeometry );
isWireframeGeometry2: boolean;
readonly sWireframeGeometry2: boolean;
}
......@@ -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;
......
......@@ -22,7 +22,7 @@ export class NodeMaterial extends ShaderMaterial {
updaters: object[];
isNodeMaterial: boolean;
readonly isNodeMaterial: true;
properties: object;
updateFrame( frame: NodeFrame ): void;
......
......@@ -17,7 +17,7 @@ export class LensflareElement {
export class Lensflare extends Mesh {
constructor();
isLensflare: boolean;
readonly isLensflare: true;
addElement( element: LensflareElement ): void;
dispose(): void;
......
......@@ -10,6 +10,7 @@ export class AnimationObjectGroup {
inUse: number;
};
};
readonly isAnimationObjectGroup: true;
add( ...args: any[] ): void;
remove( ...args: any[] ): void;
......
......@@ -5,6 +5,6 @@ export class ArrayCamera extends PerspectiveCamera {
constructor( cameras?: PerspectiveCamera[] );
cameras: PerspectiveCamera[];
isArrayCamera: true;
readonly isArrayCamera: true;
}
......@@ -29,7 +29,7 @@ export class Camera extends Object3D {
*/
projectionMatrixInverse: Matrix4;
isCamera: true;
readonly isCamera: true;
getWorldDirection( target: Vector3 ): Vector3;
......
......@@ -30,7 +30,7 @@ export class OrthographicCamera extends Camera {
type: 'OrthographicCamera';
isOrthographicCamera: true;
readonly isOrthographicCamera: true;
zoom: number;
view: null | {
......
......@@ -17,7 +17,7 @@ export class PerspectiveCamera extends Camera {
type: 'PerspectiveCamera';
isPerspectiveCamera: true;
readonly isPerspectiveCamera: true;
zoom: number;
......
......@@ -20,7 +20,7 @@ export class BufferAttribute {
set needsUpdate( value: boolean );
isBufferAttribute: true;
readonly isBufferAttribute: true;
onUploadCallback: () => void;
onUpload( callback: () => void ): this;
......
......@@ -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;
......
......@@ -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.
......
......@@ -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;
......
......@@ -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
......
......@@ -15,5 +15,6 @@ export class AmbientLight extends Light {
constructor( color?: Color | string | number, intensity?: number );
castShadow: boolean;
readonly isAmbientLight: true;
}
......@@ -5,6 +5,6 @@ export class AmbientLightProbe extends LightProbe {
constructor( color?: Color | string | number, intensity?: number );
isAmbientLightProbe: true;
readonly isAmbientLightProbe: true;
}
......@@ -30,5 +30,6 @@ export class DirectionalLight extends Light {
intensity: number;
shadow: DirectionalLightShadow;
readonly isDirectionalLight: true;
}
......@@ -4,5 +4,6 @@ import { LightShadow } from './LightShadow';
export class DirectionalLightShadow extends LightShadow {
camera: OrthographicCamera;
readonly isDirectionalLightShadow: true;
}
......@@ -12,5 +12,6 @@ export class HemisphereLight extends Light {
skyColor: Color;
groundColor: Color;
intensity: number;
readonly isHemisphereLight: true;
}
......@@ -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;
}
......@@ -13,7 +13,7 @@ export class Light extends Object3D {
color: Color;
intensity: number;
isLight: true;
readonly isLight: true;
receiveShadow: boolean;
shadow: LightShadow;
/**
......
......@@ -5,7 +5,7 @@ export class LightProbe extends Light {
constructor( sh?: SphericalHarmonics3, intensity?: number );
isLightProbe: true;
readonly isLightProbe: true;
sh: SphericalHarmonics3;
}
......@@ -14,5 +14,6 @@ export class RectAreaLight extends Light {
width: number;
height: number;
intensity: number;
readonly isRectAreaLight: true;
}
......@@ -51,5 +51,6 @@ export class SpotLight extends Light {
shadow: SpotLightShadow;
power: number;
penumbra: number;
readonly isSpotLight: true;
}
......@@ -4,5 +4,6 @@ import { LightShadow } from './LightShadow';
export class SpotLightShadow extends LightShadow {
camera: PerspectiveCamera;
readonly isSpotLightShadow: true;
}
......@@ -17,7 +17,7 @@ export class LineDashedMaterial extends LineBasicMaterial {
scale: number;
dashSize: number;
gapSize: number;
isLineDashedMaterial: boolean;
readonly isLineDashedMaterial: true;
setValues( parameters: LineDashedMaterialParameters ): void;
......
......@@ -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.
......
......@@ -11,7 +11,7 @@ export class MultiMaterial extends Material {
constructor( materials?: Material[] );
isMultiMaterial: true;
readonly isMultiMaterial: true;
materials: Material[];
......
......@@ -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;
......
......@@ -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;
......
......@@ -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.
......
......@@ -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;
......
......@@ -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;
......
......@@ -25,6 +25,7 @@ export class Quaternion {
y: number;
z: number;
w: number;
readonly isQuaternion: true;
/**
* Sets values of this quaternion.
......
......@@ -5,7 +5,7 @@ export class SphericalHarmonics3 {
constructor();
coefficients: Vector3[];
isSphericalHarmonics3: boolean;
readonly isSphericalHarmonics3: true;
set ( coefficients: Vector3[] ): SphericalHarmonics3;
zero(): SphericalHarmonics3;
......
......@@ -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.
......
......@@ -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.
......
......@@ -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.
......
......@@ -5,7 +5,7 @@ import { Object3D } from './../core/Object3D';
export class Bone extends Object3D {
constructor();
isBone: true;
readonly isBone: true;
type: 'Bone';
}
......@@ -4,6 +4,6 @@ export class Group extends Object3D {
constructor();
type: 'Group';
isGroup: true;
readonly isGroup: true;
}
......@@ -15,7 +15,7 @@ export class InstancedMesh extends Mesh {
count: number;
instanceMatrix: BufferAttribute;
isInstancedMesh: true;
readonly isInstancedMesh: true;
getMatrixAt( index: number, matrix: Matrix4 ): void;
setMatrixAt( index: number, matrix: Matrix4 ): void;
......
......@@ -11,6 +11,7 @@ export class LOD extends Object3D {
levels: { distance: number; object: Object3D }[];
autoUpdate: boolean;
readonly isLOD: true;
addLevel( object: Object3D, distance?: number ): this;
getObjectForDistance( distance: number ): Object3D | null;
......
......@@ -17,7 +17,7 @@ export class Line extends Object3D {
material: Material | Material[];
type: 'Line' | 'LineLoop' | 'LineSegments';
isLine: true;
readonly isLine: true;
computeLineDistances(): this;
raycast( raycaster: Raycaster, intersects: Intersection[] ): void;
......
......@@ -11,6 +11,6 @@ export class LineLoop extends Line {
);
type: 'LineLoop';
isLineLoop: true;
readonly isLineLoop: true;
}
......@@ -21,6 +21,6 @@ export class LineSegments extends Line {
);
type: 'LineSegments';
isLineSegments: true;
readonly isLineSegments: true;
}
......@@ -16,7 +16,7 @@ export class Mesh extends Object3D {
material: Material | Material[];
morphTargetInfluences?: number[];
morphTargetDictionary?: { [key: string]: number };
isMesh: true;
readonly isMesh: true;
type: string;
updateMorphTargets(): void;
......
......@@ -24,7 +24,7 @@ export class Points extends Object3D {
type: 'Points';
morphTargetInfluences?: number[];
morphTargetDictionary?: { [key: string]: number };
isPoints: true;
readonly isPoints: true;
/**
* An instance of Geometry or BufferGeometry, where each vertex designates the position of a particle in the system.
......
......@@ -17,6 +17,7 @@ export class SkinnedMesh extends Mesh {
bindMatrix: Matrix4;
bindMatrixInverse: Matrix4;
skeleton: Skeleton;
readonly isSkinnedMesh: true;
bind( skeleton: Skeleton, bindMatrix?: Matrix4 ): void;
pose(): void;
......
......@@ -10,7 +10,7 @@ export class Sprite extends Object3D {
constructor( material?: SpriteMaterial );
type: 'Sprite';
isSprite: true;
readonly isSprite: true;
geometry: BufferGeometry;
material: SpriteMaterial;
......
......@@ -11,4 +11,6 @@ export class WebGLMultisampleRenderTarget extends WebGLRenderTarget {
options?: WebGLRenderTargetOptions
);
readonly isWebGLMultisampleRenderTarget: true;
}
......@@ -12,6 +12,7 @@ export class WebGLMultiviewRenderTarget extends WebGLRenderTarget {
options?: WebGLRenderTargetOptions
);
readonly isWebGLMultiviewRenderTarget: true;
setNumViews( numViews: number ): this;
}
......@@ -36,6 +36,8 @@ export class WebGLRenderTarget extends EventDispatcher {
depthBuffer: boolean;
stencilBuffer: boolean;
depthTexture: DepthTexture;
readonly isWebGLRenderTarget: true;
/**
* @deprecated Use {@link Texture#wrapS texture.wrapS} instead.
*/
......
......@@ -11,7 +11,7 @@ export class WebGLCapabilities {
parameters: WebGLCapabilitiesParameters
);
isWebGL2: boolean;
readonly isWebGL2: true;
precision: string;
logarithmicDepthBuffer: boolean;
maxTextures: number;
......
......@@ -32,6 +32,8 @@ export class Fog implements IFog {
*/
far: number;
readonly isFog: true;
clone(): this;
toJSON(): any;
......
......@@ -16,6 +16,8 @@ export class FogExp2 implements IFog {
*/
density: number;
readonly isFogExp2: true;
clone(): this;
toJSON(): any;
......
......@@ -27,6 +27,8 @@ export class Scene extends Object3D {
background: null | Color | Texture;
environment: null | Texture;
readonly isScene: true;
toJSON( meta?: any ): any;
dispose(): void;
......
......@@ -54,6 +54,8 @@ export class Texture extends EventDispatcher {
encoding: TextureEncoding;
version: number;
needsUpdate: boolean;
readonly isTexture: true;
onUpdate: () => void;
static DEFAULT_IMAGE: any;
static DEFAULT_MAPPING: any;
......
......@@ -21,4 +21,6 @@ export class VideoTexture extends Texture {
anisotropy?: number
);
readonly isVideoTexture: true;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册