documentationjs / documentation

:book: documentation for modern JavaScript
http://documentation.js.org/
Other
5.78k stars 482 forks source link

Does this support TypeScript typings in JSDoc? #1612

Closed goldingdamien closed 11 months ago

goldingdamien commented 11 months ago

Can I use TypeScript typings in JSDoc comments and still get full documentation? Are there any restrictions that should be known?

Regards.

Examples:

/**
* @typedef {import('my-ts-file-or-library').ExportedType} ExportedType
* @typedef {Record<Exclude<"A"|"B"|"C", "C">, string>} InlineTypeScript
*/

/**
* @param {ExportedType} a
* @param {InlineTypeScript} b
*/
function myFunction (a, b) {}
goldingdamien commented 11 months ago

Related issues:

tmcw commented 11 months ago

Currently, no - TypeScript types aren't supported in JSDoc comments. The TypeScript syntax and semantics are expansive and to support it this tool would have to integrate much more tightly with the TypeScript compiler itself.