UNPKG

longurl-js

Version:

LongURL - Programmable URL management framework with entity-driven design and production-ready infrastructure

38 lines (37 loc) 1.12 kB
/** * QR Code Generator * * Handles QR code generation for URLs using the qrcode package. * Provides compressed, optimized QR codes for storage and sharing. */ export interface QRCodeOptions { width?: number; margin?: number; color?: { dark?: string; light?: string; }; errorCorrectionLevel?: 'L' | 'M' | 'Q' | 'H'; } /** * Generate a QR code for a URL as a base64 data URL * * @param url The URL to encode in the QR code * @param options QR code generation options * @returns Base64 data URL of the QR code image */ export declare function generateQRCode(url: string, options?: QRCodeOptions): Promise<string>; /** * Generate a QR code with optimized settings for storage * * @param url The URL to encode * @returns Compressed base64 QR code data URL */ export declare function generateOptimizedQRCode(url: string): Promise<string>; /** * Validate if a string is a valid QR code data URL * * @param qrCodeDataUrl The data URL to validate * @returns True if valid, false otherwise */ export declare function isValidQRCodeDataUrl(qrCodeDataUrl: string): boolean;