JSDoc3: How to document a AMD module that returns a function

Posted by Jens Simon on Stack Overflow See other posts from Stack Overflow or by Jens Simon
Published on 2014-05-23T08:59:22Z Indexed on 2014/06/02 15:28 UTC
Read the original article Hit count: 200

Filed under:
|
|
|
|

I'm trying to find a way to document AMD modules using JSDoc3.

/**
 * Module description.
 *
 * @module path/to/module
 */
define(['jquery', 'underscore'], function (jQuery, _) {

    /**
     * @param {string} foo  Foo-Description
     * @param {object} bar  Bar-Description
     */
    return function (foo, bar) {
        // insert code here
    };
});

Sadly none of the patterns listed on http://usejsdoc.org/howto-commonjs-modules.html work for me.

How can I generate a proper documentation that lists the parameters and return value of the function exported by the module?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about requirejs