-
Notifications
You must be signed in to change notification settings - Fork 24
Add typescript declaration file #28
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
Add typescript declaration file #28
Conversation
|
Thank you very much for the PR Christian.
/cc @akwodkiewicz as they provided the current definitions via DefinitelyTyped/DefinitelyTyped#62942 |
|
Hey @lovell, thanks for the tip to use Handling the deprecation process seems pretty straight forward, so I can take care if @akwodkiewicz is not interested. |
lovell
left a comment
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.
Thanks for the tests, one question inline otherwise this looks great.
lovell
left a comment
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.
LGTM, thank you. I'll leave this PR open for now to let @akwodkiewicz and @devongovett have a chance to comment if they wish.
|
@atombrenner Should we close this PR and continue discussion using #30 ? |
|
Closing as superseded by #30 |
|
Sorry for joining this late to the conversation. My contribution to DT was a "path of least resistance"-approach to typings. I wanted to have the package behave correctly in my side project, and I decided to share this so that nobody will be forced to recreate the very same types themselves. I was counting on somebody to upgrade my work when they realized there's more to be done, though 😄 It's great you decided to include the types within the package. Is there anything I should do regarding DT (e.g. delete types from there)? |
|
@akwodkiewicz Thanks for the background, feel free to review #30 if it might be of interest to you. Once that PR is merged and published then I'm sure any help to deprecate/remove the DT-based definitions would be most welcome. |
This PR adds a typescript definition file the the package, see #27
It allows typescript users to directly use this package without installing another dependency from DefinitelyTyped.
It allows the maintainer to add/change/remove types and keep the type definitions in sync with the implementation.
In addition to the existing type annotation at DefinitelyTyped, most tags have now more specific types, e.g.
ImageWidthis now of typenumberwhich is more precise thanunknown.The tag names were automatically generated from tag.js. During that processed I noticed, that tag.s uses the same tag name for different tags (e.g. the
WhiteBalancetag). That makes typing hard, because at runtime it depends on the image which tag is returned. The last encountered one overwrites existing tags. I don't know if this is a bug or a feature, but in those cases we can only return a generic tag type, which is