I'm having trouble using JSDoc3 to document code that's structured along these lines
/**
* @namespace MyNamespace.MySubNamespace
*/
(function (MyNamespace) {
MyNamespace.MySubNamespace.Foo = {
doSomething: function (someParam) {
// doing it
}
}
})(window.MyNamespace)
How would I use JSDoc3 to document that MyNamespace
contains MySubNamespace
which contains Foo
? Further how would I associate doSomething
with Foo
and document its parameter someParam
?
A limitation I have is that I can't add documentation to the file in which MyNamespace
and MySubNamespace
are declared.
Thanks much!
Figured it out. Hope this solution helps others.
/**
* @namespace MyNamespace.MySubNamespace
*/
(function (MyNamespace) {
/**
* Foo namespace
* @namespace Foo
* @memberOf MyNamespace.MySubNamespace
*/
var Foo = {
/**
* Does something.
* @memberOf MyNamespace.MySubNamespace.Foo
* @param {object} someParam Some parameter.
*/
doSomething: function (someParam) {
// doing it
}
};
MyNamespace.MySubNamespace.Foo = Foo;
})(window.MyNamespace)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With