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
Declare Typescript modules in IO packages #1298
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this seems fine. It would be helpful if you gave some additional details in the PR write up however. Questions:
- What is this fixing?
- How can I repro/verify the changes have made an improvement?
- What good does it do to
declare module
for the IO packages if they don't actually contain any type definitions yet? - We have usually followed the convention of putting
.d.ts
files in thesrc
directory, next to the files they provide types for. So I think it would be more consistent to move yourtypes/index.d.ts
files tosrc/index.d.ts
and updatepackage.json
accordingly. Is there a benefit to having the types in their owntypes
directory?
Sorry for the lack of information in this PR. The issue I was having was when I tried to import an IO package in my project I would get the following error:
Simply adding the module declaration resolved the error, Im not sure if this is the best way to solve this but may be a good enough interim solution until proper Typescript support is added? I added a seperate types directory as I noticed that is the way it was done in the regl-renderer package, did not check the other packages, I can move it to src/index.d.ts if you prefer? |
After adding this interim solution, was there any typing available for the deserialize / serialize functions? Were you able to use the exports of the IO packages? |
@bruceborrett sorry. that was a question for you. Were you able to import and use the IO libraries after these definitions were added? Also, please move the type definitions into src/index.d.ts |
@bruceborrett Sorry. Can you move the changes to src/index.d.ts ? |
All Submissions:
Thank you for your help in advance, much appreciated !