blokur / grpc-ts-demo

🎵 Demo of a gRPC client and server implementation in TypeScript
MIT License
124 stars 30 forks source link

great demo #9

Open jimtang9527 opened 3 years ago

jimtang9527 commented 3 years ago

There is no best practice for combining grpc and typescript. Until I saw this demo. Thank you @mschristensen .

jimtang9527 commented 3 years ago

the last version grpc_tools_node_protoc_ts will encounter errors like "Index signature is missing in type". image

` class SongsServer implements ISongsServer { {

// others ...

} `

davecusatis commented 3 years ago

a solution that worked for me was to implement they interface with the string key like vscode suggests - [name: string]: grpc.UntypedHandleCall; above all the other function implementations. There's probably a better more idiomatic typescript way to do this but that should work