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 definition file for the grpc-web npm package #255

Closed
aberasarte opened this issue Aug 21, 2018 · 7 comments
Closed

Add Typescript definition file for the grpc-web npm package #255

aberasarte opened this issue Aug 21, 2018 · 7 comments

Comments

@aberasarte
Copy link

Now that the grpcweb runtime is available as an npm package 🎉 🎉 , it would be even better if the package could include a Typescript definition file as well. This way, it would be much easier to consume the grpcweb runtime from Typescript code.

If this isn't feasible I'm thinking about submitting a d.ts file to definitely typed but this is not the best solution.

@stanley-cheung
Copy link
Collaborator

We definitely have plan to add an index.d.ts file to the npm package. I tried to use an internal version of the Angular Clutz tool to generate the .d.ts typings - it sort-of works but the output is just a bunch of any and it has these declare namespace ಠ_ಠ.clutz { thing.

The grpc node package hand-writes their index.d.ts file so I might have to do that and it might take a while.

Does anybody know of any other closure to typescript typings generator I can try? Or is there someone with more Typescript experience who can start a general structure of the desired index.d.ts file and I can certainly contribute to the rest of the content? Contributions are definitely welcome!

@jonahbron
Copy link
Collaborator

I might be able to contribute a new file with the basic outline this week.

@glerchundi
Copy link
Collaborator

glerchundi commented Aug 21, 2018 via email

@stanley-cheung
Copy link
Collaborator

I started a PR #258 to show how the index.d.ts might work. Any feedback appreciated!

@stanley-cheung
Copy link
Collaborator

PR #258 merged. The index.d.ts typings should be making it into the next release 0.4.0 currently planned for next week.

After that user should be able to do import * as grpcWeb from 'grpc-web'; after an npm i grpc-web.

@aberasarte
Copy link
Author

Great! Thanks for adding this @stanley-cheung .

@stanley-cheung
Copy link
Collaborator

The npm package version 0.4.0 has been pushed. Please try it out!

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

4 participants