| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 /** | 115 /** |
| 116 * Return the element whose local dom within which this element is contained. | 116 * Return the element whose local dom within which this element is contained. |
| 117 * @type {?Element} | 117 * @type {?Element} |
| 118 */ | 118 */ |
| 119 PolymerElement.prototype.domHost; | 119 PolymerElement.prototype.domHost; |
| 120 | 120 |
| 121 /** | 121 /** |
| 122 * Notifies the event binding system of a change to a property. | 122 * Notifies the event binding system of a change to a property. |
| 123 * @param {string} path The path to set. | 123 * @param {string} path The path to set. |
| 124 * @param {*} value The value to send in the update notification. | 124 * @param {*} value The value to send in the update notification. |
| 125 * @param {boolean=} fromAbove When true, specifies that the change came from |
| 126 * above this element and thus upward notification is not necessary. |
| 127 * @return {boolean} True if notification actually took place, based on a dirty |
| 128 * check of whether the new value was already known. |
| 125 */ | 129 */ |
| 126 PolymerElement.prototype.notifyPath = function(path, value) {}; | 130 PolymerElement.prototype.notifyPath = function(path, value, fromAbove) {}; |
| 127 | 131 |
| 128 /** | 132 /** |
| 129 * Convienence method for setting a value to a path and notifying any | 133 * Convienence method for setting a value to a path and notifying any |
| 130 * elements bound to the same path. | 134 * elements bound to the same path. |
| 131 * | 135 * |
| 132 * Note, if any part in the path except for the last is undefined, | 136 * Note, if any part in the path except for the last is undefined, |
| 133 * this method does nothing (this method does not throw when | 137 * this method does nothing (this method does not throw when |
| 134 * dereferencing undefined paths). | 138 * dereferencing undefined paths). |
| 135 * | 139 * |
| 136 * @param {(string|Array<(string|number)>)} path Path to the value | 140 * @param {(string|Array<(string|number)>)} path Path to the value |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 * | 351 * |
| 348 * @param {string} property Name of property to introspect. | 352 * @param {string} property Name of property to introspect. |
| 349 * @return {Object} Property descriptor for specified property. | 353 * @return {Object} Property descriptor for specified property. |
| 350 */ | 354 */ |
| 351 Polymer.Base.getPropertyInfo = function(property) {}; | 355 Polymer.Base.getPropertyInfo = function(property) {}; |
| 352 | 356 |
| 353 Polymer.Gestures; | 357 Polymer.Gestures; |
| 354 | 358 |
| 355 /** | 359 /** |
| 356 * Gets the original target of the given event. | 360 * Gets the original target of the given event. |
| 357 * | 361 * |
| 358 * Cheaper than Polymer.dom(ev).path[0]; | 362 * Cheaper than Polymer.dom(ev).path[0]; |
| 359 * See https://github.com/Polymer/polymer/blob/master/src/standard/gestures.html
#L191 | 363 * See https://github.com/Polymer/polymer/blob/master/src/standard/gestures.html
#L191 |
| 360 * | 364 * |
| 361 * @param {Event} ev . | 365 * @param {Event} ev . |
| 362 * @return {Element} The original target of the event. | 366 * @return {Element} The original target of the event. |
| 363 */ | 367 */ |
| 364 Polymer.Gestures.findOriginalTarget = function(ev) {}; | 368 Polymer.Gestures.findOriginalTarget = function(ev) {}; |
| 365 | 369 |
| 366 | 370 |
| 367 /** | 371 /** |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 /** | 423 /** |
| 420 * Dynamically imports an HTML document. | 424 * Dynamically imports an HTML document. |
| 421 * @param {string} href | 425 * @param {string} href |
| 422 * @param {Function=} onload | 426 * @param {Function=} onload |
| 423 * @param {Function=} onerror | 427 * @param {Function=} onerror |
| 424 */ | 428 */ |
| 425 PolymerElement.prototype.importHref = function(href, onload, onerror) {}; | 429 PolymerElement.prototype.importHref = function(href, onload, onerror) {}; |
| 426 | 430 |
| 427 /** | 431 /** |
| 428 * Delete an element from an array. | 432 * Delete an element from an array. |
| 429 * @param {!Array} array | 433 * @param {!Array|string} array Path to array from which to remove the item (or |
| 430 * @param {*} item | 434 * the array itself). |
| 435 * @param {*} item Item to remove |
| 436 * @return {!Array} The array with the item removed. |
| 431 */ | 437 */ |
| 432 PolymerElement.prototype.arrayDelete = function(array, item) {}; | 438 PolymerElement.prototype.arrayDelete = function(array, item) {}; |
| 433 | 439 |
| 434 /** | 440 /** |
| 435 * Resolve a url to make it relative to the current doc. | 441 * Resolve a url to make it relative to the current doc. |
| 436 * @param {string} url | 442 * @param {string} url |
| 437 * @return {string} | 443 * @return {string} |
| 438 */ | 444 */ |
| 439 PolymerElement.prototype.resolveUrl = function(url) {}; | 445 PolymerElement.prototype.resolveUrl = function(url) {}; |
| 440 | 446 |
| 441 /** | 447 /** |
| 442 * Re-evaluates and applies custom CSS properties based on dynamic | 448 * Re-evaluates and applies custom CSS properties based on dynamic |
| 443 * changes to this element's scope, such as adding or removing classes | 449 * changes to this element's scope, such as adding or removing classes |
| 444 * in this element's local DOM. | 450 * in this element's local DOM. |
| 445 * | 451 * |
| 446 * For performance reasons, Polymer's custom CSS property shim relies | 452 * For performance reasons, Polymer's custom CSS property shim relies |
| 447 * on this explicit signal from the user to indicate when changes have | 453 * on this explicit signal from the user to indicate when changes have |
| 448 * been made that affect the values of custom properties. | 454 * been made that affect the values of custom properties. |
| 449 * | 455 * |
| 450 * @param {Object=} properties Properties object which, if provided is mixed | 456 * @param {Object=} properties Properties object which, if provided is mixed |
| 451 * into the element's `customStyle` property. This argument provides a | 457 * into the element's `customStyle` property. This argument provides a |
| 452 * shortcut for setting `customStyle` and then calling `updateStyles`. | 458 * shortcut for setting `customStyle` and then calling `updateStyles`. |
| 453 */ | 459 */ |
| 454 PolymerElement.prototype.updateStyles = function(properties) {}; | 460 PolymerElement.prototype.updateStyles = function(properties) {}; |
| 455 | 461 |
| 456 /** | 462 /** |
| 457 * Logs a message to the console. | 463 * Logs a message to the console. |
| 458 * | 464 * |
| 459 * @param {!Array} var_args | 465 * @param {!Array} var_args |
| 460 * @protected | 466 * @protected |
| 461 */ | 467 */ |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 | 622 |
| 617 /** | 623 /** |
| 618 * Convert a string from camel-case to dash format. | 624 * Convert a string from camel-case to dash format. |
| 619 * @param {string} camel | 625 * @param {string} camel |
| 620 * @return {string} The string in dash format. | 626 * @return {string} The string in dash format. |
| 621 */ | 627 */ |
| 622 Polymer.CaseMap.camelToDashCase = function(camel) {}; | 628 Polymer.CaseMap.camelToDashCase = function(camel) {}; |
| 623 | 629 |
| 624 | 630 |
| 625 /** | 631 /** |
| 632 * A Polymer data structure abstraction. |
| 633 * |
| 634 * @param {?Array} userArray |
| 635 * @constructor |
| 636 */ |
| 637 Polymer.Collection = function(userArray) {}; |
| 638 |
| 639 Polymer.Collection.prototype.initMap = function() {}; |
| 640 |
| 641 /** |
| 642 * @param {*} item |
| 643 */ |
| 644 Polymer.Collection.prototype.add = function(item) {}; |
| 645 |
| 646 /** |
| 647 * @param {number|string} key |
| 648 */ |
| 649 Polymer.Collection.prototype.removeKey = function(key) {}; |
| 650 |
| 651 /** |
| 652 * @param {*} item |
| 653 * @return {number|string} The key of the item removed. |
| 654 */ |
| 655 Polymer.Collection.prototype.remove = function(item) {}; |
| 656 |
| 657 /** |
| 658 * @param {*} item |
| 659 * @return {number|string} The key of the item. |
| 660 */ |
| 661 Polymer.Collection.prototype.getKey = function(item) {}; |
| 662 |
| 663 /** |
| 664 * @return {!Array<number|string>} The key of the item removed. |
| 665 */ |
| 666 Polymer.Collection.prototype.getKeys = function() {}; |
| 667 |
| 668 /** |
| 669 * @param {number|string} key |
| 670 * @param {*} item |
| 671 */ |
| 672 Polymer.Collection.prototype.setItem = function(key, item) {}; |
| 673 |
| 674 /** |
| 675 * @param {number|string} key |
| 676 * @return {*} The item for the given key if present. |
| 677 */ |
| 678 Polymer.Collection.prototype.getItem = function(key) {}; |
| 679 |
| 680 /** |
| 681 * @return {!Array} The items in the collection |
| 682 */ |
| 683 Polymer.Collection.prototype.getItems = function() {}; |
| 684 |
| 685 /** |
| 686 * @param {!Array} userArray |
| 687 * @return {!Polymer.Collection} A new Collection wrapping the given array. |
| 688 */ |
| 689 Polymer.Collection.get = function(userArray) {}; |
| 690 |
| 691 /** |
| 692 * @param {!Array} userArray |
| 693 * @param {!Array<!PolymerSplice>} splices |
| 694 * @return {!Array<!PolymerKeySplice>} KeySplices with added and removed keys |
| 695 */ |
| 696 Polymer.Collection.applySplices = function(userArray, splices) {}; |
| 697 |
| 698 /** |
| 626 * Settings pulled from | 699 * Settings pulled from |
| 627 * https://github.com/Polymer/polymer/blob/master/src/lib/settings.html | 700 * https://github.com/Polymer/polymer/blob/master/src/lib/settings.html |
| 628 */ | 701 */ |
| 629 Polymer.Settings; | 702 Polymer.Settings; |
| 630 | 703 |
| 631 /** @type {boolean} */ | 704 /** @type {boolean} */ |
| 632 Polymer.Settings.wantShadow; | 705 Polymer.Settings.wantShadow; |
| 633 | 706 |
| 634 /** @type {boolean} */ | 707 /** @type {boolean} */ |
| 635 Polymer.Settings.hasShadow; | 708 Polymer.Settings.hasShadow; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 648 | 721 |
| 649 /** @type {boolean} */ | 722 /** @type {boolean} */ |
| 650 Polymer.Settings.useNativeCustomElements; | 723 Polymer.Settings.useNativeCustomElements; |
| 651 | 724 |
| 652 | 725 |
| 653 /** | 726 /** |
| 654 * @see https://github.com/Polymer/polymer/blob/master/src/lib/template/templati
zer.html | 727 * @see https://github.com/Polymer/polymer/blob/master/src/lib/template/templati
zer.html |
| 655 * @polymerBehavior | 728 * @polymerBehavior |
| 656 */ | 729 */ |
| 657 Polymer.Templatizer = { | 730 Polymer.Templatizer = { |
| 731 ctor: function() {}, |
| 732 |
| 658 /** | 733 /** |
| 659 * @param {?Object} model | 734 * @param {?Object} model |
| 660 * @return {?Element} | 735 * @return {?Element} |
| 661 */ | 736 */ |
| 662 stamp: function(model) {}, | 737 stamp: function(model) {}, |
| 663 | 738 |
| 664 /** | 739 /** |
| 665 * @param {?Element} template | 740 * @param {?Element} template |
| 666 */ | 741 */ |
| 667 templatize: function(template) {} | 742 templatize: function(template) {}, |
| 743 |
| 744 /** |
| 745 * Returns the template "model" associated with a given element, which |
| 746 * serves as the binding scope for the template instance the element is |
| 747 * contained in. A template model is an instance of `Polymer.Base`, and |
| 748 * should be used to manipulate data associated with this template instance. |
| 749 * |
| 750 * Example: |
| 751 * |
| 752 * var model = modelForElement(el); |
| 753 * if (model.index < 10) { |
| 754 * model.set('item.checked', true); |
| 755 * } |
| 756 * |
| 757 * @param {!HTMLElement} el Element for which to return a template model. |
| 758 * @return {(!PolymerElement)|undefined} Model representing the binding scope
for |
| 759 * the element. |
| 760 */ |
| 761 modelForElement: function(el) {} |
| 668 }; | 762 }; |
| 669 | 763 |
| 670 | 764 |
| 765 |
| 766 /** |
| 767 * A node produced by Templatizer which has a templateInstance property. |
| 768 * |
| 769 * @constructor |
| 770 * @extends {HTMLElement} |
| 771 */ |
| 772 var TemplatizerNode = function() {}; |
| 773 |
| 774 |
| 775 /** @type {?PolymerElement} */ |
| 776 TemplatizerNode.prototype._templateInstance; |
| 777 |
| 778 |
| 779 |
| 780 /** |
| 781 * @see https://github.com/Polymer/polymer/blob/master/src/lib/template/array-se
lector.html |
| 782 * @extends {PolymerElement} |
| 783 * @constructor |
| 784 */ |
| 785 var ArraySelectorElement = function() {}; |
| 786 |
| 787 |
| 788 /** |
| 789 * Returns whether the item is currently selected. |
| 790 * |
| 791 * @param {*} item Item from `items` array to test |
| 792 * @return {boolean} Whether the item is selected |
| 793 */ |
| 794 ArraySelectorElement.prototype.isSelected = function(item) {}; |
| 795 |
| 796 |
| 797 /** |
| 798 * Clears the selection state. |
| 799 */ |
| 800 ArraySelectorElement.prototype.clearSelection = function() {}; |
| 801 |
| 802 |
| 803 /** |
| 804 * Deselects the given item if it is already selected. |
| 805 * |
| 806 * @param {*} item Item from `items` array to deselect |
| 807 */ |
| 808 ArraySelectorElement.prototype.deselect = function(item) {}; |
| 809 |
| 810 |
| 811 /** |
| 812 * Selects the given item. When `toggle` is true, this will automatically |
| 813 * deselect the item if already selected. |
| 814 * |
| 815 * @param {*} item Item from `items` array to select |
| 816 */ |
| 817 ArraySelectorElement.prototype.select = function(item) {}; |
| 818 |
| 819 |
| 671 /** | 820 /** |
| 672 * An Event type fired when moving while finger/button is down. | 821 * An Event type fired when moving while finger/button is down. |
| 673 * state - a string indicating the tracking state: | 822 * state - a string indicating the tracking state: |
| 674 * + start: fired when tracking is first detected (finger/button down and | 823 * + start: fired when tracking is first detected (finger/button down and |
| 675 * moved past a pre-set distance threshold) | 824 * moved past a pre-set distance threshold) |
| 676 * + track: fired while tracking | 825 * + track: fired while tracking |
| 677 * + end: fired when tracking ends | 826 * + end: fired when tracking ends |
| 678 * x - clientX coordinate for event | 827 * x - clientX coordinate for event |
| 679 * y - clientY coordinate for event | 828 * y - clientY coordinate for event |
| 680 * dx - change in pixels horizontally since the first track event | 829 * dx - change in pixels horizontally since the first track event |
| (...skipping 22 matching lines...) Expand all Loading... |
| 703 * y - clientY coordinate for event | 852 * y - clientY coordinate for event |
| 704 * sourceEvent - the original DOM event that caused the down action | 853 * sourceEvent - the original DOM event that caused the down action |
| 705 * | 854 * |
| 706 * @typedef {{ | 855 * @typedef {{ |
| 707 * x: number, | 856 * x: number, |
| 708 * y: number, | 857 * y: number, |
| 709 * sourceEvent: Event | 858 * sourceEvent: Event |
| 710 * }} | 859 * }} |
| 711 */ | 860 */ |
| 712 var PolymerTouchEvent; | 861 var PolymerTouchEvent; |
| 862 |
| 863 /** |
| 864 * @typedef {{ |
| 865 * index: number, |
| 866 * removed: !Array, |
| 867 * addedCount: number |
| 868 * }} |
| 869 */ |
| 870 var PolymerSplice; |
| 871 |
| 872 /** |
| 873 * @typedef {{ |
| 874 * added: !Array<string|number>, |
| 875 * removed: !Array<string|number> |
| 876 * }} |
| 877 */ |
| 878 var PolymerKeySplice; |
| 879 |
| 880 /** |
| 881 * @typedef {{ |
| 882 * indexSplices: ?Array<!PolymerSplice>, |
| 883 * keySplices: ?Array<!PolymerKeySplice> |
| 884 * }} |
| 885 */ |
| 886 var PolymerSpliceChange; |
| OLD | NEW |