使用JSDoc记录成员函数 [英] Documenting member functions with JSDoc
本文介绍了使用JSDoc记录成员函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这样的事情:
/**
Diese Klasse bla bla...
@constructor
**/
my.namespace.ClassA = function(type)
{
/**
This function does something
**/
this.doSomething = function(param){
}
}
该类将在生成的文档中列出。该功能不会。有没有办法告诉JSDoc(3)这是类的成员函数 ClassA
?
The class will get listed in the generated documentation. The function won't. Is there a way to tell JSDoc (3) that this is a member function of the class ClassA
?
推荐答案
JSDoc需要一些额外的信息来将该函数识别为成员函数:
JSDoc needs some additional information to recognize the function as 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){
}
}
这篇关于使用JSDoc记录成员函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文