LeonardoGentile / mobx-router5

Router5 integration with mobx
MIT License
22 stars 7 forks source link

Typescript #9

Closed omerman closed 6 years ago

omerman commented 6 years ago

Im getting Could not find a declaration file for module 'mobx-router5' from my idea VSCode..

I can see an index.d.ts at the node_modules/mobx-router5/src folder.. and if I manually move it to be present at the root dir node_modules/mobx-router5, then the typings would start working.

Help?

LeonardoGentile commented 6 years ago

Hello, I was not the one taking care of the types definitions, see the PR #6. My typescript experience is very limited, but I guess during the building process the index.d.ts should be moved inside the dist folder, @nrakic90 is that right?

omerman commented 6 years ago

I added a PR for copying the the index.d to the dist :) #10

nrakic90 commented 6 years ago

HI, Moving typings file (index.d.js) doesn't solve the problem entirely in my opinion. When I do that, I'm getting typescript compilation errors. I will also work on this a bit to see what can be done.

nrakic90 commented 6 years ago

I will need to update typings file a bit, just a few lines. @omerman I guess I can do that after your pull request goes through?

omerman commented 6 years ago

The pr only touches the build file, copying it to the dist as part of the build process, so I dont think you need to wait.. :)

nrakic90 commented 6 years ago

Touche. Will get to it.

LeonardoGentile commented 6 years ago

Thanks guys 👍 Travis really got on my nerves today, the builds failed multiple times for unknown reasons, each time it was fixed by purging the cache..

Anyway, I've released the fixes, would you try it and tell me if typing now work as expected?

nrakic90 commented 6 years ago

Upgraded to 4.2.2. I can confirm that typings work in the sense of using types for TypeScript compilation. Cannot confirm about the VS Code issue tho.

omerman commented 6 years ago

Works :sparkles:

snaptopixel commented 6 years ago

FYI, there is no typing for RouterStore.route I'll put a PR together, thanks!