Fixed Fabric Object animation function to include correct parameters (#39069)

* fixed object animate function to include correct parameters

* credit

* guess not since you can't use gitlab urls

* updated fabric version number

* only allow major and minor patch

* fixed some inaccurate documentation and added properties interface to parameter
This commit is contained in:
Kyle Kaniecki 2019-10-14 13:48:10 -04:00 committed by Andrew Branch
parent c2e9725e3d
commit 90eb4f593a
2 changed files with 16 additions and 5 deletions

View File

@ -368,10 +368,10 @@ interface IObjectAnimation<T> {
/**
* Animates object's properties
* object.animate({ left: ..., top: ... }, { duration: ... });
* @param properties Properties to animate
* @param value Options object
* @param properties Properties to animate with values to animate to
* @param options The animation options
*/
animate(properties: any, options?: IAnimationOptions): Object;
animate(properties: {[key: string]: number | string}, options?: IAnimationOptions): Object;
}
interface IAnimationOptions {
/**
@ -3506,8 +3506,19 @@ export class Object {
intersectsWithRect(pointTL: any, pointBR: any, absolute?: boolean, calculate?: boolean): boolean;
/**
* Animates object's properties
* object.animate('left', ..., {duration: ...});
* @param property Property to animate
* @param value Value to animate property
* @param options The animation options
*/
animate(): Object;
animate(property: string, value: number | string, options?: IAnimationOptions): Object;
/**
* Animates object's properties
* object.animate({ left: ..., top: ... }, { duration: ... });
* @param properties Properties to animate with values to animate to
* @param options The animation options
*/
animate(properties: {[key: string]: number | string}, options?: IAnimationOptions): Object;
/**
* Calculate and returns the .coords of an object.
* @return {Object} Object with tl, tr, br, bl ....

View File

@ -1,4 +1,4 @@
// Type definitions for FabricJS 3.0
// Type definitions for FabricJS 3.4
// Project: http://fabricjs.com/
// Definitions by: Oliver Klemencic <https://github.com/oklemencic>
// Joseph Livecchi <https://github.com/joewashear007>