mapbox / pbf

A low-level, lightweight protocol buffers implementation in JavaScript.
BSD 3-Clause "New" or "Revised" License
796 stars 106 forks source link

Add JSDoc support #137

Open stepankuzmin opened 1 month ago

stepankuzmin commented 1 month ago

Different approach to https://github.com/mapbox/pbf/pull/107. Adds --jsdoc option to generate type annotations.

aberrier commented 3 days ago

I am currently using pbf with Typescript and the implementation of JSDoc is a nice and elegant feature to get type hints understandable by Typescript compilers. Big plus for the compact and minimal implementation ! 👏

Is there any blockers to merge this and integrate it in the next release ?

stepankuzmin commented 3 days ago

Hey, @aberrier, thanks for trying this implementation! It is working for me as well. I've planned to add more tests for this, like the ones in the types/ folder, before marking this as ready for review.

Another approach for TypeScript support might also be considered in https://github.com/mapbox/pbf/pull/138. I'm not sure what the best option here, but implementing JSDoc support is less intrusive and easier to review, in my opinion.