Browse Source

Merge pull request #18010 from f-a24/dev

Update .d.ts for animation
Mr.doob 5 years ago
parent
commit
e88ddc6613

+ 1 - 1
src/animation/AnimationAction.d.ts

@@ -57,6 +57,6 @@ export class AnimationAction {
 	stopWarping(): AnimationAction;
 	getMixer(): AnimationMixer;
 	getClip(): AnimationClip;
-	getRoot(): any;
+	getRoot(): Object3D;
 
 }

+ 3 - 1
src/animation/AnimationClip.d.ts

@@ -12,9 +12,11 @@ export class AnimationClip {
 	uuid: string;
 	results: any[];
 
-	resetDuration(): void;
+	resetDuration(): AnimationClip;
 	trim(): AnimationClip;
+	validate(): boolean;
 	optimize(): AnimationClip;
+	clone(): AnimationClip;
 
 	static CreateFromMorphTargetSequence(
 		name: string,

+ 1 - 1
src/animation/AnimationMixer.d.ts

@@ -11,7 +11,7 @@ export class AnimationMixer extends EventDispatcher {
 	timeScale: number;
 
 	clipAction( clip: AnimationClip, root?: Object3D ): AnimationAction;
-	existingAction( clip: AnimationClip, root?: Object3D ): AnimationAction;
+	existingAction( clip: AnimationClip, root?: Object3D ): AnimationAction | null;
 	stopAllAction(): AnimationMixer;
 	update( deltaTime: number ): AnimationMixer;
 	setTime( timeInSeconds: number ): AnimationMixer;

+ 1 - 1
src/animation/AnimationUtils.d.ts

@@ -4,7 +4,7 @@ export namespace AnimationUtils {
 	export function arraySlice( array: any, from: number, to: number ): any;
 	export function convertArray( array: any, type: any, forceClone: boolean ): any;
 	export function isTypedArray( object: any ): boolean;
-	export function getKeyFrameOrder( times: number ): number[];
+	export function getKeyFrameOrder( times: number[] ): number[];
 	export function sortedArray(
 		values: any[],
 		stride: number,

+ 2 - 2
src/animation/KeyframeTrack.d.ts

@@ -26,7 +26,7 @@ export class KeyframeTrack {
 	InterpolantFactoryMethodLinear( result: any ): LinearInterpolant;
 	InterpolantFactoryMethodSmooth( result: any ): CubicInterpolant;
 
-	setInterpolation( interpolation: InterpolationModes ): void;
+	setInterpolation( interpolation: InterpolationModes ): KeyframeTrack;
 	getInterpolation(): InterpolationModes;
 
 	getValuesize(): number;
@@ -36,8 +36,8 @@ export class KeyframeTrack {
 	trim( startTime: number, endTime: number ): KeyframeTrack;
 	validate(): boolean;
 	optimize(): KeyframeTrack;
+	clone(): KeyframeTrack;
 
-	static parse( json: any ): KeyframeTrack;
 	static toJSON( track: KeyframeTrack ): any;
 
 }

+ 10 - 1
src/animation/PropertyBinding.d.ts

@@ -1,3 +1,11 @@
+export interface ParseTrackNameResults {
+	nodeName: string;
+	objectName: string;
+	objectIndex: string;
+	propertyName: string;
+	propertyIndex: string;
+}
+
 export class PropertyBinding {
 
 	constructor( rootNode: any, path: string, parsedPath?: any );
@@ -23,7 +31,8 @@ export class PropertyBinding {
 		path: any,
 		parsedPath?: any
 	): PropertyBinding | PropertyBinding.Composite;
-	static parseTrackName( trackName: string ): any;
+	static sanitizeNodeName( name: string ): string;
+	static parseTrackName( trackName: string ): ParseTrackNameResults;
 	static findNode( root: any, nodeName: string ): any;
 
 }