I'm trying to document something similar to the following where baz1
and bazzed
are properties contained in the bar
and bar
is a member of Foo
/**
* @class
*/
function Foo(){
this.bar = {
/**
* The baz function
*/
baz1: function(){},
/**
* The baz1 function
*/
bazzed: 'bazzed'
}
}
var foo = new Foo();
//call baz and baz1
foo.bar.baz();
foo.bar.baz1;
Right now JSDoc documents Foo
and bar
, but it misses baz1
and bazzed
.
I realize that I could do something like this
/**
* @class
*/
function Foo(){
/**
* @property {function} baz - Does baz
* @proprety {string} baz1 - Stores baz1
*/
this.bar = {
/**
* The baz function
*/
baz1: function(){},
/**
* The baz1 function
*/
bazzed: 'bazzed'
}
}
but I prefer not to for three reasons:
- Some classes have
baz2:function(){}
throughbaz10:function(){}
- Some
baz
's have large comment blocks and it doesn't seem to make sense to include inbar
's comment block. - In some places the code has
foo.bar.baz.buzz()
which only compounds reasons 1 and 2.
I know this is a really long question, but I've spent the past 4 hours searching to come up empty.