Skip to content

Commit 5cd35f3

Browse files
committed
Simplify ChildNode type
1 parent 6177585 commit 5cd35f3

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

baselines/dom.generated.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3050,7 +3050,7 @@ declare var CharacterData: {
30503050
new(): CharacterData;
30513051
};
30523052

3053-
interface ChildNode {
3053+
interface ChildNode extends Node {
30543054
/**
30553055
* Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.
30563056
* Throws a "HierarchyRequestError" DOMException if the constraints of
@@ -10215,19 +10215,19 @@ interface Node extends EventTarget {
1021510215
/**
1021610216
* Returns the children.
1021710217
*/
10218-
readonly childNodes: NodeListOf<Node & ChildNode>;
10218+
readonly childNodes: NodeListOf<ChildNode>;
1021910219
/**
1022010220
* Returns the first child.
1022110221
*/
10222-
readonly firstChild: Node & ChildNode | null;
10222+
readonly firstChild: ChildNode | null;
1022310223
/**
1022410224
* Returns true if node is connected and false otherwise.
1022510225
*/
1022610226
readonly isConnected: boolean;
1022710227
/**
1022810228
* Returns the last child.
1022910229
*/
10230-
readonly lastChild: Node & ChildNode | null;
10230+
readonly lastChild: ChildNode | null;
1023110231
/**
1023210232
* Returns the next sibling.
1023310233
*/

inputfiles/overridingTypes.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
}
2828
}
2929
},
30+
"ChildNode": {
31+
"name": "ChildNode",
32+
"extends": "Node"
33+
},
3034
"GlobalEventHandlers": {
3135
"name": "GlobalEventHandlers",
3236
"events": {
@@ -495,13 +499,13 @@
495499
"override-type": "Element | null"
496500
},
497501
"childNodes": {
498-
"override-type": "NodeListOf<Node & ChildNode>"
502+
"override-type": "NodeListOf<ChildNode>"
499503
},
500504
"firstChild": {
501-
"override-type": "Node & ChildNode | null"
505+
"override-type": "ChildNode | null"
502506
},
503507
"lastChild": {
504-
"override-type": "Node & ChildNode | null"
508+
"override-type": "ChildNode | null"
505509
}
506510
}
507511
}

0 commit comments

Comments
 (0)