Skip to content

Add Typescript support#50

Merged
inxilpro merged 2 commits intoinxilpro:masterfrom
douira:patch-1
Aug 2, 2022
Merged

Add Typescript support#50
inxilpro merged 2 commits intoinxilpro:masterfrom
douira:patch-1

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.

3 participants