TypeScript warning when using jQuery: "Method Expression is not of Function type"

I get this warning when using the "$" declaration. $ isn't a function, that's true enough. $ is actually of type "JQueryStatic", which is an interface in the jQuery TS declaration file I'm using.

Any idea what's going on here? Or did I maybe come accross a bug? I'm using Webstorm EAP 6.0, build 122.864.

webstorm-typescript-error.png



Attachment(s):
webstorm-typescript-error.png
2 comments
Comment actions Permalink

Hello,

please, check if http://youtrack.jetbrains.com/issue/WI-15022 looks similar to your issue. If this is a different case, your jquery.d.ts would be helpful


Best regards,
Lena

0
Comment actions Permalink

This is the same issue, actually. Because in the jquery.d.ts, "$" is declared as type "JQueryStatic", which is an interface.

interface JQueryStatic {

...
}

declare var jQuery: JQueryStatic;
declare var $: JQueryStatic;
0

Please sign in to leave a comment.