API reference: @salmonui/charts/barcode
BarcodeApiinterface
import type { BarcodeApi } from '@salmonui/charts/barcode';Also exported from @salmonui/charts/barcode/pdf417, @salmonui/charts/barcode/gs1-databar, @salmonui/charts/barcode/dotcode.
interface BarcodeApi {
readonly element: SVGSVGElement | null;
toSVGString(): string;
toBlob(format?: BarcodeImageFormat, options?: Omit<BarcodeExportOptions, 'format' | 'fileName'>): Promise<Blob>;
toDataURL(format?: BarcodeImageFormat, options?: Omit<BarcodeExportOptions, 'format' | 'fileName'>): Promise<string>;
export(options?: BarcodeExportOptions): Promise<void>;
}
Instance reached through ref on Barcode and QRCode.
| Name | Signature | Description |
|---|---|---|
element | readonly element: SVGSVGElement | null; | The root |
toSVGString | toSVGString(): string; | Standalone SVG markup; works without a DOM (server, tests). |
toBlob | toBlob(format?: BarcodeImageFormat, options?: Omit<BarcodeExportOptions, 'format' | 'fileName'>): Promise<Blob>; | |
toDataURL | toDataURL(format?: BarcodeImageFormat, options?: Omit<BarcodeExportOptions, 'format' | 'fileName'>): Promise<string>; | |
export | export(options?: BarcodeExportOptions): Promise<void>; | Downloads the symbol; settles after the download started. |