Skip to content

Does this support TypeScript typings in JSDoc? #1612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
goldingdamien opened this issue Jul 13, 2023 · 2 comments
Closed

Does this support TypeScript typings in JSDoc? #1612

goldingdamien opened this issue Jul 13, 2023 · 2 comments

Comments

@goldingdamien
Copy link

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
Copy link
Author

@tmcw
Copy link
Member

tmcw commented Jul 14, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants