如何记录具有嵌套结构的 ES6 class 成员?

How to Document ES6 class members with nested Structures?

是否有公认的方式(最好是 IDE 兼容)来记录 ES6 中的形状嵌套成员?

例如

class Foo extends React.Components {
    constructor(props) {
       super(props);
       this.props.bar; // Webstorm for example will think 'bar' is not a member of props
    }
}

我们可以做些什么来帮助 IDE 了解我们 class 成员的预期结构?类似于:

/** @member {string} props.bar **/ 

在 class 声明或构造函数的顶部

@property 有点效果,但感觉不稳定。

/**
 * @property {object} props
 * @property {number} props.bar
 */
class Foo extends React.Components {
    constructor(props) {
        super(props);
    }
}

丑得要命,但工作起来就像发条一样:

class Foo extends React.Components {
    constructor(props) {
        super(props);

        /** @type {{foo: {bar: {}}}} */
        this.props = this.props;
    }
}