blikblum/slick-router

Add missing types declaration file

BadrChoubai opened this issue · 9 comments

I would like to add the missing type declarations file, this will be my first time contributing to open source and would love to have some back and forth on accomplishing this.

Hi, i would be glad if you do.

My initial idea is writing JSDoc annotation and automatically convert to typings, like described at https://codewithhugo.com/jsdoc-typescript-typings-types-d-ts/

I was unaware that this tool existed, I could go ahead and work on generating the types file, unless you were holding this off for any specific reason.

Please go ahead. I don't know when i will have time to do it myself

Sure thing, I just gave it a small test. It looks like some of the JSdocs are invalid. I'll have to learn more of the codebase before I can fix the errors.

[TSD-JSDoc] browser.js:27:2 Failed to find parent of doclet 'BrowserLocation#getURL' using memberof 'BrowserLocation',
 this is likely due to invalid JSDoc.
[TSD-JSDoc] browser.js:48:2 Failed to find parent of doclet 'BrowserLocation#replaceURL' using memberof 'BrowserLocati
on', this is likely due to invalid JSDoc.
[TSD-JSDoc] browser.js:59:2 Failed to find parent of doclet 'BrowserLocation#onChange' using memberof 'BrowserLocation
', this is likely due to invalid JSDoc.
[TSD-JSDoc] browser.js:67:2 Failed to find parent of doclet 'BrowserLocation#formatURL' using memberof 'BrowserLocatio
n', this is likely due to invalid JSDoc.
[TSD-JSDoc] browser.js:90:2 Failed to find parent of doclet 'BrowserLocation#removeRoot' using memberof 'BrowserLocati
on', this is likely due to invalid JSDoc.
[TSD-JSDoc] browser.js:101:2 Failed to find parent of doclet 'BrowserLocation#destroy' using memberof 'BrowserLocation
', this is likely due to invalid JSDoc.
[TSD-JSDoc] router.js:37:2 Failed to find parent of doclet 'Router#use' using memberof 'Router', this is likely due to
 invalid JSDoc.
[TSD-JSDoc] router.js:50:2 Failed to find parent of doclet 'Router#map' using memberof 'Router', this is likely due to
 invalid JSDoc.
[TSD-JSDoc] router.js:135:2 Failed to find parent of doclet 'Router#listen' using memberof 'Router', this is likely du
e to invalid JSDoc.
[TSD-JSDoc] router.js:161:2 Failed to find parent of doclet 'Router#transitionTo' using memberof 'Router', this is lik
ely due to invalid JSDoc.
[TSD-JSDoc] router.js:178:2 Failed to find parent of doclet 'Router#replaceWith' using memberof 'Router', this is like
ly due to invalid JSDoc.
[TSD-JSDoc] router.js:191:2 Failed to find parent of doclet 'Router#generate' using memberof 'Router', this is likely
due to invalid JSDoc.
[TSD-JSDoc] router.js:215:2 Failed to find parent of doclet 'Router#destroy' using memberof 'Router', this is likely d
ue to invalid JSDoc.
[TSD-JSDoc] router.js:237:2 Failed to find parent of doclet 'Router#isActive' using memberof 'Router', this is likely
due to invalid JSDoc.
[TSD-JSDoc] router.js:253:2 Failed to find parent of doclet 'Router#doTransition' using memberof 'Router', this is lik
ely due to invalid JSDoc.
[TSD-JSDoc] router.js:288:2 Failed to find parent of doclet 'Router#match' using memberof 'Router', this is likely due
 to invalid JSDoc.
[TSD-JSDoc] router.js:385:2 Failed to find parent of doclet 'Router#createLocation' using memberof 'Router', this is l
ikely due to invalid JSDoc.

Seems is needed some comment on top of the class

I added a initial working setup at https://github.com/blikblum/slick-router/tree/add-types . Feel free to use as a basis

BTW: BrowserLocation does not need to be properly typed. Dont bother with it

Hi, did you started work on this?

I have some spare time and can work on it if you did not start

Hi, unfortunately I did not get to it. School started and I had some things to work on personally.

I’m really interested in this project though as it’s a good solution for one of my biggest gripes with wc.