I am trying to determine the best way to use JSDoc 3 to document the attributes and options arguments to a Backbone.Model
.
Ideally I'd like to be able to do:
/**
* @class
* @attribute {string} foo the foo attribute
* @attribute {integer} bar the bar attribute
* @option {bolean} baz the baz option
* @option {string} qux the qux option
*/
var MyModel = Backbone.Model.extend({
...
});
However there is no @option
tag in JSDoc 3, and @attribute
doesn't mean the same thing as a Backbone attribute. In theory I think one could somehow make custom tags like the ones in my pseudo-code, but I couldn't find any existing plug-in with these, and the documentation on how to create custom tags is almost non-existent.
So, since I seem stuck with the built-in tags for now, my question is: what's the next best thing to my pseudo-code (using actual JSDoc 3 tags)?
NOTE: There are several similar questions to this one (How to jsdoc annotate BackboneJS code?, How do I document AMD + Backbone project with JSDoc3) but they all focus on the "big picture" of getting Backbone objects recognized at all. I couldn't find any that specifically addressed the issue of attributes/options.