BrowserQRCodeSvgWriter.d.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import EncodeHintType from '../core/EncodeHintType';
  2. /**
  3. * @deprecated Moving to @zxing/browser
  4. */
  5. declare class BrowserQRCodeSvgWriter {
  6. private static readonly QUIET_ZONE_SIZE;
  7. /**
  8. * SVG markup NameSpace
  9. */
  10. private static readonly SVG_NS;
  11. /**
  12. * Writes and renders a QRCode SVG element.
  13. *
  14. * @param contents
  15. * @param width
  16. * @param height
  17. * @param hints
  18. */
  19. write(contents: string, width: number, height: number, hints?: Map<EncodeHintType, any>): SVGSVGElement;
  20. /**
  21. * Renders the result and then appends it to the DOM.
  22. */
  23. writeToDom(containerElement: string | HTMLElement, contents: string, width: number, height: number, hints?: Map<EncodeHintType, any>): void;
  24. /**
  25. * Note that the input matrix uses 0 == white, 1 == black.
  26. * The output matrix uses 0 == black, 255 == white (i.e. an 8 bit greyscale bitmap).
  27. */
  28. private renderResult;
  29. /**
  30. * Creates a SVG element.
  31. *
  32. * @param w SVG's width attribute
  33. * @param h SVG's height attribute
  34. */
  35. private createSVGElement;
  36. /**
  37. * Creates a SVG rect element.
  38. *
  39. * @param x Element's x coordinate
  40. * @param y Element's y coordinate
  41. * @param w Element's width attribute
  42. * @param h Element's height attribute
  43. */
  44. private createSvgRectElement;
  45. }
  46. export { BrowserQRCodeSvgWriter };