简体   繁体   English

JSDoc:如何声明内联参数

[英]JSDoc : How to declare inline params

I can't get jsdoc 3.5.5 to generate docs for inline comments.我无法使用 jsdoc 3.5.5 来生成内联注释的文档。 Please see the attached example:请参阅附件示例:

/**
 * my TestCase Class
 */
class TestCase {

    doesntWorkA(/** String */ str) /** Number */ {
        return 5;
    }

    doesntWorkB(/** @type {String} */ str) /** @type {Number} */ {
        return 5;
    }


    /**
    * @param {String} str
    * @return {Number}
    */
    works(str) {
        return 5;
    }
}

Here is an example that shows how to use it inline:这是一个示例,展示了如何内联使用它:

 hooks.run.tap('xxxx',/** @param {WebpackCompilation} compilation */ compilation => {
  ...
 });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM