How would i document a class like this one in JSDoc3?
-----------------------------------------------------
dojo.provide("SomeClass");
dojo.declare("SomeClass,
null,
{
//some private member
_props: null,
constructor: function() {
//some constructor code
},
//some function
meth: function(args) {
//the function body
}
});
-----------------------------------------------------
In JSDoc-toolkit, it would like this:
/**
* SomeClass is used for x, y and z
* @fileOverview
*/
dojo.provide("SomeClass");
dojo.declare("SomeClass",
null,
{
/**
* @lends SomeClass.prototype
*/
/**
* doc for the property
* @field
*/
_props: null,
/**
* constructor documentation
* @constructs
*/
constructor: function() {
this._connections = [];
},
/**
* @param {Object} args, passed argument...
* @function
*/
meth: function(args) {
//the function body
}
});
-----------------------------------------------------
problem with this version (in jsdoc-toolkit-2.4) is that it can't
document the "args" variable, where args is an object containing other
objects (
http://groups.google.com/group/jsdoc-users/browse_thread/
thread/7e65c3027646bb07) which is not supported in jsdoc-toolkit
-----------------------------------------------------
In JSDoc3, using the same code as before, the following breaks:
@construtor (needs to be @class name or @constructs name)
but most Importantly, no methods appear as part of the class, "meth"
and "_props" are all parts of "global".
Adding an @module to this file will transform the output to a "module"
which will contain all the methods.
The only way I got the methods and properties as part of the Object
was by adding:
@class className to the constructor
and then i needed to add
@memeberof className to every method/property (@member wasn't enough,
i had to use memberof and explicitly set the membership of the method/
property to the class)
and
@instance (to avoid <inner> and <static>)
Any suggestions?
thank you.