OLD | NEW |
1 /** | 1 /** |
2 * @fileoverview Closure compiler externs for the Polymer library. | 2 * @fileoverview Closure compiler externs for the Polymer library. |
3 * | 3 * |
4 * @externs | 4 * @externs |
5 * @license | 5 * @license |
6 * Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 6 * Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
7 * This code may only be used under the BSD style license found at | 7 * This code may only be used under the BSD style license found at |
8 * http://polymer.github.io/LICENSE.txt. The complete set of authors may be | 8 * http://polymer.github.io/LICENSE.txt. The complete set of authors may be |
9 * found at http://polymer.github.io/AUTHORS.txt. The complete set of | 9 * found at http://polymer.github.io/AUTHORS.txt. The complete set of |
10 * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt. Code | 10 * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt. Code |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 * observers in that the change handler is called asynchronously. | 65 * observers in that the change handler is called asynchronously. |
66 * | 66 * |
67 * @type {!Object<string, string>|undefined} | 67 * @type {!Object<string, string>|undefined} |
68 */ | 68 */ |
69 PolymerElement.prototype.observers; | 69 PolymerElement.prototype.observers; |
70 | 70 |
71 /** On create callback. */ | 71 /** On create callback. */ |
72 PolymerElement.prototype.created = function() {}; | 72 PolymerElement.prototype.created = function() {}; |
73 /** On ready callback. */ | 73 /** On ready callback. */ |
74 PolymerElement.prototype.ready = function() {}; | 74 PolymerElement.prototype.ready = function() {}; |
| 75 /** On registered callback. */ |
| 76 PolymerElement.prototype.registered = function() {}; |
75 /** On attached to the DOM callback. */ | 77 /** On attached to the DOM callback. */ |
76 PolymerElement.prototype.attached = function() {}; | 78 PolymerElement.prototype.attached = function() {}; |
77 /** On detached from the DOM callback. */ | 79 /** On detached from the DOM callback. */ |
78 PolymerElement.prototype.detached = function() {}; | 80 PolymerElement.prototype.detached = function() {}; |
79 | 81 |
80 /** | 82 /** |
81 * Callback fired when an attribute on the element has been changed. | 83 * Callback fired when an attribute on the element has been changed. |
82 * | 84 * |
83 * @param {string} name The name of the attribute that changed. | 85 * @param {string} name The name of the attribute that changed. |
84 */ | 86 */ |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 * *must* be separated by dots. Note that when dereferencing array | 159 * *must* be separated by dots. Note that when dereferencing array |
158 * indicies, the index may be used as a dotted part directly | 160 * indicies, the index may be used as a dotted part directly |
159 * (e.g. `users.12.name` or `['users', 12, 'name']`). | 161 * (e.g. `users.12.name` or `['users', 12, 'name']`). |
160 * @param {Object=} root Root object from which the path is evaluated. | 162 * @param {Object=} root Root object from which the path is evaluated. |
161 * @return {*} Value at the path, or `undefined` if any part of the path | 163 * @return {*} Value at the path, or `undefined` if any part of the path |
162 * is undefined. | 164 * is undefined. |
163 */ | 165 */ |
164 PolymerElement.prototype.get = function(path, root) {}; | 166 PolymerElement.prototype.get = function(path, root) {}; |
165 | 167 |
166 /** | 168 /** |
| 169 * Adds items onto the end of the array at the path specified. |
| 170 * |
| 171 * The arguments after `path` and return value match that of |
| 172 * `Array.prototype.push`. |
| 173 * |
| 174 * This method notifies other paths to the same array that a |
| 175 * splice occurred to the array. |
| 176 * |
| 177 * @param {string} path Path to array. |
| 178 * @param {...*} var_args Items to push onto array |
| 179 * @return {number} New length of the array. |
| 180 */ |
| 181 PolymerElement.prototype.push = function(path, var_args) {}; |
| 182 |
| 183 /** |
| 184 * Removes an item from the end of array at the path specified. |
| 185 * |
| 186 * The arguments after `path` and return value match that of |
| 187 * `Array.prototype.pop`. |
| 188 * |
| 189 * This method notifies other paths to the same array that a |
| 190 * splice occurred to the array. |
| 191 * |
| 192 * @param {string} path Path to array. |
| 193 * @return {*} Item that was removed. |
| 194 */ |
| 195 PolymerElement.prototype.pop = function(path) {}; |
| 196 |
| 197 /** |
| 198 * Starting from the start index specified, removes 0 or more items |
| 199 * from the array and inserts 0 or more new itms in their place. |
| 200 * |
| 201 * The arguments after `path` and return value match that of |
| 202 * `Array.prototype.splice`. |
| 203 * |
| 204 * This method notifies other paths to the same array that a |
| 205 * splice occurred to the array. |
| 206 * |
| 207 * @param {string} path Path to array. |
| 208 * @param {number} start Index from which to start removing/inserting. |
| 209 * @param {number} deleteCount Number of items to remove. |
| 210 * @param {...*} var_args Items to insert into array. |
| 211 * @return {!Array} Array of removed items. |
| 212 */ |
| 213 PolymerElement.prototype.splice = function(path, start, deleteCount, var_args) {
}; |
| 214 |
| 215 /** |
| 216 * Removes an item from the beginning of array at the path specified. |
| 217 * |
| 218 * The arguments after `path` and return value match that of |
| 219 * `Array.prototype.pop`. |
| 220 * |
| 221 * This method notifies other paths to the same array that a |
| 222 * splice occurred to the array. |
| 223 * |
| 224 * @param {string} path Path to array. |
| 225 * @return {*} Item that was removed. |
| 226 */ |
| 227 PolymerElement.prototype.shift = function(path) {}; |
| 228 |
| 229 /** |
| 230 * Adds items onto the beginning of the array at the path specified. |
| 231 * |
| 232 * The arguments after `path` and return value match that of |
| 233 * `Array.prototype.push`. |
| 234 * |
| 235 * This method notifies other paths to the same array that a |
| 236 * splice occurred to the array. |
| 237 * |
| 238 * @param {string} path Path to array. |
| 239 * @param {...*} var_args Items to insert info array |
| 240 * @return {number} New length of the array. |
| 241 */ |
| 242 PolymerElement.prototype.unshift = function(path, var_args) {}; |
| 243 |
| 244 /** |
167 * Fire an event. | 245 * Fire an event. |
168 * | 246 * |
169 * @param {string} type An event name. | 247 * @param {string} type An event name. |
170 * @param {Object=} detail | 248 * @param {Object=} detail |
171 * @param {{ | 249 * @param {{ |
172 * bubbles: (boolean|undefined), | 250 * bubbles: (boolean|undefined), |
173 * cancelable: (boolean|undefined), | 251 * cancelable: (boolean|undefined), |
174 * node: (!HTMLElement|undefined)}=} options | 252 * node: (!HTMLElement|undefined)}=} options |
175 * @return {Object} event | 253 * @return {Object} event |
176 */ | 254 */ |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 /** | 286 /** |
209 * Convenience method to add an event listener on a given element, late bound to | 287 * Convenience method to add an event listener on a given element, late bound to |
210 * a named method on this element. | 288 * a named method on this element. |
211 * @param {!Element} node Element to add event listener to. | 289 * @param {!Element} node Element to add event listener to. |
212 * @param {string} eventName Name of event to listen for. | 290 * @param {string} eventName Name of event to listen for. |
213 * @param {string} methodName Name of handler method on this to call. | 291 * @param {string} methodName Name of handler method on this to call. |
214 */ | 292 */ |
215 PolymerElement.prototype.listen = function(node, eventName, methodName) {}; | 293 PolymerElement.prototype.listen = function(node, eventName, methodName) {}; |
216 | 294 |
217 /** | 295 /** |
| 296 * Convenience method to remove an event listener from a given element. |
| 297 * @param {!Element} node Element to remove event listener from. |
| 298 * @param {string} eventName Name of event to stop listening for. |
| 299 * @param {string} methodName Name of handler method on this to remove. |
| 300 */ |
| 301 PolymerElement.prototype.unlisten = function(node, eventName, methodName) {}; |
| 302 |
| 303 /** |
218 * Override scrolling behavior to all direction, one direction, or none. | 304 * Override scrolling behavior to all direction, one direction, or none. |
219 * | 305 * |
220 * Valid scroll directions: | 306 * Valid scroll directions: |
221 * 'all': scroll in any direction | 307 * 'all': scroll in any direction |
222 * 'x': scroll only in the 'x' direction | 308 * 'x': scroll only in the 'x' direction |
223 * 'y': scroll only in the 'y' direction | 309 * 'y': scroll only in the 'y' direction |
224 * 'none': disable scrolling for this node | 310 * 'none': disable scrolling for this node |
225 * | 311 * |
226 * @param {string=} direction Direction to allow scrolling Defaults to all. | 312 * @param {string=} direction Direction to allow scrolling Defaults to all. |
227 * @param {HTMLElement=} node Element to apply scroll direction setting. | 313 * @param {HTMLElement=} node Element to apply scroll direction setting. |
228 * Defaults to this. | 314 * Defaults to this. |
229 */ | 315 */ |
230 PolymerElement.prototype.setScrollDirection = function(direction, node) {}; | 316 PolymerElement.prototype.setScrollDirection = function(direction, node) {}; |
231 | 317 |
232 /** | 318 /** |
233 * @param {!Function} method | 319 * @param {!Function} method |
234 * @param {number=} wait | 320 * @param {number=} wait |
235 * @return {number} A handle which can be used to cancel the job. | 321 * @return {number} A handle which can be used to cancel the job. |
236 */ | 322 */ |
237 PolymerElement.prototype.async = function(method, wait) {}; | 323 PolymerElement.prototype.async = function(method, wait) {}; |
238 | 324 |
| 325 /** |
| 326 * @param {...*} var_args |
| 327 */ |
| 328 PolymerElement.prototype.factoryImpl = function(var_args) {}; |
| 329 |
239 Polymer.Base; | 330 Polymer.Base; |
240 | 331 |
241 /** | 332 /** |
242 * Used by the promise-polyfill on its own. | 333 * Used by the promise-polyfill on its own. |
243 * | 334 * |
244 * @param {!Function} method | 335 * @param {!Function} method |
245 * @param {number=} wait | 336 * @param {number=} wait |
246 * @return {number} A handle which can be used to cancel the job. | 337 * @return {number} A handle which can be used to cancel the job. |
247 */ | 338 */ |
248 Polymer.Base.async = function(method, wait) {}; | 339 Polymer.Base.async = function(method, wait) {}; |
249 | 340 |
250 /** | 341 /** |
| 342 * Returns a property descriptor object for the property specified. |
| 343 * |
| 344 * This method allows introspecting the configuration of a Polymer element's |
| 345 * properties as configured in its `properties` object. Note, this method |
| 346 * normalizes shorthand forms of the `properties` object into longhand form. |
| 347 * |
| 348 * @param {string} property Name of property to introspect. |
| 349 * @return {Object} Property descriptor for specified property. |
| 350 */ |
| 351 Polymer.Base.getPropertyInfo = function(property) {}; |
| 352 |
| 353 /** |
251 * @param {number} handle | 354 * @param {number} handle |
252 */ | 355 */ |
253 PolymerElement.prototype.cancelAsync = function(handle) {}; | 356 PolymerElement.prototype.cancelAsync = function(handle) {}; |
254 | 357 |
255 /** | 358 /** |
256 * Call debounce to collapse multiple requests for a named task into one | 359 * Call debounce to collapse multiple requests for a named task into one |
257 * invocation, which is made after the wait time has elapsed with no new | 360 * invocation, which is made after the wait time has elapsed with no new |
258 * request. If no wait time is given, the callback is called at microtask timing | 361 * request. If no wait time is given, the callback is called at microtask timing |
259 * (guaranteed to be before paint). | 362 * (guaranteed to be before paint). |
260 * @param {string} jobName | 363 * @param {string} jobName |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 PolymerDomApi.prototype.innerHTML; | 509 PolymerDomApi.prototype.innerHTML; |
407 | 510 |
408 /** | 511 /** |
409 * @param {string} selector | 512 * @param {string} selector |
410 * @return {?HTMLElement} | 513 * @return {?HTMLElement} |
411 */ | 514 */ |
412 PolymerDomApi.prototype.querySelector = function(selector) {}; | 515 PolymerDomApi.prototype.querySelector = function(selector) {}; |
413 | 516 |
414 /** | 517 /** |
415 * @param {string} selector | 518 * @param {string} selector |
416 * @return {!Array<?HTMLElement>} | 519 * @return {!Array<!HTMLElement>} |
417 */ | 520 */ |
418 PolymerDomApi.prototype.querySelectorAll = function(selector) {}; | 521 PolymerDomApi.prototype.querySelectorAll = function(selector) {}; |
419 | 522 |
420 /** @return {!Array<!Node>} */ | 523 /** @return {!Array<!Node>} */ |
421 PolymerDomApi.prototype.getDistributedNodes = function() {}; | 524 PolymerDomApi.prototype.getDistributedNodes = function() {}; |
422 | 525 |
423 /** @return {!Array<!Node>} */ | 526 /** @return {!Array<!Node>} */ |
424 PolymerDomApi.prototype.getDestinationInsertionPoints = function() {}; | 527 PolymerDomApi.prototype.getDestinationInsertionPoints = function() {}; |
425 | 528 |
426 /** @return {?Node} */ | 529 /** @return {?Node} */ |
427 PolymerDomApi.prototype.getOwnerRoot = function() {}; | 530 PolymerDomApi.prototype.getOwnerRoot = function() {}; |
428 | 531 |
429 /** | 532 /** |
430 * @param {string} attribute | 533 * @param {string} attribute |
431 * @param {string|number|boolean} value Values are converted to strings with | 534 * @param {string|number|boolean} value Values are converted to strings with |
432 * ToString, so we accept number and boolean since both convert easily to | 535 * ToString, so we accept number and boolean since both convert easily to |
433 * strings. | 536 * strings. |
434 */ | 537 */ |
435 PolymerDomApi.prototype.setAttribute = function(attribute, value) {}; | 538 PolymerDomApi.prototype.setAttribute = function(attribute, value) {}; |
436 | 539 |
437 /** @param {string} attribute */ | 540 /** @param {string} attribute */ |
438 PolymerDomApi.prototype.removeAttribute = function(attribute) {}; | 541 PolymerDomApi.prototype.removeAttribute = function(attribute) {}; |
439 | 542 |
440 /** @type {?DOMTokenList} */ | 543 /** @type {?DOMTokenList} */ |
441 PolymerDomApi.prototype.classList; | 544 PolymerDomApi.prototype.classList; |
442 | 545 |
443 /** | 546 /** |
| 547 * @param {string} selector |
| 548 * @return {!Array<!HTMLElement>} |
| 549 */ |
| 550 PolymerDomApi.prototype.queryDistributedElements = function(selector) {}; |
| 551 |
| 552 /** |
444 * A Polymer Event API. | 553 * A Polymer Event API. |
445 * | 554 * |
446 * @constructor | 555 * @constructor |
447 */ | 556 */ |
448 var PolymerEventApi = function() {}; | 557 var PolymerEventApi = function() {}; |
449 | 558 |
450 /** @type {?EventTarget} */ | 559 /** @type {?EventTarget} */ |
451 PolymerEventApi.prototype.rootTarget; | 560 PolymerEventApi.prototype.rootTarget; |
452 | 561 |
453 /** @type {?EventTarget} */ | 562 /** @type {?EventTarget} */ |
(...skipping 24 matching lines...) Expand all Loading... |
478 | 587 |
479 /** | 588 /** |
480 * Convert a string from camel-case to dash format. | 589 * Convert a string from camel-case to dash format. |
481 * @param {string} camel | 590 * @param {string} camel |
482 * @return {string} The string in dash format. | 591 * @return {string} The string in dash format. |
483 */ | 592 */ |
484 Polymer.CaseMap.camelToDashCase = function(camel) {}; | 593 Polymer.CaseMap.camelToDashCase = function(camel) {}; |
485 | 594 |
486 | 595 |
487 /** | 596 /** |
| 597 * Settings pulled from |
| 598 * https://github.com/Polymer/polymer/blob/master/src/lib/settings.html |
| 599 */ |
| 600 Polymer.Settings; |
| 601 |
| 602 /** @type {boolean} */ |
| 603 Polymer.Settings.wantShadow; |
| 604 |
| 605 /** @type {boolean} */ |
| 606 Polymer.Settings.hasShadow; |
| 607 |
| 608 /** @type {boolean} */ |
| 609 Polymer.Settings.nativeShadow; |
| 610 |
| 611 /** @type {boolean} */ |
| 612 Polymer.Settings.useShadow; |
| 613 |
| 614 /** @type {boolean} */ |
| 615 Polymer.Settings.useNativeShadow; |
| 616 |
| 617 /** @type {boolean} */ |
| 618 Polymer.Settings.useNativeImports; |
| 619 |
| 620 /** @type {boolean} */ |
| 621 Polymer.Settings.useNativeCustomElements; |
| 622 |
| 623 |
| 624 /** |
| 625 * @see https://github.com/Polymer/polymer/blob/master/src/lib/template/templati
zer.html |
| 626 * @polymerBehavior |
| 627 */ |
| 628 Polymer.Templatizer = { |
| 629 /** |
| 630 * @param {?Object} model |
| 631 * @return {?Element} |
| 632 */ |
| 633 stamp: function(model) {}, |
| 634 |
| 635 /** |
| 636 * @param {?Element} template |
| 637 */ |
| 638 templatize: function(template) {}, |
| 639 }; |
| 640 |
| 641 |
| 642 /** |
488 * An Event type fired when moving while finger/button is down. | 643 * An Event type fired when moving while finger/button is down. |
489 * state - a string indicating the tracking state: | 644 * state - a string indicating the tracking state: |
490 * + start: fired when tracking is first detected (finger/button down and | 645 * + start: fired when tracking is first detected (finger/button down and |
491 * moved past a pre-set distance threshold) | 646 * moved past a pre-set distance threshold) |
492 * + track: fired while tracking | 647 * + track: fired while tracking |
493 * + end: fired when tracking ends | 648 * + end: fired when tracking ends |
494 * x - clientX coordinate for event | 649 * x - clientX coordinate for event |
495 * y - clientY coordinate for event | 650 * y - clientY coordinate for event |
496 * dx - change in pixels horizontally since the first track event | 651 * dx - change in pixels horizontally since the first track event |
497 * dy - change in pixels vertically since the first track event | 652 * dy - change in pixels vertically since the first track event |
(...skipping 21 matching lines...) Expand all Loading... |
519 * y - clientY coordinate for event | 674 * y - clientY coordinate for event |
520 * sourceEvent - the original DOM event that caused the down action | 675 * sourceEvent - the original DOM event that caused the down action |
521 * | 676 * |
522 * @typedef {{ | 677 * @typedef {{ |
523 * x: number, | 678 * x: number, |
524 * y: number, | 679 * y: number, |
525 * sourceEvent: Event | 680 * sourceEvent: Event |
526 * }} | 681 * }} |
527 */ | 682 */ |
528 var PolymerTouchEvent; | 683 var PolymerTouchEvent; |
OLD | NEW |