-
Notifications
You must be signed in to change notification settings - Fork 2k
/
Copy pathpolymer-dom-api-externs.js
182 lines (145 loc) · 4.43 KB
/
polymer-dom-api-externs.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/**
* @externs
* @fileoverview Externs for PolymerDomApi for backwards compatibility with
* the Polymer 1 externs.
*/
/**
* A Polymer DOM API for manipulating DOM such that local DOM and light DOM
* trees are properly maintained.
*
* This type exists only to provide compatibility between compiled hybrid
* Polymer V1 and V2 code. Polymer V2 only code should simply use the DomApi
* class type.
*
* @interface
*/
var PolymerDomApi = function() {};
/**
* @param {?Node} node
* @return {boolean}
*/
PolymerDomApi.prototype.deepContains = function(node) {};
/** @param {!Node} node */
PolymerDomApi.prototype.appendChild = function(node) {};
/**
* @param {!Node} oldNode
* @param {!Node} newNode
*/
PolymerDomApi.prototype.replaceChild = function(oldNode, newNode) {};
/**
* @param {!Node} node
* @param {?Node} beforeNode
*/
PolymerDomApi.prototype.insertBefore = function(node, beforeNode) {};
/** @param {!Node} node */
PolymerDomApi.prototype.removeChild = function(node) {};
/** @type {!Array<!HTMLElement>|!NodeList<!HTMLElement>} */
PolymerDomApi.prototype.children;
/** @type {!Array<!Node>|!NodeList<!Node>} */
PolymerDomApi.prototype.childNodes;
/** @type {?Node} */
PolymerDomApi.prototype.parentNode;
/** @type {?Node} */
PolymerDomApi.prototype.firstChild;
/** @type {?Node} */
PolymerDomApi.prototype.lastChild;
/** @type {?HTMLElement} */
PolymerDomApi.prototype.firstElementChild;
/** @type {?HTMLElement} */
PolymerDomApi.prototype.lastElementChild;
/** @type {?Node} */
PolymerDomApi.prototype.previousSibling;
/** @type {?Node} */
PolymerDomApi.prototype.nextSibling;
/** @type {?HTMLElement} */
PolymerDomApi.prototype.previousElementSibling;
/** @type {?HTMLElement} */
PolymerDomApi.prototype.nextElementSibling;
/** @type {string} */
PolymerDomApi.prototype.textContent;
/** @type {string} */
PolymerDomApi.prototype.innerHTML;
/** @type {?HTMLElement} */
PolymerDomApi.prototype.activeElement;
/**
* @param {string} selector
* @return {?Element}
*/
PolymerDomApi.prototype.querySelector = function(selector) {};
/**
* @param {string} selector
* @return {!Array<!Element>|!NodeList<!Element>}
*/
PolymerDomApi.prototype.querySelectorAll = function(selector) {};
/** @return {!Array<!Node>} */
PolymerDomApi.prototype.getDistributedNodes = function() {};
/** @return {!Array<!Node>} */
PolymerDomApi.prototype.getDestinationInsertionPoints = function() {};
/** @return {?Node} */
PolymerDomApi.prototype.getOwnerRoot = function() {};
/** @type {!Node} */
PolymerDomApi.prototype.node;
/**
* @param {string} attribute
* @param {string} value
*/
PolymerDomApi.prototype.setAttribute = function(attribute, value) {};
/** @param {string} attribute */
PolymerDomApi.prototype.removeAttribute = function(attribute) {};
/**
* @typedef {function(!PolymerDomApi.ObserveInfo)}
*/
PolymerDomApi.ObserveCallback;
/**
* @typedef {{
* target: !Node,
* addedNodes: !Array<!Node>,
* removedNodes: !Array<!Node>
* }}
*/
PolymerDomApi.ObserveInfo;
/**
* A virtual type for observer callback handles.
*
* @interface
*/
PolymerDomApi.ObserveHandle = function() {};
/**
* @return {void}
*/
PolymerDomApi.ObserveHandle.prototype.disconnect = function() {};
/**
* Notifies callers about changes to the element's effective child nodes,
* the same list as returned by `getEffectiveChildNodes`.
*
* @param {!PolymerDomApi.ObserveCallback} callback The supplied callback
* is called with an `info` argument which is an object that provides
* the `target` on which the changes occurred, a list of any nodes
* added in the `addedNodes` array, and nodes removed in the
* `removedNodes` array.
*
* @return {!PolymerDomApi.ObserveHandle} Handle which is the argument to
* `unobserveNodes`.
*/
PolymerDomApi.prototype.observeNodes = function(callback) {};
/**
* Stops observing changes to the element's effective child nodes.
*
* @param {!PolymerDomApi.ObserveHandle} handle The handle for the
* callback that should no longer receive notifications. This
* handle is returned from `observeNodes`.
*/
PolymerDomApi.prototype.unobserveNodes = function(handle) {};
/** @type {?DOMTokenList} */
PolymerDomApi.prototype.classList;
/**
* @param {string} selector
* @return {!Array<!HTMLElement>}
*/
PolymerDomApi.prototype.queryDistributedElements = function(selector) {};
/**
* Returns a list of effective child nodes for this element.
*
* @return {!Array<!HTMLElement>}
*/
PolymerDomApi.prototype.getEffectiveChildNodes = function() {};