Question

Does anyone know of an extern file for jQueryUI 1.9.1?

Alternately is there a tool that can generate an extern file? Seems like someone out there must be smart enough to have figured out how to do it automatically.

Thanks!

Was it helpful?

Solution

Unfortunately the answer is that no known extern for any version of jQuery UI currently exists.

The jQuery UI documentation now has public feeds which would make generating an extern from that documentation possible, but that has yet to be done.

OTHER TIPS

As far as I can tell, it is not possible to have a meaningful closure extern declaration for the jQuery UI API. The problem is stems from the API structure. Instead of creating typeable methods, such as:

var date = $("#datepicker").getDate();  // does not work

the API exposes sub-methods for each type of widget with the method selector given as a string for the first argument, e.g.

var date = $("#datepicker").datepicker("getDate");

So that means that the datepicker function can take a wide variety of arguments, and return a wide variety of types, depending both on what method selector is provided. The best I can figure out how to do with just an externs declaration is something following this pattern:

/**
 * @param {(string|Object)} fnName
 * @param {...?} fnArgs
 * @return {?}
 */
jQuery.prototype.datepicker = function(fnName, fnArgs) {};

This has the effect of quieting warning messages for correct calls to jQuery UI APIs, but does not help in finding incorrect calls.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top