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.
https://github.com/Microsoft/TypeScript/blob/c7b4ed3a91964915b953b34ad2ae72f36e7d6efe/lib/lib.dom.d.ts#L8260-L8265
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 😄