@levischuck/receiptline 0.0.4 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,71 @@
1
+ export type BarcodeSymbolType = 'upc' | 'ean' | 'jan' | 'code39' | 'itf' | 'codabar' | 'nw7' | 'code93' | 'code128';
2
+ export type BarcodeCode128Symbol = {
3
+ type: 'code128';
4
+ data: string;
5
+ hri: boolean;
6
+ width: number;
7
+ height: number;
8
+ quietZone: boolean;
9
+ };
10
+ export type BarcodeCode93Symbol = {
11
+ type: 'code93';
12
+ data: string;
13
+ hri: boolean;
14
+ width: number;
15
+ height: number;
16
+ quietZone: boolean;
17
+ };
18
+ export type BarcodeCodabarSymbol = {
19
+ type: 'codabar' | 'nw7';
20
+ data: string;
21
+ hri: boolean;
22
+ width: number;
23
+ height: number;
24
+ quietZone: boolean;
25
+ };
26
+ export type BarcodeItfSymbol = {
27
+ type: 'itf';
28
+ data: string;
29
+ hri: boolean;
30
+ width: number;
31
+ height: number;
32
+ quietZone: boolean;
33
+ };
34
+ export type BarcodeCode39Symbol = {
35
+ type: 'code39';
36
+ data: string;
37
+ hri: boolean;
38
+ width: number;
39
+ height: number;
40
+ quietZone: boolean;
41
+ };
42
+ export type BarcodeUpcSymbol = {
43
+ type: 'upc';
44
+ data: string;
45
+ hri: boolean;
46
+ width: number;
47
+ height: number;
48
+ quietZone: boolean;
49
+ };
50
+ export type BarcodeEanSymbol = {
51
+ type: 'ean' | 'jan';
52
+ data: string;
53
+ hri: boolean;
54
+ width: number;
55
+ height: number;
56
+ quietZone: boolean;
57
+ };
58
+ export type BarcodeSymbol = BarcodeCode128Symbol | BarcodeCode93Symbol | BarcodeCodabarSymbol | BarcodeItfSymbol | BarcodeCode39Symbol | BarcodeUpcSymbol | BarcodeEanSymbol;
59
+ export type BarcodeResult = {
60
+ hri?: boolean;
61
+ text?: string;
62
+ widths?: number[];
63
+ length?: number;
64
+ height?: number;
65
+ };
66
+ /**
67
+ * Generate barcode.
68
+ * @param symbol barcode information (data, type, width, height, hri, quietZone)
69
+ * @returns barcode form
70
+ */
71
+ export declare function generate(symbol: BarcodeSymbol): BarcodeResult;
@@ -0,0 +1,17 @@
1
+ import { Printer } from './types.ts';
2
+ export { BaseTarget } from './targets/base.ts';
3
+ export { SvgTarget } from './targets/svg.ts';
4
+ export { HtmlTarget } from './targets/html.ts';
5
+ export { AuditTarget } from './targets/audit.ts';
6
+ /**
7
+ * Transform ReceiptLine document to printer commands or SVG/HTML output.
8
+ * This is an async function to support targets that need async operations (e.g., PNG generation).
9
+ * @param {string} doc ReceiptLine document
10
+ * @param {object} [printer] printer configuration
11
+ * @returns {Promise<{content: string, width: number, height: number}>} result with output string, width, and height
12
+ */
13
+ export declare function transform(doc: string, printer: Printer): Promise<{
14
+ content: string;
15
+ width: number;
16
+ height: number;
17
+ }>;