我想记录一个名为User的类中的功能,该类位于闭包内部 - 我如何使用JsDoc3实现这一点?
以下是我的代码:
/**
@class User
@classdesc This is the class that describes each user.
*/
(function($){
var _defaults = {
'first_name': '',
'last_name': ''
};
/**
@constructor
*/
function User(options) {
this.options = $.extend({}, _defaults, options);
}
/**
@method
@desc Returns the combined first name and last name as a string
@returns {string}
*/
User.prototype.getName() = function(){
return this.options.first_name + this.options.last_name;
};
window.User = User;
}(jQuery));