I used https://www.npmjs.com/package/ts-protoc-gen to generate typescript definition.
In my case, I needed to pass in service=grpc-node
param to the --ts_out
. Then I got the correct file generated.
xxx_grpc_pb.d.ts
My full command is sth like
protoc --proto_path={{path to proto files}} \
--plugin=protoc-gen-ts={{path to ts-protoc-gen plugin}} \
--plugin=protoc-gen-grpc={{path to grpc-tools plugin}} \
--plugin={{path to official js plugin downloaded from https://github.com/protocolbuffers/protobuf-javascript release}} \
--js_out=import_style=commonjs,binary:{{generated file path}} \
--grpc_out=grpc_js:{{generated file path}} \
--ts_out=service=grpc-node:{{generated file path}} \