OLD | NEW |
(Empty) | |
| 1 /** |
| 2 * @fileoverview Closure compiler externs for the Polymer library. |
| 3 * |
| 4 * @externs |
| 5 * @license |
| 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 |
| 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 |
| 10 * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt. Code |
| 11 * distributed by Google as part of the polymer project is also subject to an |
| 12 * additional IP rights grant found at http://polymer.github.io/PATENTS.txt. |
| 13 */ |
| 14 |
| 15 /** |
| 16 * @param {!{is: string}} descriptor The Polymer descriptor of the element. |
| 17 * @see https://github.com/Polymer/polymer/blob/0.8-preview/PRIMER.md#custom-ele
ment-registration |
| 18 */ |
| 19 var Polymer = function(descriptor) {}; |
| 20 |
| 21 |
| 22 /** @constructor @extends {HTMLElement} */ |
| 23 var PolymerElement = function() { |
| 24 /** @type {!Object<string,!HTMLElement>} */ |
| 25 this.$; |
| 26 }; |
| 27 |
| 28 /** @type {string} The Custom element tag name. */ |
| 29 PolymerElement.prototype.is; |
| 30 |
| 31 /** @type {string} The native element this element extends. */ |
| 32 PolymerElement.prototype.extends; |
| 33 |
| 34 /** |
| 35 * An array of objects whose properties get mixed in to this element. |
| 36 * |
| 37 * @type {!Array<!Object>|undefined} |
| 38 */ |
| 39 PolymerElement.prototype.mixins; |
| 40 |
| 41 /** |
| 42 * A string-separated list of dependent properties that should result in a |
| 43 * change function being called. These observers differ from single-property |
| 44 * observers in that the change handler is called asynchronously. |
| 45 * |
| 46 * @type {!Object<string, string>|undefined} |
| 47 */ |
| 48 PolymerElement.prototype.observers; |
| 49 |
| 50 /** On create callback. */ |
| 51 PolymerElement.prototype.created = function() {}; |
| 52 /** On ready callback. */ |
| 53 PolymerElement.prototype.ready = function() {}; |
| 54 /** On attached to the DOM callback. */ |
| 55 PolymerElement.prototype.attached = function() {}; |
| 56 /** On detached from the DOM callback. */ |
| 57 PolymerElement.prototype.detached = function() {}; |
| 58 |
| 59 /** |
| 60 * Callback fired when an attribute on the element has been changed. |
| 61 * |
| 62 * @param {string} name The name of the attribute that changed. |
| 63 */ |
| 64 PolymerElement.prototype.attributeChanged = function(name) {}; |
| 65 |
| 66 /** @typedef {!{ |
| 67 * type: !Function, |
| 68 * reflectToAttribute: (boolean|undefined), |
| 69 * readOnly: (boolean|undefined), |
| 70 * notify: (boolean|undefined), |
| 71 * value: *, |
| 72 * computed: (string|undefined), |
| 73 * observer: (string|undefined) |
| 74 * }} */ |
| 75 PolymerElement.PropertyConfig; |
| 76 |
| 77 /** @typedef {!Object<string, (!Function|!PolymerElement.PropertyConfig)>} */ |
| 78 PolymerElement.Properties; |
| 79 |
| 80 /** @type {!PolymerElement.Properties} */ |
| 81 PolymerElement.prototype.properties; |
| 82 |
| 83 /** @type {!Object<string, *>} */ |
| 84 PolymerElement.prototype.hostAttributes; |
| 85 |
| 86 /** |
| 87 * An object that maps events to event handler function names. |
| 88 * @type {!Object<string, string>} |
| 89 */ |
| 90 PolymerElement.prototype.listeners; |
| 91 |
| 92 /** |
| 93 * Notifies the event binding system of a change to a property. |
| 94 * @param {string} path The path to set. |
| 95 * @param {*} value The value to send in the update notification. |
| 96 */ |
| 97 PolymerElement.prototype.notifyPath = function(path, value) {}; |
| 98 |
| 99 /** |
| 100 * Shorthand for setting a property, then calling notifyPath. |
| 101 * @param {string} path The path to set. |
| 102 * @param {*} value The new value. |
| 103 */ |
| 104 PolymerElement.prototype.setPathValue = function(path, value) {}; |
| 105 |
| 106 /** |
| 107 * Fire an event. |
| 108 * |
| 109 * @param {string} type An event name. |
| 110 * @param {Object=} detail |
| 111 * @param {{ |
| 112 * bubbles: (boolean|undefined), |
| 113 * cancelable: (boolean|undefined), |
| 114 * node: (!HTMLElement|undefined)}=} options |
| 115 * @return {Object} event |
| 116 */ |
| 117 PolymerElement.prototype.fire = function(type, detail, options) {}; |
| 118 |
OLD | NEW |