Documenting member functions using JSDoc

I have something like this:

/** Diese Klasse bla bla... @constructor **/ my.namespace.ClassA = function(type) { /** This function does something **/ this.doSomething = function(param){ } } 

The class will be displayed in the generated documentation. Function will not be. Is there a way to tell JSDoc (3) that this is a member function of ClassA ?

+4
source share
3 answers

JSDoc needs additional information to recognize a function as a member function:

 /** * Diese Klasse bla bla... * @constructor */ my.namespace.ClassA = function(type) { /** * This function does something * @function * @memberOf my.namespace.ClassA */ this.doSomething = function(param){ } } 
+3
source

Try it!

 /** * Diese Klasse bla bla... * @constructor */ my.namespace.ClassA = function(type) { /** * This function does something * @function doSomething * @memberOf my.namespace.ClassA# */ this.doSomething = function(param){ }; }; 

JSDoc seems rather awkward in this area: / The key should indicate both memberof and the function name. See also .

+9
source

You need to explicitly describe the function using the full path to the name. There are three types of namepath syntax for describing functions:

 Person#say // the instance method named "say." Person.say // the static method named "say." Person~say // the inner method named "say." 

See this page for more details.

0
source

All Articles