JSDoc 不能使用这个示例脚本,为什么?

JSDoc wont work with this example script, why?

我试图用 nodejs 掌握 JSDoc 3.5 的窍门,我制作了一个小脚本来测试它。我按原样使用 JSDoc,没有任何更改或自定义配置。

这是脚本:

/**
 * TestLib
 * A simple test for jsdoc to parse
 * @author MMAI
 * @version 0.1
 * @returns {TestLib} The static reference of this lib
 */
 'use strict';
function TestLib() {
    var api = {};

    /**
     * testMethod()
     * adds two arguments together and returns the results
     * @type {Function}
     * @param {Number} a_arg1 The first number in the addition
     * @param {Number} a_arg2 The second number in the addition
     * @returns {Number} The result of the addition
     */
    api.testMethod = function (a_arg1, a_arg2) {
        return a_arg1 + a_arg2;
    };

    //api set
    return api;
}

目前只有全局函数 TestLib 记录在 global.html 中,但 testMethod 中没有记录。这是否意味着 JSDoc 不能很好地处理这种编码?或者我在这里遗漏了什么?

在此先感谢您提供有关此问题的任何信息。

吉姆

好的,找到我需要的东西了。我需要在我的内部方法中使用@namepsace 和@alias。

/**
 * @namespace
 * TestLib
 * A simple test for jsdoc to parse
 * @author MMAI
 * @version 0.1
 * @returns {TestLib} The static reference of this lib
 */
 'use strict';
function TestLib() {
    var api = {};

    /**
     * @alias TestLib.testMethod
     * adds two arguments together and returns the results
     * @type {Function}
     * @param {Number} a_arg1 The first number in the addition
     * @param {Number} a_arg2 The second number in the addition
     * @returns {Number} The result of the addition
     */
    api.testMethod = function (a_arg1, a_arg2) {
        return a_arg1 + a_arg2;
    };

    //api set
    return api;
}