4 ms·
> Very rarely we find a case that we can't cover with JSDoc annotations, and most of the time it means the code could be refactored to be simpler. Can with JSD
by alerighi 3y ago
> Very rarely we find a case that we can't cover with JSDoc annotations, and most of the time it means the code could be refactored to be simpler.
Can with JSDoc define types? And can you define generic types? To me that is the real power of TypeScript, being able to type every object you use.
- mjjp 3y agoYes you can with @typedef and @template
- mdaniel 3y agofor those interested, https://jsdoc.app/tags-template.html https://jsdoc.app/tags-template.html is 404 but https://github.com/google/closure-compiler/wiki/Generic-Types https://github.com/google/closure-compiler/wiki/Generic-Type... appears to be the thing (reinforcing my rage at the JFC situation with JSDoc specification)
- mxkyb 3y agoand you can always define more complex types in interfaces and import into jsdoc.