mirror of
https://github.com/Polymer/polymer.git
synced 2026-08-17 16:34:49 -05:00
Improve types for the template field on Polymer elements. (#5596)
null is allowed!
This commit is contained in:
@@ -41,7 +41,7 @@ PolymerInit.prototype.extends;
|
||||
PolymerInit.prototype.properties;
|
||||
/** @type {(!Array<string> | undefined)} */
|
||||
PolymerInit.prototype.observers;
|
||||
/** @type {(!HTMLTemplateElement | string | undefined)} */
|
||||
/** @type {(!HTMLTemplateElement | string | undefined | null)} */
|
||||
PolymerInit.prototype.template;
|
||||
/** @type {(!Object<string, *> | undefined)} */
|
||||
PolymerInit.prototype.hostAttributes;
|
||||
@@ -60,7 +60,7 @@ PolymerElementConstructor.extends;
|
||||
PolymerElementConstructor.properties;
|
||||
/** @type {(!Array<string> | undefined)} */
|
||||
PolymerElementConstructor.observers;
|
||||
/** @type {(!HTMLTemplateElement | string | undefined)} */
|
||||
/** @type {(!HTMLTemplateElement | string | undefined | null)} */
|
||||
PolymerElementConstructor.template;
|
||||
|
||||
/** @interface */
|
||||
@@ -150,7 +150,7 @@ var PolymerElement = function() {};
|
||||
PolymerElement.is;
|
||||
/**
|
||||
* The template to stamp when creating this element type.
|
||||
* @type {!HTMLTemplateElement|undefined}
|
||||
* @type {!HTMLTemplateElement|undefined|null}
|
||||
*/
|
||||
PolymerElement.template;
|
||||
/**
|
||||
|
||||
@@ -115,7 +115,7 @@ export class DomBind extends domBindBase {
|
||||
render() {
|
||||
let template;
|
||||
if (!this.__children) {
|
||||
template = /** @type {HTMLTemplateElement} */(template || this.querySelector('template'));
|
||||
template = /** @type {?HTMLTemplateElement} */(template || this.querySelector('template'));
|
||||
if (!template) {
|
||||
// Wait until childList changes and template should be there by then
|
||||
let observer = new MutationObserver(() => {
|
||||
|
||||
Reference in New Issue
Block a user