Type Alias AttributeNameForElement<TN>

AttributeNameForElement: TN extends HTMLElementTagName
    ? Extract<keyof HTMLElementAttributes<TN>, string>
    : TN extends SVGElementTagName
        ? Extract<keyof SVGElementAttributes, string>
        : TN extends "*" ? Extract<keyof AllAttributes, string> : never

Valid attribute names for the element of tag name TN.

Type Parameters

  • TN extends TagName

    TN extends TagName = "*" with corresponding attribute names.