New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How Do I Document an Overloaded Constructor #1017
Comments
You need to nestle the start and end of each comment together like so: /**
* DateRange class to store ranges and query dates.
*
* @constructor
* @param {(Moment|Date)} start Start of interval
* @param {(Moment|Date)} end End of interval
*//**
* DateRange class to store ranges and query dates.
*
* @constructor
* @param {!Array} range Array containing start and end dates.
*//**
* DateRange class to store ranges and query dates.
*
* @constructor
* @param {!String} range String formatted as an IS0 8601 time interval
*/
function DateRange(start, end) {
// ...
} (In the future, if you have questions, please email the jsdoc-users mailing list. The GitHub issue tracker is for bug reports and feature requests. Thanks!) |
The members of the class are repeated for each constructor though. Is that a bug? |
@hegemonic perhaps this is actually a bug, because nestling them doesn't seem to do anything. the following code: /**
* DateRange class to store ranges and query dates.
*
* @constructor
* @param {(Moment|Date)} start Start of interval
* @param {(Moment|Date)} end End of interval
*//**
* DateRange class to store ranges and query dates.
*
* @constructor
* @param {!Array} range Array containing start and end dates.
*//**
* DateRange class to store ranges and query dates.
*
* @constructor
* @param {!String} range String formatted as an IS0 8601 time interval
*/
function DateRange(start, end) {
var parts;
var s = start;
var e = end;
if (arguments.length === 1 || end === undefined) {
if (start.length === 2) { // Infer array
s = start[0];
e = start[1];
}
else {
parts = start.split('/');
s = parts[0];
e = parts[1];
}
}
this.start = moment(s);
this.end = moment(e);
} generates the following documentation (i.e. only the first example): using jsdoc |
you can view the generated documentation here. |
It's not clear in the docs, I'm trying the following but it's only showing the last definition:
The text was updated successfully, but these errors were encountered: