UNPKG

@qr-platform/qr-code.js

Version:

QRCode.js is a professional JavaScript/TypeScript library for creating customized QR codes, offering a blend of simplicity and sophistication. With versatile styling options—dot shapes, colors, gradients, embedded images, borders, and text—it enables you

18 lines (17 loc) 883 B
/** * Fetches an image directly from its URL and converts it to a Data URL. * Handles potential CORS issues and other fetch errors. * Works in Browser, Node.js, and Worker environments. * * @param imageUrl The URL of the image to fetch. * @param crossOrigin The crossOrigin attribute value ('anonymous', 'use-credentials'). * @returns A Promise resolving to the Data URL string, or null if fetching fails. */ export declare function fetchImageDataUrlDirectly(imageUrl: string, crossOrigin?: string): Promise<string | null>; /** * Fetches an image via a proxy service, which returns the image as a Data URL. * * @param imageUrl The original URL of the image to fetch via proxy. * @returns A Promise resolving to the Data URL string from the proxy, or null if fetching fails. */ export declare function fetchImageDataUrlViaProxy(imageUrl: string): Promise<string | null>;