But, is it possible to write some kind of extension in order not to call every time gsap.utils.SelectorFunc; gsap.to(this.q(selector), {...})?
Something like the following:
declare global {
interface gsap {
hosto(
tl: gsap.core.Timeline,
targets: gsap.TweenTarget,
vars: gsap.TweenVars,
position?: gsap.Position | undefined):gsap.core.Timeline;
}
}
gsap.prototype.hosto = function(
tl: gsap.core.Timeline,
targets: gsap.TweenTarget,
vars: gsap.TweenVars,
position?: gsap.Position | undefined?gsap.core.Timeline {
// where this.host is gsap.utils.SelectorFunc;
return tl.to(this.host(targets), vars, position);
}