@pdfme/schemas
Version:
TypeScript base PDF generator and React base UI. Open source, developed by the community, and completely free to use under the MIT license!
24 lines (21 loc) • 743 B
text/typescript
import { pdfRender } from './pdfRender.js';
import { getPropPanelByBarcodeType } from './propPanel.js';
import { uiRender } from './uiRender.js';
import type { BarcodeSchema, BarcodeTypes } from './types.js';
import { BARCODE_TYPES } from './constants.js';
import { createSvgStr } from '../utils.js';
import { Plugin } from '@pdfme/common';
import { QrCode, Barcode } from 'lucide';
const barcodes = BARCODE_TYPES.reduce(
(acc, type) =>
Object.assign(acc, {
[type]: {
pdf: pdfRender,
ui: uiRender,
propPanel: getPropPanelByBarcodeType(type),
icon: createSvgStr(type == 'qrcode' ? QrCode : Barcode),
},
}),
{} as Record<BarcodeTypes, Plugin<BarcodeSchema>>,
);
export default barcodes;