agreatfool / grpc_tools_node_protoc_ts

Generate TypeScript d.ts definitions for generated js files from grpc_tools_node_protoc
MIT License
498 stars 56 forks source link

help with make a props read for nestjs framework #112

Closed gtsigner closed 3 years ago

gtsigner commented 3 years ago

it's the best tool to gen typescript for project but it's maybe miss some props read like this https://www.npmjs.com/package/protoc-gen-ts

https://www.npmjs.com/package/protoc-gen-ts this lib is gen only interface api to read props like object, when im using nestjs DI feature like this image it will not inject the LoginRequest object and therefore lacks the get set

gtsigner commented 3 years ago

hope there is one way to convert a interface object to pb object

gtsigner commented 3 years ago

or there is one way direct to access props instead of get set method

agreatfool commented 3 years ago

Sorry, I didn't get the point. What feature actually you want? I'm not familiar with the DI feature of nestjs, a bit confused.

I guess you want

messageObject.someAttr

and now the coding style is

messageObject.getSomeAttr()

Am I correct?

One thing to mention is this repo is aiming to generate d.ts for the js codes generated by grpc_tools_node_protoc. So for the features you want, you may need to raise ticket here: https://github.com/grpc/grpc-node.

gtsigner commented 3 years ago

Sorry, I didn't get the point. What feature actually you want? I'm not familiar with the DI feature of nestjs, a bit confused.

I guess you want

messageObject.someAttr

and now the coding style is

messageObject.getSomeAttr()

Am I correct?

One thing to mention is this repo is aiming to generate d.ts for the js codes generated by grpc_tools_node_protoc. So for the features you want, you may need to raise ticket here: https://github.com/grpc/grpc-node.

Yes i want this like what you say. thanks. i got it, i will publish a issue to grpc_tools_node_protoc