I have struggled to try and figure out a good way of doing this, but to no avail. Maybe someone here can help me document an IIFE like the following
var module = (function(){
var main = function() {
return Object.create(main.prototype);
};
main.foo = function() {};
main.prototype.foo = function() {};
return main;
}());
Module can then be used like jQuery where you can call module()
, module.foo()
or module().foo()
and I need to document all of those calls clearly.
Edit: Specifically, what JSDoc annotations can I use to document the public API of this module? I've tried mixtures of @namespace, @module, @alias and @memberof and either the prototype functions do not show, or they do, but they are indistinguishable from the primary functions.