So far i have added extension methods to JQuery like this:
module JQueryExtensions {
export function foo() {
...
}
}
interface JQuery {
foo(): JQuery;
}
(function ($) {
$.fn.foo = function (): JQuery {
...
return this;
};
})(jQuery);
It was good as an extension method to a JQuery instance like $('selector').foo(). But now i need to add a static function to be able to call it like $.foo();
I Have tried replacing "JQuery" with "JQueryStatic" like this:
module JQueryExtensions {
export function foo() {
...
}
}
interface JQueryStatic{
foo(): JQuery;
}
(function ($) {
$.fn.foo = function (): JQuery {
...
return this;
};
})(JQueryStatic);
But it gives me the following error: "Cannot find name 'JQueryStatic'."
jQueryinstead ofJQueryStaticand use$.foo =instead of$.fn.foo =