Options
All
  • Public
  • Public/Protected
  • All
Menu

canvg

Index

Type aliases

AnyElement: Elements[keyof Elements]
Axis: "x" | "y"
Command: { type: CommandType } & Omit<CommandM, "type"> & Omit<CommandL, "type"> & Omit<CommandH, "type"> & Omit<CommandV, "type"> & Omit<CommandZ, "type"> & Omit<CommandQ, "type"> & Omit<CommandT, "type"> & Omit<CommandC, "type"> & Omit<CommandS, "type"> & Omit<CommandA, "type">
CommandType: SVGCommand["type"]
CreateCanvas: (width: number, height: number) => HTMLCanvasElement | OffscreenCanvas

Type declaration

    • (width: number, height: number): HTMLCanvasElement | OffscreenCanvas
    • Function to create new canvas.

      Parameters

      • width: number
      • height: number

      Returns HTMLCanvasElement | OffscreenCanvas

CreateImage: (src: string, anonymousCrossOrigin?: boolean) => Promise<CanvasImageSource>

Type declaration

    • (src: string, anonymousCrossOrigin?: boolean): Promise<CanvasImageSource>
    • Function to create new image.

      Parameters

      • src: string
      • Optional anonymousCrossOrigin: boolean

      Returns Promise<CanvasImageSource>

Fetch: typeof __type
IViewBoxConfig: Omit<IScreenViewBoxConfig, "document">
MatrixValue: readonly [number, number, number, number, number, number]
RenderingContext2D: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D
VectorValue: readonly [number, number]

Variables

PSEUDO_ZERO: 1e-8 = .00000001
elements: { a: typeof AElement; animate: typeof AnimateElement; animateColor: typeof AnimateColorElement; animateTransform: typeof AnimateTransformElement; circle: typeof CircleElement; clipPath: typeof ClipPathElement; defs: typeof DefsElement; desc: typeof DescElement; ellipse: typeof EllipseElement; feColorMatrix: typeof FeColorMatrixElement; feComposite: typeof FeCompositeElement; feDropShadow: typeof FeDropShadowElement; feGaussianBlur: typeof FeGaussianBlurElement; feMorphology: typeof FeMorphologyElement; filter: typeof FilterElement; font: typeof FontElement; font-face: typeof FontFaceElement; g: typeof GElement; glyph: typeof GlyphElement; image: typeof ImageElement; line: typeof LineElement; linearGradient: typeof LinearGradientElement; marker: typeof MarkerElement; mask: typeof MaskElement; missing-glyph: typeof MissingGlyphElement; path: typeof PathElement; pattern: typeof PatternElement; polygon: typeof PolygonElement; polyline: typeof PolylineElement; radialGradient: typeof RadialGradientElement; rect: typeof RectElement; stop: typeof StopElement; style: typeof StyleElement; svg: typeof SVGElement; symbol: typeof SymbolElement; text: typeof TextElement; textPath: typeof TextPathElement; title: typeof TitleElement; tref: typeof TRefElement; tspan: typeof TSpanElement; use: typeof UseElement } = ...

Type declaration

Functions

  • CB1(t: number): number
  • CB2(t: number): number
  • CB3(t: number): number
  • CB4(t: number): number
  • QB1(t: number): number
  • QB2(t: number): number
  • QB3(t: number): number
  • compressSpaces(str: string): string
  • HTML-safe compress white-spaces.

    Parameters

    • str: string

      String to compress.

    Returns string

    String.

  • getSelectorSpecificity(selector: string): string
  • Measure selector specificity.

    Parameters

    • selector: string

      Selector to measure.

    Returns string

    Specificity.

  • normalizeAttributeName(name: string): string
  • Normalize attribute name.

    Parameters

    • name: string

      Attribute name.

    Returns string

    Normalized attribute name.

  • normalizeColor(color: string): string
  • Transform floats to integers in rgb colors.

    Parameters

    • color: string

      Color to normalize.

    Returns string

    Normalized color.

  • parseExternalUrl(url: string): string
  • Parse external URL.

    Parameters

    • url: string

      CSS url string.

    Returns string

    Parsed URL.

  • toNumbers(str: string): number[]
  • String to numbers array.

    Parameters

    • str: string

      Numbers string.

    Returns number[]

    Numbers array.

  • trimLeft(str: string): string
  • HTML-safe left trim.

    Parameters

    • str: string

      String to trim.

    Returns string

    String.

  • trimRight(str: string): string
  • HTML-safe right trim.

    Parameters

    • str: string

      String to trim.

    Returns string

    String.

Generated using TypeDoc