-
Couldn't load subscription status.
- Fork 13.1k
Closed
Labels
Domain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
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 😄
ericbf
Metadata
Metadata
Assignees
Labels
Domain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript