I'd like to get Intellisense support in Visual Studio for the options objects I use in my method calls.
It's common to configure a call to a function in Javascript with a catch-all options object - for example jquery's Ajax call uses:
$.ajax(settings);
Where settings is just an object like:
$.ajax({
url: '/blah',
data: { stuff: 1 },
method: 'POST',
// etc
});
Although it's an implicit object, the properties follow a specific class. Typically when you have something like this that's important for Intellisense/describing code but not for the code to work you put this in a -vsdoc.js file. But how do I get Intellisense to come up for this object?
I looked at jquery-vsdoc.js for an example, since it's provided by Microsoft - to no avail. In one case they just type it as "Object" and the other they just don't document it at all.
I've tried this for example - in fillTable.js:
function fillTable(options) {
/// <param name="options" type="FillTableOptions">Options to fill table</param>
And in fillTable-vsdoc.js:
function FillTableOptions() {
/// <field type="String">Id property</field>
this.idProp = 'Id';
But all I get for Intellisense is that the type is FillTableOptions - when I then create the object I get no Intellisense help while picking properties.
So, how do I get Intellisense support for the properties of an object like this?