Multiple externs may declare the same symbol and that's ok. That doesn't work if an extern is declared with `let` instead of `var`, you get errors like: Duplicate let / const / class / function declaration in the same scope is not allowed.
With these changes we have zero errors and zero warnings with `RECOMMENDED_FLAGS`!
Most of the changes were adding `@override` for methods and properties in mixins. Apparently if you implement an interface you need to say `@override` for each method or property on the interface. This combines with our mixin strategy to the tune of needing to add `@override` on every non-private method and property.
I'm not sure this is intended behavior of the compiler. Filed https://github.com/google/closure-compiler/issues/3137 to see if it is.
Polymer V1 applications are compiled with hand-written externs at
https://github.com/google/closure-compiler/blob/master/contrib/externs/polymer-1.0.js.
These externs contain some types that do not exist in the V2 code.
PolymerDomApi is the type returned by the V1 Polymer.dom API, but in V2
it returns Polymer.DomApi. This adds the PolymerDomApi interface to the
V2 externs, and annotates that Polymer.DomApi implements it. This allows
both V1 and V2 code to use the PolymerDomApi type. Similar story for
PolymerDomApi.ObserveCallback.
Polymer.Iconset would ideally live in the iron-iconset repo, but many
packages reference the type without actually depending on that library,
so its simpler to just include it here, similar to how it worked for
Polymer V1.
* Update gen-closure-declarations to 0.5.0
This fixes the externs generation for our modules
* Generate closure types before publishing
* Actually remove closure-types.js from git
* Remove HTML Imports from webcomponents externs
* Add back externs/polymer-externs.js
Make Polymer gestures library safe for Closure property renaming.
The issue here was that we were assuming that the method for a given
gesture would always match the string name of that gesture, e.g. that if
the gesture name was "mousedown" that we could call
gestureDefinition.mousedown. In actuality, gestureDefinition.mousedown
could be renamed by Closure, which would throw with "undefined is not a
function".
The fix is to move the GesturesRecognizer type into our externs, which
prevents those methods from being renamed.
- Publishing (actually packing) will now generate the typings and fail
if they don't compile.
- Travis will now generate the typings and fail if they don't compile.
- Some minor tweaks to get typings compiling.
* add void return type annotations
* define dom api prototype members as functions
* fix renderstatus optional parameters
* fix style-gatherer types
* fix templatize types
* fix event listener remove types
* use generics in mixinBehaviors
* update gen-typescript-declarations
* add memberof annotation to domapi methods
* add domapi types
* move dom methods to correct place
* use parameterless NodeList for the dom API