Do I need to declare all my JQuery prototypes in a JQueryStatic definition file with typescript?
- by Marilou
I have the following code:
///<reference path="../typescript/jquery.d.ts" />
function addThemePrototypes() {
var templateSetup = new Array();
$.fn.addTemplateSetup = function(func, prioritary)
{
if (prioritary)
{
templateSetup.unshift(func);
}
else
{
templateSetup.push(func);
}
};
}
When I try to add the following:
$('a').addTemplateSetup(
Into this same file I notice there is no intellisense and typescript does not seem to know about the addTemplateSetup prototype that I just added.
Is this the correct way for it to work or do I always need to add things like the definition for addTemplateSetup to an JQueryStatic definition file and then include that?