JSDoc and singleton JavaScript documentation

I have a singleton JavaScript that is defined as:

/**
 * A description here
 * @class
 */
com.mydomain.ClassName = (function(){

/**
 * @constructor
 * @lends com.mydomain.ClassName
 */ 
var ClassName = function(){};

/**
 * method description
 * @public
 * @lends com.mydomain.ClassName
*/
ClassName.prototype.method1 = function(){};

return new ClassName();

})();

No warnings are printed in verbose mode (-v), but the documentation only says "com.mydomain.ClassName ()" with "Description here" as a description ... how can I create documentation for ClassName methods?

+5
source share
1 answer

I decided!:)

  /**
 * A description here
 * @class
 */
com.mydomain.ClassName = (function(){

/**
 * @constructor
 * @name com.mydomain.ClassName
 */ 
var ClassName = function(){};

/**
 * method description
 * @public
 * @name com.mydomain.ClassName.method1
*/
ClassName.prototype.method1 = function(){};

return new ClassName();

})();

I just replaced @lends with @name!

UPDATE: the right approach for complete documentation:

/**
 * A description here
 * @class
 */
com.mydomain.ClassName = (function(){

var ClassName = function(){};

/**
 * method description
 * @memberOf com.mydomain.ClassName
*/
ClassName.prototype.method1 = function(){};

return new ClassName();

})();
+7
source

All Articles