Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS: Added @default values #20036

Merged
merged 1 commit into from
Aug 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions src/animation/AnimationAction.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,55 @@ export class AnimationAction {
constructor( mixer: AnimationMixer, clip: AnimationClip, localRoot?: Object3D, blendMode?: AnimationBlendMode );

blendMode: AnimationBlendMode;

/**
* @default THREE.LoopRepeat
*/
loop: AnimationActionLoopStyles;

/**
* @default 0
*/
time: number;

/**
* @default 1
*/
timeScale: number;

/**
* @default 1
*/
weight: number;

/**
* @default Infinity
*/
repetitions: number;

/**
* @default false
*/
paused: boolean;

/**
* @default true
*/
enabled: boolean;

/**
* @default false
*/
clampWhenFinished: boolean;

/**
* @default true
*/
zeroSlopeAtStart: boolean;

/**
* @default true
*/
zeroSlopeAtEnd: boolean;

play(): AnimationAction;
Expand Down
8 changes: 8 additions & 0 deletions src/animation/AnimationClip.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ export class AnimationClip {

name: string;
tracks: KeyframeTrack[];

/**
* @default THREE.NormalAnimationBlendMode
*/
blendMode: AnimationBlendMode;

/**
* @default -1
*/
duration: number;
uuid: string;
results: any[];
Expand Down
7 changes: 7 additions & 0 deletions src/animation/AnimationMixer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ export class AnimationMixer extends EventDispatcher {

constructor( root: Object3D | AnimationObjectGroup );

/**
* @default 0
*/
time: number;

/**
* @default 1.0
*/
timeScale: number;

clipAction( clip: AnimationClip, root?: Object3D | AnimationObjectGroup, blendMode?: AnimationBlendMode ): AnimationAction;
Expand Down
15 changes: 15 additions & 0 deletions src/animation/AnimationUtils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,28 @@ export namespace AnimationUtils {
values: any[],
valuePropertyName: string
): void;

/**
* @param sourceClip
* @param name
* @param startFrame
* @param endFrame
* @param [fps=30]
*/
export function subclip(
sourceClip: AnimationClip,
name: string,
startFrame: number,
endFrame: number,
fps?: number
): AnimationClip;

/**
* @param targetClip
* @param [referenceFrame=0]
* @param [referenceClip=targetClip]
* @param [fps=30]
*/
export function makeClipAdditive(
targetClip: AnimationClip,
referenceFrame?: number,
Expand Down
9 changes: 9 additions & 0 deletions src/animation/KeyframeTrack.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import { InterpolationModes } from '../constants';

export class KeyframeTrack {

/**
* @param name
* @param times
* @param values
* @param [interpolation=THREE.InterpolateLinear]
*/
constructor(
name: string,
times: any[],
Expand All @@ -20,6 +26,9 @@ export class KeyframeTrack {
TimeBufferType: Float32Array;
ValueBufferType: Float32Array;

/**
* @default THREE.InterpolateLinear
*/
DefaultInterpolation: InterpolationModes;

InterpolantFactoryMethodDiscrete( result: any ): DiscreteInterpolant;
Expand Down
5 changes: 5 additions & 0 deletions src/animation/tracks/BooleanKeyframeTrack.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ export class BooleanKeyframeTrack extends KeyframeTrack {

constructor( name: string, times: any[], values: any[] );

/**
* @default 'bool'
*/
ValueTypeName: string;

}
5 changes: 5 additions & 0 deletions src/animation/tracks/ColorKeyframeTrack.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ export class ColorKeyframeTrack extends KeyframeTrack {
interpolation?: InterpolationModes
);

/**
* @default 'color'
*/
ValueTypeName: string;

}
5 changes: 5 additions & 0 deletions src/animation/tracks/NumberKeyframeTrack.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ export class NumberKeyframeTrack extends KeyframeTrack {
interpolation?: InterpolationModes
);

/**
* @default 'number'
*/
ValueTypeName: string;

}
5 changes: 5 additions & 0 deletions src/animation/tracks/QuaternionKeyframeTrack.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ export class QuaternionKeyframeTrack extends KeyframeTrack {
interpolation?: InterpolationModes
);

/**
* @default 'quaternion'
*/
ValueTypeName: string;

}
5 changes: 5 additions & 0 deletions src/animation/tracks/StringKeyframeTrack.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ export class StringKeyframeTrack extends KeyframeTrack {
interpolation?: InterpolationModes
);

/**
* @default 'string'
*/
ValueTypeName: string;

}
5 changes: 5 additions & 0 deletions src/animation/tracks/VectorKeyframeTrack.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ export class VectorKeyframeTrack extends KeyframeTrack {
interpolation?: InterpolationModes
);

/**
* @default 'vector'
*/
ValueTypeName: string;

}
48 changes: 48 additions & 0 deletions src/audio/Audio.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,67 @@ export class Audio<NodeType extends AudioNode = GainNode> extends Object3D {
listener: AudioListener;
context: AudioContext;
gain: GainNode;

/**
* @default false
*/
autoplay: boolean;
buffer: null | AudioBuffer;

/**
* @default 0
*/
detune: number;

/**
* @default false
*/
loop: boolean;

/**
* @default 0
*/
loopStart: number;

/**
* @default 0
*/
loopEnd: number;

/**
* @default 0
*/
offset: number;

/**
* @default undefined
*/
duration: number | undefined;

/**
* @default 1
*/
playbackRate: number;

/**
* @default false
*/
isPlaying: boolean;

/**
* @default true
*/
hasPlaybackControl: boolean;

/**
* @default 'empty'
*/
sourceType: string;
source: AudioBufferSourceNode;

/**
* @default []
*/
filters: any[];

getOutput(): NodeType;
Expand Down
6 changes: 5 additions & 1 deletion src/audio/AudioAnalyser.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { Audio } from './Audio';

export class AudioAnalyser {

constructor( audio: Audio<AudioNode>, fftSize: number );
/**
* @param audio
* @param [fftSize=2048]
*/
constructor( audio: Audio<AudioNode>, fftSize?: number );

analyser: AnalyserNode;
data: Uint8Array;
Expand Down
8 changes: 8 additions & 0 deletions src/audio/AudioListener.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ export class AudioListener extends Object3D {
type: 'AudioListener';
context: AudioContext;
gain: GainNode;

/**
* @default null
*/
filter: null | any;

/**
* @default 0
*/
timeDelta: number;

getInput(): GainNode;
Expand Down
3 changes: 3 additions & 0 deletions src/cameras/ArrayCamera.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ export class ArrayCamera extends PerspectiveCamera {

constructor( cameras?: PerspectiveCamera[] );

/**
* @default []
*/
cameras: PerspectiveCamera[];
readonly isArrayCamera: true;

Expand Down
3 changes: 3 additions & 0 deletions src/cameras/Camera.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@ export class Camera extends Object3D {

/**
* This is the inverse of matrixWorld. MatrixWorld contains the Matrix which has the world transform of the Camera.
* @default new THREE.Matrix4()
*/
matrixWorldInverse: Matrix4;

/**
* This is the matrix which contains the projection.
* @default new THREE.Matrix4()
*/
projectionMatrix: Matrix4;

/**
* This is the inverse of projectionMatrix.
* @default new THREE.Matrix4()
*/
projectionMatrixInverse: Matrix4;

Expand Down
17 changes: 15 additions & 2 deletions src/cameras/OrthographicCamera.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export class OrthographicCamera extends Camera {
* @param right Camera frustum right plane.
* @param top Camera frustum top plane.
* @param bottom Camera frustum bottom plane.
* @param near Camera frustum near plane.
* @param far Camera frustum far plane.
* @param [near=0.1] Camera frustum near plane.
* @param [far=2000] Camera frustum far plane.
*/
constructor(
left: number,
Expand All @@ -32,7 +32,14 @@ export class OrthographicCamera extends Camera {

readonly isOrthographicCamera: true;

/**
* @default 1
*/
zoom: number;

/**
* @default null
*/
view: null | {
enabled: boolean;
fullWidth: number;
Expand All @@ -45,31 +52,37 @@ export class OrthographicCamera extends Camera {

/**
* Camera frustum left plane.
* @default -1
*/
left: number;

/**
* Camera frustum right plane.
* @default 1
*/
right: number;

/**
* Camera frustum top plane.
* @default 1
*/
top: number;

/**
* Camera frustum bottom plane.
* @default -1
*/
bottom: number;

/**
* Camera frustum near plane.
* @default 0.1
*/
near: number;

/**
* Camera frustum far plane.
* @default 2000
*/
far: number;

Expand Down
Loading