Closed
Description
Greetings!
Ran into this earlier today and I'm wondering if it's a bug or if I'm just mistaken for what I assumed would be returned.
Below is a snapshot of the definition of Node
.
Currently, Node.childNodes
returns a NodeList
which is mostly correct. However, wouldn't it be more accurate to instead return a NodeListOf<Node & ChildNode>
so that the remove
method is exposed?
Example of the issue:
declare const node: Node;
for (const child of node.childNodes) {
child.remove(); // fails "Property 'remove' does not exist on type 'Node'
}
Happy to submit a PR for this if needed (I'm going to also submit one for the issue I opened yesterday when I get some spare time this weekend).
Thanks in advance π