@better-auth-ui/core
Version:
Authentication components and data utilities for [Better Auth](https://better-auth.com), available for React and Solid.
19 lines (18 loc) • 756 B
TypeScript
export type QrCodeSvgData = {
/** A path composed only from the encoded QR module coordinates. */
path: string;
/** The width and height of the square SVG view box. */
size: number;
};
/**
* Encode a value into safe path data for an inline SVG QR code.
*
* The input is converted to a boolean matrix before the SVG path is built, so
* the original value can never become markup or an SVG attribute. Generation
* stays local and synchronous. The four-module border preserves the quiet zone
* that phone cameras need for reliable scanning.
*
* @param value - The text or URL to encode.
* @returns SVG view-box dimensions and a path for the dark modules.
*/
export declare function createQrCodeSvgData(value: string): QrCodeSvgData;