2017-01-30 02:06:06 +00:00
declare namespace gsap {
2018-10-22 10:43:31 +00:00
class Animation {
/ * *
* Base class for all TweenLite , TweenMax , TimelineLite , and TimelineMax classes , providing core methods / properties / ( ) = > voidality , but there is no reason to create an instance of this
* class directly .
* /
2017-01-30 02:06:06 +00:00
constructor ( duration? : number , vars? : any ) ;
2018-10-22 10:43:31 +00:00
/ * *
* A place to store any data you want ( initially populated with vars . data if it exists ) .
* /
2017-01-30 02:06:06 +00:00
data : any ;
2018-10-22 10:20:05 +00:00
/** [Read-only] Parent timeline. */
2017-01-30 02:06:06 +00:00
timeline : SimpleTimeline ;
2018-10-22 10:20:05 +00:00
/** The vars object passed into the constructor which stores configuration variables like onComplete, onUpdate, etc. */
2017-01-30 02:06:06 +00:00
vars : { } ;
2018-10-22 10:20:05 +00:00
/** Gets or sets the animation's initial delay which is the length of time in seconds (or frames for frames-based tweens) before the animation should begin. */
2017-01-30 02:06:06 +00:00
delay ( ) : number ;
delay ( value : number ) : Animation ;
2018-10-22 10:20:05 +00:00
/** Gets or sets the animation's duration, not including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax). */
2017-01-30 02:06:06 +00:00
duration ( ) : number ;
duration ( value : number ) : Animation ;
2018-10-22 10:43:31 +00:00
/ * *
* Gets or sets an event callback like "onComplete" , "onUpdate" , "onStart" , "onReverseComplete" or "onRepeat" ( onRepeat only applies to TweenMax or TimelineMax instances ) along with any
* parameters that should be passed to that callback .
* /
2019-02-17 13:43:09 +00:00
eventCallback ( type : string ) : ( . . . args : any [ ] ) = > void ;
eventCallback ( type : string , callback : ( . . . args : any [ ] ) = > void , params? : any [ ] , scope? : any ) : Animation ;
2017-01-30 02:06:06 +00:00
2018-10-22 10:43:31 +00:00
/ * *
* Clears any initialization data ( like starting / ending values in tweens ) which can be useful if , for example , you want to restart a tween without reverting to any previously recorded
* starting values .
* /
2017-01-30 02:06:06 +00:00
invalidate ( ) : Animation ;
2018-10-22 10:43:31 +00:00
/ * *
* Indicates whether or not the animation is currently active ( meaning the virtual playhead is actively moving across this instance ' s time span and it is not paused , nor are any of its
* ancestor timelines ) .
* /
2017-01-30 02:06:06 +00:00
isActive ( ) : boolean ;
2018-10-22 10:20:05 +00:00
/** Kills the animation entirely or in part depending on the parameters. */
2017-01-30 02:06:06 +00:00
kill ( vars ? : { } , target ? : { } ) : Animation ;
2018-10-22 10:20:05 +00:00
/** Pauses the instance, optionally jumping to a specific time. */
2017-01-30 02:06:06 +00:00
pause ( atTime? : any , suppressEvents? : boolean ) : Animation ;
2018-10-22 10:20:05 +00:00
/** Gets or sets the animation's paused state which indicates whether or not the animation is currently paused. */
2017-01-30 02:06:06 +00:00
paused ( ) : boolean ;
paused ( value : boolean ) : Animation ;
2018-10-22 10:20:05 +00:00
/** Begins playing forward, optionally from a specific time (by default playback begins from wherever the playhead currently is). */
2017-01-30 02:06:06 +00:00
play ( from ? : any , suppressEvents? : boolean ) : Animation ;
2018-10-22 10:43:31 +00:00
/ * *
* Gets or sets the animations ' s progress which is a value between 0 and 1 indicating the position of the virtual playhead ( excluding repeats ) where 0 is at the beginning , 0.5 is at the
* halfway point , and 1 is at the end ( complete ) .
* /
2017-01-30 02:06:06 +00:00
progress ( ) : number ;
progress ( value : number , suppressEvents? : boolean ) : Animation ;
2018-10-22 10:20:05 +00:00
/** Restarts and begins playing forward from the beginning. */
2017-01-30 02:06:06 +00:00
restart ( includeDelay? : boolean , suppressEvents? : boolean ) : Animation ;
2018-10-22 10:20:05 +00:00
/** Resumes playing without altering direction (forward or reversed), optionally jumping to a specific time first. */
2017-01-30 02:06:06 +00:00
resume ( from ? : any , suppressEvents? : boolean ) : Animation ;
2018-10-22 10:20:05 +00:00
/** Reverses playback so that all aspects of the animation are oriented backwards including, for example, a tween's ease. */
2017-01-30 02:06:06 +00:00
reverse ( from ? : any , suppressEvents? : boolean ) : Animation ;
2018-10-22 10:20:05 +00:00
/** Gets or sets the animation's reversed state which indicates whether or not the animation should be played backwards. */
2017-01-30 02:06:06 +00:00
reversed ( ) : boolean ;
reversed ( value : boolean ) : Animation ;
2018-10-22 10:20:05 +00:00
/** Jumps to a specific time without affecting whether or not the instance is paused or reversed. */
2017-01-30 02:06:06 +00:00
seek ( time : any , suppressEvents? : boolean ) : Animation ;
2018-10-22 10:20:05 +00:00
/** Gets or sets the time at which the animation begins on its parent timeline (after any delay that was defined). */
2017-01-30 02:06:06 +00:00
startTime ( ) : number ;
startTime ( value : number ) : Animation ;
2018-10-22 10:43:31 +00:00
/ * *
* Gets or sets the local position of the playhead ( essentially the current time ) , described in seconds ( or frames for frames - based animations ) which will never be less than 0 or greater
* than the animation ' s duration .
* /
2017-01-30 02:06:06 +00:00
time ( ) : number ;
time ( value : number , suppressEvents? : boolean ) : Animation ;
2018-10-22 10:20:05 +00:00
/** Factor that's used to scale time in the animation where 1 = normal speed (the default), 0.5 = half speed, 2 = double speed, etc. */
2017-01-30 02:06:06 +00:00
timeScale ( ) : number ;
timeScale ( value : number ) : Animation ;
2018-10-22 10:20:05 +00:00
/** Gets or sets the animation's total duration including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax). */
2017-01-30 02:06:06 +00:00
totalDuration ( ) : number ;
totalDuration ( value : number ) : Animation ;
2018-10-22 10:43:31 +00:00
/ * *
* Gets or sets the animation ' s total progress which is a value between 0 and 1 indicating the position of the virtual playhead ( including repeats ) where 0 is at the beginning , 0.5 is at
* the halfway point , and 1 is at the end ( complete ) .
* /
2017-01-30 02:06:06 +00:00
totalProgress ( ) : number ;
totalProgress ( value : number , suppressEvents? : boolean ) : Animation ;
2018-10-22 10:20:05 +00:00
/** Gets or sets the position of the playhead according to the totalDuration which includes any repeats and repeatDelays (only available in TweenMax and TimelineMax). */
2017-01-30 02:06:06 +00:00
totalTime ( ) : number ;
totalTime ( time : number , suppressEvents? : boolean ) : Animation ;
}
}