I am struggling with JSDoc 3 recognizing instance properties defined using Object.defineProperties
in my class. Here is a simplified version of the code I am working on:
/** @exports mymodule */
function mymodule(exports) {
/** @constructor
* @param {String} foo A foo.
* @param {String} bar A bar.
* @classdesc Has a foo and a bar.
*/
function Example(foo, bar) {
Object.defineProperties(this, {
/** A foo and a bar
* @memberof Example
*/
foobar: { enumerable: false, value: foo + bar, writable: false }
});
}
exports.Example = Example;
}
After running JSDoc, I can see output for mymodule
, Example
, foo
, and bar
, but not for foobar
. Despite trying various approaches like adding @memberof mymmodule~Example
and using @lends
, I have not been successful in documenting foobar
as part of Example
.
Can anyone provide guidance on how to properly document foobar
as belonging to Example
?