How to use JSDoc3 to document nested namespaces

前端 未结 1 953
無奈伤痛
無奈伤痛 2021-01-17 17:16

I\'m having trouble using JSDoc3 to document code that\'s structured along these lines

/**
 * @namespace MyNamespace.MySubNamespace
 */

(function (MyNamespa         


        
相关标签:
1条回答
  • 2021-01-17 18:08

    Figured it out. Hope this solution helps others.

    /**
     * @namespace MyNamespace.MySubNamespace
     */
    
     (function (MyNamespace) {
         /**
          * Foo namespace
          * @namespace Foo
          * @memberOf MyNamespace.MySubNamespace
          */ 
         var Foo = {
             /**
              * Does something.
              * @memberOf MyNamespace.MySubNamespace.Foo
              * @param {object} someParam Some parameter.
              */
             doSomething: function (someParam) {
                 // doing it
             }
         };
         MyNamespace.MySubNamespace.Foo = Foo;
     })(window.MyNamespace)    
    
    0 讨论(0)
提交回复
热议问题