UNPKG

gen-qrcode-logo

Version:

qrCode with logo,完全支持node端和前端

47 lines (39 loc) 900 B
interface Logo { src: string; logoSize?: number; logoWidth?: number; logoHeight?: number; logoRadius?: number; borderWidth?: number; borderHeight?: number; borderRadius?: number; borderColor?: string; } interface NodeQrCodeOptions { margin?: number; color?: { dark?: string; light?: string; } } interface BaseOptions { content: string; width?: number; nodeQrCodeOptions?: NodeQrCodeOptions | object; logo?: string | Logo } interface CanvasOptions { canvas: Element; } interface ImageOptions { image?: Element; download?: boolean | Function; downloadName?: string; } interface IQrCodeWithLogo { toCanvas(config: BaseOptions & CanvasOptions): Promise<any>; toImage(config: BaseOptions & ImageOptions): Promise<any>; toDataURL(config: BaseOptions): Promise<any>; } declare const QrCodeWithLogo: IQrCodeWithLogo; export default QrCodeWithLogo