语法
🌐 Syntax
@classdesc <some description>
概述
🌐 Overview
@classdesc 标签用于为类提供描述,与构造函数的描述分开。将 @classdesc 标签与 @class(或 @constructor) 标签 一起使用。
🌐 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.
@classdesc 标签在 JSDoc 3 中的功能重复了之前版本中 @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() {
}