Microsoft/TypeScript

Some SVG types would benefit from stricter appendChild() overloads

オープン

#4,178 opened on 2015/08/06

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)TypeScript (13,395 件のフォーク)batch import
Domain: lib.d.tsHelp WantedSuggestion

Repository metrics

Stars
 (108,860 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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.

コントリビューターガイド