ts-reset icon indicating copy to clipboard operation
ts-reset copied to clipboard

Improve return type of `Node.cloneNode`

Open Stadly opened this issue 1 year ago • 1 comments

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 avatar Mar 20 '24 11:03 Stadly

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

Stadly avatar Mar 20 '24 11:03 Stadly