I am trying to use JsDoc to document es6 classes. I can’t believe that you cannot pass a class as a parameter (class type, not instance type).
I tried everything, but I can not get this simple code to work so that JsDoc does not give me any warnings.
I cannot get it to work unless I create @typedef for each of my classes and then manually add all of my own and inherited ones to it. I can’t even make a mix!
Has anyone succeeded in passing a constructor / class parameter? So, is JsDoc in a static context, not an instance context?
class A {
static helloFromClassA(){
}
}
class B extends A{
static helloFromClassB(){
}
}
function fn1(ClassArgument){
ClassArgument.helloFromClassA();
}
function fn2(ClassArgument){
ClassArgument.helloFromClassA();
}
function fn3(ClassArgument){
ClassArgument.helloFromClassA();
ClassArgument.helloFromClassB();
}
function fn4(ClassArgument){
ClassArgument.helloFromClassA();
ClassArgument.helloFromClassB();
}
fn1(B);
fn2(B);
fn3(B);
fn4(B);
JsDoc problem: https://github.com/jsdoc3/jsdoc/issues/1088