pseudo-dom 0.17.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -5869
- package/browser/pseudo-dom.js +14889 -15288
- package/dist/classes/PseudoEventListener.d.ts +11 -37
- package/dist/classes/PseudoEventListener.js +11 -37
- package/dist/classes/PseudoHTMLDocument.d.ts +4 -12
- package/dist/classes/PseudoHTMLDocument.js +1 -11
- package/dist/classes/PseudoNodeList.d.ts +1 -9
- package/dist/classes/PseudoNodeList.js +1 -9
- package/dist/factories/createDataset.d.ts +1 -3
- package/dist/factories/createDataset.js +3 -8
- package/dist/factories/createEvent.d.ts +5 -9
- package/dist/factories/createEvent.js +3 -5
- package/dist/factories/createStyleDeclaration.d.ts +4 -10
- package/dist/factories/createStyleDeclaration.js +4 -10
- package/dist/factories/cssSelectAdapter.d.ts +0 -2
- package/dist/factories/cssSelectAdapter.js +3 -8
- package/dist/factories/eventDefaults.d.ts +5 -9
- package/dist/factories/eventDefaults.js +1 -4
- package/dist/factories/generateDocument.d.ts +2 -4
- package/dist/factories/generateDocument.js +2 -13
- package/dist/factories/generateNodeList.d.ts +1 -2
- package/dist/factories/generateNodeList.js +1 -2
- package/dist/factories/installGlobal.d.ts +2 -3
- package/dist/factories/installGlobal.js +3 -6
- package/dist/factories/logElement.d.ts +2 -4
- package/dist/factories/logElement.js +3 -7
- package/dist/factories/parseHTML.d.ts +3 -5
- package/dist/factories/parseHTML.js +4 -8
- package/dist/factories/query.d.ts +8 -16
- package/dist/factories/query.js +9 -19
- package/dist/factories/serializeHTML.d.ts +4 -10
- package/dist/factories/serializeHTML.js +12 -25
- package/dist/functions/activeElement.d.ts +3 -6
- package/dist/functions/activeElement.js +3 -6
- package/dist/functions/getElementById.d.ts +2 -4
- package/dist/functions/getElementById.js +2 -4
- package/dist/functions/getParentNodes.d.ts +1 -3
- package/dist/functions/getParentNodes.js +1 -3
- package/dist/functions/getParentNodesFromAttribute.d.ts +3 -5
- package/dist/functions/getParentNodesFromAttribute.js +3 -5
- package/dist/functions/modifierState.d.ts +3 -12
- package/dist/functions/modifierState.js +3 -7
- package/dist/interfaces/PseudoCSSStyleDeclaration.d.ts +1 -1
- package/dist/interfaces/PseudoDocument.d.ts +4 -9
- package/dist/interfaces/PseudoDocumentFragment.d.ts +1 -2
- package/dist/interfaces/PseudoElement.d.ts +39 -78
- package/dist/interfaces/PseudoEvent.d.ts +11 -43
- package/dist/interfaces/PseudoEvent.js +1 -3
- package/dist/interfaces/PseudoEventTarget.d.ts +7 -16
- package/dist/interfaces/PseudoHTMLCollection.d.ts +2 -4
- package/dist/interfaces/PseudoHTMLElement.d.ts +8 -13
- package/dist/interfaces/PseudoNode.d.ts +3 -13
- package/dist/main.d.ts +1 -6
- package/dist/main.js +1 -6
- package/dist/services/AttrService.d.ts +5 -9
- package/dist/services/AttrService.js +5 -9
- package/dist/services/CSSStyleDeclarationService.d.ts +10 -23
- package/dist/services/CSSStyleDeclarationService.js +10 -23
- package/dist/services/CustomEventService.d.ts +4 -15
- package/dist/services/CustomEventService.js +3 -10
- package/dist/services/DOMTokenListService.d.ts +2 -5
- package/dist/services/DOMTokenListService.js +2 -5
- package/dist/services/DocumentFragmentService.d.ts +1 -5
- package/dist/services/DocumentFragmentService.js +1 -5
- package/dist/services/DocumentService.d.ts +4 -12
- package/dist/services/DocumentService.js +4 -12
- package/dist/services/ElementService.d.ts +62 -120
- package/dist/services/ElementService.js +61 -117
- package/dist/services/EventService.d.ts +6 -44
- package/dist/services/EventService.js +18 -44
- package/dist/services/EventTargetService.d.ts +16 -28
- package/dist/services/EventTargetService.js +16 -28
- package/dist/services/FocusEventService.d.ts +4 -12
- package/dist/services/FocusEventService.js +3 -10
- package/dist/services/HTMLCollectionService.d.ts +6 -16
- package/dist/services/HTMLCollectionService.js +6 -16
- package/dist/services/HTMLElementService.d.ts +132 -154
- package/dist/services/HTMLElementService.js +333 -353
- package/dist/services/InputEventService.d.ts +5 -16
- package/dist/services/InputEventService.js +3 -12
- package/dist/services/KeyboardEventService.d.ts +8 -26
- package/dist/services/KeyboardEventService.js +4 -16
- package/dist/services/MouseEventService.d.ts +7 -30
- package/dist/services/MouseEventService.js +4 -18
- package/dist/services/NamedNodeMapService.d.ts +1 -4
- package/dist/services/NamedNodeMapService.js +1 -4
- package/dist/services/NodeService.d.ts +38 -69
- package/dist/services/NodeService.js +39 -72
- package/dist/services/PointerEventService.d.ts +4 -22
- package/dist/services/PointerEventService.js +3 -15
- package/dist/services/ShadowRootService.d.ts +0 -3
- package/dist/services/ShadowRootService.js +0 -3
- package/dist/services/UIEventService.d.ts +5 -17
- package/dist/services/UIEventService.js +3 -11
- package/dist/simulate.d.ts +7 -9
- package/dist/simulate.js +9 -15
- package/package.json +8 -7
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
4
|
-
* @version 1.0.0
|
|
2
|
+
* Substitute for the DOM Element Class.
|
|
5
3
|
*/
|
|
6
4
|
import { PseudoNode } from '../interfaces/PseudoNode';
|
|
7
5
|
import { PseudoElement } from '../interfaces/PseudoElement';
|
|
@@ -27,18 +25,6 @@ type DOMRect = {
|
|
|
27
25
|
};
|
|
28
26
|
/**
|
|
29
27
|
* Simulate the behaviour of the Element Class when there is no DOM available.
|
|
30
|
-
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
31
|
-
* @class
|
|
32
|
-
* @augments PseudoNode
|
|
33
|
-
* @property {string} tagName
|
|
34
|
-
* @property {string} className
|
|
35
|
-
* @property {string} id
|
|
36
|
-
* @property {string} innerHtml
|
|
37
|
-
* @property {Array} attributes
|
|
38
|
-
* @property {function} hasAttribute
|
|
39
|
-
* @property {function} setAttribute
|
|
40
|
-
* @property {function} getAttribute
|
|
41
|
-
* @property {function} removeAttribute
|
|
42
28
|
*/
|
|
43
29
|
export declare class ElementService extends NodeService implements Partial<PseudoElement> {
|
|
44
30
|
id: string;
|
|
@@ -67,12 +53,11 @@ export declare class ElementService extends NodeService implements Partial<Pseud
|
|
|
67
53
|
private shadowRootInstance;
|
|
68
54
|
private defaultEventApplied;
|
|
69
55
|
/**
|
|
70
|
-
* @param
|
|
71
|
-
* @param
|
|
72
|
-
* @param
|
|
73
|
-
* @param
|
|
74
|
-
* @param
|
|
75
|
-
* @constructor
|
|
56
|
+
* @param settings
|
|
57
|
+
* @param settings.tagName The name of the tag this element represents
|
|
58
|
+
* @param settings.attributes The attributes (also assigned as properties) to start with
|
|
59
|
+
* @param settings.parent The node to add this element to as its last child
|
|
60
|
+
* @param settings.children The nodes to start as children
|
|
76
61
|
*/
|
|
77
62
|
constructor({ tagName, attributes, parent, children }?: {
|
|
78
63
|
tagName?: string;
|
|
@@ -83,45 +68,38 @@ export declare class ElementService extends NodeService implements Partial<Pseud
|
|
|
83
68
|
/**
|
|
84
69
|
* The attributes with the values they have now: the ones which are also properties (className, id, style, ...) can
|
|
85
70
|
* have been changed through the property, which does not change the stored list.
|
|
86
|
-
* @returns {Array<{name: string, value: *}>}
|
|
87
71
|
*/
|
|
88
72
|
private currentAttributes;
|
|
89
73
|
get nodeName(): string;
|
|
90
74
|
/**
|
|
91
75
|
* A copy of this element without its children: the same tag and attributes (the values which are objects, such as
|
|
92
76
|
* style, are copied too rather than shared), but not its parent or listeners.
|
|
93
|
-
* @returns {ElementService}
|
|
94
77
|
*/
|
|
95
78
|
protected cloneShallow(): NodeService;
|
|
96
79
|
/**
|
|
97
80
|
* Elements are equal when they have the same tag and the same attributes (in any order), which is what isEqualNode
|
|
98
81
|
* checks before it compares the children.
|
|
99
|
-
* @param
|
|
100
|
-
* @returns {boolean}
|
|
82
|
+
* @param other The element to compare with
|
|
101
83
|
*/
|
|
102
84
|
protected equalsShallow(other: NodeService): boolean;
|
|
103
85
|
get tagName(): string;
|
|
104
86
|
/**
|
|
105
87
|
* The local part of the element's qualified name. There is no real namespace parsing here, so this is always the
|
|
106
88
|
* same as tagName.
|
|
107
|
-
* @returns {string}
|
|
108
89
|
*/
|
|
109
90
|
get localName(): string;
|
|
110
91
|
/**
|
|
111
92
|
* The element's namespace prefix, or null when it has none. There is no real namespace parsing here, so this is
|
|
112
93
|
* always null.
|
|
113
|
-
* @returns {string|null}
|
|
114
94
|
*/
|
|
115
95
|
get prefix(): string | null;
|
|
116
96
|
/**
|
|
117
97
|
* The HTML markup of this element's children. Only the getter is here (the setter, which needs to build new
|
|
118
98
|
* elements from parsed HTML, is on HTMLElementService - see its class comment).
|
|
119
|
-
* @returns {string}
|
|
120
99
|
*/
|
|
121
100
|
get innerHTML(): string;
|
|
122
101
|
/**
|
|
123
102
|
* The HTML markup of this element itself, including its children. Only the getter is here (see innerHTML).
|
|
124
|
-
* @returns {string}
|
|
125
103
|
*/
|
|
126
104
|
get outerHTML(): string;
|
|
127
105
|
get nodeType(): number;
|
|
@@ -131,253 +109,226 @@ export declare class ElementService extends NodeService implements Partial<Pseud
|
|
|
131
109
|
set className(className: string);
|
|
132
110
|
/**
|
|
133
111
|
* Some elements have default behaviour, this registers it when the element is added.
|
|
134
|
-
* @returns {Function}
|
|
135
112
|
*/
|
|
136
113
|
/**
|
|
137
114
|
* A live view of this element's element children (text, comments and the like are not included).
|
|
138
|
-
* @returns {PseudoHTMLCollection}
|
|
139
115
|
*/
|
|
140
116
|
get children(): PseudoHTMLCollection;
|
|
141
117
|
/**
|
|
142
118
|
* How many element children this element has.
|
|
143
|
-
* @returns {number}
|
|
144
119
|
*/
|
|
145
120
|
get childElementCount(): number;
|
|
146
121
|
/**
|
|
147
122
|
* The first child of this element which is an element, or null when there is none.
|
|
148
|
-
* @returns {PseudoElement|null}
|
|
149
123
|
*/
|
|
150
124
|
get firstElementChild(): PseudoElement | null;
|
|
151
125
|
/**
|
|
152
126
|
* The last child of this element which is an element, or null when there is none.
|
|
153
|
-
* @returns {PseudoElement|null}
|
|
154
127
|
*/
|
|
155
128
|
get lastElementChild(): PseudoElement | null;
|
|
156
129
|
/**
|
|
157
130
|
* The sibling after this one which is an element, or null when there is none.
|
|
158
|
-
* @returns {PseudoElement|null}
|
|
159
131
|
*/
|
|
160
132
|
get nextElementSibling(): PseudoElement | null;
|
|
161
133
|
/**
|
|
162
134
|
* The sibling before this one which is an element, or null when there is none.
|
|
163
|
-
* @returns {PseudoElement|null}
|
|
164
135
|
*/
|
|
165
136
|
get previousElementSibling(): PseudoElement | null;
|
|
166
137
|
/**
|
|
167
138
|
* Put an element at a position relative to this one: beforebegin (before this element, as its previous sibling),
|
|
168
139
|
* afterbegin (as this element's first child), beforeend (as this element's last child) or afterend (after this
|
|
169
140
|
* element, as its next sibling).
|
|
170
|
-
* @param
|
|
171
|
-
* @param
|
|
172
|
-
* @returns
|
|
141
|
+
* @param position beforebegin, afterbegin, beforeend or afterend
|
|
142
|
+
* @param element The element to insert
|
|
143
|
+
* @returns The inserted element, or null when the position needed a parent this element does not have
|
|
173
144
|
* @throws {Error} When the position is not one of the four above
|
|
174
145
|
*/
|
|
175
146
|
insertAdjacentElement(position: string, element: PseudoElement): PseudoElement | null;
|
|
176
147
|
/**
|
|
177
148
|
* Put text at a position relative to this element, the same as insertAdjacentElement but the text becomes a text node.
|
|
178
|
-
* @param
|
|
179
|
-
* @param
|
|
149
|
+
* @param position beforebegin, afterbegin, beforeend or afterend
|
|
150
|
+
* @param text The text to insert
|
|
180
151
|
* @throws {Error} When the position is not one of the four above
|
|
181
152
|
*/
|
|
182
153
|
insertAdjacentText(position: string, text: string): void;
|
|
183
154
|
/**
|
|
184
155
|
* Shared implementation for insertAdjacentElement / insertAdjacentText.
|
|
185
|
-
* @param
|
|
186
|
-
* @param
|
|
187
|
-
* @returns
|
|
156
|
+
* @param position beforebegin, afterbegin, beforeend or afterend
|
|
157
|
+
* @param node The node (or text) to insert
|
|
158
|
+
* @returns The inserted node, or null when the position needed a parent this element does not have
|
|
188
159
|
* @throws {Error} When the position is not one of the four above
|
|
189
160
|
*/
|
|
190
161
|
private insertAdjacent;
|
|
191
162
|
/**
|
|
192
163
|
* Not implemented yet (HTML parsing is out of scope for now).
|
|
193
|
-
* @param
|
|
194
|
-
* @param
|
|
164
|
+
* @param position beforebegin, afterbegin, beforeend or afterend
|
|
165
|
+
* @param text The markup which would be parsed
|
|
195
166
|
* @throws {Error}
|
|
196
167
|
*/
|
|
197
168
|
insertAdjacentHTML(position: string, text: string): void;
|
|
198
169
|
/**
|
|
199
170
|
* Whether this element itself (not its descendants) matches the given CSS selector.
|
|
200
|
-
* @param
|
|
201
|
-
* @returns {boolean}
|
|
171
|
+
* @param selectors A CSS selector
|
|
202
172
|
*/
|
|
203
173
|
matches(selectors: string): boolean;
|
|
204
174
|
/**
|
|
205
175
|
* The nearest ancestor of this element (starting with this element itself) which matches the CSS selector, or
|
|
206
176
|
* null when none of them do.
|
|
207
|
-
* @param
|
|
208
|
-
* @returns {PseudoElement|null}
|
|
177
|
+
* @param selectors A CSS selector
|
|
209
178
|
*/
|
|
210
179
|
closest(selectors: string): PseudoElement | null;
|
|
211
180
|
applyDefaultEvent(): Function;
|
|
212
181
|
/**
|
|
213
182
|
* An element which is added as a child gets its default events (for example a submit button submits its form).
|
|
214
|
-
* @param
|
|
183
|
+
* @param child The node which was inserted
|
|
215
184
|
*/
|
|
216
185
|
protected childInserted(child: NodeService): void;
|
|
217
186
|
/**
|
|
218
187
|
* Check whether the element has an attribute by that name.
|
|
219
|
-
* @param
|
|
220
|
-
* @returns {boolean}
|
|
188
|
+
* @param attributeName
|
|
221
189
|
*/
|
|
222
190
|
hasAttribute(attributeName: string): boolean;
|
|
223
191
|
/**
|
|
224
192
|
* Set the value of an attribute, adding the attribute if it did not exist.
|
|
225
|
-
* @param
|
|
226
|
-
* @param
|
|
227
|
-
* @returns {undefined}
|
|
193
|
+
* @param attributeName
|
|
194
|
+
* @param attributeValue
|
|
228
195
|
*/
|
|
229
196
|
setAttribute(attributeName: string, attributeValue: string): void;
|
|
230
197
|
/**
|
|
231
198
|
* Retrieve the value of an attribute.
|
|
232
|
-
* @param
|
|
233
|
-
* @returns
|
|
199
|
+
* @param attributeName
|
|
200
|
+
* @returns The value, or null when there is no such attribute
|
|
234
201
|
*/
|
|
235
202
|
getAttribute(attributeName: string): string | null;
|
|
236
203
|
/**
|
|
237
204
|
* Remove an attribute from the element.
|
|
238
|
-
* @param
|
|
239
|
-
* @returns {undefined}
|
|
205
|
+
* @param attributeName
|
|
240
206
|
*/
|
|
241
207
|
removeAttribute(attributeName: string): void;
|
|
242
208
|
/**
|
|
243
209
|
* The name of every attribute on the element, in the order they were set.
|
|
244
|
-
* @returns {Array<string>}
|
|
245
210
|
*/
|
|
246
211
|
getAttributeNames(): Array<string>;
|
|
247
212
|
/**
|
|
248
213
|
* Whether the element has any attributes at all.
|
|
249
|
-
* @returns {boolean}
|
|
250
214
|
*/
|
|
251
215
|
hasAttributes(): boolean;
|
|
252
216
|
/**
|
|
253
217
|
* Retrieve the node representation of an attribute.
|
|
254
|
-
* @param
|
|
255
|
-
* @returns
|
|
218
|
+
* @param attributeName
|
|
219
|
+
* @returns An Attr for the attribute, or null when there is no such attribute
|
|
256
220
|
*/
|
|
257
221
|
getAttributeNode(attributeName: string): AttrService | null;
|
|
258
222
|
/**
|
|
259
223
|
* Retrieve the node representation of an attribute. There is no real namespace parsing here, so this ignores
|
|
260
224
|
* the namespace and behaves exactly like getAttributeNode.
|
|
261
|
-
* @param
|
|
262
|
-
* @param
|
|
263
|
-
* @returns
|
|
225
|
+
* @param namespace Ignored
|
|
226
|
+
* @param attributeName
|
|
227
|
+
* @returns An Attr for the attribute, or null when there is no such attribute
|
|
264
228
|
*/
|
|
265
229
|
getAttributeNodeNS(namespace: string, attributeName: string): AttrService | null;
|
|
266
230
|
/**
|
|
267
231
|
* Retrieve the value of an attribute. There is no real namespace parsing here, so this ignores the namespace
|
|
268
232
|
* and behaves exactly like getAttribute.
|
|
269
|
-
* @param
|
|
270
|
-
* @param
|
|
271
|
-
* @returns
|
|
233
|
+
* @param namespace Ignored
|
|
234
|
+
* @param attributeName
|
|
235
|
+
* @returns The value, or null when there is no such attribute
|
|
272
236
|
*/
|
|
273
237
|
getAttributeNS(namespace: string, attributeName: string): string | null;
|
|
274
238
|
/**
|
|
275
239
|
* Check whether the element has an attribute by that name. There is no real namespace parsing here, so this
|
|
276
240
|
* ignores the namespace and behaves exactly like hasAttribute.
|
|
277
|
-
* @param
|
|
278
|
-
* @param
|
|
279
|
-
* @returns {boolean}
|
|
241
|
+
* @param namespace Ignored
|
|
242
|
+
* @param attributeName
|
|
280
243
|
*/
|
|
281
244
|
hasAttributeNS(namespace: string, attributeName: string): boolean;
|
|
282
245
|
/**
|
|
283
246
|
* Remove the node representation of an attribute from the element, and return it.
|
|
284
|
-
* @param
|
|
285
|
-
* @returns
|
|
247
|
+
* @param attr
|
|
248
|
+
* @returns The removed Attr
|
|
286
249
|
* @throws {Error} When the element has no attribute matching attr.name
|
|
287
250
|
*/
|
|
288
251
|
removeAttributeNode(attr: AttrService): AttrService;
|
|
289
252
|
/**
|
|
290
253
|
* Remove an attribute from the element. There is no real namespace parsing here, so this ignores the namespace
|
|
291
254
|
* and behaves exactly like removeAttribute.
|
|
292
|
-
* @param
|
|
293
|
-
* @param
|
|
294
|
-
* @returns {undefined}
|
|
255
|
+
* @param namespace Ignored
|
|
256
|
+
* @param attributeName
|
|
295
257
|
*/
|
|
296
258
|
removeAttributeNS(namespace: string, attributeName: string): void;
|
|
297
259
|
/**
|
|
298
260
|
* Set the node representation of an attribute, adding the attribute if it did not exist. Returns any previous
|
|
299
261
|
* Attr that had the same name, or null when there was none.
|
|
300
|
-
* @param
|
|
301
|
-
* @returns
|
|
262
|
+
* @param attr
|
|
263
|
+
* @returns The replaced Attr, or null when the attribute was new
|
|
302
264
|
*/
|
|
303
265
|
setAttributeNode(attr: AttrService): AttrService | null;
|
|
304
266
|
/**
|
|
305
267
|
* Set the node representation of an attribute. There is no real namespace parsing here, so this behaves
|
|
306
268
|
* exactly like setAttributeNode (Attr.name already carries any prefix).
|
|
307
|
-
* @param
|
|
308
|
-
* @returns
|
|
269
|
+
* @param attr
|
|
270
|
+
* @returns The replaced Attr, or null when the attribute was new
|
|
309
271
|
*/
|
|
310
272
|
setAttributeNodeNS(attr: AttrService): AttrService | null;
|
|
311
273
|
/**
|
|
312
274
|
* Set the value of an attribute, adding the attribute if it did not exist. There is no real namespace parsing
|
|
313
275
|
* here, so this ignores the namespace and behaves exactly like setAttribute.
|
|
314
|
-
* @param
|
|
315
|
-
* @param
|
|
316
|
-
* @param
|
|
317
|
-
* @returns {undefined}
|
|
276
|
+
* @param namespace Ignored
|
|
277
|
+
* @param attributeName
|
|
278
|
+
* @param attributeValue
|
|
318
279
|
*/
|
|
319
280
|
setAttributeNS(namespace: string, attributeName: string, attributeValue: string): void;
|
|
320
281
|
/**
|
|
321
282
|
* Add the attribute (with an empty value) when it is not present, or remove it when it is - unless force says
|
|
322
283
|
* which of those to do instead. Returns whether the attribute is present after the call.
|
|
323
|
-
* @param
|
|
324
|
-
* @param
|
|
325
|
-
* @returns {boolean}
|
|
284
|
+
* @param attributeName
|
|
285
|
+
* @param force
|
|
326
286
|
*/
|
|
327
287
|
toggleAttribute(attributeName: string, force?: boolean): boolean;
|
|
328
288
|
/**
|
|
329
289
|
* The size of the element and its position, settable directly - there is no layout engine here to compute it.
|
|
330
|
-
* @returns {DOMRect}
|
|
331
290
|
*/
|
|
332
291
|
getBoundingClientRect(): DOMRect;
|
|
333
292
|
/**
|
|
334
293
|
* The bounding rectangles for each line of text in the element, settable directly - there is no layout engine
|
|
335
294
|
* here to compute it.
|
|
336
|
-
* @returns {Array<DOMRect>}
|
|
337
295
|
*/
|
|
338
296
|
getClientRects(): Array<DOMRect>;
|
|
339
297
|
/**
|
|
340
298
|
* The Animation objects currently active on the element, settable directly - there is no animation engine here.
|
|
341
|
-
* @returns {Array<*>}
|
|
342
299
|
*/
|
|
343
300
|
getAnimations(): Array<any>;
|
|
344
301
|
/**
|
|
345
302
|
* Whether the element is expected to be visible, settable directly - there is no rendering here to check it.
|
|
346
|
-
* @returns {boolean}
|
|
347
303
|
*/
|
|
348
304
|
checkVisibility(): boolean;
|
|
349
305
|
/**
|
|
350
306
|
* A read-only view of the element's own inline style declarations (there is no CSS cascade here, so this is not a
|
|
351
307
|
* real computed style - just what the element's own style object holds).
|
|
352
|
-
* @returns {{get: function(string): (string|undefined)}}
|
|
353
308
|
*/
|
|
354
309
|
computedStyleMap(): {
|
|
355
310
|
get: (property: string) => string | undefined;
|
|
356
311
|
};
|
|
357
312
|
/**
|
|
358
313
|
* Whether this element currently has capture of the given pointer.
|
|
359
|
-
* @param
|
|
360
|
-
* @returns {boolean}
|
|
314
|
+
* @param pointerId
|
|
361
315
|
*/
|
|
362
316
|
hasPointerCapture(pointerId: number): boolean;
|
|
363
317
|
/**
|
|
364
318
|
* Give this element capture of the given pointer.
|
|
365
|
-
* @param
|
|
366
|
-
* @returns {undefined}
|
|
319
|
+
* @param pointerId
|
|
367
320
|
*/
|
|
368
321
|
setPointerCapture(pointerId: number): void;
|
|
369
322
|
/**
|
|
370
323
|
* Release this element's capture of the given pointer, if it had it.
|
|
371
|
-
* @param
|
|
372
|
-
* @returns {undefined}
|
|
324
|
+
* @param pointerId
|
|
373
325
|
*/
|
|
374
326
|
releasePointerCapture(pointerId: number): void;
|
|
375
327
|
/**
|
|
376
328
|
* Scroll to the given position (or, given an options object, the position(s) it has). There is no real scrollable
|
|
377
329
|
* viewport here: this just sets scrollLeft / scrollTop.
|
|
378
|
-
* @param
|
|
379
|
-
* @param
|
|
380
|
-
* @returns {undefined}
|
|
330
|
+
* @param x
|
|
331
|
+
* @param y
|
|
381
332
|
*/
|
|
382
333
|
scroll(x?: number | {
|
|
383
334
|
left?: number;
|
|
@@ -385,9 +336,8 @@ export declare class ElementService extends NodeService implements Partial<Pseud
|
|
|
385
336
|
}, y?: number): void;
|
|
386
337
|
/**
|
|
387
338
|
* Scroll to the given position. An alias for scroll.
|
|
388
|
-
* @param
|
|
389
|
-
* @param
|
|
390
|
-
* @returns {undefined}
|
|
339
|
+
* @param x
|
|
340
|
+
* @param y
|
|
391
341
|
*/
|
|
392
342
|
scrollTo(x?: number | {
|
|
393
343
|
left?: number;
|
|
@@ -395,9 +345,8 @@ export declare class ElementService extends NodeService implements Partial<Pseud
|
|
|
395
345
|
}, y?: number): void;
|
|
396
346
|
/**
|
|
397
347
|
* Scroll by the given amount, relative to the current position.
|
|
398
|
-
* @param
|
|
399
|
-
* @param
|
|
400
|
-
* @returns {undefined}
|
|
348
|
+
* @param x
|
|
349
|
+
* @param y
|
|
401
350
|
*/
|
|
402
351
|
scrollBy(x?: number | {
|
|
403
352
|
left?: number;
|
|
@@ -406,25 +355,21 @@ export declare class ElementService extends NodeService implements Partial<Pseud
|
|
|
406
355
|
/**
|
|
407
356
|
* Scroll an ancestor until this element is in view. There is no real viewport here for that to mean anything, so
|
|
408
357
|
* this does nothing (override it on an instance in a test which needs to observe the call).
|
|
409
|
-
* @returns {undefined}
|
|
410
358
|
*/
|
|
411
359
|
scrollIntoView(): void;
|
|
412
360
|
/**
|
|
413
361
|
* Asynchronously ask for the element to be shown fullscreen. There is no real fullscreen here, so this just
|
|
414
362
|
* resolves, like a browser granting the request would.
|
|
415
|
-
* @returns {Promise<void>}
|
|
416
363
|
*/
|
|
417
364
|
requestFullscreen(): Promise<void>;
|
|
418
365
|
/**
|
|
419
366
|
* Asynchronously ask for the pointer to be locked to this element. There is no real pointer lock here, so this
|
|
420
367
|
* just resolves, like a browser granting the request would.
|
|
421
|
-
* @returns {Promise<void>}
|
|
422
368
|
*/
|
|
423
369
|
requestPointerLock(): Promise<void>;
|
|
424
370
|
/**
|
|
425
371
|
* Attach a shadow tree to this element and return its ShadowRoot. Throws when it already hosts one.
|
|
426
|
-
* @param
|
|
427
|
-
* @returns {PseudoShadowRoot}
|
|
372
|
+
* @param options
|
|
428
373
|
* @throws {Error}
|
|
429
374
|
*/
|
|
430
375
|
attachShadow(options: {
|
|
@@ -433,20 +378,17 @@ export declare class ElementService extends NodeService implements Partial<Pseud
|
|
|
433
378
|
/**
|
|
434
379
|
* This element's shadow root, when it has one attached in 'open' mode, or null (including when the mode is
|
|
435
380
|
* 'closed' - it still exists, but is not reachable this way, like the DOM's).
|
|
436
|
-
* @returns {PseudoShadowRoot|null}
|
|
437
381
|
*/
|
|
438
382
|
get shadowRoot(): PseudoShadowRoot | null;
|
|
439
383
|
/**
|
|
440
384
|
* Read one of the aria-* reflected properties (see the individual aria* getters/setters below).
|
|
441
|
-
* @param
|
|
442
|
-
* @returns {string}
|
|
385
|
+
* @param attributeName A real aria-* attribute name (aria-label, ...)
|
|
443
386
|
*/
|
|
444
387
|
private getAriaAttribute;
|
|
445
388
|
/**
|
|
446
389
|
* Write one of the aria-* reflected properties.
|
|
447
|
-
* @param
|
|
448
|
-
* @param
|
|
449
|
-
* @returns {undefined}
|
|
390
|
+
* @param attributeName A real aria-* attribute name (aria-label, ...)
|
|
391
|
+
* @param value
|
|
450
392
|
*/
|
|
451
393
|
private setAriaAttribute;
|
|
452
394
|
get ariaAtomic(): string;
|