Re:Node.js adds experimental support for TypeScript
by adhamsalama on Thursday July 25, 2024 @04:20AM
(#41066174)
You can write TypeScript types in JSDoc.
[ Parent
| on HN ]
Re:Node.js adds experimental support for TypeScript
by sureIy on Thursday July 25, 2024 @06:51AM
(#41067055)
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)