Open storymessinger opened 7 years ago
+1
+1
+2
+10
+1
+1
Can you please add this functionality @janpaepke
+233
I think it is already sort of time to do it by ourselves, guys? Who have some spare time to join me?
I have only concerns that project owner will pick it up for supporting afterwards...
Anyone know an alternative to ScrollMagic that can work with typescript?
In the mean time, how could I ignore / write a type definition for this:
const sm = new $.ScrollMagic.Scene(options)
.duration(sectionHeight)
.setClassToggle(linkSelector, 'is-active');
Error:
[tsl] ERROR in /home/x/work/develtech/based/ux/js/toc-scroller.ts(213,24) │
TS2339: Property 'ScrollMagic' does not exist on type '{ (selector: any, context: any): any; fn: { [x: string]: any; jquery: string; c│
onstructor: any; length: number; toArray: () => any; get: (num: any) => any; pushStack: (elems: any) => any; each: (callback: any) => any; .│
.. 8 more ...; splice: { ...; }; }; ... 37 more ...; noConflict(deep: any): any; } | ((w: any) => ...'. │
Property 'ScrollMagic' does not exist on type '{ (selector: any, context: any): any; fn: { [x: string]: any; jquery: string; constructor: │
any; length: number; toArray: () => any; get: (num: any) => any; pushStack: (elems: any) => any; each: (callback: any) => any; ... 8 more ..│
.; splice: { ...; }; }; ... 37 more ...; noConflict(deep: any): any; }'.
Anyone want to do a typings PR with me?
@wbhob We can PR it against https://github.com/DefinitelyTyped/DefinitelyTyped.
I'm happy to help facilitate, but I'm too new to typescript to lead it.
We should do it for ScrollMagic and for jquery.scrollmagic.
https://github.com/basp/flow/blob/22928779146d0732502110a56fdec235e84f9a21/scrollmagic.d.ts
https://github.com/Redhotminute/kali/blob/177a542304adeefdf16a053df8f0164b07f55921/scrollmagic.d.ts
@phanronald are you okay licensing your ScrollMagic / Tweenmax typing MIT and putting them into DefinitelyTyped? Or giving us permission to do so?
@tony @wbhob Sure, you can use what I have if you think it will help you, though it's outdated and you would need to do an import instead of a reference of tweenmax. Also note that the tweenmax.d.ts already exists on DefinitelyTyped.
I'm probably abandoning my attempt.
I just can't get custom type definitions to play with with my webpack setup. I can't spend any more time on trying to make this work, I'm better off finding another solution or writing it from scratch in typescript.
The other thing is in my personal project, I had jQuery everywhere, so have to remove that as a dependency.
it would be great if there could be d.ts file for the awesome scrollmagic :)
Any plans? Thanks!