Function creator

  • Given the specified element name, returns a function which creates an element of the given name, assuming that "this" is the parent element.

    Type Parameters

    • K extends "symbol" | "filter" | "g" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "set" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap

    Parameters

    • name: K

      Tag name of the element to be added.

    Returns ((this) => ElementTagNameMap[K])

      • (this): ElementTagNameMap[K]
      • Parameters

        Returns ElementTagNameMap[K]

  • Given the specified element name, returns a function which creates an element of the given name, assuming that "this" is the parent element.

    The generic refers to the type of the new element to be returned by the creator function.

    Type Parameters

    Parameters

    • name: string

      Tag name of the element to be added. See "namespace" for details on supported namespace prefixes, such as for SVG elements.

    Returns ((this) => NewGElement)

      • (this): NewGElement
      • Parameters

        Returns NewGElement