3

See example I trying to use autocompletion and document code together but @param information is ignored - how to do jsdoc correctly?

/**
 * @constructor
 */
function WhiteClass() {
    this._rgb = [1.0, 1.0, 1.0]
}

/**
 * @constructor
 */
function ColorClass() {

}

ColorClass.prototype = {
    constructor: RedClass,

    /**
     * @param {WhiteClass} whiteInstance
     */
    attachWhite: function (whiteInstance) {
        this._white = whiteInstance;
        /** @type {WhiteClass} */
        this._white2 = whiteInstance;
    },

    otherAction: function() {
        // this._white. <- autocompletion not works since type is any @param is ignored - how to make @param working?
        // this._white2. <- autocompletion works but @param is ignored only @type is used
    }
}
4

0 回答 0