Publish TypeScript types with package
See original GitHub issueCongratulations on releasing the big ES modules rewrite! I gave it a try in a simple toy app, and it works wonderfully. It was great to see tree-shaking working correctly!
The only feedback I have is that it’d be really nice to have the TypeScript definitions published as part of the package instead of a separate @types
package. This would ensure that all consumers of v7 and up are able to use the package with TypeScript without installing another package that is potentially out of date. As an example, I’m unable to test the new v7 beta in my TypeScript projects since the published types are only for v3. In order to use the beta, I’d need to write my own declaration file, and if I’m doing that I figured I might as well offer to do it officially.
If you’re interested, I’m willing to write new type declarations and send a PR adding them.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:9 (4 by maintainers)
Top GitHub Comments
@types/uuid@7.0.0
has finally been released and should fix this issue.As mentioned above I’m happy to update the TypeScript definitions over at DefinitelyTyped if the API surface of this module changes, but I will follow the official recommendation of not bundling the type definitions into this module as long as it is not written in TypeScript.
Right now I cannot upgrade to
uuid
v7 because my app/lib is written in TypeScript so it also needs @types/uuid which, right now, is still 3.4.7.Please, consider adding TypeScript into
uuid
itself. If you don’t want, you don’t need to rewrite the whole code to TS but just add a"types": "index.d.ts"
inpackage.json
and create aindex.d.ts
that exposes the public library API in TypeScript. Something like this:https://github.com/ibc/h264-profile-level-id