GSAP icon indicating copy to clipboard operation
GSAP copied to clipboard

export TweenVars type

Open monolithed opened this issue 7 months ago • 5 comments

Please export the TweenVars type so that the configuration can be reused. Right now, due to the two overloaded to functions, TypeScript can't correctly infer the type using Parameters.

function to(targets: TweenTarget, vars: TweenVars): core.Tween;
function to(targets: TweenTarget, duration: number, vars: TweenVars): core.Tween;
type TweenVars = Parameters<typeof gsap.to>[1];


... 

{ease}

^ 
TS2339: Property ease does not exist on type Number

I see that the second overloaded to function is deprecated, but it would be preferable to get the type directly without relying on any workarounds.

monolithed avatar Jun 02 '25 07:06 monolithed

you can use TweenVars from gsap

import gsap from 'gsap'
let animation: gsap.TweenVars;

Timi-Leyin avatar Jun 04 '25 20:06 Timi-Leyin

@Timi-Leyin gsap.TweenVars isn't exported

Image

monolithed avatar Jun 05 '25 04:06 monolithed

@monolithed I’d like to work on it. Could you please assign it to me?

anya-xcode avatar Nov 13 '25 11:11 anya-xcode

jackdoyle

monolithed avatar Nov 13 '25 16:11 monolithed

We'll add that export in the next release. Thanks for pointing it out.

jackdoyle avatar Nov 13 '25 17:11 jackdoyle