total-typescript / ts-reset

A 'CSS reset' for TypeScript, improving types for common JavaScript API's
https://www.totaltypescript.com/ts-reset
MIT License
7.74k stars 117 forks source link

Improve return type of `Node.cloneNode` #192

Open Stadly opened 4 months ago

Stadly commented 4 months ago

Would it be possible to improve the return type of Node.cloneNode?

For example:

let svg: SVGElement;
const clone = svg.cloneNode(true);

I would expect the type of clone to be SVGElement, but it is in fact Node.

Stadly commented 4 months ago

There is an issue in the TypeScript repo, but very little activity lately: https://github.com/microsoft/TypeScript/issues/283