google-closure

Best way to define a configuration object using Google Closure

I love how Google Closure compiler will optimize symbols in code. However, I have not found a good way to define public, exported functions that take configuration objects as parameters. Consider this code snippet: goog.provide('foo'); goog.require('goog.dom'); /** @typedef {{ * id : string, * clazz : stri...

How do I get the Closure Compiler to stop complaining about union types when calling a function?

I'm seeing this in particular when using the jQuery-1.4.3 externs file. The javadocs for that reads /** * @param {(string|number|function(number,number))=} arg1 * @return {(number|jQueryObject)} * @nosideeffects */ jQueryObject.prototype.width = function(arg1) {}; I have a call that looks like this: var w = $(window).width(...