How to do this is now described in the JSDoc documentation, and it uses an ellipsis like the Closure docs do.
@param {...<type>} <argName> <Argument description>
You need to supply a type to go after the ellipsis, but you can use a *
to describe accepting anything, or use the |
to separate multiple acceptable types. In the generated documentation JSDoc will describe this argument as repeatable, in the same way it describes optional arguments as optional.
In my testing there was no need to have an argument in the actual javascript function definition, so your actual code can just have empty parentheses, i.e. function whatever() { ... }
.
Single type:
@param {...number} terms Terms to multiply together
Any type (in the example below, the square brackets mean items
will get tagged as both optional and repeatable):
@param {...*} [items] - zero or more items to log.
Multiple types need parentheses around the type list, with the ellipsis before the opening paren:
@param {...(Person|string)} attendees - Meeting attendees, listed as either
String names or {@link Person} objects