Microsoft/TypeScript

Some SVG types would benefit from stricter appendChild() overloads

Open

#4,178 建立於 2015年8月6日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)TypeScript (48,455 star) (6,726 fork)batch import
Domain: lib.d.tsHelp WantedSuggestion

描述

interface SVGFEComponentTransferElement {
    appendChild(newChild: SVGFEFuncAElement): SVGFEFuncAElement;
    appendChild(newChild: SVGFEFuncBElement): SVGFEFuncBElement;
    appendChild(newChild: SVGFEFuncGElement): SVGFEFuncGElement;
    appendChild(newChild: SVGFEFuncRElement): SVGFEFuncRElement;
    appendChild(newChild: Comment): Comment;
}

interface SVGFEMergeElement {
    appendChild(newChild: SVGFEMergeNodeElement): SVGFEMergeNodeElement;
    appendChild(newChild: Comment): Comment;
}

...

to override the generic appendChild(Node) inherited from Node, and so on. This would make it an error to append a <g> to a <feMerge> for example.

貢獻者指南