Skip to content

How to represent these SVG types? #15015

@saschanaz

Description

@saschanaz

SVGFEBlendElement by SVG spec can be represented as:

interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
    // ...
    readonly mode: SVGAnimatedEnumeration;
    // ...
}
generated/dom.generated.d.ts(3163,11): error TS2430: Interface 'SVGFEBlendElement' incorrectly extends interface
 'SVGElement'.
  Types of property 'mode' are incompatible.
    Type 'SVGAnimatedEnumeration' is not assignable to type 'ShadowRootMode'.
      Type 'SVGAnimatedEnumeration' is not assignable to type '"closed"'.

The new conflicting mode property is from SVGElement->SVGElementInstance->ShadowRoot which is not in current lib.d.ts.

SVGAElement by SVG spec can be represented as:

interface SVGAElement extends SVGGraphicsElement, SVGURIReference, HTMLHyperlinkElementUtils {
    // ...
}
// The current lib.d.ts does not have the HTMLHyperlinkElementUtils part.
generated/dom.generated.d.ts(9542,11): error TS2320: Interface 'SVGAElement' cannot simultaneously extend types 'SVGGraphicsElement' and 'HTMLHyperlinkElementUtils'.
  Named property 'host' of types 'SVGGraphicsElement' and 'HTMLHyperlinkElementUtils' are not identical.
generated/dom.generated.d.ts(9542,11): error TS2320: Interface 'SVGAElement' cannot simultaneously extend types 'SVGURIReference' and 'HTMLHyperlinkElementUtils'.
  Named property 'href' of types 'SVGURIReference' and 'HTMLHyperlinkElementUtils' are not identical.

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions