mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
save observedAttributes for registration calls
This commit is contained in:
@@ -1,16 +1,51 @@
|
||||
window.Polymer = {};
|
||||
/**
|
||||
* @fileoverview Externs for Polymer, polyfills, and missing stuff in Closure Compiler
|
||||
* @externs
|
||||
* */
|
||||
/**
|
||||
* @param {!{is: string}} init
|
||||
*/
|
||||
function Polymer(init){}
|
||||
|
||||
function Polymer(){}
|
||||
/**
|
||||
* @record
|
||||
*/
|
||||
function CustomElement(){}
|
||||
/** @type {!Array<string> | undefined} */
|
||||
CustomElement.observedAttributes;
|
||||
/** @type {function()|undefined} */
|
||||
CustomElement.prototype.connectedCallback;
|
||||
/** @type {function()|undefined} */
|
||||
CustomElement.prototype.disconnectedCallback;
|
||||
/** @type {function(string, ?string, ?string, ?string)|undefined} */
|
||||
CustomElement.prototype.attributeChangedCallback;
|
||||
|
||||
let customElements = {
|
||||
define(){},
|
||||
get(){},
|
||||
whenDefined(){}
|
||||
const customElements = {
|
||||
/**
|
||||
* @param {string} tagName
|
||||
* @param {!CustomElement} klass
|
||||
* @param {Object=} options
|
||||
* @return {CustomElement}
|
||||
*/
|
||||
define(tagName, klass, options){},
|
||||
/**
|
||||
* @param {string} tagName
|
||||
* @return {CustomElement}
|
||||
*/
|
||||
get(tagName){},
|
||||
/**
|
||||
* @param {string} tagName
|
||||
* @return {Promise<!CustomElement>}
|
||||
*/
|
||||
whenDefined(tagName){}
|
||||
}
|
||||
window.customElements = customElements;
|
||||
|
||||
let HTMLImports = {
|
||||
whenReady(){}
|
||||
/**
|
||||
* @param {function()} callback
|
||||
*/
|
||||
whenReady(callback){}
|
||||
};
|
||||
|
||||
window.HTMLImports = HTMLImports;
|
||||
@@ -64,24 +99,6 @@ function CustomStyle(){}
|
||||
*/
|
||||
CustomStyle.prototype.processHook = function(style){};
|
||||
|
||||
/**
|
||||
* @record
|
||||
*/
|
||||
function CustomElement(){}
|
||||
/**
|
||||
* @type {!Array<string> | undefined}
|
||||
*/
|
||||
CustomElement.observedAttributes;
|
||||
CustomElement.prototype.connectedCallback = function(){};
|
||||
CustomElement.prototype.disconnectedCallback = function(){};
|
||||
/**
|
||||
* @param {string} attributeName
|
||||
* @param {?string} oldValue
|
||||
* @param {?string} newValue
|
||||
* @param {?string} namespaceURI
|
||||
*/
|
||||
CustomElement.prototype.attributeChangedCallback = function(attributeName, oldValue, newValue, namespaceURI){};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {HTMLElement}
|
||||
|
||||
@@ -94,7 +94,8 @@ gulp.task('build', ['clean'], () => {
|
||||
output_wrapper: '(function(){\n%output%\n}).call(self)',
|
||||
rewrite_polyfills: false,
|
||||
formatting: 'PRETTY_PRINT',
|
||||
externs: ['externs/externs.js']
|
||||
externs: 'externs/externs.js'
|
||||
// polymer_pass: true
|
||||
});
|
||||
|
||||
const closurePipeline = lazypipe()
|
||||
|
||||
@@ -28,10 +28,6 @@
|
||||
|
||||
static get observedAttributes() { return ['id'] }
|
||||
|
||||
get modules() {
|
||||
return modules;
|
||||
}
|
||||
|
||||
attributeChangedCallback(name, old, value) {
|
||||
if (old !== value) {
|
||||
this.register();
|
||||
@@ -86,6 +82,8 @@
|
||||
|
||||
}
|
||||
|
||||
DomModule.prototype['modules'] = modules;
|
||||
|
||||
customElements.define('dom-module', DomModule);
|
||||
|
||||
// export
|
||||
|
||||
Reference in New Issue
Block a user