如何JsDoc多重继承或混合? [英] How to JsDoc multiple inheritance or mixins?

查看:241
本文介绍了如何JsDoc多重继承或混合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何记录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() {
}

JsDoc有什么官方?如果不是,那么你会喜欢写什么?

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

推荐答案

多个 @augments 实际上是由JsDoc Toolkit支持的(我没有尝试过,但他们的单元测试建议,搜索multiple)。

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

对于Mixins,您可以使用 @lends @borrows ,请参见以下示例: http://code.google.com/p/jsdoc-toolkit/wiki/CookBook

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

这篇关于如何JsDoc多重继承或混合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆