export interface WebPropertyOptions { [ name ] : PropertyResolver < PropertyValue > | PropertyResolver < PropertyValue > [ ] ; } export interface PropertyOptions { [ name ] : PropertyValueOptions | PropertyResolver < PropertyValue > | PropertyResolver < PropertyValue > [ ] ; } export interface PropertyValueOptions { value : PropertyResolver < PropertyValue > | PropertyResolver < PropertyValue > [ ] ; easing ? : string ; interpolate ? : Interpolator | string ; } export interface Dictionary < T > { [ prop ] : T ; } export interface SetOptions { [ name ] : PropertyResolver < string | number > ; } export interface Interpolator { ( left , right ) : ( offset : number ) => any ; } export interface Keyframe { offset : number ; value : string | number ; easing : string ; interpolate : Function ; simpleFn ? : boolean ; } export type AnimationTarget = any ; export type KeyframeValue = string | number ; export interface PropertyFunction < T > { ( target , index , len ) : T ; } export interface PropertyObject { value : string | number ; offset ? : number ; easing ? : string ; interpolate ? : Interpolator | string ; } export type PropertyValue = string | number | PropertyObject ; export type PropertyResolver < T > = T | PropertyFunction < T > ; export interface AnimationController { cancel ( ) : void ; update ( time , playbackRate , isActive ) : void ; } export interface AnimationPlayer extends AnimationController { config : TargetConfiguration ; from : number ; to : number ; } export interface JustAnimatePlugin { name : string ; onWillAnimate ? : { ( target , effects , propToPlugin ? ) : void ; } ; animate ( effect ) : AnimationController ; getValue ( target , key ) : string | number ; } export interface PropertyKeyframe { easing : string ; time : number ; prop : string ; plugin : string ; index : number ; value : string | number ; interpolate : Interpolator | string ; } export interface PropertyEffects { [ name ] : PropertyEffect [ ] ; } export interface PropertyEffect { offset : number ; easing : string ; value : string | number ; interpolate : Interpolator ; } export interface TargetConfiguration { target : AnimationTarget ; targetLength : number ; easing : string ; from : number ; to : number ; endDelay : number ; duration : number ; stagger : number ; propNames : string [ ] ; keyframes : PropertyKeyframe [ ] ; } export interface BaseAnimationOptions { targets : AnimationTarget | AnimationTarget [ ] ; delay ? : PropertyResolver < number > ; easing ? : string ; endDelay ? : PropertyResolver < number > ; props ? : PropertyOptions ; stagger ? : number ; web ? : WebPropertyOptions ; } export interface BaseSetOptions { targets : AnimationTarget | AnimationTarget [ ] ; at ? : number ; easing ? : string ; props ? : SetOptions ; web ? : SetOptions ; } export interface AddAnimationOptions extends BaseAnimationOptions { from ? : number ; to ? : number ; duration ? : number ; } export interface AnimationOptions { from : number ; to : number ; easing ? : string ; targets : AnimationTarget [ ] ; stagger ? : number ; delay ? : PropertyResolver < number > ; endDelay ? : PropertyResolver < number > ; props ? : PropertyOptions ; web ? : WebPropertyOptions ; } export interface Effect { target : AnimationTarget ; plugin : string ; prop : string ; keyframes : Keyframe [ ] ; to : number ; from : number ; } export interface References { [ name ] : any ; } export interface TimelineOptions { id ? : string ; references ? : References ; } export type TimelineEvent = 'cancel' | 'config' | 'finish' | 'pause' | 'reverse' | 'update' | 'play' ; export interface IReducerContext { events : string [ ] ; needUpdate : TargetConfiguration [ ] ; destroyed ? : boolean ; trigger ( eventName ) : void ; dirty ( config ) : void ; } export interface IReducer { ( model , data , ctx ) : void ; } export interface ITimelineEventListener { ( data ) : void ; } export interface IStore { state : ITimelineModel ; subs : Record < TimelineEvent , ITimelineEventListener [ ] > ; } export interface ITimelineModel { /**
     * Internal identifier used by Just Animate
     */ id : string ; /**
     * Target configurations.  This includes all properties, plugins, and keyframes to use during animation.
     */ configs : TargetConfiguration [ ] ; /**
     * Total active time of an animation.  In certain circumstances, the duration may increase during the active state.
     */ duration : number ; /**
     * Next position to insert new animations.  This is the same as duration unless an animation specifies a negative endDelay.
     * A negative endDelay can cause this to move prior to duration.
     * A positive endDelay will cause the duration to match
     */ cursor : number ; /**
     * The playrate of the Timeline. Positive numbers are forward and negative numbers are in reverse
     */ rate : number ; /**
     * References (@strings) to used as placeholders for values in the Timeline
     */ refs : References ; /**
     * Number of times to repeat the timeline when played.
     */ repeat : number ; /**
     * Number of repetitions currently played.
     */ round : number ; /**
     * Current state of the Timeline (inactive, starting, running, paused, etc.)
     */ state : number ; /**
     * Current time of the Timeline
     */ time : number ; /**
     * True if the timeline should alternate directions for each iteration
     */ yoyo : boolean ; /**
     * Animation players used to actually animate things
     */ players : AnimationPlayer [ ] ; /**
     * True if the timeline should be destroyed on finish
     */ destroy ? : boolean ; } export interface PlayOptions { /**
     * Number of times to repeat the Timeline.
     */ repeat ? : number ; /**
     * True if the timeline should alternate directions for each iteration
     */ alternate ? : boolean ; /**
     * True if the timeline should be destroyed on finish
     */ destroy ? : boolean ; } param opts export interface ITimeline { currentTime : number ; duration : number ; playbackRate : number ; state : number ; id ? : string ; param opts add ( opts ) : this ; param opts animate ( opts ) : this ; /**
     * Destroys the internal model of the timeline
     */ destroy ( ) : void ; param from param to param options fromTo ( from , to , options ) : this ; param seqOptions sequence ( this , seqOptions ) : this ; param options set ( options ) : this ; /**
     * Cancels an animation, removes all effects, and resets internal state
     */ cancel ( ) : this ; /**
     * Finishes an animation.  If the animation has never been active, this will
     * activate effects
     * - If playbackRate is 0 or more, the animation will seek to duration.
     * - If playbackRate is less than 0, the animation will seek to 0
     */ finish ( ) : this ; param eventName param listener on ( eventName , listener ) : this ; param eventName param listener once ( eventName , listener ) : this ; param eventName param listener off ( eventName , listener ) : this ; /**
     * Pauses execution of the animation. If the animation has never been active, this will
     * activate effects
     */ pause ( ) : this ; param iterations param dir play ( options ? ) : this ; /**
     * Reverses the animation playbackRate.  If the animation is currently playing, it will reverse the animation
     */ reverse ( ) : this ; param time seek ( time ) : this ; }