1 | /**
|
2 | * @fileoverview Externs for Polymer Pass and external Polymer API
|
3 | * @externs
|
4 | *
|
5 | * @license
|
6 | * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
7 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
8 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
9 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
10 | * Code distributed by Google as part of the polymer project is also
|
11 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
12 | */
|
13 |
|
14 | /* eslint-disable */
|
15 |
|
16 | /**
|
17 | * @typedef {{
|
18 | * type: !Function,
|
19 | * value: (* | undefined),
|
20 | * readOnly: (boolean | undefined),
|
21 | * computed: (string | undefined),
|
22 | * reflectToAttribute: (boolean | undefined),
|
23 | * notify: (boolean | undefined),
|
24 | * observer: (string | function(this:?, ?, ?) | undefined)
|
25 | * }}
|
26 | */
|
27 | let PolymerElementPropertiesMeta;
|
28 |
|
29 | /**
|
30 | * @typedef {Object<string, !Function|!PolymerElementPropertiesMeta>}
|
31 | */
|
32 | let PolymerElementProperties;
|
33 |
|
34 | /** @record */
|
35 | let PolymerInit = function() {};
|
36 | /** @type {string} */
|
37 | PolymerInit.prototype.is;
|
38 | /** @type {(string | undefined)} */
|
39 | PolymerInit.prototype.extends;
|
40 | /** @type {(!PolymerElementProperties | undefined)} */
|
41 | PolymerInit.prototype.properties;
|
42 | /** @type {(!Array<string> | undefined)} */
|
43 | PolymerInit.prototype.observers;
|
44 | /** @type {(!HTMLTemplateElement | string | undefined | null)} */
|
45 | PolymerInit.prototype.template;
|
46 | /** @type {(!Object<string, *> | undefined)} */
|
47 | PolymerInit.prototype.hostAttributes;
|
48 | /** @type {(!Object<string, string> | undefined)} */
|
49 | PolymerInit.prototype.listeners;
|
50 | /** @type {(!Object| !Array<!Object> | undefined)} */
|
51 | PolymerInit.prototype.behaviors;
|
52 |
|
53 | /** @record */
|
54 | let PolymerElementConstructor = function () {};
|
55 | /** @type {(string | undefined)} */
|
56 | PolymerElementConstructor.is;
|
57 | /** @type {(string | undefined)} */
|
58 | PolymerElementConstructor.extends;
|
59 | /** @type {(!PolymerElementProperties | undefined)} */
|
60 | PolymerElementConstructor.properties;
|
61 | /** @type {(!Array<string> | undefined)} */
|
62 | PolymerElementConstructor.observers;
|
63 | /** @type {(!HTMLTemplateElement | string | undefined | null)} */
|
64 | PolymerElementConstructor.template;
|
65 |
|
66 | /** @interface */
|
67 | let PropertiesMixinConstructor = function () {};
|
68 | /** @type {(!PolymerElementProperties | undefined)} */
|
69 | PropertiesMixinConstructor.prototype.properties;
|
70 | /** @return {void} */
|
71 | PropertiesMixinConstructor.prototype.finalize = function() {};
|
72 |
|
73 | /**
|
74 | * @param {!PolymerInit} init
|
75 | * @return {!function(new:HTMLElement)}
|
76 | */
|
77 | function Polymer(init){}
|
78 |
|
79 | /**
|
80 | * @type {(function(*,string,string,Node):*)|undefined}
|
81 | */
|
82 | Polymer.sanitizeDOMValue;
|
83 |
|
84 | /**
|
85 | * @type {boolean}
|
86 | */
|
87 | Polymer.passiveTouchGestures;
|
88 |
|
89 | /**
|
90 | * @type {boolean}
|
91 | */
|
92 | Polymer.strictTemplatePolicy;
|
93 |
|
94 | /**
|
95 | * @type {boolean}
|
96 | */
|
97 | Polymer.allowTemplateFromDomModule;
|
98 |
|
99 | /**
|
100 | * @type {string}
|
101 | */
|
102 | Polymer.rootPath;
|
103 |
|
104 | /**
|
105 | * @param {string} string
|
106 | * @param {Object} obj
|
107 | * @return {string}
|
108 | */
|
109 | function JSCompiler_renameProperty(string, obj) {}
|
110 |
|
111 | /** @record */
|
112 | function PolymerTelemetry() {}
|
113 | /** @type {number} */
|
114 | PolymerTelemetry.instanceCount;
|
115 | /** @type {function():void} */
|
116 | PolymerTelemetry.incrementInstanceCount;
|
117 | /** @type {Array<HTMLElement>} */
|
118 | PolymerTelemetry.registrations;
|
119 | /** @type {function(HTMLElement)} */
|
120 | PolymerTelemetry._regLog;
|
121 | /** @type {function(HTMLElement)} */
|
122 | PolymerTelemetry.register;
|
123 | /** @type {function(HTMLElement)} */
|
124 | PolymerTelemetry.dumpRegistrations;
|
125 |
|
126 | /** @type {PolymerTelemetry} */
|
127 | Polymer.telemetry;
|
128 |
|
129 | /** @type {string} */
|
130 | Polymer.version;
|
131 |
|
132 | /** @type {boolean} */
|
133 | Polymer.legacyOptimizations;
|
134 |
|
135 | /** @type {boolean} */
|
136 | Polymer.syncInitialRender;
|
137 |
|
138 | /** @type {boolean} */
|
139 | Polymer.legacyUndefined;
|
140 |
|
141 | /** @type {boolean} */
|
142 | Polymer.legacyWarnings;
|
143 |
|
144 | /** @type {boolean} */
|
145 | Polymer.orderedComputed;
|
146 |
|
147 | /** @type {boolean} */
|
148 | Polymer.fastDomIf;
|
149 |
|
150 | /** @type {boolean} */
|
151 | Polymer.removeNestedTemplates;
|
152 |
|
153 | /** @type {boolean} */
|
154 | Polymer.suppressTemplateNotifications;
|
155 |
|
156 | // nb. This is explicitly 'var', as Closure Compiler checks that this is the case.
|
157 | /**
|
158 | * @constructor
|
159 | * @extends {HTMLElement}
|
160 | * @implements {Polymer_LegacyElementMixin}
|
161 | */
|
162 | var PolymerElement = function() {};
|
163 |
|
164 | /**
|
165 | * The tag name of the cutom element type.
|
166 | * @type {string|undefined}
|
167 | */
|
168 | PolymerElement.is;
|
169 | /**
|
170 | * The template to stamp when creating this element type.
|
171 | * @type {!HTMLTemplateElement|undefined|null}
|
172 | */
|
173 | PolymerElement.template;
|
174 | /**
|
175 | * The properties of the cutom element type.
|
176 | * @type {!PolymerElementProperties|undefined}
|
177 | */
|
178 | PolymerElement.properties;
|
179 | /**
|
180 | * The observers of this custom element type.
|
181 | * @type {!Array<string>|undefined}
|
182 | */
|
183 | PolymerElement.observers;
|
184 | /** @type {!PolymerInit|undefined} */
|
185 | PolymerElement.generatedFrom;
|
186 |
|
187 | /**
|
188 | * On create callback.
|
189 | * @override
|
190 | */
|
191 | PolymerElement.prototype.created = function() {};
|
192 | /**
|
193 | * On ready callback.
|
194 | * @override
|
195 | */
|
196 | PolymerElement.prototype.ready = function() {};
|
197 | /** On before register callback. */
|
198 | PolymerElement.prototype.beforeRegister = function() {};
|
199 | /** On registered callback. */
|
200 | PolymerElement.prototype.registered = function() {};
|
201 | /**
|
202 | * On attached to the DOM callback.
|
203 | * @override
|
204 | */
|
205 | PolymerElement.prototype.attached = function() {};
|
206 | /**
|
207 | * On detached from the DOM callback.
|
208 | * @override
|
209 | */
|
210 | PolymerElement.prototype.detached = function() {};
|
211 |
|
212 | /**
|
213 | * @typedef {{
|
214 | * index: number,
|
215 | * removed: !Array,
|
216 | * addedCount: number,
|
217 | * object: !Array,
|
218 | * type: string,
|
219 | * }}
|
220 | */
|
221 | var PolymerSplice;
|
222 | /**
|
223 | * @typedef {{
|
224 | * indexSplices: ?Array<!PolymerSplice>,
|
225 | * }}
|
226 | */
|
227 | var PolymerSpliceChange;
|
228 |
|
229 | /**
|
230 | * The type of the object received by an observer function when deep
|
231 | * sub-property observation is enabled. See:
|
232 | * https://www.polymer-project.org/2.0/docs/devguide/observers#deep-observation
|
233 | *
|
234 | * @typedef {{
|
235 | * path: string,
|
236 | * value: (?Object|undefined),
|
237 | * base: (?Object|undefined)
|
238 | * }}
|
239 | */
|
240 | var PolymerDeepPropertyChange;
|
241 |
|
242 | /**
|
243 | * Event object for events dispatched by children of a dom-repeat template.
|
244 | * @see https://www.polymer-project.org/2.0/docs/devguide/templates#handling-events
|
245 | * @extends {Event}
|
246 | * @constructor
|
247 | * @template T
|
248 | */
|
249 | var DomRepeatEvent = function() {};
|
250 |
|
251 | /**
|
252 | * @type {{
|
253 | * index: number,
|
254 | * item: T
|
255 | * }}
|
256 | */
|
257 | DomRepeatEvent.prototype.model;
|