From 8f8135b2deda42cfbe7d411bb9bd6419d6b71b43 Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Wed, 21 Feb 2018 12:52:00 -0800 Subject: [PATCH] fix typings --- externs/closure-types.js | 2 +- lib/elements/dom-if.html | 2 +- lib/elements/dom-repeat.html | 2 +- lib/mixins/disable-upgrade-mixin.html | 6 +++--- lib/mixins/properties-changed.html | 2 +- types/lib/mixins/disable-upgrade-mixin.d.ts | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/externs/closure-types.js b/externs/closure-types.js index a4897db637..27e4bc7835 100644 --- a/externs/closure-types.js +++ b/externs/closure-types.js @@ -1377,7 +1377,7 @@ Polymer_ArraySelectorMixin.prototype.select = function(item){}; Polymer_ArraySelectorMixin.prototype.selectIndex = function(idx){}; /** * @interface -* @extends {Polymer_PropertiesChanged} +* @extends {Polymer_ElementMixin} */ function Polymer_DisableUpgradeMixin(){} /** diff --git a/lib/elements/dom-if.html b/lib/elements/dom-if.html index d6ad8ca736..527ede86ae 100644 --- a/lib/elements/dom-if.html +++ b/lib/elements/dom-if.html @@ -179,7 +179,7 @@ // Guard against element being detached while render was queued if (parentNode) { if (!this.__ctor) { - let template = this.querySelector('template'); + let template = /** @type {HTMLTemplateElement} */(this.querySelector('template')); if (!template) { // Wait until childList changes and template should be there by then let observer = new MutationObserver(() => { diff --git a/lib/elements/dom-repeat.html b/lib/elements/dom-repeat.html index a68e68796f..4cd2189d8b 100644 --- a/lib/elements/dom-repeat.html +++ b/lib/elements/dom-repeat.html @@ -335,7 +335,7 @@ // until ready, since won't have its template content handed back to // it until then if (!this.__ctor) { - let template = this.template = this.querySelector('template'); + let template = this.template = /** @type {HTMLTemplateElement} */(this.querySelector('template')); if (!template) { // // Wait until childList changes and template should be there by then let observer = new MutationObserver(() => { diff --git a/lib/mixins/disable-upgrade-mixin.html b/lib/mixins/disable-upgrade-mixin.html index 4e7bfb4535..4f3a73c62d 100644 --- a/lib/mixins/disable-upgrade-mixin.html +++ b/lib/mixins/disable-upgrade-mixin.html @@ -35,7 +35,7 @@ * * @mixinFunction * @polymer - * @appliesMixin Polymer.PropertiesChanged + * @appliesMixin Polymer.ElementMixin * @memberof Polymer */ Polymer.DisableUpgradeMixin = Polymer.dedupingMixin((base) => { @@ -43,9 +43,9 @@ /** * @constructor * @extends {base} - * @implements {Polymer_PropertiesMixin} + * @implements {Polymer_ElementMixin} */ - const superClass = Polymer.PropertiesMixin(base); + const superClass = Polymer.ElementMixin(base); /** * @polymer * @mixinClass diff --git a/lib/mixins/properties-changed.html b/lib/mixins/properties-changed.html index bd47e08c73..000c1374af 100644 --- a/lib/mixins/properties-changed.html +++ b/lib/mixins/properties-changed.html @@ -355,7 +355,7 @@ * @return {boolean} true if changedProps is truthy */ _shouldPropertiesChange(currentProps, changedProps, oldProps) { // eslint-disable-line no-unused-vars - return changedProps; + return Boolean(changedProps); } /** diff --git a/types/lib/mixins/disable-upgrade-mixin.d.ts b/types/lib/mixins/disable-upgrade-mixin.d.ts index 471a8462e4..80757fb860 100644 --- a/types/lib/mixins/disable-upgrade-mixin.d.ts +++ b/types/lib/mixins/disable-upgrade-mixin.d.ts @@ -31,7 +31,7 @@ declare namespace Polymer { * * MyClass = Polymer.DisableUpgradeMixin(class extends BaseClass {...}); */ - function DisableUpgradeMixin {}>(base: T): T & DisableUpgradeMixinConstructor & Polymer.PropertiesChangedConstructor; + function DisableUpgradeMixin {}>(base: T): T & DisableUpgradeMixinConstructor & Polymer.ElementMixinConstructor & Polymer.PropertyEffectsConstructor & Polymer.TemplateStampConstructor & Polymer.PropertyAccessorsConstructor & Polymer.PropertiesChangedConstructor & Polymer.PropertiesMixinConstructor; interface DisableUpgradeMixinConstructor { new(...args: any[]): DisableUpgradeMixin;