简体   繁体   English

如何使用JSDoc3评论JS模块模式类?

[英]How to comment a JS module pattern class using JSDoc3?

That's the way I actually do this but the private methods and propertys are not visable after I generate the Documentation. 这就是我实际执行此操作的方式,但在生成文档后,私有方法和属性是不可见的。

have I done something wrong? 我做错了什么?

Incidentally, everything else works fine. 顺便说一下,其他一切都很好。 I use the first time a documentation generator, and I'm very impressed. 我第一次使用文档生成器,我印象非常深刻。

/**
 * Constructor Description
 * @constructor
 * @class
 * @classdesc Something about my class Foo.
 */
container.Foo = function() { this.init(); };
container.Foo.prototype = (function() {

  /**
   * @private
   * @name container.Foo~fooPropertyPrivat
   * @property {boolean} fooPropertyPrivat Some description
   */   
  var fooPropertyPrivat = true;

  /**
   * Some description
   * @private
   * @name container.Foo~doSomethingPrivat
   * @memberOf container.Foo
   * @method doSomethingPrivat
   */   
  function doSomethingPrivat() {
      //...
  }

  return {
    /**
     * @public
     * @name container.Foo#fooPropertyPublic
     * @property {boolean} fooPropertyPublic Some description
     */ 
    fooPropertyPublic: true,

    /**
     * Some description
     * @public
     * @constructs
     * @name container.Foo#init
     * @memberOf container.Foo
     * @method init
     */
     init: function() {
       //...
     }
  };
})();

Raphael, I'm glad to hear that JSDoc 3 is working well for you so far! 拉斐尔,我很高兴听到JSDoc 3到目前为止对你有用!

By default, JSDoc omits any symbol tagged with @private . 默认情况下,JSDoc省略了用@private标记的任何符号。 You can override this setting by using the --private command-line option. 您可以使用--private命令行选项覆盖此设置。

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

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