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

Include types #35

Open
gregbacchus opened this issue Aug 6, 2020 · 2 comments
Open

Include types #35

gregbacchus opened this issue Aug 6, 2020 · 2 comments

Comments

@gregbacchus
Copy link

It would be great if this project included types to improve its compatibility with typed languages such as TypeScript.

@usulpro
Copy link
Member

usulpro commented Aug 28, 2020

Yes such PR would be very appreciated 👍

@gregbacchus
Copy link
Author

I went to have a look at this but it wasn't clear to me how this is being deployed to npmjs, so I could't modify the process to include the types.

What needs to be done is

npx typescript 'src/index.js' --declaration --allowJs --emitDeclarationOnly --outDir dist

as part of the build for deployment.

Then add the following to package.json

"types": "dist/index.d.ts",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants