'JSDoc and Revealing Module Pattern: module functions passed as parameters (type unresolved)

In a revealing module pattern we have functions that are our modules. Let's say we want to pass a function/module as a parameter to another function/module.

let myApp = function ()
{
    let settings = appSettings();
    settings.foo();
    let module1 = appModule1(settings);
}();

/**
 * @namespace Settings
 */
let appSettings = function ()
{
    /**
     * @memberof Settings
     * @returns {Number} Zero.
     */
    function foo ()
    {
        return 0;
    }
    return {
        foo: foo
    };
};

/**
 * @param {Settings}
 */
let appModule1 = function (settings)
{
    settings.foo();
    return {};
};

For @param {Settings} VS Code / IntelliSense says

type Settings = /*unresolved*/ any

enter image description here

How would we document appSettings so the type of the parameter in appModule1 is resolvend correctly?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source