How can I @link in JSDoc to a method in a class returned by an IIFE?
Due to JS runtime constraints, I need to use an IIFE that returns a class. How can I use {@link } in JSDoc to link to methods in that class? The normal syntax Class.method doesn't work.
const Singleton = (function () {
// IIFE
return class {
init() {
console.log('Spreadsheet clears');
}
};
})();
class Foo {
method() {
console.log('Foo.method');
}
}
class Bar {
/**
* See also {@link Foo.method} and {@link Singleton.init} <-- how can I link to Singleton.init?
* ^ Cmd/Ctrl+click on init doesn't go to the method above.
*/
method() {
console.log('Bar.method');
}
1 comment
Sort by
Date
Votes
Didn't find a way to make this work; please follow https://youtrack.jetbrains.com/issue/WEB-61783/JSDoc-link-members-of-a-class-returned-by-an-IIFE-are-not-navigable for updates
Please sign in to leave a comment.