JSDoc 中文网

语法

¥Syntax

@kind <kindName>

其中 <kindName> 是以下之一:

¥where <kindName> is one of:

概述

¥Overview

@kind 标签用于记录正在记录的符号类型(例如,类或模块)。符号的种类不同于符号的类型(例如,字符串或布尔值)。

¥The @kind tag is used to document what kind of symbol is being documented (for example, a class or a module). The kind of symbol differs from a symbol's type (for example, string or boolean).

通常你不需要 @kind 标记,因为符号的种类由 doclet 中的其他标记确定。例如,使用@class 标签自动暗示 "@kind class",使用@namespace 标签暗示 "@kind namespace"。

¥Usually you do not need the @kind tag, because the symbol's kind is determined by other tags in the doclet. For example, using the @class tag automatically implies "@kind class", and using the @namespace tag implies "@kind namespace".

示例

¥Examples

使用@kind
// The following examples produce the same result:

/**

 * A constant.

 * @kind constant
 */
const asdf = 1;

/**

 * A constant.

 * @constant
 */
const asdf = 1;

在标签类型冲突的情况下(例如,同时使用 @module(将类型设置为 "module")和 "@kind constant"(将类型设置为 "constant"),最后一个标签决定类型。

¥In the case of tags with conflicting kinds (for example, using both @module, which sets the kind to "module", and "@kind constant" which sets the kind to "constant"), the last tag determines the kind.

相互矛盾的@kind 声明
/**

 * This will show up as a constant

 * @module myModule

 * @kind constant
 */

/**

 * This will show up as a module.

 * @kind constant

 * @module myModule
 */