readyou / jsdoc-toolkit

Automatically exported from code.google.com/p/jsdoc-toolkit
0 stars 0 forks source link

Documenting indefinite number of params #246

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I sometimes use functions which allow an indefinite number of non-named
arguments (accessed via the arguments object).

I'd like to have a way to document such parameters as such. I could name
the first potential parameter (which may itself be optional), but it would
be nice to have some formal way to indicate that this parameter, if
present, may also be followed by an indefinite number of additional
arguments (probably of the same type, though I have seen some cases where
there may be an alternation--e.g., add('someProp', 'someVal', 'someProp2',
'someVal2', ...)).

A partial solution might be to describe the arguments object as a kind of
property (though "arguments" can be used as an argument--it is not reserved
solely for the arguments object).

Original issue reported on code.google.com by bret...@gmail.com on 29 Aug 2009 at 12:55

GoogleCodeExporter commented 9 years ago
Wouldn't tis work?

@param {string} [someProp] An optional first argument.
@param {string[]} [...] More optional arguments.

Original comment by micmath on 8 Nov 2009 at 8:26

GoogleCodeExporter commented 9 years ago
Inactive so closing.

Original comment by micmath on 3 Jul 2010 at 7:56

GoogleCodeExporter commented 9 years ago
Has anything changed in this regard? Is there a way to document indefinite 
arguments now? I would love to see support for this too (such signatures are 
quite common).

Original comment by kan...@gmail.com on 28 Sep 2010 at 8:18