tsdoc
tsdoc copied to clipboard
How do I link to a file?
I have used some code from an external package which is not exported and I would like to create some link/see reference to it so others will know where this is coming from and if it is maybe exported in the future to remove it.
Is using @see the right way? I could not find anything about js/tsdoc and file urls. But @link in this case does not really get the file url correctly because of the at in angualr and asks for some hash.

maybe you cna try the import("@angular/.../forms.js") syntax
But I do not want to import something just tell the next person that this is copied from there because it is not exported.
Any solution please post here. It's the most relevant answer to Google search. https://google.com/?q=tsdoc+link+to+file
in vscode u can use :
file://./
aside from that you cna try the markdown syntax [test](link) but ive only gotten that one to work with absolute paths
At this time, it does not seem supported: https://tsdoc.org/pages/tags/link/
I can confirm that the solution from @jonnytest1 works on the command block for vs-code,

but the tooltip doesn't recognize the format

It might be useful if a team mostly uses vs-code, although it would be nice to have something native in the spec.
ok i did a bit more testing :
you can
/**
* @see [text](./file.ts)
*/
this link appears in the tooltip
however this one doesnt work in the editor in vscode 😅 so maybe adding both might be an option
i also dont know if this is a typescript or vscode thing so i cant say for certain wether this will work in other IDEs
How is this still an issue? Just tried it and none of the suggestions above work in Windows. :(
@mctrafik Agreed. Would be a nice feature to have or atleast a recommended work around that works
Any progress? I'm not big on the idea of an import that is otherwise useless.
Shame, I wanted to have a doc that references another type, like {@link import("openai/resources/index.js").ChatCompletionCreateParamsNonStreaming}, but that doesn't seem to work :/