mathieuanthoine / haxe-gsap

Haxe externs for Greensock Animation Platform
MIT License
20 stars 6 forks source link

TweenLite.delayedCall argument issues #3

Closed ghost closed 6 years ago

ghost commented 7 years ago

Hello there

I noticed that the callback argument to TweenLite.delayedCall is typed Void->Void. However, we clearly want to be able to supply a callback that might accept any number of arguments, that will be passed the contents of the optional params array. As also explained in the GSAP documentation.

Here is the relevant line.

For the time being I have replaced

TweenLite.delayedCall( delay, myCallback, [a,b,c])

with

TweenLite.delayedCall( delay, myCallback.bind(a,b,c))

so that the types match. Do you think there is a good fix for this? Obviously it depends a great deal on how the callback is evoked by the underlying GSAP library.

Thoughts? -colin

mathieuanthoine commented 7 years ago

Hi,

Try to modify your local externs with Dynamic as type for myCallBack. If it works, thank you to PR :)