Skip to content

Commit

Permalink
Merge pull request #5300 from Polymer/2.x-typescript
Browse files Browse the repository at this point in the history
Updates to Polymer 2.x for latest type generator changes
  • Loading branch information
aomarks authored Jul 27, 2018
2 parents 654f904 + 7f68ab5 commit d59546d
Show file tree
Hide file tree
Showing 33 changed files with 9,003 additions and 7,118 deletions.
2 changes: 1 addition & 1 deletion externs/closure-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ Polymer_TemplateStamp.prototype._addMethodEventListenerToNode = function(node, e
*/
Polymer_TemplateStamp.prototype._addEventListenerToNode = function(node, eventName, handler){};
/**
* @param {Node} node Node to remove event listener from
* @param {!Node} node Node to remove event listener from
* @param {string} eventName Name of event
* @param {function (!Event): void} handler Listener function to remove
* @return {void}
Expand Down
2 changes: 2 additions & 0 deletions lib/elements/array-selector.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
* @constructor
* @extends {superClass}
* @implements {Polymer_ElementMixin}
* @private
*/
let elementBase = Polymer.ElementMixin(superClass);

Expand Down Expand Up @@ -347,6 +348,7 @@
* @constructor
* @extends {Polymer.Element}
* @implements {Polymer_ArraySelectorMixin}
* @private
*/
let baseArraySelector = ArraySelectorMixin(Polymer.Element);

Expand Down
1 change: 1 addition & 0 deletions lib/elements/dom-bind.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* @implements {Polymer_PropertyEffects}
* @implements {Polymer_OptionalMutableData}
* @implements {Polymer_GestureEventListeners}
* @private
*/
const domBindBase =
Polymer.GestureEventListeners(
Expand Down
1 change: 1 addition & 0 deletions lib/elements/dom-repeat.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* @constructor
* @implements {Polymer_OptionalMutableData}
* @extends {Polymer.Element}
* @private
*/
const domRepeatBase = Polymer.OptionalMutableData(Polymer.Element);

Expand Down
1 change: 1 addition & 0 deletions lib/legacy/class.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
*/
function GenerateClassFromInfo(info, Base) {

/** @private */
class PolymerGenerated extends Base {

static get properties() {
Expand Down
1 change: 1 addition & 0 deletions lib/legacy/legacy-element-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
* @implements {Polymer_ElementMixin}
* @implements {Polymer_GestureEventListeners}
* @implements {Polymer_DirMixin}
* @private
*/
const legacyElementBase = Polymer.DirMixin(Polymer.GestureEventListeners(Polymer.ElementMixin(base)));

Expand Down
1 change: 1 addition & 0 deletions lib/mixins/dir-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
* @constructor
* @extends {base}
* @implements {Polymer_PropertyAccessors}
* @private
*/
const elementBase = Polymer.PropertyAccessors(base);

Expand Down
2 changes: 2 additions & 0 deletions lib/mixins/disable-upgrade-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@
* @constructor
* @extends {base}
* @implements {Polymer_ElementMixin}
* @private
*/
const superClass = Polymer.ElementMixin(base);

/**
* @polymer
* @mixinClass
Expand Down
1 change: 1 addition & 0 deletions lib/mixins/element-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
* @extends {base}
* @implements {Polymer_PropertyEffects}
* @implements {Polymer_PropertiesMixin}
* @private
*/
const polymerElementBase = Polymer.PropertiesMixin(Polymer.PropertyEffects(base));

Expand Down
1 change: 1 addition & 0 deletions lib/mixins/properties-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
* @constructor
* @extends {superClass}
* @implements {Polymer_PropertiesChanged}
* @private
*/
const base = Polymer.PropertiesChanged(superClass);

Expand Down
1 change: 1 addition & 0 deletions lib/mixins/property-accessors.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
* @extends {superClass}
* @implements {Polymer_PropertiesChanged}
* @unrestricted
* @private
*/
const base = Polymer.PropertiesChanged(superClass);

Expand Down
1 change: 1 addition & 0 deletions lib/mixins/property-effects.html
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,7 @@
* @implements {Polymer_PropertyAccessors}
* @implements {Polymer_TemplateStamp}
* @unrestricted
* @private
*/
const propertyEffectsBase = Polymer.TemplateStamp(Polymer.PropertyAccessors(superClass));

Expand Down
1 change: 1 addition & 0 deletions lib/mixins/strict-binding-parser.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
* @constructor
* @extends {base}
* @implements {Polymer_PropertyEffects}
* @private
*/
const elementBase = Polymer.PropertyEffects(base);

Expand Down
2 changes: 1 addition & 1 deletion lib/mixins/template-stamp.html
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@
/**
* Override point for adding custom or simulated event handling.
*
* @param {Node} node Node to remove event listener from
* @param {!Node} node Node to remove event listener from
* @param {string} eventName Name of event
* @param {function(!Event):void} handler Listener function to remove
* @return {void}
Expand Down
1 change: 1 addition & 0 deletions lib/utils/mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
/**
* @constructor
* @extends {Function}
* @private
*/
function MixinFunction(){}
/** @type {(WeakMap | undefined)} */
Expand Down
11 changes: 10 additions & 1 deletion lib/utils/templatize.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
// class only because Babel (incorrectly) requires super() in the class
// constructor even though no `this` is used and it returns an instance.
let newInstance = null;

/**
* @constructor
* @extends {HTMLTemplateElement}
* @private
*/
function HTMLTemplateElementExtension() { return newInstance; }
HTMLTemplateElementExtension.prototype = Object.create(HTMLTemplateElement.prototype, {
Expand All @@ -32,16 +34,20 @@
writable: true
}
});

/**
* @constructor
* @implements {Polymer_PropertyEffects}
* @extends {HTMLTemplateElementExtension}
* @private
*/
const DataTemplate = Polymer.PropertyEffects(HTMLTemplateElementExtension);

/**
* @constructor
* @implements {Polymer_MutableData}
* @extends {DataTemplate}
* @private
*/
const MutableDataTemplate = Polymer.MutableData(DataTemplate);

Expand All @@ -53,10 +59,11 @@
newInstance = null;
}

// Base class for TemplateInstance's
/**
* Base class for TemplateInstance.
* @constructor
* @implements {Polymer_PropertyEffects}
* @private
*/
const base = Polymer.PropertyEffects(class {});

Expand Down Expand Up @@ -268,6 +275,7 @@
* @constructor
* @extends {TemplateInstanceBase}
* @implements {Polymer_MutableData}
* @private
*/
const MutableTemplateInstanceBase = Polymer.MutableData(TemplateInstanceBase);

Expand Down Expand Up @@ -311,6 +319,7 @@
let klass = templateInfo.templatizeTemplateClass;
if (!klass) {
let base = options.mutableData ? MutableDataTemplate : DataTemplate;
/** @private */
klass = templateInfo.templatizeTemplateClass =
class TemplatizedTemplate extends base {};
// Add template - >instances effects
Expand Down
Loading

0 comments on commit d59546d

Please sign in to comment.