JSDoc 中文网

概述

¥Overview

@public 标签表示一个符号应该被记录为公共符号。

¥The @public tag indicates that a symbol should be documented as if it were public.

默认情况下,JSDoc 将所有符号视为公共符号,因此使用此标记通常不会影响生成的文档。但是,你可能更愿意明确使用 @public 标记,以便其他人清楚你打算公开该符号。

¥By default, JSDoc treats all symbols as public, so using this tag does not normally affect the generated documentation. However, you may prefer to use the @public tag explicitly so it is clear to others that you intended to make the symbol public.

在 JSDoc 3 中,@public 标记不影响符号的范围。使用 @instance@static@global 标签可以更改符号的范围。

¥In JSDoc 3, the @public tag does not affect a symbol's scope. Use the @instance, @static, and @global tags to change a symbol's scope.

示例

¥Examples

使用@public 标签
/**

 * The Thingy class is available to all.

 * @public

 * @class
 */
function Thingy() {
    /**

     * The Thingy~foo member. Note that 'foo' is still an inner member

     * of 'Thingy', in spite of the @public tag.

     * @public
     */
    var foo = 0;
}