mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
split externs
This commit is contained in:
parent
d6b8b89898
commit
e1ad25200c
@ -1,15 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* @fileoverview Externs for Polymer, polyfills, and missing stuff in Closure Compiler
|
* @fileoverview Externs to upstream to closure compiler
|
||||||
* @externs
|
* @externs
|
||||||
* */
|
|
||||||
|
|
||||||
/* externs to upstream to closure compiler */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @record
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** @record */
|
||||||
function CustomElement(){}
|
function CustomElement(){}
|
||||||
/** @type {!Array<string> | undefined} */
|
/** @type {!Array<string>|undefined} */
|
||||||
CustomElement.observedAttributes;
|
CustomElement.observedAttributes;
|
||||||
/** @type {function()|undefined} */
|
/** @type {function()|undefined} */
|
||||||
CustomElement.prototype.connectedCallback;
|
CustomElement.prototype.connectedCallback;
|
||||||
@ -76,60 +72,3 @@ const customElements = {
|
|||||||
whenDefined(tagName){}
|
whenDefined(tagName){}
|
||||||
}
|
}
|
||||||
window.customElements = customElements;
|
window.customElements = customElements;
|
||||||
|
|
||||||
/* externs to include in webcomponents polyfills */
|
|
||||||
/**
|
|
||||||
* @constructor
|
|
||||||
* @extends {HTMLElement}
|
|
||||||
*/
|
|
||||||
function CustomStyle(){}
|
|
||||||
/**
|
|
||||||
* @param {!HTMLStyleElement} style
|
|
||||||
*/
|
|
||||||
CustomStyle.prototype.processHook = function(style){};
|
|
||||||
|
|
||||||
let HTMLImports = {
|
|
||||||
/**
|
|
||||||
* @param {function()} callback
|
|
||||||
*/
|
|
||||||
whenReady(callback){}
|
|
||||||
};
|
|
||||||
|
|
||||||
window.HTMLImports = HTMLImports;
|
|
||||||
|
|
||||||
let ShadyCSS = {
|
|
||||||
applyStyle(){},
|
|
||||||
updateStyles(){},
|
|
||||||
prepareTemplate(){},
|
|
||||||
nativeCss: false,
|
|
||||||
nativeCssApply: false,
|
|
||||||
nativeShadow: false
|
|
||||||
};
|
|
||||||
window.ShadyCSS = ShadyCSS;
|
|
||||||
|
|
||||||
let ShadyDOM = {
|
|
||||||
inUse: false,
|
|
||||||
flush(){},
|
|
||||||
observeChildren(){},
|
|
||||||
unobserveChildren(){},
|
|
||||||
patch(){}
|
|
||||||
};
|
|
||||||
|
|
||||||
window.ShadyDOM = ShadyDOM;
|
|
||||||
|
|
||||||
let WebComponents = {};
|
|
||||||
window.WebComponents = WebComponents;
|
|
||||||
|
|
||||||
/** @type {Element} */
|
|
||||||
HTMLElement.prototype._activeElement;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {HTMLTemplateElement} template
|
|
||||||
*/
|
|
||||||
HTMLTemplateElement.prototype.decorate = function(template){};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {!{is: string}} init
|
|
||||||
* @return {!CustomElement}
|
|
||||||
*/
|
|
||||||
function Polymer(init){}
|
|
10
externs/polymer-externs.js
Normal file
10
externs/polymer-externs.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/**
|
||||||
|
* @fileoverview Externs for Polymer
|
||||||
|
* @externs
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {!{is: string}} init
|
||||||
|
* @return {!CustomElement}
|
||||||
|
*/
|
||||||
|
function Polymer(init){}
|
73
externs/webcomponents-externs.js
Normal file
73
externs/webcomponents-externs.js
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
/**
|
||||||
|
* @fileoverview Externs for webcomponents polyfills
|
||||||
|
* @externs
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @constructor
|
||||||
|
* @extends {HTMLElement}
|
||||||
|
*/
|
||||||
|
function CustomStyle(){}
|
||||||
|
/**
|
||||||
|
* @param {!HTMLStyleElement} style
|
||||||
|
*/
|
||||||
|
CustomStyle.prototype.processHook = function(style){};
|
||||||
|
|
||||||
|
let HTMLImports = {
|
||||||
|
/**
|
||||||
|
* @param {function()} callback
|
||||||
|
*/
|
||||||
|
whenReady(callback){}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.HTMLImports = HTMLImports;
|
||||||
|
|
||||||
|
let ShadyCSS = {
|
||||||
|
/**
|
||||||
|
* @param {!HTMLElement} element
|
||||||
|
* @param {Object=} overrides
|
||||||
|
*/
|
||||||
|
applyStyle(element, overrides){},
|
||||||
|
updateStyles(){},
|
||||||
|
/**
|
||||||
|
* @param {!HTMLTemplateElement} template
|
||||||
|
* @param {string} is
|
||||||
|
* @param {string=} extends
|
||||||
|
*/
|
||||||
|
prepareTemplate(template, is, extends){},
|
||||||
|
nativeCss: false,
|
||||||
|
nativeShadow: false
|
||||||
|
};
|
||||||
|
window.ShadyCSS = ShadyCSS;
|
||||||
|
|
||||||
|
let ShadyDOM = {
|
||||||
|
inUse: false,
|
||||||
|
flush(){},
|
||||||
|
/**
|
||||||
|
* @param {!Node} target
|
||||||
|
* @param {function(Array<MutationRecords>, MutationObserver)} callback
|
||||||
|
* @return {MutationObserver}
|
||||||
|
*/
|
||||||
|
observeChildren(target, callback){},
|
||||||
|
/**
|
||||||
|
* @param {MutationObserver} observer
|
||||||
|
*/
|
||||||
|
unobserveChildren(observer){},
|
||||||
|
/**
|
||||||
|
* @param {Node} node
|
||||||
|
*/
|
||||||
|
patch(node){}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.ShadyDOM = ShadyDOM;
|
||||||
|
|
||||||
|
let WebComponents = {};
|
||||||
|
window.WebComponents = WebComponents;
|
||||||
|
|
||||||
|
/** @type {Element} */
|
||||||
|
HTMLElement.prototype._activeElement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {HTMLTemplateElement} template
|
||||||
|
*/
|
||||||
|
HTMLTemplateElement.prototype.decorate = function(template){};
|
@ -89,7 +89,7 @@ gulp.task('closure', ['clean'], () => {
|
|||||||
warning_level: 'VERBOSE',
|
warning_level: 'VERBOSE',
|
||||||
output_wrapper: '(function(){\n%output%\n}).call(self)',
|
output_wrapper: '(function(){\n%output%\n}).call(self)',
|
||||||
rewrite_polyfills: false,
|
rewrite_polyfills: false,
|
||||||
externs: 'externs/externs.js'
|
externs: ['externs/closure-upstream-externs.js', 'externs/webcomponents-externs.js', 'externs/polymer-externs.js']
|
||||||
});
|
});
|
||||||
|
|
||||||
const closurePipeline = lazypipe()
|
const closurePipeline = lazypipe()
|
||||||
|
Loading…
Reference in New Issue
Block a user