Skip to content
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

Please review my TypeScript types #110

Closed
altano opened this issue Aug 28, 2023 · 3 comments
Closed

Please review my TypeScript types #110

altano opened this issue Aug 28, 2023 · 3 comments

Comments

@altano
Copy link

altano commented Aug 28, 2023

I'm adding TypeScript types for this library to DefinitelyTyped. Once submitted, people will be able to npm install @types/svgdom to get TypeScript types for this library.

Would anyone be willing to review the types I've created over at https://github.com/DefinitelyTyped/DefinitelyTyped/pull/66501/files?

@Fuzzyma
Copy link
Member

Fuzzyma commented Sep 2, 2023

What are the advantages of having the types over at definitely typed? Why not create a PR for this repo instead?

@altano
Copy link
Author

altano commented Sep 2, 2023

DefinitelyTyped is where the community can fill the gap when maintainers don’t want to do that investment themselves, which seems to be the case here (mainly your comment here). This isn’t a bad thing, of course: you owe us nothing!

The best case scenario is that the library author is interested in owning and maintaining first-party types that ship with the library. The easiest way to accomplish this is to write the lib in typescript and compile to JS and type files, but that isn’t required of course.

The second best outcome is that the community maintains types over at DefiniteyTyped. Anyone can contribute, the bar for contribution is low (I contributed types and had them merged in days), and the types are very discoverable (TS will prompt TS users to install the types I contributed!).

The worst case scenario is you get half-baked or inaccurate types that ship with the lib and the maintainer stops bothering with PRs or is just slow to accept them. This sucks when it happens.

If you’re interested in going from that second category to the first one I can help you convert the codebase to TypeScript. It’s super easy. If you want to ship and maintain first-party types without converting your code (manually maintaining the types) I’d probably be willing to help you with that too, but you’d have to promise to maintain what I contribute and not let it get out of sync with the code (because in that case you’re better off just keeping them at DefinitelyTyped). Let me know!

@altano
Copy link
Author

altano commented Sep 2, 2023

Types merged into DefinitelyTyped. Thanks everyone.

@altano altano closed this as completed Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants