语法
¥Syntax
@classdesc <some description>
概述
¥Overview
@classdesc 标签用于提供类的描述,与构造函数的描述分开。将 @classdesc 标签与 @class (or @constructor) tag 结合使用。
¥The @classdesc tag is used to provide a description for a class, separate from the constructor function's description. Use the @classdesc tag in combination with the @class (or @constructor) tag.
JSDoc 3 中 @classdesc 标记的功能与以前版本中的 @class 的功能相同。从版本 3 开始,@class 标记的语法和功能现在与 @constructor 标记完全匹配,并且 @classdesc 标记更明确地传达了其用途:记录类的描述。
¥The functionality of the @classdesc tag in JSDoc 3 duplicates that of the @class in previous versions. As of version 3, the syntax and functionality of the @class tag now exactly matches the @constructor tag, and the @classdesc tag more explicitly communicates its purpose: to document a class's description.
示例
¥Examples
如下所示,一个类有两个地方可以描述,一个适用于函数本身,另一个适用于整个类。
¥As shown below, a class has places for two descriptions, one applies to the function itself, while the other applies to the class in general.
/**
* This is a description of the MyClass constructor function.
* @class
* @classdesc This is a description of the MyClass class.
*/
function MyClass() {
}