JSDoc @generator 标签
目录
Syntax
@generator
Overview
The @generator
tag indicates that a function is a generator function, meaning that it
was declared using the syntax function* foo() {}
. This tag is available in JSDoc 3.5.0 and later.
In general, you do not need to use this tag, because JSDoc automatically detects generator functions and identifies them in the generated documentation. However, if you are writing a virtual comment for a generator function that does not appear in your code, you can use this tag to tell JSDoc that the function is a generator function.
Example
The following example shows a virtual comment that uses the @generator
tag: