@package

.. @package::
语法

@package [{typeExpression}]

概述

使用JSDoc标记字典(默认启用):

@package With the Closure Compiler

tag dictionary:

The @package tag marks a symbol as package-private. Typically, this tag indicates that a symbol is available only to code in the same directory as the source file for this symbol. This tag is available in JSDoc 3.5.0 and later.

By default, symbols marked with the @package tag will appear in your documentation. In JSDoc 3.3.0 and later, you can use the -a/--access JSDoc的命令行参数 to change this behavior.

The @package tag is equivalent to @access package.

示例

在下面的示例中, 实例成员``Thingy#_bar``出现在生成的文档中, 但带有一个注释, 表明它是包私有的:

Using the @package tag
/** @constructor */
function Thingy() {
    /** @package */
    this._bar = 1;
}