-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
index.d.ts in base folder is causing issue with TypeScript #44
Comments
Also trying to solve this. I believe it is related to babel 6+ changes, as referenced here. Unfortunately, I haven't been able to figure out the proper structure yet. I'll issue a pull request if I manage to figure out the syntax that TypeScript wants here. |
Thanks @dballance, that is good information to know. I see that the type definitions were submitted to DT but were closed a few days ago I would think the best solution would be to have the type definitions separate from the actual repository if possible. Removing the index.d.ts file from the base directory is what solved the problem for me. cc @droritos |
If that's causing problems I don't mind moving the typing to DT. |
I get the same error with 1.7. I'm not sure about the auto-discovery of .d.ts files, that would be nice though. Either way, this should probably be renamed to something other than index.d.ts? I think it's tripping up the compiler which is trying to treat it as the entrance to this module. Similar to this discussion. |
The root issue here is the index.d.ts file needs to be updated to act like a external Typescript module, and not like an internal module. I ran into the same problem with some definitions I added to the redux-ui-router library, and required a simple fix to get things working without errors: neilff/redux-ui-router#30. As for the DT typings, I suggest that once we correct this index.d.ts file to have the right format, you remove the DT typings from your code base. The use of index.d.ts was added to let lib authors include the typings directly with a package, and not force users to get them from somewhere else. I'm happy to submit a PR that fixes the issue. |
I just tested declaring the typings as external modules as @sstorie said and it works great, so this is the way to go. |
Released on npm @ |
Thank you @wbuchwalter |
I installed latest
ng-redux
module and put it into my project using browserify + tsify (I'm using TypeScript). I've also included the type definitions from the DT repo.When I include this lib in my project via
import 'ng-redux'
, I get the following error:If I move
index.d.ts
outside the folder, it will compile properly and include the lib in my project.Is it possible to move this file into
dist
folder or another location?BTW thanks for making this lib, it's very helpful when using redux with ng1!
The text was updated successfully, but these errors were encountered: