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

Add Typescript support #50

Merged
merged 2 commits into from Aug 2, 2022
Merged

Add Typescript support #50

merged 2 commits into from Aug 2, 2022

Conversation

douira
Copy link
Contributor

@douira douira commented Sep 16, 2021

This PR simply adds a small declaration file that declares the types of the methods exposed by the exported object.

@douira douira marked this pull request as ready for review September 16, 2021 21:54
@douira
Copy link
Contributor Author

douira commented Sep 16, 2021

I just noticed this might be slightly unnecessary as there are already typed on DefinitelyTyped. idk, you decide if you want to have this.

@inxilpro
Copy link
Owner

Is it better to have it in the library itself instead of in DefinitelyTyped? I don't use TypeScript so I'm not sure what the best practice is here.

@douira
Copy link
Contributor Author

douira commented Sep 17, 2021

You need to install an @type package additionally if it's published by DefinitelyTyped. (you can also publish it to @type/... yourself I think) If it's in the package itself the maintainer may have a better idea of what the types should be (and more control). Right now types can be downloaded on DefinitelyTyped so there's no problem really.

@bfaulk96
Copy link

I'd say in general it's better to have it in the library itself when possible, as you don't need to keep two separate repos (one of them a ridiculous monorepo in DefinitelyTyped/types)

@inxilpro inxilpro merged commit 506c98d into inxilpro:master Aug 2, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants