Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to JsDoc multiple inheritance or mixins?

How do I document mixins or multiple inheritance?

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

Parent.prototype.parentTest = 5;

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

Mixin.prototype.mixinTest = 5;

/**
 * @class Child
 * @augments Parent
 * @mixin Mixin
 */
function Child() {
}

Is there anything official from JsDoc? If not then how would you prefer it to be written?

like image 996
Tower Avatar asked Jan 30 '11 14:01

Tower


1 Answers

Multiple @augments are actually supported by the JsDoc Toolkit (I haven't tried, but their unit tests suggest so, search for "multiple").

For Mixins you can make use of @lends and @borrows, see the examples here: http://code.google.com/p/jsdoc-toolkit/wiki/CookBook

like image 146
meyertee Avatar answered Oct 05 '22 11:10

meyertee