Question

How do I document a member function from a father class. There is a class A with a member function Afunc(), and I am gonna document class B extends A. I do not overwrite Afunc() in B, yet I need the function Afunc() appear in my document, how do I do it?

I wrote

/**
 * description
 * @function Afunc
 * @memberOf A
 */

It works that appears Afunc in the document, yet there is a <static> tag at the start of the function name. How do I solve it? Thanks everyone.

Was it helpful?

Solution

jsdoc 3.2.2 does what you want by default. In this example, the method B.foo will automatically be documented because B extends A and does not override foo:

/**
 * @class
 */
function A() {
}

/**
 * Foo the flerbl.
 * @param {Object} flerbl The flerbl.
 */
A.prototype.foo = function (flerbl) {
};

/**
 * @class
 * @extends A
 */
function B() {
}

B.prototype = new A();

Otherwise, you must use # in your @memberof tag to mark the object as an belonging to an instance of the class:

/**
 * description
 * @function Afunc
 * @memberof A#
 */
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top