diff --git a/tags-alias.html b/tags-alias.html
index 810eee85..3e4657b3 100644
--- a/tags-alias.html
+++ b/tags-alias.html
@@ -38,13 +38,13 @@ Table of Contents
Syntax
- @alias <aliasNamepath>
-
+ @alias <aliasNamepath>
Overview
- The @alias tag causes JSDoc to treat all references to a member as if the member had a different name. This tag is especially useful if you define a class within
- an inner function; in this case, you can use the @alias tag to tell JSDoc how the class is exposed in your app.
- While the @alias tag may sound similar to the @name tag, these tags behave very differently. The @name tag tells JSDoc to ignore any code associated with the
- comment. For example, when JSDoc processes the following code, it ignores the fact that the comment for bar
is attached to a function:
+
The @alias
tag causes JSDoc to treat all references to a member as if the member had a different name. This tag is especially useful if you define
+ a class within an inner function; in this case, you can use the @alias
tag to tell JSDoc how the class is exposed in your app.
+ While the @alias
tag may sound similar to the @name
tag, these tags behave very differently. The
+ @name
tag tells JSDoc to ignore any code associated with the comment. For example, when JSDoc processes the following code, it ignores the fact
+ that the comment for bar
is attached to a function:
/**
* Bar function.
@@ -52,22 +52,22 @@ Overview
*/
function foo() {}
- The @alias tag tells JSDoc to pretend that Member A is actually named Member B. For example, when JSDoc processes the following code, it recognizes that foo
is a function, then renames foo
to
+
The @alias
tag tells JSDoc to pretend that Member A is actually named Member B. For example, when JSDoc processes the following
+ code, it recognizes that foo
is a function, then renames foo
to
bar
in the documentation:
/**
* Bar function.
* @alias bar
*/
function foo() {}
-
-
+
Examples
- Suppose you are using a class framework that expects you to pass in a constructor function when you define a class. You can use the @alias tag to tell JSDoc
- how the class will be exposed in your app.
- In the following example, the @alias tag tells JSDoc to treat the anonymous function as if it were the constructor for the class "trackr.CookieManager".
+
Suppose you are using a class framework that expects you to pass in a constructor function when you define a class. You can use the @alias
tag to
+ tell JSDoc how the class will be exposed in your app.
+ In the following example, the @alias
tag tells JSDoc to treat the anonymous function as if it were the constructor for the class trackr.CookieManager
.
Within the function, JSDoc interprets the
- this
keyword relative to trackr.CookieManager, so the "value" method has the namepath "trackr.CookieManager#value".
-
+ this
keyword relative to trackr.CookieManager
, so the value
method has the namepath
+ trackr.CookieManager#value
.
Using @alias with an anonymous constructor functionKlass('trackr.CookieManager',
@@ -82,10 +82,8 @@ Examples
}
);
-
-
- You can also use the @alias tag with members that are created within an immediately invoked function expression (IIFE). The @alias tag tells JSDoc that these
- members are exposed outside of the IIFE's scope.
+
+
You can also use the @alias
tag with members that are created within an immediately invoked function expression (IIFE). The @alias
tag tells JSDoc that these members are exposed outside of the IIFE's scope.
Using @alias for static members of a namespace/** @namespace */
@@ -103,9 +101,8 @@ Examples
ns.Core = core;
})(Apple);
-
-
- For members that are defined within an object literal, you can use the @alias tag as an alternative to the @lends tag.
+
+ For members that are defined within an object literal, you can use the @alias
tag as an alternative to the @lends
tag.
Using @alias for an object literal// Documenting objectA with @alias
@@ -146,8 +143,7 @@ Examples
return x;
})();
-
-
+
diff --git a/tags-author.html b/tags-author.html
index b4ccfa2a..453c9589 100644
--- a/tags-author.html
+++ b/tags-author.html
@@ -38,19 +38,17 @@ Table of Contents
Syntax
- @author <name> [<emailAddress>]
-
+ @author <name> [<emailAddress>]
Overview
- The @author tag identifies the author of an item. In JSDoc 3.2 and later, if the author's name is followed by an email address enclosed in angle brackets,
- the default template will convert the email address to a mailto:
link.
+ The @author
tag identifies the author of an item. In JSDoc 3.2 and later, if the author's name is followed by an email address enclosed in angle
+ brackets, the default template will convert the email address to a mailto:
link.
Examples
Documenting the author of an item/**
* @author Jane Smith <jsmith@example.com>
*/
function MyClass() {}
-
-
+
diff --git a/tags-borrows.html b/tags-borrows.html
index 4050591c..5bb750db 100644
--- a/tags-borrows.html
+++ b/tags-borrows.html
@@ -35,13 +35,12 @@ Table of Contents
Syntax
- @borrows <that namepath> as <this namepath>
-
+ @borrows <that namepath> as <this namepath>
Overview
- The @borrows tag allows you to add documentation for another symbol to your documentation.
+ The @borrows
tag allows you to add documentation for another symbol to your documentation.
This tag would be useful if you had more than one way to reference a function, but you didn't want to duplicate the same documentation in two places.
Examples
- In this example there exists documentation for the "trstr" function, but "util.trim" is just a reference to that same function by a different
+
In this example there exists documentation for the trstr
function, but util.trim
is just a reference to that same function by a different
name.
Duplicate the documentation for trstr as util.trim/**
@@ -58,13 +57,11 @@ Examples
*/
function trstr(str) {
}
-
-
+
diff --git a/tags-callback.html b/tags-callback.html
index 0b4ef1d2..2dc327ec 100644
--- a/tags-callback.html
+++ b/tags-callback.html
@@ -38,13 +38,13 @@ Table of Contents
Syntax
- @callback <namepath>
-
+ @callback <namepath>
Overview
- The @callback tag provides information about a callback function that can be passed to other functions, including the callback's parameters and return value.
- You can include any of the tags that you can provide for a @method.
- Once you define a callback, you can use it in the same way as a custom type defined with the @typedef tag. In particular, you can use the callback's name
- as a type name. This allows you to indicate that a function parameter should contain a certain type of callback.
+ The @callback
tag provides information about a callback function that can be passed to other functions, including the callback's parameters
+ and return value. You can include any of the tags that you can provide for a @method
.
+ Once you define a callback, you can use it in the same way as a custom type defined with the
+ @typedef
tag. In particular, you can use the callback's name as a type name. This allows you to indicate that a function parameter should
+ contain a certain type of callback.
If you want a callback to be displayed with the type definitions for a specific class, you can give the callback a namepath indicating that it is an inner function
of that class. You can also define a global callback type that is referenced from multiple classes.
Examples
@@ -68,8 +68,7 @@ Examples
* @param {number} responseCode
* @param {string} responseMessage
*/
-
-
+
Documenting a global callback/**
* @class
@@ -90,8 +89,7 @@ Examples
* @param {number} responseCode
* @param {string} responseMessage
*/
-
-
+
diff --git a/tags-classdesc.html b/tags-classdesc.html
index 191a64f3..6a25e4b9 100644
--- a/tags-classdesc.html
+++ b/tags-classdesc.html
@@ -38,14 +38,13 @@ Table of Contents
Syntax
- @classdesc <some description>
-
+ @classdesc <some description>
Overview
- The @classdesc tag is used to provide a description for a class, separate from the constructor function's description. Use the @classdesc tag in combination
- with the @class (or @constructor)
+ The @classdesc
tag is used to provide a description for a class, separate from the constructor function's description. Use the @classdesc
tag in combination with the @class
(or @constructor
)
tag.
- The functionality of the @classdesc tag in JSDoc 3 duplicates that of the @class in previous versions. As of version 3, the syntax and functionality of the @class
- tag now exactly matches the @constructor tag, and the @classdesc tag more explicitly communicates its purpose: to document a class's description.
+ The functionality of the @classdesc
tag in JSDoc 3 duplicates that of the @class
in previous versions. As of version 3, the syntax
+ and functionality of the @class
tag now exactly matches the
+ @constructor
tag, and the @classdesc
tag more explicitly communicates its purpose: to document a class's description.
Examples
As shown below, a class has places for two descriptions, one applies to the function itself, while the other applies to the class in general.
@@ -56,8 +55,7 @@ Examples
*/
function MyClass() {
}
-
-
+
Copyright © 2011-2017 the
contributors to the JSDoc 3 documentation project.
This website is open source and is licensed under the
diff --git a/tags-constant.html b/tags-constant.html
index d243ccf6..e18b2ff0 100644
--- a/tags-constant.html
+++ b/tags-constant.html
@@ -45,14 +45,12 @@ Synonyms
@const
Syntax
- @constant [<type> <name>]
-
+ @constant [<type> <name>]
Overview
- The @constant tag is used to mark the documentation as belonging to a symbol that is a constant.
+ The @constant
tag is used to mark the documentation as belonging to a symbol that is a constant.
Examples
In this example we are documenting a string constant. Note that although the code is using the
- const
keyword, this is not required by JSDoc. If your JavaScript host environment doesn't yet support constant declarations, the @const documentation
- can just as effectively be used on var
declarations.
+ const
keyword, this is not required by JSDoc. If your JavaScript host environment doesn't yet support constant declarations, the @const
documentation can just as effectively be used on var
declarations.
A string constant representing the color red/** @constant
@@ -63,10 +61,9 @@ Examples
/** @constant {number} */
var ONE = 1;
-
-
- Note that the example provides the type in a @type tag. This is optional. Also the optional @default tag is used here too, this will automatically add whatever
- the assigned value is (for example 'FF0000') to the documentation.
+
+ Note that the example provides the type in a @type
tag. This is optional. Also the optional
+ @default
tag is used here too, this will automatically add whatever the assigned value is (for example 'FF0000'
) to the documentation.
diff --git a/tags-default.html b/tags-default.html
index 19dbfcc9..70700417 100644
--- a/tags-default.html
+++ b/tags-default.html
@@ -42,28 +42,25 @@ Synonyms
@defaultvalue
Syntax
- @default [<some value>]
-
+ @default [<some value>]
Overview
- The @default tag allows you to document the assigned value of a symbol. You can supply this tag with a value yourself or you can allow JSDoc to automatically
- document the value from the source code -- only possible when the documented symbol is being assigned a single, simple value that is either: a string, a number,
- a boolean or null.
+ The @default
tag allows you to document the assigned value of a symbol. You can supply this tag with a value yourself or you can allow JSDoc to
+ automatically document the value from the source code -- only possible when the documented symbol is being assigned a single, simple value that is either:
+ a string, a number, a boolean or null.
Examples
- In this example a constant is documented. The value of the constant is 0xff0000
. By adding the @default tag this value is automatically added to
- the documentation.
+ In this example a constant is documented. The value of the constant is 0xff0000
. By adding the
+ @default
tag this value is automatically added to the documentation.
Document the number value of a constant/**
* @constant
* @default
*/
const RED = 0xff0000;
-
-
+
diff --git a/tags-deprecated.html b/tags-deprecated.html
index 5cdd1205..c0176dbd 100644
--- a/tags-deprecated.html
+++ b/tags-deprecated.html
@@ -35,12 +35,11 @@ Table of Contents
Syntax
- @deprecated [<some text>]
-
+ @deprecated [<some text>]
Overview
- The @deprecated tag marks a symbol in your code as being deprecated.
+ The @deprecated
tag marks a symbol in your code as being deprecated.
Examples
- You can use the @deprecated tag by itself, or include some text that describes more about the deprecation.
+
You can use the @deprecated
tag by itself, or include some text that describes more about the deprecation.
Document that the old function has been deprecated since version 2.0/**
@@ -48,13 +47,11 @@ Examples
*/
function old() {
}
-
-
+
diff --git a/tags-description.html b/tags-description.html
index 64970155..e652dc7d 100644
--- a/tags-description.html
+++ b/tags-description.html
@@ -45,14 +45,13 @@ Synonyms
@desc
Syntax
- @description <some description>
-
+ @description <some description>
Overview
- The @description tag allows you to provide a general description of the symbol you are documenting. The description may include HTML markup. It may also include
- Markdown formatting if the
+
The @description
tag allows you to provide a general description of the symbol you are documenting. The description may include HTML markup. It
+ may also include Markdown formatting if the
Markdown plugin is enabled.
Examples
- If you describe a symbol at the very beginning of a JSDoc comment, before using any block tags, you may omit the @description tag.
+ If you describe a symbol at the very beginning of a JSDoc comment, before using any block tags, you may omit the @description
tag.
Describing a symbol without the @description tag/**
* Add two numbers.
@@ -63,9 +62,8 @@ Examples
function add(a, b) {
return a + b;
}
-
-
- By using the @description tag, you can place the description anywhere in the JSDoc comment.
+
+ By using the @description
tag, you can place the description anywhere in the JSDoc comment.
Describing a symbol with the @description tag/**
* @param {number} a
@@ -76,10 +74,9 @@ Examples
function add(a, b) {
return a + b;
}
-
-
- If there's both a description at the beginning of a JSDoc comment and a description provided with the @description tag, the description specified with the
- @description will override the description at the beginning of the comment.
+
+ If there's both a description at the beginning of a JSDoc comment and a description provided with the @description
tag, the description specified
+ with the @description
will override the description at the beginning of the comment.
diff --git a/tags-enum.html b/tags-enum.html
index c55e45df..2bda156d 100644
--- a/tags-enum.html
+++ b/tags-enum.html
@@ -38,15 +38,14 @@ Table of Contents
Syntax
- @enum [<type>]
-
+ @enum [<type>]
Overview
- The @enum tag documents a collection of static properties whose values are all of the same type.
+ The @enum
tag documents a collection of static properties whose values are all of the same type.
An enum is similar a collection of properties, except that an enum is documented in its own doc comment, whereas properties are documented within the doc comment
- of their container. Often this tag is used with @readonly, as an enum typically represents a collection of constants.
+ of their container. Often this tag is used with @readonly
, as an enum typically represents a collection of constants.
Examples
This shows how to document an object that represents a value with three possible states. Note that the enum members can have optional descriptions added if you
- wish. Also you can override the type, as is shown with "MAYBE" -- by default enum members will be documented with the same type as the enum itself.
+ wish. Also you can override the type, as is shown with MAYBE
-- by default enum members will be documented with the same type as the enum itself.
A numeric enum, representing three states/**
* Enum for tri-state values.
@@ -60,8 +59,7 @@ Examples
/** @type {boolean} */
MAYBE: true
};
-
-
+
@property
@@ -69,8 +67,7 @@
diff --git a/tags-event.html b/tags-event.html
index fdbb0632..08a67149 100644
--- a/tags-event.html
+++ b/tags-event.html
@@ -38,16 +38,15 @@ Table of Contents
Syntax
- @event <className>#[event:]<eventName>
-
+ @event <className>#[event:]<eventName>
Overview
- The @event tag allows you to document an event that can be fired. A typical event is represented by an object with a defined set of properties.
- Once you have used the @event tag to define a specific type of event, you can use the @fires tag to indicate that a method can fire that event. You can also
- use the @listens tag to indicate that a symbol listens for the event.
+ The @event
tag allows you to document an event that can be fired. A typical event is represented by an object with a defined set of properties.
+ Once you have used the @event
tag to define a specific type of event, you can use the @fires
tag to indicate that a method can fire
+ that event. You can also use the @listens
tag to indicate that a symbol listens for the event.
JSDoc automatically prepends the namespace event:
to each event's name. In general, you must include this namespace when you link to the event
- in another doclet. (The @fires tag is a notable exception; it allows you to omit the namespace.)
- Note: JSDoc 3 uses @event doclets to document the content of an event. In contrast, JSDoc Toolkit 2 used @event doclets to identify a function
- that can be fired when an event of the same name occurs.
+ in another doclet. (The @fires
tag is a notable exception; it allows you to omit the namespace.)
+ Note: JSDoc 3 uses @event
doclets to document the content of an event. In contrast, JSDoc Toolkit 2 used @event
doclets
+ to identify a function that can be fired when an event of the same name occurs.
Examples
The following examples show how to document an event in the Hurl
class called snowball
. The event contains an object with a single
property.
@@ -69,8 +68,7 @@ Examples
isPacked: this._snowball.isPacked
});
};
-
-
+
Using a named doclet to document an event/**
* Throw a snowball.
@@ -88,8 +86,7 @@ Examples
* @type {object}
* @property {boolean} isPacked - Indicates whether the snowball is tightly packed.
*/
-
-
+
diff --git a/tags-exports.html b/tags-exports.html
index 436d0813..6baf47f2 100644
--- a/tags-exports.html
+++ b/tags-exports.html
@@ -38,14 +38,14 @@ Table of Contents
Syntax
- @exports <moduleName>
-
+ @exports <moduleName>
In JSDoc 3.3.0 and later, <moduleName>
may include the module:
prefix. In previous versions, you must omit this prefix.
Overview
- Use the @exports tag when documenting JavaScript modules that export anything other than the "exports" object or the "module.exports" property.
+ Use the @exports
tag when documenting JavaScript modules that export anything other than the
+ exports
object or the module.exports
property.
Examples
- In modules where you are using the special "exports" object, the @exports tag is never needed. JSDoc automatically recognizes that this object's
- members are being exported. Similarly, JSDoc automatically recognizes the special "module.exports" property in Node.js modules.
+ In modules where you are using the special exports
object, the @exports
tag is never needed. JSDoc automatically recognizes that this
+ object's members are being exported. Similarly, JSDoc automatically recognizes the special module.exports
property in Node.js modules.
CommonJS module/**
* A module that says hello!
@@ -56,8 +56,7 @@ Examples
exports.sayHello = function() {
return 'Hello world';
};
-
-
+
Node.js module/**
* A module that shouts hello!
@@ -68,8 +67,7 @@ Examples
module.exports = function() {
return "HELLO WORLD";
};
-
-
+
AMD module that exports an object literaldefine(function() {
@@ -86,8 +84,7 @@ Examples
return exports;
});
-
-
+
AMD module that exports a constructordefine(function() {
/**
@@ -110,10 +107,9 @@ Examples
return exports;
});
-
-
- If your module exports an object named anything other than "exports" or "module.exports", use the @exports tag to indicate what is being
- exported.
+
+ If your module exports an object named anything other than exports
or module.exports
, use the
+ @exports
tag to indicate what is being exported.
AMD module that exports an objectdefine(function () {
@@ -130,8 +126,7 @@ Examples
return ns;
});
-
-
+
diff --git a/tags-external.html b/tags-external.html
index 1367a87b..ed39ce18 100644
--- a/tags-external.html
+++ b/tags-external.html
@@ -42,8 +42,7 @@ Synonyms
@host
Syntax
- @external <NameOfExternal>
-
+ @external <NameOfExternal>
Overview
The @external
tag identifies a class, namespace, or module that is defined outside of the current package. By using this tag, you can document your
package's extensions to the external symbol, or you can provide information about the external symbol to your package's users. You can also refer to
@@ -70,8 +69,7 @@
Examples
* var greeting = new String('hello world');
* console.log( greeting.rot13() ); // uryyb jbeyq
*/
-
-
+
The following example documents a new starfairy
function added to the external namespace
"jQuery.fn"
:
@@ -85,8 +83,7 @@ Examples
* A jQuery plugin to make stars fly around your home page.
* @function external:"jQuery.fn".starfairy
*/
-
-
+
In the following example, the class EncryptedRequest
is documented as a subclass of the built-in class XMLHttpRequest
:
Extending an external./**
@@ -100,8 +97,7 @@ Examples
* @class EncodedRequest
* @extends external:XMLHttpRequest
*/
-
-
+
You should only add the @external
tag to the highest-level symbol that is defined outside of your project. In the following example, the documentation
@@ -120,13 +116,11 @@
Examples
* @class TLS
* @memberof external:security
*/
-
-
+
diff --git a/tags-function.html b/tags-function.html
index 8d927acd..f7af5aa7 100644
--- a/tags-function.html
+++ b/tags-function.html
@@ -47,32 +47,27 @@ Synonyms
Syntax
- @function [<FunctionName>]
-
+ @function [<FunctionName>]
Overview
- This marks an object as being a function, even though it may not appear to be one to the parser. It sets the doclet's @kind to 'function'.
+ This marks an object as being a function, even though it may not appear to be one to the parser. It sets the doclet's @kind
to function
.
Examples
Using @function to mark a function./** @function */
var paginate = paginateFactory(pages);
-
-
- Without the @function tag, the paginate
object would be documented as a generic object (a
- @member), because it isn't possible to tell from examining the line of code what type of value paginate
will
- hold when it is run.
+
+ Without the @function
tag, the paginate
object would be documented as a generic object (a
+ @member
), because it isn't possible to tell from examining the line of code what type of value paginate
will hold when it is run.
Using @function with a name./** @function myFunction */
// the above is the same as:
/** @function
* @name myFunction */
-
-
+
diff --git a/tags-global.html b/tags-global.html
index af7690ca..a9d36173 100644
--- a/tags-global.html
+++ b/tags-global.html
@@ -35,10 +35,10 @@ Table of Contents
Overview
- The @global tag specifies that a symbol should appear in the documentation as a global symbol. JSDoc ignores the symbol's actual scope within the
- source file. This tag is especially useful for symbols that are defined locally, then assigned to a global symbol.
+ The @global
tag specifies that a symbol should appear in the documentation as a global symbol. JSDoc ignores the symbol's actual scope
+ within the source file. This tag is especially useful for symbols that are defined locally, then assigned to a global symbol.
Examples
- Use the @global tag to specify that a symbol should be documented as global.
+ Use the @global
tag to specify that a symbol should be documented as global.
Document an inner variable as a global(function() {
/** @global */
@@ -46,8 +46,7 @@ Examples
this.foo = foo;
}).apply(window);
-
-
+
diff --git a/tags-inner.html b/tags-inner.html
index 01a95d29..291e963d 100644
--- a/tags-inner.html
+++ b/tags-inner.html
@@ -35,8 +35,8 @@ Table of Contents
Overview
- Using the @inner tag will mark a symbol as an inner member of its parent symbol. This means it can be referred to by "Parent~Child".
- Using @inner will override a doclet's default scope (unless it is in the global scope, in which case it will remain global).
+ Using the @inner
tag will mark a symbol as an inner member of its parent symbol. This means it can be referred to by Parent~Child
.
+ Using @inner
will override a doclet's default scope (unless it is in the global scope, in which case it will remain global).
Examples
Using @inner to make a virtual doclet an inner member/** @namespace MyNamespace */
@@ -46,9 +46,9 @@ Examples
* @memberof MyNamespace
* @inner
*/
-
-
- Note that in the above we could have used "@function MyNamespace~myFunction" instead of the @memberof and @inner tags.
+
+ Note that in the above we could have used @function MyNamespace~myFunction
instead of the
+ @memberof
and @inner
tags.
Using @inner/** @namespace */
var MyNamespace = {
@@ -58,8 +58,7 @@ Examples
*/
foo: 1
};
-
-
+
In the above example, we use @inner to force a member of a namespace to be documented as an inner member (by default, it would be a static member). This means
that foo
now has the longname
MyNamespace~foo
instead of MyNamespace.foo
.
@@ -78,8 +77,7 @@
diff --git a/tags-instance.html b/tags-instance.html
index 4ece08a4..21b191fb 100644
--- a/tags-instance.html
+++ b/tags-instance.html
@@ -35,10 +35,10 @@ Table of Contents
Overview
- Using the @instance tag will mark a symbol as an instance member of its parent symbol. This means it can be referred to by "Parent#Child".
- Using @instance will override a doclet's default scope (unless it is in the global scope, in which case it will remain global).
+ Using the @instance
tag will mark a symbol as an instance member of its parent symbol. This means it can be referred to by Parent#Child
.
+ Using @instance
will override a doclet's default scope (unless it is in the global scope, in which case it will remain global).
Examples
- The following example is a longhand way of writing "@function MyNamespace#myFunction":
+ The following example is a longhand way of writing @function MyNamespace#myFunction
:
Using @instance to make a virtual doclet an instance member/** @namespace MyNamespace */
/**
@@ -47,10 +47,9 @@ Examples
* @memberof MyNamespace
* @instance
*/
-
-
- More usefully, you can use the @instance tag to override the scope that JSDoc infers. For example, you can indicate that a static member is used as an instance
- member:
+
+ More usefully, you can use the @instance
tag to override the scope that JSDoc infers. For example, you can indicate that a static member is used
+ as an instance member:
Using @instance to identify an instance member/** @namespace */
var BaseObject = {
@@ -66,8 +65,7 @@ Examples
var props = { foo: fooValue };
return Object.create(BaseObject, props);
}
-
-
+
diff --git a/tags-interface.html b/tags-interface.html
index deec24ca..e5aa2213 100644
--- a/tags-interface.html
+++ b/tags-interface.html
@@ -39,11 +39,9 @@ Table of Contents
Syntax
With the JSDoc tag dictionary (enabled by default):
- @interface [<name>]
-
+ @interface [<name>]
With the Closure Compiler tag dictionary:
- @interface
-
+ @interface
Overview
The @interface
tag marks a symbol as an interface that other symbols can implement. For example, your code might define a parent class whose methods
and properties are stubbed out. You can add the
@@ -73,8 +71,7 @@
Examples
Color.prototype.rgb = function() {
throw new Error('not implemented');
};
-
-
+
The following example uses virtual comments, rather than code, to define the Color
interface:
@@ -94,8 +91,7 @@ Examples
* @returns {Array<number>} An array containing the red, green, and blue values,
* in that order.
*/
-
-
+
@implements
@@ -103,8 +99,7 @@
diff --git a/tags-kind.html b/tags-kind.html
index 8090e0ef..79d49dda 100644
--- a/tags-kind.html
+++ b/tags-kind.html
@@ -38,27 +38,26 @@ Table of Contents
Syntax
- @kind <kindName>
-
+ @kind <kindName>
where <kindName>
is one of:
- - class
- - constant
- - event
- - external
- - file
- - function
- - member
- - mixin
- - module
- - namespace
- - typedef
+ class
+ constant
+ event
+ external
+ file
+ function
+ member
+ mixin
+ module
+ namespace
+ typedef
Overview
- 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).
- 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".
+ 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).
+ 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
Using @kind// The following examples produce the same result:
@@ -74,10 +73,9 @@ Examples
* @constant
*/
const asdf = 1;
-
-
- 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.
+
+ 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.
Conflicting @kind statements/**
* This will show up as a constant
@@ -90,8 +88,7 @@ Examples
* @kind constant
* @module myModule
*/
-
-
+
@type
@@ -99,8 +96,7 @@
diff --git a/tags-lends.html b/tags-lends.html
index 0b580b31..bbc594c8 100644
--- a/tags-lends.html
+++ b/tags-lends.html
@@ -38,8 +38,7 @@ Table of Contents
Syntax
- @lends <namepath>
-
+ @lends <namepath>
Overview
The @lends
tag allows you to document all the members of an object literal as if they were members of a symbol with the given name. You might want
to do this if you are passing an object literal into a function that creates a named class from its members.
@@ -59,8 +58,7 @@ Examples
}
}
);
-
-
+
Without any comments, JSDoc won't recognize that this code creates a Person
class with two methods. To document the methods, we must use a @lends
tag in a doc comment immediately before the object literal. The @lends
tag tells JSDoc that all the member names of that object literal are being
"loaned" to a variable named Person
. We must also add comments to each of the methods.
The following example gets us closer to what we want:
@@ -86,8 +84,7 @@ Examples
}
}
);
-
-
+
Now the functions named initialize
and say
will be documented, but they appear as static methods of the Person
class.
That is possibly what you meant, but in this case we want initialize
and
say
to belong to the instances of the Person
class. So we change things slightly by lending the methods to the class's prototype:
@@ -113,8 +110,7 @@ Examples
}
}
);
-
-
+
One final step: Our class framework uses the loaned initialize
function to construct Person
instances, but a Person
instance
does not have its own initialize
method. The solution is to add the @constructs
tag to the loaned function. Remember to remove the
@class
tag as well, or else two classes will be documented.
@@ -140,8 +136,7 @@ Examples
}
}
);
-
-
+
diff --git a/tags-member.html b/tags-member.html
index 3178439f..fef51446 100644
--- a/tags-member.html
+++ b/tags-member.html
@@ -42,11 +42,10 @@ Synonyms
@var
Syntax
- @member [<type>] [<name>]
-
+ @member [<type>] [<name>]
Overview
- The @member tag identifies any member that does not have a more specialized kind, such as "class", "function", or "constant". A
- member can optionally have a type as well as a name.
+ The @member
tag identifies any member that does not have a more specialized kind, such as class
,
+ function
, or constant
. A member can optionally have a type as well as a name.
Examples
Using @member with Data#point/** @class */
@@ -54,16 +53,14 @@ Examples
/** @member {Object} */
this.point = {};
}
-
-
- Here is an example of using @var, a synonym of @member, to document a (virtual) variable 'foo'.
+
+ Here is an example of using @var
, a synonym of @member
, to document a (virtual) variable foo
.
Using @var to document a virtual member/**
* A variable in the global namespace called 'foo'.
* @var {number} foo
*/
-
-
+
The above example is equivalent to the following:
/**
* A variable in the global namespace called 'foo'.
@@ -74,8 +71,7 @@ Examples
diff --git a/tags-memberof.html b/tags-memberof.html
index 55b77494..20dc138a 100644
--- a/tags-memberof.html
+++ b/tags-memberof.html
@@ -39,20 +39,18 @@ Table of Contents
Syntax
- @memberof <parentNamepath>
-
- @memberof! <parentNamepath>
-
+ @memberof <parentNamepath>
+ @memberof! <parentNamepath>
Overview
- The @memberof tag identifies a member symbol that belongs to a parent symbol.
- By default, the @memberof tag documents member symbols as static members. For inner and instance members, you can use scoping punctuation after the namepath,
- or you can add the @inner or @instance tag.
- The "forced" @memberof tag, @memberof!, forces the object to be documented as belonging to a specific parent even if it appears to have a different
- parent.
+ The @memberof
tag identifies a member symbol that belongs to a parent symbol.
+ By default, the @memberof
tag documents member symbols as static members. For inner and instance members, you can use scoping punctuation after
+ the namepath, or you can add the @inner
or @instance
tag.
+ The "forced" @memberof
tag, @memberof!
, forces the object to be documented as belonging to a specific parent even if it appears
+ to have a different parent.
Examples
In the following example, the hammer
function would normally be documented as a global function. That's because, in fact, it is a global function,
- but it is also a member of the Tools
namespace, and that's how you wish to document it. The solution is to add a @memberof tag:
+ but it is also a member of the Tools
namespace, and that's how you wish to document it. The solution is to add a @memberof
tag:
Using @memberof/** @namespace */
var Tools = {};
@@ -62,10 +60,9 @@ Examples
};
Tools.hammer = hammer;
-
-
- For instance members of a class, use the syntax "@memberof ClassName.prototype" or "@memberof ClassName#". Alternatively, you can combine
- "@memberof ClassName" with the "@instance" tag.
+
+ For instance members of a class, use the syntax @memberof ClassName.prototype
or
+ @memberof ClassName#
. Alternatively, you can combine @memberof ClassName
with the @instance
tag.
Using @memberof with a class prototype/** @class Observable */
create(
@@ -97,13 +94,12 @@ Examples
end: function() {}
}
);
-
-
- The following example uses the forced @memberof tag, "@memberof!", to document a property of an object (Data#point) that is an instance member of a
- class (Data).
- When you use the @property tag to document a property, you cannot link to the property using its longname. We can force the property to be linkable by using
- "@alias" and "@memberof!" to tell JSDoc that Data#point.y should be documented as a member "point.y" of "Data#", rather
- than a member "y" of "point" of "Data#".
+
+ The following example uses the forced @memberof
tag, @memberof!
, to document a property of an object (Data#point
) that
+ is an instance member of a class (Data
).
+ When you use the @property
tag to document a property, you cannot link to the property using its longname. We can force the property to be linkable
+ by using @alias
and @memberof!
to tell JSDoc that Data#point.y
should be documented as a member point.y
of Data#
, rather than a member y
of
+ point
of Data#
.
Using @memberof! for object properties/** @class */
function Data() {
@@ -124,8 +120,7 @@ Examples
y: 1
};
}
-
-
+
@name
@@ -133,8 +128,7 @@
diff --git a/tags-mixes.html b/tags-mixes.html
index cbf42b5a..94d9f991 100644
--- a/tags-mixes.html
+++ b/tags-mixes.html
@@ -38,12 +38,11 @@ Table of Contents
Syntax
- @mixes <OtherObjectPath>
-
+ @mixes <OtherObjectPath>
Overview
- The @mixes tag indicates that the current object mixes in all the members from OtherObjectPath
, which is a @mixin.
+ The @mixes
tag indicates that the current object mixes in all the members from OtherObjectPath
, which is a @mixin
.
Examples
- To start, we document a mixin with the @mixin tag:
+ To start, we document a mixin with the @mixin
tag:
Example of a @mixin/**
* This provides methods used for event handling. It's not meant to
@@ -70,10 +69,9 @@ Examples
// code...
}
};
-
-
- Now we add a FormButton class and call a "mix" function that mixes all of the Eventful functions into FormButton, so that FormButton can also fire
- events and have listeners. We use the @mixes tag to indicate that FormButton mixes the Eventful functions.
+
+ Now we add a FormButton
class and call a mix
function that mixes all of the Eventful functions into FormButton
, so that
+ FormButton
can also fire events and have listeners. We use the @mixes
tag to indicate that FormButton
mixes the Eventful
functions.
Using the @mixes tag/**
* @constructor FormButton
@@ -86,8 +84,7 @@ Examples
this.fire('press', {});
}
mix(Eventful).into(FormButton.prototype);
-
-
+
diff --git a/tags-module.html b/tags-module.html
index 5afead6f..2ed2c604 100644
--- a/tags-module.html
+++ b/tags-module.html
@@ -38,18 +38,18 @@ Table of Contents
Syntax
- @module [[{<type>}] <moduleName>]
-
+ @module [[{<type>}] <moduleName>]
In JSDoc 3.3.0 and later, <moduleName>
may include the module:
prefix. In previous versions, you must omit this prefix.
Note: If you provide a type, you must also provide a name.
Overview
- The @module tag marks the current file as being its own module. All symbols in the file are assumed to be members of the module unless documented otherwise.
- Link to a module (e.g. within a @link or @see tag) using "module:moduleName". For example,
- "@module foo/bar" can be linked to using "{@link module:foo/bar}".
+ The @module
tag marks the current file as being its own module. All symbols in the file are assumed to be members of the module unless documented
+ otherwise.
+ Link to a module (e.g. within a @link
or @see
tag) using module:moduleName
.
+ For example, @module foo/bar
can be linked to using {@link module:foo/bar}
.
If the module name is not provided, it is derived from the module's path and filename. For example, suppose I have a file test.js
, located in
the src
directory, that contains the block comment
- /** @module */
. Here are some scenarios for running JSDoc and the resulting module names for test.js:
-
+ /** @module */
. Here are some scenarios for running JSDoc and the resulting module names for
+ test.js
:
Derived module names if none is provided.# from src/
jsdoc ./test.js # module name 'test'
@@ -57,8 +57,7 @@ Overview
# from src's parent directory:
jsdoc src/test.js # module name 'src/test'
jsdoc -r src/ # module name 'test'
-
-
+
Examples
The following example shows the namepaths that are used for symbols in a module. The first symbol is a module-private, or "inner," variable--it can
be only accessed within the module. The second symbol is a static function that is exported by the module.
@@ -70,11 +69,10 @@ Examples
/** will be module:myModule.bar */
var bar = function() {};
-
-
+
When an exported symbol is defined as a member of module.exports
, exports
, or this
, JSDoc infers that the symbol is a
static member of the module.
- In the following example, the Book class is documented as a static member, "module:bookshelf.Book", with one instance member, "module:bookshelf.Book#title".
+ In the following example, the Book
class is documented as a static member, module:bookshelf.Book
, with one instance member, module:bookshelf.Book#title
.
Defining exported symbols as a member of 'this'/** @module bookshelf */
/** @class */
@@ -82,10 +80,9 @@ Examples
/** The title. */
this.title = title;
};
-
-
- In the following example, the two functions have the namepaths "module:color/mixer.blend" and "module:color/mixer.darken".
-
+
+ In the following example, the two functions have the namepaths module:color/mixer.blend
and
+ module:color/mixer.darken
.
Defining exported symbols as a member of 'module.exports' or 'exports'/** @module color/mixer */
module.exports = {
@@ -94,8 +91,7 @@ Examples
};
/** Darkens a color. */
exports.darken = function (color, shade) {};
-
-
+
See Documenting JavaScript Modules for further examples.
diff --git a/tags-name.html b/tags-name.html
index 868827b4..3980dfdb 100644
--- a/tags-name.html
+++ b/tags-name.html
@@ -38,18 +38,18 @@ Table of Contents
Syntax
- @name <namePath>
-
+ @name <namePath>
Overview
- The @name tag forces JSDoc to associate the remainder of the JSDoc comment with the given name, ignoring all surrounding code. This tag is best used in "virtual
- comments" for symbols that are not readily visible in the code, such as methods that are generated at runtime.
- When you use the @name tag, you must provide additional tags that tell JSDoc what kind of symbol you are documenting; whether the symbol is a member of another
- symbol; and so on. If you do not provide this information, the symbol will not be documented correctly.
- Warning: By using the @name tag, you are telling JSDoc to ignore the surrounding code and treat your documentation comment in isolation.
- In many cases, it is best to use the
- @alias tag instead, which changes a symbol's name in the documentation but preserves other information about the symbol.
+ The @name
tag forces JSDoc to associate the remainder of the JSDoc comment with the given name, ignoring all surrounding code. This tag is best
+ used in "virtual comments" for symbols that are not readily visible in the code, such as methods that are generated at runtime.
+ When you use the @name
tag, you must provide additional tags that tell JSDoc what kind of symbol you are documenting; whether the symbol is a member
+ of another symbol; and so on. If you do not provide this information, the symbol will not be documented correctly.
+ Warning: By using the @name
tag, you are telling JSDoc to ignore the surrounding code and treat your documentation comment
+ in isolation. In many cases, it is best to use the
+ @alias
tag instead, which changes a symbol's name in the documentation but preserves other information about
+ the symbol.
Examples
- The following example shows how to use the @name tag to document a function that JSDoc would not normally recognize.
+ The following example shows how to use the @name
tag to document a function that JSDoc would not normally recognize.
Using the @name tag/**
* @name highlightSearchTerm
@@ -58,8 +58,7 @@ Examples
* @param {string} term - The search term to highlight.
*/
eval("window.highlightSearchTerm = function(term) {};")
-
-
+
diff --git a/tags-namespace.html b/tags-namespace.html
index 8689cb62..6841d38a 100644
--- a/tags-namespace.html
+++ b/tags-namespace.html
@@ -38,14 +38,12 @@ Table of Contents
Syntax
- @namespace [[{<type>}] <SomeName>]
-
+ @namespace [[{<type>}] <SomeName>]
Overview
- The @namespace tag indicates that an object creates a namespace for its members. You can also write a virtual JSDoc comment that defines a namespace used by
- your code.
- If a namespace is defined by a symbol other than an object literal, you can include a type expression along with the @namespace tag. If the @namespace tag includes
- a type, it must also include a name.
- You may need to document a namespace whose name includes unusual characters, such as "#" or "!". In these cases, when you document or link
+
The @namespace
tag indicates that an object creates a namespace for its members. You can also write a virtual JSDoc comment that defines a namespace
+ used by your code.
+ If a namespace is defined by a symbol other than an object literal, you can include a type expression along with the @namespace
tag. If the @namespace
tag includes a type, it must also include a name.
+ You may need to document a namespace whose name includes unusual characters, such as #
or !
. In these cases, when you document or link
to the namespace, you must add quotation marks around the portion of the namespace that includes unusual characters. See the examples below for details.
Examples
@@ -59,8 +57,7 @@ Examples
/** documented as MyNamespace.bar */
bar: 1
};
-
-
+
Using the @namespace tag for virtual comments/**
* A namespace.
@@ -72,10 +69,9 @@ Examples
* @function myFunction
* @memberof MyNamespace
*/
-
-
- If a @namespace includes a symbol whose name has unusual characters, you must enclose the symbol's name in double quotes. If the symbol's name already
- contains one or more double quotes, escape the double quotes with a leading backslash (\).
+
+ If a @namespace
includes a symbol whose name has unusual characters, you must enclose the symbol's name in double quotes. If the symbol's
+ name already contains one or more double quotes, escape the double quotes with a leading backslash (\\
).
Using the @namespace tag with unusual member names/** @namespace window */
@@ -84,8 +80,7 @@ Examples
* Refer to it as {@link window."!"} (note the double quotes).
*/
window["!"] = function(msg) { alert(msg); };
-
-
+
@module
@@ -93,8 +88,7 @@
diff --git a/tags-param.html b/tags-param.html
index 11eafc5c..b52456df 100644
--- a/tags-param.html
+++ b/tags-param.html
@@ -83,8 +83,7 @@ Names, types, and descriptions
function sayHello(somebody) {
alert('Hello ' + somebody);
}
-
-
+
Name and type/**
* @param {string} somebody
@@ -92,8 +91,7 @@ Names, types, and descriptions
function sayHello(somebody) {
alert('Hello ' + somebody);
}
-
-
+
Name, type, and description/**
* @param {string} somebody Somebody's name.
@@ -101,8 +99,7 @@ Names, types, and descriptions
function sayHello(somebody) {
alert('Hello ' + somebody);
}
-
-
+
You can add a hyphen before the description to make it more readable. Be sure to include a space before and after the hyphen.
Name, type, and description, with a hyphen before the description/**
@@ -111,8 +108,7 @@ Names, types, and descriptions
function sayHello(somebody) {
alert('Hello ' + somebody);
}
-
-
+
Parameters with properties
If a parameter is expected to have a specific property, you can document that property by providing an additional @param
tag. For example, if an
employee
parameter is expected to have name
and
@@ -151,8 +147,7 @@
Parameters with properties
Project.prototype.assign = function(employees) {
// ...
};
-
-
+
Optional parameters and default values
The following examples show how to indicate that a parameter is optional and has a default value.
@@ -165,8 +160,7 @@ Optional parameters and default
}
alert('Hello ' + somebody);
}
-
-
+
An optional parameter (using Google Closure Compiler syntax)/**
* @param {string=} somebody - Somebody's name.
@@ -177,8 +171,7 @@ Optional parameters and default
}
alert('Hello ' + somebody);
}
-
-
+
An optional parameter and default value/**
* @param {string} [somebody=John Doe] - Somebody's name.
@@ -189,8 +182,7 @@ Optional parameters and default
}
alert('Hello ' + somebody);
}
-
-
+
Multiple types and repeatable parameters
The following examples show how to use type expressions to indicate that a parameter can accept multiple types (or any type), and that a parameter can be provided
more than once. See the
@@ -207,8 +199,7 @@
Multiple types and repeatable
}
alert('Hello ' + somebody);
}
-
-
+
Allows any type/**
* @param {*} somebody - Whatever you want.
@@ -216,8 +207,7 @@ Multiple types and repeatable
function sayHello(somebody) {
console.log('Hello ' + JSON.stringify(somebody));
}
-
-
+
Allows a parameter to be repeated/**
* Returns the sum of all numbers passed to the function.
@@ -230,8 +220,7 @@ Multiple types and repeatable
}
return t;
}
-
-
+
Callback functions
If a parameter accepts a callback function, you can use the @callback
tag to define a callback type, then include
the callback type in the @param
tag.
@@ -251,8 +240,7 @@ Callback functions
function doSomethingAsynchronously(cb) {
// code
};
-
-
+
diff --git a/tags-property.html b/tags-property.html
index fcf66e0b..5c265a5f 100644
--- a/tags-property.html
+++ b/tags-property.html
@@ -42,14 +42,14 @@ Synonyms
@prop
Overview
- The @property tag is a way to easily document a list of static properties of a class, namespace or other object.
+ The @property
tag is a way to easily document a list of static properties of a class, namespace or other object.
Normally JSDoc templates would create an entire new page to display information about each level of a nested namespace hierarchy. Sometimes what you really want
is to just list all the properties, including nested properties, all together on the same page.
Note that property tags must be used in doc comments for the thing that they are properties of, a namespace or a class for example. This tag is intended for
- simple collections of static properties, it does not allow you to provide @examples or similar complex information for each property, just the type, name and
- description.
+ simple collections of static properties, it does not allow you to provide @examples
or similar complex information for each property, just the
+ type, name and description.
Examples
- In this example we have a namespace named "config." We want all the information about the defaults property, including its nested values, to appear
+
In this example we have a namespace named config
. We want all the information about the defaults property, including its nested values, to appear
on the same page with the documentation for config.
A namespace with defaults and nested default properties/**
diff --git a/tags-protected.html b/tags-protected.html
index 0db28faa..6ddd4a65 100644
--- a/tags-protected.html
+++ b/tags-protected.html
@@ -39,11 +39,9 @@ Table of Contents
Syntax
With the JSDoc tag dictionary (enabled by default):
- @protected
-
+ @protected
With the Closure Compiler tag dictionary:
- @protected [{typeExpression}]
-
+ @protected [{typeExpression}]
Overview
The @protected
tag marks a symbol as protected. Typically, this tag indicates that a symbol is only available, or should only be used, within the
current module.
@@ -58,8 +56,7 @@ Examples
/** @protected */
this._bar = 1;
}
-
-
+
diff --git a/tags-requires.html b/tags-requires.html
index a0c59159..fd9f9172 100644
--- a/tags-requires.html
+++ b/tags-requires.html
@@ -35,11 +35,11 @@ Table of Contents
Syntax
- @requires <someModuleName>
-
+ @requires <someModuleName>
Overview
- 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.
+ 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 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.
@@ -53,13 +53,11 @@ Examples
* @requires xyzcorp/helper.ShinyWidget#polish
*/
function Widgetizer() {}
-
-
+
diff --git a/tags-since.html b/tags-since.html
index d0a8e50a..b2a075f2 100644
--- a/tags-since.html
+++ b/tags-since.html
@@ -38,10 +38,9 @@ Table of Contents
Syntax
- @since <versionDescription>
-
+ @since <versionDescription>
Overview
- The @since tag indicates that a class, method, or other symbol was added in a specific version.
+ The @since
tag indicates that a class, method, or other symbol was added in a specific version.
Examples
Using the @since tag/**
@@ -49,8 +48,7 @@ Examples
* @since 1.0.1
*/
function UserRecord() {}
-
-
+
@version
@@ -58,8 +56,7 @@
diff --git a/tags-static.html b/tags-static.html
index 9bc168be..e9c5cd2f 100644
--- a/tags-static.html
+++ b/tags-static.html
@@ -35,10 +35,10 @@ Table of Contents
Overview
- The @static tag indicates that a symbol is contained within a parent and can be accessed without instantiating the parent.
- Using the @static tag will override a symbol's default scope, with one exception: Symbols in global scope will remain global.
+ The @static
tag indicates that a symbol is contained within a parent and can be accessed without instantiating the parent.
+ Using the @static
tag will override a symbol's default scope, with one exception: Symbols in global scope will remain global.
Examples
- The following example has the same effect as writing "@function MyNamespace.myFunction" and omitting the @memberof and @static tags:
+ The following example has the same effect as writing @function MyNamespace.myFunction
and omitting the @memberof
and @static
tags:
Using @static in a virtual comment/** @namespace MyNamespace */
@@ -47,8 +47,7 @@ Examples
* @memberof MyNamespace
* @static
*/
-
-
+
The following example forces a module's inner member to be documented as a static member:
Using @static to override the default scope/** @module Rollerskate */
@@ -59,8 +58,7 @@ Examples
* @static
*/
var wheel = 1;
-
-
+
diff --git a/tags-summary.html b/tags-summary.html
index eaddc799..19ef4f99 100644
--- a/tags-summary.html
+++ b/tags-summary.html
@@ -38,10 +38,9 @@ Table of Contents
Syntax
- @summary Summary goes here.
-
+ @summary Summary goes here.
Overview
- The @summary tag is a shorter version of the full description. It can be added to any doclet.
+ The @summary
tag is a shorter version of the full description. It can be added to any doclet.
Examples
/**
* A very long, verbose, wordy, long-winded, tedious, verbacious, tautological,
@@ -63,8 +62,7 @@
diff --git a/tags-this.html b/tags-this.html
index 48e0d3df..6d8e1ae4 100644
--- a/tags-this.html
+++ b/tags-this.html
@@ -38,12 +38,12 @@ Table of Contents
Syntax
- @this <namePath>
-
+ @this <namePath>
Overview
- The @this tag indicates what the this
keyword refers to when used within another symbol.
+ The @this
tag indicates what the this
keyword refers to when used within another symbol.
Examples
- In the following example, the @this tag causes "this.name" to be documented as "Greeter#name" rather than a global symbol called "name".
+ In the following example, the @this
tag causes this.name
to be documented as Greeter#name
rather than a global symbol
+ called name
.
/** @constructor */
function Greeter(name) {
setName.apply(this, name);
@@ -62,8 +62,7 @@
diff --git a/tags-type.html b/tags-type.html
index 37f4637b..d90927f4 100644
--- a/tags-type.html
+++ b/tags-type.html
@@ -38,11 +38,10 @@ Table of Contents
Syntax
- @type {typeName}
-
+ @type {typeName}
Overview
- The @type tag allows you to provide a type expression identifying the type of value that a symbol may contain, or the type of value returned by a function. You
- can also include type expressions with many other JSDoc tags, such as the @param tag.
+ The @type
tag allows you to provide a type expression identifying the type of value that a symbol may contain, or the type of value returned by
+ a function. You can also include type expressions with many other JSDoc tags, such as the @param
tag.
A type expression can include the JSDoc namepath to a symbol (for example, myNamespace.MyClass
); a built-in JavaScript type (for example, string
);
or a combination of these. You can use any
Google Closure Compiler type expression,
@@ -280,9 +279,8 @@
Examples
var foo;
/** @type {number} */
var bar = 1;
-
-
- In many cases, you can include a type expression as part of another tag, rather than including a separate @type tag in your JSDoc comment.
+
+ In many cases, you can include a type expression as part of another tag, rather than including a separate @type
tag in your JSDoc comment.
Type expressions can accompany many tags./**
* @type {number}
@@ -294,8 +292,7 @@ Examples
/** @const {number} */
var FOO = 1;
-
-
+
diff --git a/tags-typedef.html b/tags-typedef.html
index 2401234b..4f839129 100644
--- a/tags-typedef.html
+++ b/tags-typedef.html
@@ -38,13 +38,12 @@ Table of Contents
Syntax
- @typedef [<type>] <namepath>
-
+ @typedef [<type>] <namepath>
Overview
- The @typedef tag is useful for documenting custom types, particularly if you wish to refer to them repeatedly. These types can then be used within other tags
- expecting a type, such as
- @type or @param.
- Use the @callback tag to document the type of callback functions.
+ The @typedef
tag is useful for documenting custom types, particularly if you wish to refer to them repeatedly. These types can then be used within
+ other tags expecting a type, such as
+ @type
or @param
.
+ Use the @callback
tag to document the type of callback functions.
Examples
This example defines a union type for parameters that can contain either numbers or strings that represent numbers.
@@ -59,8 +58,7 @@ Examples
*/
function setMagicNumber(x) {
}
-
-
+
This example defines a more complex type, an object with several properties, and sets its namepath so it will be displayed along with the class that uses the
type. Because the type definition is not actually exposed by the class, it is customary to document the type definition as an inner member.
@@ -79,8 +77,7 @@ Examples
* containing all three components of the Triforce.
*/
function WishGranter(triforce) {}
-
-
+
diff --git a/tags-variation.html b/tags-variation.html
index e835ac05..84b0f3c6 100644
--- a/tags-variation.html
+++ b/tags-variation.html
@@ -38,19 +38,17 @@ Table of Contents
Syntax
- @variation <variationNumber>
-
+ @variation <variationNumber>
Overview
Sometimes your code may include multiple symbols with the same longname. For example, you might have both a global class and a top-level namespace called Widget
.
- In cases such as these, what does "{@link Widget}" or "@memberof Widget" mean? The global namespace, or the global class?
- Variations help JSDoc distinguish between different symbols with the same longname. For example, if "@variation 2" is added to the JSDoc comment for
- the Widget class, "{@link Widget(2)}" will refer to the class, and "{@link Widget}" will refer to the namespace. Alternatively, you can
- include the variation when you specify the symbol's with tags such as @alias or @name (for example,
- "@alias Widget(2)").
- You can provide any value with the @variation tag, as long as the combination of the value and the longname results in a globally unique version of the longname.
- As a best practice, use a predictable pattern for choosing the values, which will make it easier for you to document your code.
+ In cases such as these, what does
+ {@link Widget}
or @memberof Widget
mean? The global namespace, or the global class?
+ Variations help JSDoc distinguish between different symbols with the same longname. For example, if
+ @variation 2
is added to the JSDoc comment for the Widget class, {@link Widget(2)}
will refer to the class, and {@link Widget}
will refer to the namespace. Alternatively, you can include the variation when you specify the symbol's with tags such as @alias
or @name
(for example, @alias Widget(2)
).
+ You can provide any value with the @variation
tag, as long as the combination of the value and the longname results in a globally unique version
+ of the longname. As a best practice, use a predictable pattern for choosing the values, which will make it easier for you to document your code.
Examples
- The following example uses the @variation tag to distinguish between the Widget class and the Widget namespace.
+
The following example uses the @variation
tag to distinguish between the Widget class and the Widget namespace.
Using the @variation tag/**
@@ -80,8 +78,7 @@ Examples
*/
metallic: true
};
-
-
+
diff --git a/tags-yields.html b/tags-yields.html
index 1f28fe94..99c36a8e 100644
--- a/tags-yields.html
+++ b/tags-yields.html
@@ -45,8 +45,7 @@ Synonyms
@yield
Syntax
- @yields [{type}] [description]
-
+ @yields [{type}] [description]
Overview
The @yields
tag documents the value that is yielded by a generator function. This tag is available in JSDoc 3.5.0 and later.
If you are documenting a regular function, use the @returns
tag instead of this tag.
@@ -59,8 +58,7 @@
Examples
* @yields {number}
*/
function* fibonacci() {}
-
-
+
@yields tag with a type and description/**
* Generate the Fibonacci sequence of numbers.
@@ -68,8 +66,7 @@ Examples
* @yields {number} The next number in the Fibonacci sequence.
*/
function* fibonacci() {}
-
-
+
@returns
@@ -77,8 +74,7 @@