Hacker News new | ask | show | jobs
by adhamsalama 700 days ago
You can write TypeScript types in JSDoc.
1 comments

You can’t write complex TypeScript types in JSDoc, which is what GP said.

The moment you need to declare or extend a type you’re done, you have to do so in a separate .ts file. It would be possible to do so and import it in JSDoc, but as mentioned before it’s a huge PITA on top of the PITA that writing types can already be (e.g. function/callbacks/generics)