2

I am trying desperately to document a function that returns an ES6 class with JSDoc, and as I use Webstorm, I'd love if it worked with its inspector.

Here is a dummy example:

/**
 * @param {*} foo
 * @return {?????}
 */
const classFactory = (foo) => class {
    constructor() {
        this.bar = foo
    }
}

const MyClass = classFactory('foo')

And I have no idea what return type to give in the JSDoc here...

4

0 回答 0