I have been able to get javascript intellisense working correctly for a 'class' prototype defined like this:
function GetCustomerList()
{
}
GetCustomerList.prototype =
{
HEADER: {
RETURN_CODE: 0,
RETURN_MESSAGE: "",
}
,
NUM_RECORDS: 0,
START_RECORD: 0,
END_RECORD: 0
};
I can type something like:
var req = new GetCustomerList();
req.HEADER.RETURN_CODE = 100;
And Visual Studio's intellisense knows about the HEADER property, and its own properties named 'RETURN_CODE' and 'RETURN_MESSAGE'. I can do:
req.NUM_RECORDS = 50;
With intellisense working perfectly.
So intellisense works with complex nested types - great. However is it possible to get intellisense with an array of complex types?
Example:
function Customer()
Customer.prototype = {
NAME: "",
ADDRESS: "",
ID: 0
};
function GetCustomerList()
{
}
GetCustomerList.prototype =
{
HEADER: {
RETURN_CODE: 0,
RETURN_MESSAGE: "",
}
,
NUM_RECORDS: 0,
START_RECORD: 0,
END_RECORD: 0,
CUSTOMERS: [ new CUSTOMER() ]
};
Where I have an array of the type 'CUSTOMER' which I have also defined a prototype for. I'd like to be able to type things like:
req.CUSTOMER[ 0 ].NAME
And have intellisense prompt me that 'NAME' is a property available for this array.
Is this possible?