-
-
Notifications
You must be signed in to change notification settings - Fork 983
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
Export typescript definitions #1279
base: master
Are you sure you want to change the base?
Export typescript definitions #1279
Conversation
I just read the TS docs and if I have read it correctly, it says we should get rid of the https://www.typescriptlang.org/docs/handbook/namespaces-and-modules.html#needless-namespacing |
Ah yes you're right! I've also removed the namespace for the React module. Hope that's ok! |
Thanks, I will take a look in the morning when I'm a little less tired. I hope to get version 5.2 out later this week, which will also include #1278, which should finally fix the last perf bottleneck. |
Having slept on this, is removing the namespaces a breaking change? |
@davidjbradshaw after a chat with Gion, we can also remove the module declarations. As the typescript definition files are bound to the packages via the generated package.json files "types" properties (Done via the rollup package plugin). This way you don't need to manually change the module declarations, should the package names change in the future. We also re-checked the possible breaking change for the React module and it's not a breaking change. The used "export = ..." declaration from before, is in fact Node's way of definieng a default export. |
IMO this should be enough to make the definitions importable/usable in third party Typescript applications, using the iframe-resizer as an npm dependency.