简体   繁体   English

如何在JSDoc3中正确记录此代码

[英]How to document this code properly in JSDoc3

How to document this code properly in JSDoc3? 如何在JSDoc3中正确记录此代码?

var Foo,
    doFoo;

/**
 * What JSDoc string should go here ...
 */
doFoo = function () {};

/**
 * @constructor
 */
Foo = function () {};

/**
 * ... and here ..
 */
Foo.doFoo = doFoo;

/**
 * ... and here ..
 */
Foo.prototype.doBar = doFoo;

/**
 * ... and here?
 */
Foo.prototype.doBoo = doFoo;

Help will be appreciated.. 帮助将不胜感激..

The tag you are probably looking for is @method ( http://usejsdoc.org/tags-method.html ), which lets the parser know that something that might not look like a function is actually a function. 您可能正在寻找的标签是@methodhttp://usejsdoc.org/tags-method.html ),它使解析器知道看起来不像函数的东西实际上是一个函数。

You can also use @link ( http://usejsdoc.org/tags-link.html ) to point to the description of the original function declaration if you don't want to duplicate descriptions. 如果您不想重复描述,也可以使用@linkhttp://usejsdoc.org/tags-link.html )指向原始函数声明的描述。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM