So far, I have added extension methods in jQuery as follows:
module JQueryExtensions {
export function foo() {
...
}
}
interface JQuery {
foo(): JQuery;
}
(function ($) {
$.fn.foo = function (): JQuery {
...
return this;
};
})(jQuery);
It was good as an extension method for a jQuery instance of type $ ('selector'). foo (). But now I need to add a static function in order to be able to call it as $ .foo ();
I tried replacing "jQuery" with "jQueryStatic" as follows:
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 the name" JQueryStatic "."
source
share