Almost another year has passed and it’s still not possible to use JSDoc and have the TypeScript LSP understand when you’re referring to a class and when you’re referring to an instance…
*sigh*
https://github.com/jsdoc/jsdoc/issues/1349#issuecomment-1725400751
@aral I don't understand.
```js
class Base {
bla() {
console.log("base");
}
};
class Derived extends Base {
bla() {
console.log("derived");
}
};
/**
* @template {Base} T
* @param {T} base
*/
function fun(base) {
base.bla();
}
fun(new Base());
fun(new Derived());
/**
*
* @param {typeof Base} cls
*/
function makeBase(cls) {
return new cls();
}
makeBase(Base).bla();
makeBase(Derived).bla();
```
@bart I explained my use case in the linked comment. I don’t see how the use of @template can fix that. (It’s possible I’m missing something.)