I created a separate file for the utility functions, and the second file for the utility functions + VSDoc.
utilities.js:
function castToJQuery(item) { return item; }
utility-vsdoc.js:
function castToJQuery(item) { /// <summary> /// 1: $(item) - "Casts" the specified item to a jQuery object for the sake of Intellisense /// </summary> /// <returns type="jQuery" /> return $("dummy"); }
Now I can call castToJQuery in any of my downstream files so that Visual Studio considers the dynamic property to be a jQuery object.
var selectedStoreDocument = castToJQuery(urlParams["storeDocument"]); selectedStoreDocument.find("products");
Visual Studio now works with Intellisense for my dynamic urlParams ["storeDocument"].
Peder rice
source share