logoalt Hacker News

culilast Monday at 12:06 AM1 replyview on HN

Care to give an example? In another reply I pointed out how advanced JSDoc syntax's support for generics is.[0] Even allowing for `extends` and default values for generic slots.

The clunkiest part is in the way you "pass in" a generic to a slot. But this is solved by typing the return type.

I use generics pretty extensively and I've not yet come across a use-case JSDoc couldn't handle

[0] https://news.ycombinator.com/item?id=46267810


Replies

paulddraperlast Monday at 3:51 PM

Ah.....you're putting TypeScript in JSDoc annotations.

Which is a lot different than vanilla JSDoc [1].

I understand.

[1] https://jsdoc.app/

show 1 reply