I have some code that returns a promise object, e.g. using Q library for NodeJS.
var Q = require(\'q\');
/**
* @returns
Syntax currently supported by Jsdoc3:
/**
* Retrieve the user's favorite color.
*
* @returns {Promise} A promise that contains the user's favorite color
* when fulfilled.
*/
User.prototype.getFavoriteColor = function() {
// ...
};
Supported in the future?
/**
* A promise for the user's favorite color.
*
* @promise FavoriteColorPromise
* @fulfill {string} The user's favorite color.
* @reject {TypeError} The user's favorite color is an invalid type.
* @reject {MissingColorError} The user has not specified a favorite color.
*/
/**
* Retrieve the user's favorite color.
*
* @returns {FavoriteColorPromise} A promise for the user's favorite color.
*/
User.prototype.getFavoriteColor = function() {
// ...
};
See github discussion at: https://github.com/jsdoc3/jsdoc/issues/1197