语法
¥Syntax
@requires <someModuleName>
概述
¥Overview
@requires 标签允许你记录使用此代码需要一个模块。一个 JSDoc 注释可以有多个 @require 标签。模块名称可以指定为 "moduleName" 或 "module:moduleName";两种形式都将被解释为模块。
¥The @requires tag allows you to document that a module is needed to use this code. A JSDoc comment can have multiple @require tags. The module name can be specified as "moduleName" or "module:moduleName"; both forms will be interpreted as modules.
JSDoc 不会尝试处理正在包含的模块。如果你希望该模块包含在文档中,则必须将该模块包含在要处理的 JavaScript 文件列表中。
¥JSDoc does not attempt to process the module that is being included. If you want the module to be included in the documentation, you must include the module in the list of JavaScript files to process.
示例
¥Examples
/**
* This class requires the modules {@link module:xyzcorp/helper} and
* {@link module:xyzcorp/helper.ShinyWidget#polish}.
* @class
* @requires module:xyzcorp/helper
* @requires xyzcorp/helper.ShinyWidget#polish
*/
function Widgetizer() {}