I eventually found the answer myself in this (non-Backbone-specific) Stack Overflow thread: How to describe "object" arguments in jsdoc?.
To summarize, you can document attributes/options by making an initial parameter (eg. @param attributes
), then making a @param attributes.foo
or @param options.bar
tag. In other words, my pseudo code could be re-done properly with the following syntax:
/**
* @class
* @param {Object} attributes
* @param {string} attributes.foo the foo attribute
* @param {integer} attributes.bar the bar attribute
* @param {Object} options
* @param {boolean} options.baz the baz option
* @param {string} options.qux the qux option
*/
var MyModel = Backbone.Model.extend({
...
});
I still think that it'd be preferable if there was some sort of JSDoc3-Backbone plug-in that allowed @attribute
/@option
tags, so if one exists and someone posts it as an answer I'll gladly accept that answer instead of my own.