// My function does X and Y.
// @params {object} parameters An object containing the parameters
// @params {function} callback The callback function
function(parameters, callback) {
}
But how do I describe how the parameters object should be structured? For example it should be something like:
{
setting1 : 123, // (required, integer)
setting2 : 'asdf' // (optional, string)
}
From the @param wiki page:
Parameters With Properties
If a parameter is expected to have a particular property, you can document that immediately after the @param tag for that parameter, like so:
There used to be a @config tag which immediately followed the corresponding @param, but it appears to have been deprecated (example here).