// @ts-expect-error bwip-js types not resolved by bundler moduleResolution import bwipjs from 'bwip-js'; export async function generateBarcodeSvg(text: string): Promise { const buf = await bwipjs.toBuffer({ bcid: 'code128', text, scale: 2, height: 8, includetext: true, textsize: 10, textxalign: 'center' }); // Return as base64 data URL for embedding in HTML return `data:image/png;base64,${buf.toString('base64')}`; }