This project is read-only.

Scoping issues while ugmenting jQuery interface

Topics: General
Mar 7, 2013 at 5:10 AM
I have a jquery.random.d.ts file that hold all of my little jQuery extension interfaces. Obviously, they have to augment either the JQuery or the JQueryStatic interface. They work fine 99% of the time, but I ran into a small issue, and I'm not sure if it's a bug or intentional. Here's my code:
$.base64.encode(...); //works fine here
    onComplete: function() {
        $.base64.decode(...); //isn't part of interface here
As you can see, I call the jQuery fancybox function in my code (actually inside a private method of a class). It works just fine, and all of my jQuery extensions show up just fine. But when I'm inside the callback function in the code, none of the extensions show up. Only the members from jquery.d.ts show up, none of the ones from any of my files.

I've been searching for about 30 minutes with no luck. Have I run into a bug?
Mar 8, 2013 at 4:16 PM

You might be hitting a bug. There's a known issue where object literals sometimes do not give you the correct completion list.

We're currently doing a thorough rewrite of the typechecker, so we'll keep this on the radar for the rewrite.