How to document namespaces in JavaScript?

How can a namespace be documented in JavaScript using jsDoc?

Here is my attempt, is that right?

/** * My special namespace * * @name my.namespace * @namespace */ $namespace('my.namespace', /** @lends my.namespace **/ { /** * Foo - does something really neat... * @function */ foo: function() { } }); 

To clarify, the above is used as follows:

 my.namespace.foo(); 
+6
source share
1 answer

This feature is available in jsdoc3 micmath / jsdoc . Jsdoc3 syntax is different than jsdoc-toolkit (jsdoc2)

In the following example, Michael jsdoc and pseudo-spaces?

 /** * Document me. * @namespace my */ /** * My special namespace * @namespace my.namespace */ $namespace('my.namespace', /** @lends my.namespace **/ { /** * Foo - does something really neat... */ foo: function() { } }); 
+8
source

Source: https://habr.com/ru/post/895981/