Is there any plans to generate typescript definition files?
Not yet. Are you aware of any typescript protobuf implementation?
This is needed for my team to adopt this. It has been on my long todo list. My plan was to see what it would take to wrap the NodeJS grpc support with TypeScript and then tackle grpc-web. I was assuming that .t.ds files could be generated for use on top of the existing JavaScript generated code.
It's not as nice as direct typescript but if you're looking for something that works today we're doing protobuf (grpc-gateway annotated) -> swagger -> typescript fetch client. You'll obviously have to run grpc-gateway and are can't use streaming but IMO still much better than writing boilerplate endpoint code.
Sorry for spelling etc on mobile
We are looking into this right now, with Michal etc from improbable.io. Will post our plan here soon.
Magnificent if this happens.
A while back I looked at the protoc javascript generator code to see how things are done but it got a bit lonely.
Would love to be in the loop if at all possible.
@quiasmo
The plan for the typescript support is:
protoc-gen-ts that will code-generate TS definitions for the protoc --js-out= compiled classesprotoc-gen-ts which will build typed interfaces for remote calls. This unfortunately will differ from the nodejs APIs since typescript and EventEmitters don't gel well.We currently are working on rewriting a prototype that we built internally (and is tied to our stack) and making it into proper stand-alone open source projects. Stay tuned.
Just gotta throw this in here:
the TS definitions will make dart much, much easier. And I'm a big fan of dart.
Right, so the ts-protoc-gen plugin is out: https://github.com/improbable-eng/ts-protoc-gen
It currently produces ts.d files for official protobuf/js (i.e. js_out) objects. We're currently in the process of open sourcing our TS interfaces for remote calls. Stay tuned :)
@mwitkow any updates on this so far?
Most helpful comment
Right, so the
ts-protoc-genplugin is out: https://github.com/improbable-eng/ts-protoc-genIt currently produces
ts.dfiles for officialprotobuf/js(i.e.js_out) objects. We're currently in the process of open sourcing our TS interfaces for remote calls. Stay tuned :)