| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 * @param {string} path The path to set. | 133 * @param {string} path The path to set. |
| 134 * @param {*} value The value to send in the update notification. | 134 * @param {*} value The value to send in the update notification. |
| 135 * @param {boolean=} fromAbove When true, specifies that the change came from | 135 * @param {boolean=} fromAbove When true, specifies that the change came from |
| 136 * above this element and thus upward notification is not necessary. | 136 * above this element and thus upward notification is not necessary. |
| 137 * @return {boolean} True if notification actually took place, based on a dirty | 137 * @return {boolean} True if notification actually took place, based on a dirty |
| 138 * check of whether the new value was already known. | 138 * check of whether the new value was already known. |
| 139 */ | 139 */ |
| 140 PolymerElement.prototype.notifyPath = function(path, value, fromAbove) {}; | 140 PolymerElement.prototype.notifyPath = function(path, value, fromAbove) {}; |
| 141 | 141 |
| 142 /** | 142 /** |
| 143 * @param {string} path Path that should be notified. |
| 144 * @param {!Array<!PolymerSplice>} splices Array of splice records indicating |
| 145 * ordered changes that occurred to the array. |
| 146 */ |
| 147 PolymerElement.prototype.notifySplices = function(path, splices) {}; |
| 148 |
| 149 /** |
| 143 * Convienence method for setting a value to a path and notifying any | 150 * Convienence method for setting a value to a path and notifying any |
| 144 * elements bound to the same path. | 151 * elements bound to the same path. |
| 145 * | 152 * |
| 146 * Note, if any part in the path except for the last is undefined, | 153 * Note, if any part in the path except for the last is undefined, |
| 147 * this method does nothing (this method does not throw when | 154 * this method does nothing (this method does not throw when |
| 148 * dereferencing undefined paths). | 155 * dereferencing undefined paths). |
| 149 * | 156 * |
| 150 * @param {(string|Array<(string|number)>)} path Path to the value | 157 * @param {(string|Array<(string|number)>)} path Path to the value |
| 151 * to read. The path may be specified as a string (e.g. `foo.bar.baz`) | 158 * to read. The path may be specified as a string (e.g. `foo.bar.baz`) |
| 152 * or an array of path parts (e.g. `['foo.bar', 'baz']`). Note that | 159 * or an array of path parts (e.g. `['foo.bar', 'baz']`). Note that |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 * elements are returned. | 272 * elements are returned. |
| 266 * | 273 * |
| 267 * @param {string=} slctr CSS selector to choose the desired | 274 * @param {string=} slctr CSS selector to choose the desired |
| 268 * `<content>`. Defaults to `content`. | 275 * `<content>`. Defaults to `content`. |
| 269 * @return {!Array<!HTMLElement>} List of distributed nodes for the | 276 * @return {!Array<!HTMLElement>} List of distributed nodes for the |
| 270 * `<content>`. | 277 * `<content>`. |
| 271 */ | 278 */ |
| 272 PolymerElement.prototype.getContentChildren = function(slctr) {}; | 279 PolymerElement.prototype.getContentChildren = function(slctr) {}; |
| 273 | 280 |
| 274 /** | 281 /** |
| 282 * Returns a list of nodes that are the effective childNodes. The effective |
| 283 * childNodes list is the same as the element's childNodes except that |
| 284 * any `<content>` elements are replaced with the list of nodes distributed |
| 285 * to the `<content>`, the result of its `getDistributedNodes` method. |
| 286 * |
| 287 * @return {!Array<!Node>} List of effective child nodes. |
| 288 */ |
| 289 PolymerElement.prototype.getEffectiveChildNodes = function() {}; |
| 290 |
| 291 /** |
| 292 * Returns a list of elements that are the effective children. The effective |
| 293 * children list is the same as the element's children except that |
| 294 * any `<content>` elements are replaced with the list of elements |
| 295 * distributed to the `<content>`. |
| 296 * |
| 297 * @return {!Array<!Node>} List of effective children. |
| 298 */ |
| 299 PolymerElement.prototype.getEffectiveChildren = function() {}; |
| 300 |
| 301 /** |
| 302 * Returns a string of text content that is the concatenation of the |
| 303 * text content's of the element's effective childNodes (the elements |
| 304 * returned by <a href="#getEffectiveChildNodes>getEffectiveChildNodes</a>. |
| 305 * |
| 306 * @return {string} A concatenated string of all effective childNode text |
| 307 * content. |
| 308 */ |
| 309 PolymerElement.prototype.getEffectiveTextContent = function() {}; |
| 310 |
| 311 /** |
| 312 * @param {string} selector |
| 313 * @return {?HTMLElement} |
| 314 */ |
| 315 PolymerElement.prototype.queryEffectiveChildren = function(selector) {}; |
| 316 |
| 317 /** |
| 275 * Fire an event. | 318 * Fire an event. |
| 276 * | 319 * |
| 277 * @param {string} type An event name. | 320 * @param {string} type An event name. |
| 278 * @param {*=} detail | 321 * @param {*=} detail |
| 279 * @param {{ | 322 * @param {{ |
| 280 * bubbles: (boolean|undefined), | 323 * bubbles: (boolean|undefined), |
| 281 * cancelable: (boolean|undefined), | 324 * cancelable: (boolean|undefined), |
| 282 * node: (!EventTarget|undefined)}=} options | 325 * node: (!EventTarget|undefined)}=} options |
| 283 * @return {Object} event | 326 * @return {Object} event |
| 284 */ | 327 */ |
| 285 PolymerElement.prototype.fire = function(type, detail, options) {}; | 328 PolymerElement.prototype.fire = function(type, detail, options) {}; |
| 286 | 329 |
| 287 /** | 330 /** |
| 288 * Toggles the named boolean class on the host element, adding the class if | 331 * Toggles the named boolean class on the host element, adding the class if |
| 289 * bool is truthy and removing it if bool is falsey. If node is specified, sets | 332 * bool is truthy and removing it if bool is falsey. If node is specified, sets |
| 290 * the class on node instead of the host element. | 333 * the class on node instead of the host element. |
| 291 * @param {string} name | 334 * @param {string} name |
| 292 * @param {boolean} bool | 335 * @param {boolean=} bool |
| 293 * @param {HTMLElement=} node | 336 * @param {HTMLElement=} node |
| 294 */ | 337 */ |
| 295 PolymerElement.prototype.toggleClass = function(name, bool, node) {}; | 338 PolymerElement.prototype.toggleClass = function(name, bool, node) {}; |
| 296 | 339 |
| 297 /** | 340 /** |
| 298 * Toggles the named boolean attribute on the host element, adding the attribute | 341 * Toggles the named boolean attribute on the host element, adding the attribute |
| 299 * if bool is truthy and removing it if bool is falsey. If node is specified, | 342 * if bool is truthy and removing it if bool is falsey. If node is specified, |
| 300 * sets the attribute on node instead of the host element. | 343 * sets the attribute on node instead of the host element. |
| 301 * @param {string} name | 344 * @param {string} name |
| 302 * @param {boolean} bool | 345 * @param {boolean} bool |
| (...skipping 14 matching lines...) Expand all Loading... |
| 317 * Convenience method to add an event listener on a given element, late bound to | 360 * Convenience method to add an event listener on a given element, late bound to |
| 318 * a named method on this element. | 361 * a named method on this element. |
| 319 * @param {!EventTarget} node Element to add event listener to. | 362 * @param {!EventTarget} node Element to add event listener to. |
| 320 * @param {string} eventName Name of event to listen for. | 363 * @param {string} eventName Name of event to listen for. |
| 321 * @param {string} methodName Name of handler method on this to call. | 364 * @param {string} methodName Name of handler method on this to call. |
| 322 */ | 365 */ |
| 323 PolymerElement.prototype.listen = function(node, eventName, methodName) {}; | 366 PolymerElement.prototype.listen = function(node, eventName, methodName) {}; |
| 324 | 367 |
| 325 /** | 368 /** |
| 326 * Convenience method to remove an event listener from a given element. | 369 * Convenience method to remove an event listener from a given element. |
| 327 * @param {!EventTarget} node Element to remove event listener from. | 370 * @param {?EventTarget} node Element to remove event listener from. |
| 328 * @param {string} eventName Name of event to stop listening for. | 371 * @param {string} eventName Name of event to stop listening for. |
| 329 * @param {string} methodName Name of handler method on this to remove. | 372 * @param {string} methodName Name of handler method on this to remove. |
| 330 */ | 373 */ |
| 331 PolymerElement.prototype.unlisten = function(node, eventName, methodName) {}; | 374 PolymerElement.prototype.unlisten = function(node, eventName, methodName) {}; |
| 332 | 375 |
| 333 /** | 376 /** |
| 334 * Override scrolling behavior to all direction, one direction, or none. | 377 * Override scrolling behavior to all direction, one direction, or none. |
| 335 * | 378 * |
| 336 * Valid scroll directions: | 379 * Valid scroll directions: |
| 337 * 'all': scroll in any direction | 380 * 'all': scroll in any direction |
| (...skipping 20 matching lines...) Expand all Loading... |
| 358 PolymerElement.prototype.factoryImpl = function(var_args) {}; | 401 PolymerElement.prototype.factoryImpl = function(var_args) {}; |
| 359 | 402 |
| 360 /** | 403 /** |
| 361 * Apply style scoping to the specified container and all its descendants. | 404 * Apply style scoping to the specified container and all its descendants. |
| 362 * @param {!Element} container Element to scope. | 405 * @param {!Element} container Element to scope. |
| 363 * @param {boolean} shouldObserve When true, monitors the container for changes | 406 * @param {boolean} shouldObserve When true, monitors the container for changes |
| 364 * and re-applies scoping for any future changes. | 407 * and re-applies scoping for any future changes. |
| 365 */ | 408 */ |
| 366 PolymerElement.prototype.scopeSubtree = function(container, shouldObserve) {}; | 409 PolymerElement.prototype.scopeSubtree = function(container, shouldObserve) {}; |
| 367 | 410 |
| 411 /** |
| 412 * Aliases one data path as another, such that path notifications from one |
| 413 * are routed to the other. |
| 414 * |
| 415 * @param {string} to Target path to link. |
| 416 * @param {string} from Source path to link. |
| 417 */ |
| 418 PolymerElement.prototype.linkPaths = function(to, from) {} |
| 419 |
| 420 /** |
| 421 * Removes a data path alias previously established with `linkPaths`. |
| 422 * |
| 423 * Note, the path to unlink should be the target (`to`) used when |
| 424 * linking the paths. |
| 425 * |
| 426 * @param {string} path Target path to unlink. |
| 427 */ |
| 428 PolymerElement.prototype.unlinkPaths = function(path) {} |
| 429 |
| 368 Polymer.Base; | 430 Polymer.Base; |
| 369 | 431 |
| 370 /** | 432 /** |
| 371 * Used by the promise-polyfill on its own. | 433 * Used by the promise-polyfill on its own. |
| 372 * | 434 * |
| 373 * @param {!Function} method | 435 * @param {!Function} method |
| 374 * @param {number=} wait | 436 * @param {number=} wait |
| 375 * @return {number} A handle which can be used to cancel the job. | 437 * @return {number} A handle which can be used to cancel the job. |
| 376 */ | 438 */ |
| 377 Polymer.Base.async = function(method, wait) {}; | 439 Polymer.Base.async = function(method, wait) {}; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 * shortcut for setting `customStyle` and then calling `updateStyles`. | 561 * shortcut for setting `customStyle` and then calling `updateStyles`. |
| 500 */ | 562 */ |
| 501 PolymerElement.prototype.updateStyles = function(properties) {}; | 563 PolymerElement.prototype.updateStyles = function(properties) {}; |
| 502 | 564 |
| 503 /** | 565 /** |
| 504 * @type {!Object<string, string|undefined>} | 566 * @type {!Object<string, string|undefined>} |
| 505 */ | 567 */ |
| 506 PolymerElement.prototype.customStyle; | 568 PolymerElement.prototype.customStyle; |
| 507 | 569 |
| 508 /** | 570 /** |
| 571 * Returns the computed style value for the given property. |
| 572 * @param {string} property |
| 573 * @return {string} the computed value |
| 574 */ |
| 575 PolymerElement.prototype.getComputedStyleValue = function(property) {}; |
| 576 |
| 577 /** |
| 509 * Logs a message to the console. | 578 * Logs a message to the console. |
| 510 * | 579 * |
| 511 * @param {!Array} var_args | 580 * @param {!Array} var_args |
| 512 * @protected | 581 * @protected |
| 513 */ | 582 */ |
| 514 PolymerElement.prototype._log = function(var_args) {}; | 583 PolymerElement.prototype._log = function(var_args) {}; |
| 515 | 584 |
| 516 /** | 585 /** |
| 517 * Logs a message to the console with a 'warn' level. | 586 * Logs a message to the console with a 'warn' level. |
| 518 * | 587 * |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 | 666 |
| 598 /** @type {?Node} */ | 667 /** @type {?Node} */ |
| 599 PolymerDomApi.prototype.nextSibling; | 668 PolymerDomApi.prototype.nextSibling; |
| 600 | 669 |
| 601 /** @type {string} */ | 670 /** @type {string} */ |
| 602 PolymerDomApi.prototype.textContent; | 671 PolymerDomApi.prototype.textContent; |
| 603 | 672 |
| 604 /** @type {string} */ | 673 /** @type {string} */ |
| 605 PolymerDomApi.prototype.innerHTML; | 674 PolymerDomApi.prototype.innerHTML; |
| 606 | 675 |
| 676 /** @type {?HTMLElement} */ |
| 677 PolymerDomApi.prototype.activeElement; |
| 678 |
| 607 /** | 679 /** |
| 608 * @param {string} selector | 680 * @param {string} selector |
| 609 * @return {?HTMLElement} | 681 * @return {?HTMLElement} |
| 610 */ | 682 */ |
| 611 PolymerDomApi.prototype.querySelector = function(selector) {}; | 683 PolymerDomApi.prototype.querySelector = function(selector) {}; |
| 612 | 684 |
| 613 /** | 685 /** |
| 614 * @param {string} selector | 686 * @param {string} selector |
| 615 * @return {!Array<!HTMLElement>} | 687 * @return {!Array<!HTMLElement>} |
| 616 */ | 688 */ |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 * var model = modelForElement(el); | 953 * var model = modelForElement(el); |
| 882 * if (model.index < 10) { | 954 * if (model.index < 10) { |
| 883 * model.set('item.checked', true); | 955 * model.set('item.checked', true); |
| 884 * } | 956 * } |
| 885 * | 957 * |
| 886 * @param {?HTMLElement} el Element for which to return a template model. | 958 * @param {?HTMLElement} el Element for which to return a template model. |
| 887 * @return {(!PolymerElement)|undefined} Model representing the binding scope
for | 959 * @return {(!PolymerElement)|undefined} Model representing the binding scope
for |
| 888 * the element. | 960 * the element. |
| 889 */ | 961 */ |
| 890 modelForElement: function(el) {}, | 962 modelForElement: function(el) {}, |
| 891 | 963 |
| 892 /** | 964 /** |
| 893 * @param {function()} fn | 965 * @param {function()} fn |
| 894 * @protected | 966 * @protected |
| 895 */ | 967 */ |
| 896 _debounceTemplate: function(fn) {} | 968 _debounceTemplate: function(fn) {} |
| 897 }; | 969 }; |
| 898 | 970 |
| 899 | 971 |
| 900 | 972 |
| 901 /** | 973 /** |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1043 * y: number, | 1115 * y: number, |
| 1044 * sourceEvent: Event | 1116 * sourceEvent: Event |
| 1045 * }} | 1117 * }} |
| 1046 */ | 1118 */ |
| 1047 var PolymerTouchEvent; | 1119 var PolymerTouchEvent; |
| 1048 | 1120 |
| 1049 /** | 1121 /** |
| 1050 * @typedef {{ | 1122 * @typedef {{ |
| 1051 * index: number, | 1123 * index: number, |
| 1052 * removed: !Array, | 1124 * removed: !Array, |
| 1053 * addedCount: number | 1125 * addedCount: number, |
| 1126 * object: !Array, |
| 1127 * type: string, |
| 1054 * }} | 1128 * }} |
| 1055 */ | 1129 */ |
| 1056 var PolymerSplice; | 1130 var PolymerSplice; |
| 1057 | 1131 |
| 1058 /** | 1132 /** |
| 1059 * @typedef {{ | 1133 * @typedef {{ |
| 1060 * added: !Array<string|number>, | 1134 * added: !Array<string|number>, |
| 1061 * removed: !Array<string|number> | 1135 * removed: !Array<string|number> |
| 1062 * }} | 1136 * }} |
| 1063 */ | 1137 */ |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1087 * method does not size the element, and it's usually necessary to set | 1161 * method does not size the element, and it's usually necessary to set |
| 1088 * the element's height and width so that the background image is visible. | 1162 * the element's height and width so that the background image is visible. |
| 1089 * | 1163 * |
| 1090 * @param {Element} element The element to which the icon is applied. | 1164 * @param {Element} element The element to which the icon is applied. |
| 1091 * @param {string} icon The name of the icon to apply. | 1165 * @param {string} icon The name of the icon to apply. |
| 1092 * @param {string=} theme (optional) The name or index of the icon to apply. | 1166 * @param {string=} theme (optional) The name or index of the icon to apply. |
| 1093 * @param {number=} scale (optional, defaults to 1) Icon scaling factor. | 1167 * @param {number=} scale (optional, defaults to 1) Icon scaling factor. |
| 1094 */ | 1168 */ |
| 1095 Polymer.Iconset.prototype.applyIcon = function( | 1169 Polymer.Iconset.prototype.applyIcon = function( |
| 1096 element, icon, theme, scale) {}; | 1170 element, icon, theme, scale) {}; |
| 1171 |
| 1172 Polymer.ResolveUrl = {}; |
| 1173 |
| 1174 /** |
| 1175 * @param {string} cssText Some CSS text taken from ownerDocument. |
| 1176 * @param {!Document} ownerDocument The source of the css. |
| 1177 * @return {string} The given CSS text with its URLs rewritten to be based on |
| 1178 * the primary document of this window rather than the given ownerDocument. |
| 1179 */ |
| 1180 Polymer.ResolveUrl.resolveCss = function(cssText, ownerDocument) {} |
| 1181 /** |
| 1182 * @param {!Element} element An element whose URL attributes need to be renormed
. |
| 1183 * @param {!Document} ownerDocument The document whose URL is the base of the |
| 1184 * element's current attributes. |
| 1185 */ |
| 1186 Polymer.ResolveUrl.resolveAttrs = function(element, ownerDocument) {} |
| 1187 /** |
| 1188 * @param {string} url A url that needs to be renormed. |
| 1189 * @param {?string} baseURI The current base of URL for the URL. |
| 1190 * @return {string} The given url rewritten to be based on |
| 1191 * the primary document of this window rather than the given url. |
| 1192 */ |
| 1193 Polymer.ResolveUrl.resolveUrl = function(url, baseURI) {} |
| 1194 |
| 1195 Polymer.RenderStatus; |
| 1196 |
| 1197 /** |
| 1198 * Makes callback when first render occurs or immediately if render has occured. |
| 1199 * @param {!function()} cb Callback function to be invoked. |
| 1200 */ |
| 1201 Polymer.RenderStatus.whenReady = function(cb) {} |
| 1202 |
| 1203 /** |
| 1204 * Queue up function call on next render. |
| 1205 * @param {!Element} element The element on which the function call is made. |
| 1206 * @param {!function()} fn The function called on next render. |
| 1207 * @param {...*} args The function arguments. |
| 1208 */ |
| 1209 Polymer.RenderStatus.afterNextRender = function(element, fn, args) {} |
| 1210 |
| 1211 Polymer.AppLayout; |
| 1212 |
| 1213 /** @constructor */ |
| 1214 Polymer.AppLayout.LocalDomWithBackground = function(){}; |
| 1215 /** @type {!HTMLElement} */ |
| 1216 Polymer.AppLayout.LocalDomWithBackground.prototype.backgroundFrontLayer; |
| 1217 /** @type {!HTMLElement} */ |
| 1218 Polymer.AppLayout.LocalDomWithBackground.prototype.backgroundRearLayer; |
| 1219 /** @type {!HTMLElement} */ |
| 1220 Polymer.AppLayout.LocalDomWithBackground.prototype.background; |
| 1221 |
| 1222 /** |
| 1223 * @constructor |
| 1224 * @extends {PolymerElement} |
| 1225 */ |
| 1226 Polymer.AppLayout.ElementWithBackground = function(){}; |
| 1227 |
| 1228 // TODO(garlicnation): Follow up with app-layout team and remove private api fro
m this prototype |
| 1229 Polymer.AppLayout.ElementWithBackground.prototype = { |
| 1230 /** @type {!Polymer.AppLayout.LocalDomWithBackground} */ |
| 1231 $: null, |
| 1232 /** @return {boolean} True if there's content below the current element */ |
| 1233 isContentBelow: function(){}, |
| 1234 /** Updates the elements scroll state */ |
| 1235 _updateScrollState: function(){}, |
| 1236 /** @return {boolean} true if the element is on screen */ |
| 1237 isOnScreen: function(){}, |
| 1238 /** @type {number} Internal bookkeeping to track screen position */ |
| 1239 _deltaHeight: 0, |
| 1240 } |
| OLD | NEW |