@cldcvr/protobufjs-typescript-gen is a tool which used protocol buffers to generate a Typescript interface. The tool is currently highly opinionated in how it generates files. It internally uses protobuf.js.
protobuf.js is a pure JavaScript implementation with TypeScript support for node.js and the browser. It's easy to use, blazingly fast and works out of the box with .proto files!
$> npm install @cldcvr/protobufjs-typescript-gen [--save --save-prefix=~]
// generate-protocol.js
const { generateProtocol } = require('@cldcvr/protobufjs-typescript-gen');
generateProtocol({
protocolDir: 'YOUR_PROTOCOL_DIRECTORY',
outDir: 'YOUR_OUTPUT_DIRECTORY',
});
$> node generate-protocol.js
Please see the examples folder for the structure of the generated interface.