Post AlR4XTehSWdvAOaK7U by bart@floss.social
 (DIR) More posts by bart@floss.social
 (DIR) Post #AlQnGxHmLJE8v5OpeK by aral@mastodon.ar.al
       2024-08-28T16:25:35Z
       
       0 likes, 0 repeats
       
       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#JSDoc #TypeScript #web #dev
       
 (DIR) Post #AlR4XTehSWdvAOaK7U by bart@floss.social
       2024-08-28T19:39:04Z
       
       0 likes, 0 repeats
       
       @aral I don't understand. ```jsclass 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();```
       
 (DIR) Post #AlUswMHDbmXchhXTwu by aral@mastodon.ar.al
       2024-08-30T15:47:59Z
       
       0 likes, 0 repeats
       
       @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.)