-
Notifications
You must be signed in to change notification settings - Fork 28
Working example(s)? #19
Comments
I've been working with this all day and have nothing. When I reference and import the definition typescript file, I end up with dozens of errors from TypeScript indicating problems like "Declaration or statement expected" etc. which indicate to me the file format generated by Proto2Ts is incorrect. Are there some other constraints to using this library? Like only protobuf 3.x definitions? |
Hei, I'm sorry to hear that. I don't use this library anymore and I don't exactly know in which state it is with the latest releases of Protobuf, Protobuf.js, and TypeScript. It looks like some work is required. |
Did you move on to something more effective/up to date? When you did use the library, was the workflow for this?
|
The problem it's having is type extensions. For example:
I'm poking around in the DUST templates now to see if I can clarify this. |
I don't use Typescript anymore in my professionnals projects :( I merge pull requests time to time, but because I am not an user of this tool, I don't really know in which state it is with the recent versions. When I used the library, it wasn't with ES2015 and |
I've searched for days for a working example of how someone has used this library to work with protocol buffers in TypeScript and have come up with nothing. The example provided in the README.md also indicates a method on ProtoBuf (protobufjs, I assume) that does not presently exist in that library (
protoFromFile
). I admit I'm still learning all the nuances of TypeScript and project configurations, however it would be great to see the source code of a working example for using this library and protobufs in general.For my particular use case, I have a library that I'm porting from JS/Angular1 to TS/Angular2 as a ES2015 module, and it has some protocol buffers defined in it. I've tried going through the process of converting the proto files to JSON, and then from JSON to typings definitions as indicated in the README.md. I then installed those definitions (d.ts) into my global typings (
typings install --global --save file:<path>/file.d.ts
). When I then try to reference the default module name generated by this tool, Proto2TypeScript, in my TypeScript files, I get: Cannot find namespace 'Proto2TypeScript'. I also cannot import that module name, etc. which leaves me wondering what part of this process is actually broken since there is no end-to-end example that I can find.The text was updated successfully, but these errors were encountered: