import { ColorElementValue } from '../utils/color.js'; import { Gradient } from '../utils/gradient.js'; import { Options, Plugin } from '../utils/options.js'; declare enum TextPosition { top = "top", bottom = "bottom", left = "left", right = "right" } export interface TextConfig { font?: string; color?: string; size?: number; fontWeight?: 'normal' | 'bold' | number; fontStyle?: 'normal' | 'italic' | 'oblique'; } export interface BorderPluginOptions { /** Border roundnes, from 0 (square) to 1 (circle) */ round?: number; size: number; color?: string; gradient?: Gradient; dasharray?: string; margin?: number; /** * If true, all dimensions are proportional to the code size, * i.e. `size: 0.1` means the border thickness is 1/10 of the QR code size * * This is useful to keep the border visually consistent regardless of the amount of data * * Note: if using dasharray, use percentage values to maintain consistency */ proportional?: boolean; text?: TextConfig & { [key in TextPosition]?: TextConfig & { content: string; }; }; /** * A string of embedded CSS \@font-face rules * * @deprecated Use @liquid-js/qr-code-styling/font-faces-plugin */ fontFaces?: string; } export default class BorderPlugin implements Plugin { private readonly pluginOptions; /** @ignore Create unique id for SVG elements to prevent naming collisions; specify your own if neccesary e.g. for testing */ private readonly idSuffix; constructor(pluginOptions: BorderPluginOptions, /** @ignore Create unique id for SVG elements to prevent naming collisions; specify your own if neccesary e.g. for testing */ idSuffix?: string); postProcess(svg: SVGSVGElement, options: Options, colors: { dots?: ColorElementValue; background?: ColorElementValue; }): void; } export {};