Skip to content

Conversation

@louwers
Copy link

@louwers louwers commented Oct 11, 2025

This takes a different approach than #107, #137 and #138.

Instead of modifying the existing JavaScript code generator to also support TypeScript output, this leaves the JavaScript code generator completely intact while adding support for generating TypeScript declarations.

The pbf script outputs to stdout. I did not want to change that, so you have to call it twice if you want to use it. For example:

input=example.proto

pbf $input > $input.js
pbf $input --ts-declarations  > $input.d.ts

I have updated the fixtures. Please help me verify the output is correct by checking the .d.ts files in this PR and by using the generator on your projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant