我有一段这样的代码:
//line 0
/**
* Constructor of class Person
* @class
* @constructor
* @param {string} name Name of person
* @param {string} surname Surname of person
* @param {number} age Age of person
*/
function Person(name, surname, age){
this.name = name;
this.surname = surname;
this.age = age;
}
/** Optional for my project, MISSING JSDOC */
Person.prototype = {
//..somethings..
/** MISSING JSDOC */
talk: function(){
//..somethings..
},
/** MISSING JSDOC */
walk: function(){
//..somethings..
},
/** MISSING JSDOC */
foo: function(){
//..somethings..
p.bar();
//..somethings..
}
};
/**
* A shortcut to access to {@link Person} methods' more easly
* @type {Object} p
*/
var p = Person.prototype;
//something else
但我不知道如何注释 .prototype 对象以使用 IntelliSense 查看属性或方法的描述和可能的类型。 我之前曾尝试在 StackOverflow 和其他网站上进行搜索,但没有什么真正有用的。 抱歉英语不好。
使用@memberof标签标识符。请参阅文档和使用示例:JSDoc @memberof
您可能还想使用@alias从文档中排除“原型”。使用示例和文档:JSDoc @alias