TypeScript-DOM-lib-generator
TypeScript-DOM-lib-generator copied to clipboard
`Attr.cloneNode()` should return `Attr`, not `Node`
Expectation
Attr extends Node, but Attr.cloneNode() returns a new Attr, not just a Node.
Chrome dev tools:
Reality
But in lib.dom.d.ts, its return type is Node. This can give false errors, like this example from the VS Code TS linter:
It's just special case of https://github.com/microsoft/TypeScript/issues/283 #811 was reverted as it broke libs in DefinitelyTyped