red-agate-barcode
Version:
red-agate barcode tag library.
63 lines (62 loc) • 2.31 kB
TypeScript
import { SvgCanvas } from 'red-agate-svg-canvas/modules/drawing/canvas/SvgCanvas';
import { BarcodeBaseProps, BarcodeBasePropsNoUndefined, BarcodeBase } from './BarcodeBase';
export declare type EanTypesEnum = "ean-2" | "ean-5" | "ean-8" | "ean-13" | "upc-a" | "upc-e";
export interface EanProps extends BarcodeBaseProps {
smallFont?: string;
elementWidth?: number;
guardExtHeight?: number;
}
export interface EanPropsNoUndefined extends BarcodeBasePropsNoUndefined {
smallFont: string;
elementWidth: number;
guardExtHeight: number;
}
export declare const eanPropsDefault: EanPropsNoUndefined;
export declare class EanBase extends BarcodeBase<EanProps> {
constructor(props: EanProps);
protected get eanTypes(): EanTypesEnum;
protected calcSymbolSize(data: string, startChar: string, stopChar: string, cdChar: string): {
tw: number;
th: number;
};
protected calcEanMod10W3Checksum(data: string): number;
protected calcEan5Checksum(data: string): number;
protected calcEan2Checksum(data: string): number;
protected encodeData(data: string): {
data: string;
heightData?: string;
labelText?: string;
startChar: string;
stopChar: string;
};
protected getBarSpaceWidth(): number[];
protected getBarSpaceHeight(): Array<Array<{
offset: number;
height: number;
}>>;
protected getRenderStartCoodinate(data: string, text: string): {
rx: number;
ry: number;
};
protected renderText(canvas: SvgCanvas, tw: number, th: number, data: string, text: string): void;
}
export declare class Ean13 extends EanBase {
protected get eanTypes(): EanTypesEnum;
}
export declare const Gtin13: typeof Ean13;
export declare class Ean8 extends EanBase {
protected get eanTypes(): EanTypesEnum;
}
export declare const Gtin8: typeof Ean8;
export declare class Ean5 extends EanBase {
protected get eanTypes(): EanTypesEnum;
}
export declare class Ean2 extends EanBase {
protected get eanTypes(): EanTypesEnum;
}
export declare class UpcA extends EanBase {
protected get eanTypes(): EanTypesEnum;
}
export declare class UpcE extends EanBase {
protected get eanTypes(): EanTypesEnum;
}