API Reference
@qrcodesdk/core
Section titled “@qrcodesdk/core”qrcode
Section titled “qrcode”SVGQRCodeRenderer
Section titled “SVGQRCodeRenderer”Creates a renderer that returns an SVG string.
SVGQRCodeRenderer(options?);Options include shared styling plus SVG accessibility attributes: alt, ariaLabel, and title.
QRCodeTextRenderer
Section titled “QRCodeTextRenderer”Creates a renderer that returns terminal text.
QRCodeTextRenderer(options?);Options include size and margin.
parseQRCodeStylingOptions
Section titled “parseQRCodeStylingOptions”Normalizes styling options into complete defaults.
parseQRCodeStylingOptions(options?);Defaults are size: 5, margin: 4, colors.colorLight: '#ffffff', and colors.colorDark: '#000000'.
The core package exports these public types:
type ParsedQRCodeStylingOptions;type QRCodeErrorCorrectionLevel;type QRCodeInputData;type QRCodeMask;type QRCodeMatrix;type QRCodeMatrixOptions;type QRCodeMode;type QRCodeRenderer;type QRCodeStylingOptions;type QRCodeTextRendererOptions;type QRCodeSVGRendererOptions;type QRCodeVersion;@qrcodesdk/browser
Section titled “@qrcodesdk/browser”CanvasQRCodeRenderer
Section titled “CanvasQRCodeRenderer”Creates a renderer that returns an HTMLCanvasElement.
CanvasQRCodeRenderer(options?);Options use the shared styling shape: size, margin, colors.colorLight, and colors.colorDark.
ImageQRCodeRenderer
Section titled “ImageQRCodeRenderer”Creates a renderer that returns an HTMLImageElement with a PNG data URL.
ImageQRCodeRenderer(options?);Options include shared styling plus image accessibility attributes: alt, ariaLabel, and title.
DownloadImageQRCodeRenderer
Section titled “DownloadImageQRCodeRenderer”Creates a renderer that triggers a PNG download in the browser and returns void.
DownloadImageQRCodeRenderer(options);Options include renderer, an image renderer such as ImageQRCodeRenderer(options), and optional filename.
DownloadSVGQRCodeRenderer
Section titled “DownloadSVGQRCodeRenderer”Creates a renderer that triggers an SVG download in the browser and returns void.
DownloadSVGQRCodeRenderer(options);Options include renderer, an SVG renderer such as SVGQRCodeRenderer(options), and optional filename.
The browser package exports:
type QRCodeCanvasRendererOptions;type QRCodeDownloadImageRendererOptions;type QRCodeDownloadSVGRendererOptions;type QRCodeImageRendererOptions;@qrcodesdk/node
Section titled “@qrcodesdk/node”PNGQRCodeRenderer
Section titled “PNGQRCodeRenderer”Creates a renderer that returns a PNG Buffer.
PNGQRCodeRenderer(options?);Options use the shared styling shape: size, margin, colors.colorLight, and colors.colorDark.
The Node package exports:
type QRCodePNGRendererOptions;