@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
36 lines (35 loc) • 1.31 kB
TypeScript
import { Gradient } from '../utils/gradient';
import { BorderOptions } from '../utils/options.js';
import { Position } from './QRBorderHelpers.js';
export interface QRBorderPluginStyleOptions {
fontFace?: string;
fontSize?: number;
fontColor?: string;
textTransform?: string;
letterSpacing?: number;
fontWeight?: string;
}
interface QRPluginSettings {
width?: number | string;
height?: number | string;
document: Document;
instanceId: number;
backgroundOptions?: {
/** Background roundnes, from 0 (square) to 1 (circle) */
round?: number;
/** Background color */
color?: string;
/** Background Gradient */
gradient?: Gradient;
} | false;
}
type QRBorderPluginFn = (options: BorderOptions) => (svgElement: SVGElement, settings: QRPluginSettings, svgSize: number, drawBackgroundForBorder: (padding: number, baseRadius: number) => SVGElement | undefined, bordersMain: {
[key in Position]: number;
}, bordersOuter: {
[key in Position]: number;
}, bordersInner: {
[key in Position]: number;
}, noBorderThickness: number) => void;
export declare const isBorderSideEnabled: (options: BorderOptions, position: Position) => boolean;
declare const QRBorderPlugin: QRBorderPluginFn;
export { QRBorderPlugin };