export class Action { param time param opacity public static fadeTo ( time , opacity , easing ? ) { return ( ) : ActionData => { let animationData = new ActionData ( ) ; animationData . type = ActionData . fadeTo ; animationData . time = time ; animationData . opacity = opacity ; if ( easing != undefined ) { animationData . easingProperty = easing ; } return animationData ; } ; } param time public static fadeIn ( time , easing ? ) { return ( ) : ActionData => { let animationData = new ActionData ( ) ; animationData . type = ActionData . fadeIn ; animationData . time = time ; animationData . opacity = 255 ; if ( easing != undefined ) { animationData . easingProperty = easing ; } return animationData ; } ; } param time public static fadeOut ( time , easing ? ) { return ( ) : ActionData => { let animationData = new ActionData ( ) ; animationData . type = ActionData . fadeOut ; animationData . time = time ; animationData . opacity = 0 ; if ( easing != undefined ) { animationData . easingProperty = easing ; } return animationData ; } ; } param time param x param y public static moveTo ( time , x ? , y ? , easing ? ) { return ( ) : ActionData => { let animationData = new ActionData ( ) ; animationData . type = ActionData . moveTo ; animationData . time = time ; if ( x != undefined ) { animationData . x = x ; } if ( y != undefined ) { animationData . y = y ; } if ( easing != undefined ) { animationData . easingProperty = easing ; } return animationData ; } ; } param time param x param y public static moveBy ( time , x ? , y ? , easing ? ) { return ( ) : ActionData => { let animationData = new ActionData ( ) ; animationData . type = ActionData . moveBy ; animationData . time = time ; if ( x != undefined ) { animationData . x = x ; } if ( y != undefined ) { animationData . y = y ; } if ( easing != undefined ) { animationData . easingProperty = easing ; } return animationData ; } ; } param time param x param y public static scaleTo ( time , x ? , y ? , easing ? ) { return ( ) : ActionData => { let animationData = new ActionData ( ) ; animationData . type = ActionData . scaleTo ; animationData . time = time ; if ( x != undefined ) { animationData . scaleX = x ; } if ( y != undefined ) { animationData . scaleY = y ; } if ( easing != undefined ) { animationData . easingProperty = easing ; } return animationData ; } ; } param time param x param y public static scaleBy ( time , x ? , y ? , easing ? ) { return ( ) : ActionData => { let animationData = new ActionData ( ) ; animationData . type = ActionData . scaleBy ; animationData . time = time ; if ( x != undefined ) { animationData . scaleX = x ; } if ( y != undefined ) { animationData . scaleY = y ; } if ( easing != undefined ) { animationData . easingProperty = easing ; } return animationData ; } ; } param time param rotation public static rotateTo ( time , rotation , easing ? ) { return ( ) : ActionData => { let animationData = new ActionData ( ) ; animationData . type = ActionData . rotateTo ; animationData . time = time ; animationData . rotation = rotation ; if ( easing != undefined ) { animationData . easingProperty = easing ; } return animationData ; } ; } param time param rotation public static rotateBy ( time , rotation , easing ? ) { return ( ) : ActionData => { let animationData = new ActionData ( ) ; animationData . type = ActionData . rotateBy ; animationData . time = time ; animationData . rotation = rotation ; if ( easing != undefined ) { animationData . easingProperty = easing ; } return animationData ; } ; } param time param x param y public static skewTo ( time , x ? , y ? , easing ? ) { return ( ) : ActionData => { let animationData = new ActionData ( ) ; animationData . type = ActionData . skewTo ; animationData . time = time ; if ( x != undefined ) { animationData . skewX = x ; } if ( y != undefined ) { animationData . skewY = y ; } if ( easing != undefined ) { animationData . easingProperty = easing ; } return animationData ; } ; } param time param x param y public static skewBy ( time , x ? , y ? , easing ? ) { return ( ) : ActionData => { let animationData = new ActionData ( ) ; animationData . type = ActionData . skewBy ; animationData . time = time ; if ( x != undefined ) { animationData . skewX = x ; } if ( y != undefined ) { animationData . skewY = y ; } if ( easing != undefined ) { animationData . easingProperty = easing ; } return animationData ; } ; } param callback public static callFunc ( callback ? ) { return ( ) : ActionData => { let animationData = new ActionData ( ) ; animationData . type = ActionData . callFunc ; animationData . callback = callback ; return animationData ; } ; } param adArr public static spawn ( ... adArr ) { return ( ) : ActionData => { let animationData = new ActionData ( ) ; animationData . type = ActionData . spawn ; animationData . animationDataArray = adArr ; return animationData ; } ; } param adArr public static sequence ( ... adArr ) { return ( ) : ActionData => { let animationData = new ActionData ( ) ; animationData . type = ActionData . sequence ; animationData . animationDataArray = adArr ; return animationData ; } ; } param time public static wait ( time ) { return ( ) : ActionData => { let animationData = new ActionData ( ) ; animationData . time = time ; return animationData ; } ; } } export class ActionData { public static fadeTo = "fadeTo" ; public static fadeIn = "fadeIn" ; public static fadeOut = "fadeOut" ; public static moveTo = "moveTo" ; public static moveBy = "moveBy" ; public static scaleTo = "scaleTo" ; public static scaleBy = "scaleBy" ; public static rotateTo = "rotateTo" ; public static rotateBy = "rotateBy" ; public static skewTo = "skewTo" ; public static skewBy = "skewBy" ; public static callFunc = "callFunc" ; public static spawn = "spawn" ; public static sequence = "sequence" ; type : string | undefined ; opacity : number = NaN ; time : number = 0 ; y : number = NaN ; x : number = NaN ; rotation : number = NaN ; scaleX : number = NaN ; scaleY : number = NaN ; skewX : number = NaN ; skewY : number = NaN ; easingProperty : Function | undefined ; tween : Function | undefined ; callback : Function | undefined ; animationDataArray : Array < Function > | undefined ; }