Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "helpers/Parser"

Index

Functions

fetchSVGNode

  • fetchSVGNode(fileUrl: string): Promise<SVGNode>
  • Asynchroniously fetch a SVGNode from a file

    Will reject if file cannot be fetched

    Parameters

    • fileUrl: string

      A path to a svg file from the generated JS file

    Returns Promise<SVGNode>

fetchSVGNodeSync

  • fetchSVGNodeSync(fileUrl: string): SVGNode
  • Synchroniously fetch a SVGNode from a file

    Will throw an error if file cannot be fetched

    Parameters

    • fileUrl: string

      A path to a svg file from the generated JS file

    Returns SVGNode

htmlParseSVGNode

  • htmlParseSVGNode(elem: HTMLElement): SVGNode

parseSVGNode

  • parseSVGNode(str: string): SVGNode
  • Parse a string into a SVGNode object, importing all SVG tags and attributes. Also imports innerText.

    Counts on a single head element.

    If a unrecognized tag or attributes appears will throw error. If parse fails will also throw an error.

    Parameters

    • str: string

      A string to parse

    Returns SVGNode

parseSVGViewBox

  • parseSVGViewBox(str: string): ViewBox

Generated using TypeDoc