9.1.1 Type annotations and other Closure Compiler annotations
Documentation for JSDoc used by the Closure Compiler is described inAnnotating JavaScript for the Closure Compiler and .
9.1.2 Documentation annotations
In addition to the JSDoc described in the following tags are common and well supported by variousdocumentation generation tools (such as JsDossier) for purely documentationpurposes.
You may also see other types of JSDoc annotations in third-party code. Theseannotations appear in the but are not consideredpart of valid Google style.
9.1.2.1 @author or @owner - Not recommended.
Not recommended.
Syntax:
Documents the author of a file or the owner of a test, generally only used inthe @fileoverview
comment. The @owner
tag is used by the unit test dashboardto determine who owns the test results.
9.1.2.2 @bug
Syntax: @bug bugnumber
/** @bug 1234567 */
function testSomething() {
// …
}
/**
* @bug 1234568
* @bug 1234569
*/
}
Indicates what bugs the given test function regression tests.
9.1.2.3 @code - Deprecated. Do not use.
Deprecated. Do not use. Use Markdown backticks instead.
Syntax: {@code …}
Historically,
was written asBatchItem
{@code BatchItem}
.
Indicates that a term in a JSDoc description is code so it may be correctlyformatted in generated documentation.
9.1.2.4 @desc
Syntax: @desc Message description
/** @desc Notifying a user that their account has been created. */
exports.MSG_ACCOUNT_CREATED = goog.getMsg(
'Your account has been successfully created.');
9.1.2.5 @link
Syntax: {@link …}
This tag is used to generate cross-reference links within generateddocumentation.
Historical note: @link tags have also been used to create external links ingenerated documentation. For external links, always use Markdown's link syntaxinstead:
* This class implements a useful subset of the
* [native Event interface](https://dom.spec.whatwg.org/#event).
*/
class ApplicationEvent {}
9.1.2.6 @see
Reference a lookup to another class function or method.
9.1.2.7 @supported
Syntax: @supported Description
/**
* @fileoverview Event Manager
* Provides an abstracted interface to the browsers' event systems.
*/
Used in a fileoverview to indicate what browsers are supported by the file.
9.1.3 Framework specific annotations
The following annotations are specific to a particular framework.
9.1.3.1 @ngInject for Angular 1
9.1.3.2 @polymerBehavior for Polymer
https://github.com/google/closure-compiler/wiki/Polymer-Pass
9.1.4 Notes about standard Closure Compiler annotations
The following tags used to be standard but are now deprecated.
9.1.4.1 @expose - Deprecated. Do not use.
Deprecated. Do not use. Use @export
and/or instead.
9.1.4.2 @inheritDoc - Deprecated. Do not use.
Deprecated. Do not use. Use @override
instead.