jsdoc, arrays, and @type [message #757529] |
Fri, 18 November 2011 19:10 |
tdunnigan Messages: 1 Registered: November 2011 |
Junior Member |
|
|
Hi all,
I have a few questions regarding jsDoc, arrays, and @type.
1) Are curly braces { } required when specifying a type?
@param {string} familyName The user's family name
@param string familyName The user's family name
2) How do I specify arrays of objects? Say I have an object 'Person'. I've seen jsdoc examples defining arrays in a couple of ways:
@param {Person[]} people An array of person objects
@param {Array.<Person>} people An array of person objects
When I try either option I get the warning "JSdoc: Invalid tag param name".
3) When I define a type of an instance variable Eclipse doesn't seem to be picking up on it.
/**
* @constructor
*/
function Person () {
/** @type {string} */
this.familyName = null;
}
/**
* @constructor
*/
function Payroll () {
/** @type {Person} */
this.employee;
}
Payroll.prototype.GiveRaise = function() {
this.employee.
}
Now when I create this function I try to auto-complete after 'this.employee.' but Eclipse can't offer any auto-completes. I was expecting it to present "familyName". Am I doing something wrong?
[Updated on: Fri, 18 November 2011 19:11] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03317 seconds