I managed to get javascript intellisense to work correctly for a prototype class defined as follows:
function GetCustomerList()
{
}
GetCustomerList.prototype =
{
HEADER: {
RETURN_CODE: 0,
RETURN_MESSAGE: "",
}
,
NUM_RECORDS: 0,
START_RECORD: 0,
END_RECORD: 0
};
I can print something like:
var req = new GetCustomerList();
req.HEADER.RETURN_CODE = 100;
And Visual Studio intellisense knows about the HEADER property and its own properties with the names "RETURN_CODE" and "RETURN_MESSAGE". I can do:
req.NUM_RECORDS = 50;
With perfect intellisense work.
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 type "CUSTOMER", for which I also defined a prototype. I would like to be able to introduce things like:
req.CUSTOMER[ 0 ].NAME
And ask intellisense to indicate that "NAME" is a property available for this array.
?