haxiomic / dts2hx

Converts TypeScript definition files (d.ts) to haxe externs (.hx) via the TypeScript compiler API
MIT License
134 stars 9 forks source link

gsap not supoort #41

Closed sonygod closed 4 years ago

sonygod commented 4 years ago
 npm install --save @types/gsap

there is no

  TweenLite.to

only have Tween.to

and I found in gasp-core.d.ts

     declare class TweenLite extends gsap.core.Tween {}  
haxiomic commented 4 years ago

This works fine for me, I get a TweenLite.hx and a TweenLite.to() function:

npm install --save @types/gsap npx dts2hx gsap

Then in .haxelib/gsap/1,20,2/gsap/TweenLite.hx I get:

package gsap;

@:jsRequire("gsap", "TweenLite") extern class TweenLite extends Animation {
    function new(target:Dynamic, duration:Float, vars:Dynamic);
    /**
        Target object (or array of objects) whose properties the tween affects.
    **/
    final target : Dynamic;
    /**
        [override] 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.
    **/
    function invalidate():TweenLite;
    static var prototype : TweenLite;
    /**
        Provides An easy way to change the default easing equation.
    **/
    static var defaultEase : Ease;
    /**
        Provides An easy way to change the default overwrite mode.
    **/
    static var defaultOverwrite : String;
    /**
        The selector engine (like jQuery) that should be used when a tween receives a string as its target, like TweenLite.to("#myID", 1, {x:"100px"}).
    **/
    static dynamic function selector(query:String):Dynamic;
    /**
        The object that dispatches a "tick" event each time the engine updates, making it easy for you to add your own listener(s) to run custom logic after each update
        (great for game developers).
    **/
    static var ticker : Dynamic;
    /**
        Provides a simple way to call a () => void after a set amount of time (or frames).
    **/
    static function delayedCall(delay:Float, callback:(args:haxe.extern.Rest<Dynamic>) -> Void, ?params:Array<Dynamic>, ?scope:Dynamic, ?useFrames:Bool):TweenLite;
    /**
        Static method for creating a TweenLite instance that tweens backwards - you define the BEGINNING values and the current values are used as the destination values which is great for doing
        things like animating objects onto the screen because you can set them up initially the way you want them to look at the end of the tween and then animate in from elsewhere.
    **/
    static function from(target:Dynamic, duration:Float, vars:Dynamic):TweenLite;
    /**
        Static method for creating a TweenLite instance that allows you to define both the starting and ending values (as opposed to to() and from() tweens which are based on the target's
        current values at one end or the other).
    **/
    static function fromTo(target:Dynamic, duration:Float, fromVars:Dynamic, toVars:Dynamic):TweenLite;
    /**
        Returns an array containing all the tweens of a particular target (or group of targets) that have not been released for garbage collection yet which typically happens within a few
        seconds after the tween completes.
    **/
    static function getTweensOf(target:Dynamic, ?onlyActive:Bool):Array<TweenLite>;
    /**
        Immediately kills all of the delayedCalls to a particular () => void.
    **/
    static function killDelayedCallsTo(func:(args:haxe.extern.Rest<Dynamic>) -> Void):Void;
    /**
        Kills all the tweens (or specific tweening properties) of a particular object or delayedCalls to a particular () => void.
    **/
    static function killTweensOf(target:Dynamic, ?onlyActive:Bool, ?vars:Dynamic):Void;
    /**
        Permits you to control what happens when too much time elapses between two ticks (updates) of the engine, adjusting the core timing mechanism to compensate and avoid "jumps".
    **/
    static function lagSmoothing(threshold:Float, adjustedLag:Float):Void;
    /**
        Forces a render of all active tweens which can be useful if, for example, you set up a bunch of from() tweens and then you need to force an immediate render (even of "lazy" tweens) to
        avoid a brief delay before things render on the very next tick.
    **/
    static function render():Void;
    /**
        Immediately sets properties of the target accordingly - essentially a zero-duration to() tween with a more intuitive name.
    **/
    static function set(target:Dynamic, vars:Dynamic):TweenLite;
    /**
        Static method for creating a TweenLite instance that animates to the specified destination values (from the current values).
    **/
    static function to(target:Dynamic, duration:Float, vars:Dynamic):TweenLite;
}