From 605c8912c23d2f1424e0e3f55563fe348dd2f7e6 Mon Sep 17 00:00:00 2001 From: Alexander Marks Date: Tue, 17 Jul 2018 21:12:11 -0700 Subject: [PATCH] Tweaks to make Polymer 3 more amenable to typings generation. --- lib/elements/dom-repeat.js | 4 +--- lib/legacy/legacy-element-mixin.js | 6 +++--- lib/legacy/polymer.dom.js | 4 ++-- lib/legacy/templatizer-behavior.js | 4 +--- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/elements/dom-repeat.js b/lib/elements/dom-repeat.js index 1aa95cc101..8ca614c857 100644 --- a/lib/elements/dom-repeat.js +++ b/lib/elements/dom-repeat.js @@ -9,15 +9,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN */ import { PolymerElement } from '../../polymer-element.js'; -import { TemplateInstanceBase as TemplateInstanceBase$0, templatize, modelForElement as modelForElement$0 } from '../utils/templatize.js'; +import { TemplateInstanceBase, templatize, modelForElement as modelForElement$0 } from '../utils/templatize.js'; import { Debouncer } from '../utils/debounce.js'; import { enqueueDebouncer, flush } from '../utils/flush.js'; import { OptionalMutableData } from '../mixins/mutable-data.js'; import { matches, translate } from '../utils/path.js'; import { timeOut, microTask } from '../utils/async.js'; -let TemplateInstanceBase = TemplateInstanceBase$0; // eslint-disable-line - /** * @constructor * @implements {Polymer_OptionalMutableData} diff --git a/lib/legacy/legacy-element-mixin.js b/lib/legacy/legacy-element-mixin.js index 152508799c..6d6967d830 100644 --- a/lib/legacy/legacy-element-mixin.js +++ b/lib/legacy/legacy-element-mixin.js @@ -515,7 +515,7 @@ export const LegacyElementMixin = dedupingMixin((base) => { */ getEffectiveChildNodes() { const thisEl = /** @type {Element} */ (this); - const domApi = /** @type {Polymer.DomApi} */(dom$0(thisEl)); + const domApi = /** @type {DomApi} */(dom$0(thisEl)); return domApi.getEffectiveChildNodes(); } @@ -529,7 +529,7 @@ export const LegacyElementMixin = dedupingMixin((base) => { */ queryDistributedElements(selector) { const thisEl = /** @type {Element} */ (this); - const domApi = /** @type {Polymer.DomApi} */(dom$0(thisEl)); + const domApi = /** @type {DomApi} */(dom$0(thisEl)); return domApi.queryDistributedElements(selector); } @@ -601,7 +601,7 @@ export const LegacyElementMixin = dedupingMixin((base) => { */ getContentChildNodes(slctr) { let content = this.root.querySelector(slctr || 'slot'); - return content ? /** @type {Polymer.DomApi} */(dom$0(content)).getDistributedNodes() : []; + return content ? /** @type {DomApi} */(dom$0(content)).getDistributedNodes() : []; } /** diff --git a/lib/legacy/polymer.dom.js b/lib/legacy/polymer.dom.js index 699348e169..95364f8391 100644 --- a/lib/legacy/polymer.dom.js +++ b/lib/legacy/polymer.dom.js @@ -53,7 +53,7 @@ export class DomApi { * * @param {function(!Element, { target: !Element, addedNodes: !Array, removedNodes: !Array }):void} callback Called when direct or distributed children * of this element changes - * @return {!Polymer.FlattenedNodesObserver} Observer instance + * @return {!FlattenedNodesObserver} Observer instance */ observeNodes(callback) { return new FlattenedNodesObserver(this.node, callback); @@ -62,7 +62,7 @@ export class DomApi { /** * Disconnects an observer previously created via `observeNodes` * - * @param {!Polymer.FlattenedNodesObserver} observerHandle Observer instance + * @param {!FlattenedNodesObserver} observerHandle Observer instance * to disconnect. * @return {void} */ diff --git a/lib/legacy/templatizer-behavior.js b/lib/legacy/templatizer-behavior.js index f1b8f7fd2f..54d6d53388 100644 --- a/lib/legacy/templatizer-behavior.js +++ b/lib/legacy/templatizer-behavior.js @@ -7,9 +7,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ -import { TemplateInstanceBase as TemplateInstanceBase$0, templatize as templatize$0, modelForElement as modelForElement$0 } from '../utils/templatize.js'; - -let TemplateInstanceBase = TemplateInstanceBase$0; // eslint-disable-line +import { TemplateInstanceBase, templatize as templatize$0, modelForElement as modelForElement$0 } from '../utils/templatize.js'; /** * @typedef {{