BrowserSvgCodeWriter.d.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import EncodeHintType from '../core/EncodeHintType';
  2. /**
  3. * @deprecated Moving to @zxing/browser
  4. */
  5. declare abstract class BrowserSvgCodeWriter {
  6. /**
  7. * Default quiet zone in pixels.
  8. */
  9. private static readonly QUIET_ZONE_SIZE;
  10. /**
  11. * SVG markup NameSpace
  12. */
  13. private static readonly SVG_NS;
  14. /**
  15. * A HTML container element for the image.
  16. */
  17. private containerElement;
  18. /**
  19. * Constructs. 😉
  20. */
  21. constructor(containerElement: string | HTMLElement);
  22. /**
  23. * Writes the QR code to a SVG and renders it in the container.
  24. */
  25. write(contents: string, width: number, height: number, hints?: Map<EncodeHintType, any>): SVGSVGElement;
  26. /**
  27. * Encodes the content to a Barcode type.
  28. */
  29. private encode;
  30. /**
  31. * Renders the SVG in the container.
  32. *
  33. * @note the input matrix uses 0 == white, 1 == black. The output matrix uses 0 == black, 255 == white (i.e. an 8 bit greyscale bitmap).
  34. */
  35. private renderResult;
  36. /**
  37. * Creates a SVG element.
  38. */
  39. protected createSVGElement(w: number, h: number): SVGSVGElement;
  40. /**
  41. * Creates a SVG rect.
  42. */
  43. protected createSvgPathPlaceholderElement(w: number, h: number): SVGPathElement;
  44. /**
  45. * Creates a SVG rect.
  46. */
  47. protected createSvgRectElement(x: number, y: number, w: number, h: number): SVGRectElement;
  48. }
  49. export { BrowserSvgCodeWriter };