diff --git a/lib/mixins/element-mixin.html b/lib/mixins/element-mixin.html
index 193f709fc4..58880fa3aa 100644
--- a/lib/mixins/element-mixin.html
+++ b/lib/mixins/element-mixin.html
@@ -32,7 +32,6 @@
*/
let PolymerElementProperties; // eslint-disable-line no-unused-vars
- /** @record */
let PolymerElementConstructor = function(){}; // eslint-disable-line no-unused-vars
/** @type {(string | undefined)} */
PolymerElementConstructor.is;
@@ -139,7 +138,7 @@
JSCompiler_renameProperty('__ownProperties', klass))) {
klass.__ownProperties =
klass.hasOwnProperty(JSCompiler_renameProperty('properties', klass)) ?
- klass.properties : {};
+ /** @type PolymerElementConstructor */ (klass).properties : {};
}
return klass.__ownProperties;
}
@@ -157,7 +156,7 @@
JSCompiler_renameProperty('__ownObservers', klass))) {
klass.__ownObservers =
klass.hasOwnProperty(JSCompiler_renameProperty('observers', klass)) ?
- klass.observers : [];
+ /** @type PolymerElementConstructor */ (klass).observers : [];
}
return klass.__ownObservers;
}
@@ -188,7 +187,7 @@
* (1) observedAttributes,
* (2) class property default values
*
- * @param {HTMLElement} klass Element class
+ * @param {PolymerElementConstructor} klass Element class
* @return {PolymerElementProperties} Flattened properties for this class
* @private
*/
@@ -200,7 +199,7 @@
let superCtor = Object.getPrototypeOf(klass.prototype).constructor;
if (superCtor.prototype instanceof PolymerElement) {
klass.__classProperties = Object.assign(
- Object.create(propertiesForClass(superCtor)),
+ Object.create(propertiesForClass(/** @type PolymerElementConstructor */(superCtor))),
klass.__classProperties);
}
}
@@ -213,7 +212,7 @@
* the list returned from `propertiesForClass`.
* This list is used in `_initializeProperties` to set property defaults.
*
- * @param {HTMLElement} klass Element class
+ * @param {PolymerElementConstructor} klass Element class
* @return {PolymerElementProperties} Flattened properties for this class
* that have default values
* @private
@@ -236,7 +235,7 @@
/**
* Returns true if a `klass` has finalized. Called in `ElementClass.finalize()`
- * @param {HTMLElement} klass Element class
+ * @param {PolymerElementConstructor} klass Element class
* @return {boolean} True if all metaprogramming for this class has been
* completed
* @private
@@ -250,11 +249,11 @@
* *all superclasses* are finalized by traversing the prototype chain
* and calling `klass.finalize()`.
*
- * @param {HTMLElement} klass Element class
+ * @param {PolymerElementConstructor} klass Element class
* @private
*/
function finalizeClassAndSuper(klass) {
- let proto = klass.prototype;
+ let proto = /** @type PolymerElementConstructor */ (klass).prototype;
let superCtor = Object.getPrototypeOf(proto).constructor;
if (superCtor.prototype instanceof PolymerElement) {
superCtor.finalize();
@@ -268,12 +267,12 @@
* for properties in `config` and the `template` as well as preparing the
* `template` for stamping.
*
- * @param {HTMLElement} klass Element class
+ * @param {PolymerElementConstructor} klass Element class
* @private
*/
function finalizeClass(klass) {
klass.__finalized = true;
- let proto = klass.prototype;
+ let proto = /** @type PolymerElementConstructor */ (klass).prototype;
if (klass.hasOwnProperty(
JSCompiler_renameProperty('is', klass)) && klass.is) {
Polymer.telemetry.register(proto);
@@ -287,7 +286,7 @@
finalizeObservers(proto, observers, props);
}
// note: create "working" template that is finalized at instance time
- let template = klass.template;
+ let template = /** @type PolymerElementConstructor */ (klass).template;
if (template) {
if (typeof template === 'string') {
let t = document.createElement('template');
@@ -305,7 +304,7 @@
* Leverages `PropertyEffects` to create property accessors and effects
* supporting, observers, reflecting to attributes, change notification,
* computed properties, and read only properties.
- * @param {HTMLElement} proto Element class prototype to add accessors
+ * @param {PolymerElement} proto Element class prototype to add accessors
* and effects to
* @param {Object} properties Flattened bag of property descriptors for
* this class
@@ -320,7 +319,7 @@
/**
* Configures a `proto` based on a `observers` array.
* Leverages `PropertyEffects` to create observers.
- * @param {HTMLElement} proto Element class prototype to add accessors
+ * @param {PolymerElement} proto Element class prototype to add accessors
* and effects to
* @param {Object} observers Flattened array of observer descriptors for
* this class
@@ -384,7 +383,7 @@
* and/or provide an advanced api for manipulating them.
* Also consider adding warnings when an effect cannot be changed.
*
- * @param {HTMLElement} proto Element class prototype to add accessors
+ * @param {PolymerElement} proto Element class prototype to add accessors
* and effects to
* @param {string} name Name of the property.
* @param {Object} info Info object from which to create property effects.
@@ -426,7 +425,7 @@
* The element name `is` and extends `ext` must be specified for ShadyCSS
* style scoping.
*
- * @param {HTMLElement} proto Element class prototype to add accessors
+ * @param {PolymerElement} proto Element class prototype to add accessors
* and effects to
* @param {HTMLTemplateElement} template Template to process and bind
* @param {string} baseURI URL against which to resolve urls in
@@ -535,11 +534,12 @@
*/
static get template() {
if (!this.hasOwnProperty(JSCompiler_renameProperty('_template', this))) {
- this._template = Polymer.DomModule.import(this.is, 'template') ||
+ this._template = Polymer.DomModule.import(
+ /** @type PolymerElementConstructor*/ (this).is, 'template') ||
// note: implemented so a subclass can retrieve the super
// template; call the super impl this way so that `this` points
// to the superclass.
- Object.getPrototypeOf(this.prototype).constructor.template;
+ Object.getPrototypeOf(/** @type PolymerElementConstructor*/ (this).prototype).constructor.template;
}
return this._template;
}
@@ -557,9 +557,9 @@
*/
static get importPath() {
if (!this.hasOwnProperty(JSCompiler_renameProperty('_importPath', this))) {
- const module = Polymer.DomModule.import(this.is);
+ const module = Polymer.DomModule.import(/** @type PolymerElementConstructor */ (this).is);
this._importPath = module ? module.assetpath : '' ||
- Object.getPrototypeOf(this.prototype).constructor.importPath;
+ Object.getPrototypeOf(/** @type PolymerElementConstructor*/ (this).prototype).constructor.importPath;
}
return this._importPath;
}