Microsoft/TypeScript

Some SVG types would benefit from stricter appendChild() overloads

Open

#4 178 ouverte le 6 août 2015

Voir sur GitHub
 (0 commentaires) (0 réactions) (0 assignés)TypeScript (6 726 forks)batch import
Domain: lib.d.tsHelp WantedSuggestion

Métriques du dépôt

Stars
 (48 455 stars)
Métriques de merge PR
 (Merge moyen 6j 17h) (9 PRs mergées en 30 j)

Description

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.

Guide contributeur