@levischuck/receiptline 0.1.2 → 0.1.3
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.
- package/dist/index.js +515 -486
- package/dist/targets/html.d.ts +8 -0
- package/package.json +1 -1
package/dist/targets/html.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export declare class HtmlTarget extends BaseTarget {
|
|
|
31
31
|
defaultFont: string;
|
|
32
32
|
actualFontCharacterWidth: number | undefined;
|
|
33
33
|
private explicitCharHeight;
|
|
34
|
+
widthSpacingUnit: 'px' | '%' | 'ch';
|
|
34
35
|
contentNodes: HtmlNode[];
|
|
35
36
|
currentStyles: HtmlStyle;
|
|
36
37
|
textScale: number;
|
|
@@ -41,6 +42,13 @@ export declare class HtmlTarget extends BaseTarget {
|
|
|
41
42
|
setDefaultFont(font: string): string;
|
|
42
43
|
setActualFontCharacterWidth(width: number | undefined): void;
|
|
43
44
|
setCharHeight(height: number | undefined): void;
|
|
45
|
+
setWidthSpacingUnit(unit: 'px' | '%' | 'ch'): void;
|
|
46
|
+
/**
|
|
47
|
+
* Converts a character width to the appropriate CSS unit based on widthSpacingUnit.
|
|
48
|
+
* @param chars - Width in characters
|
|
49
|
+
* @returns CSS value string (e.g., "12px", "50%", "12ch")
|
|
50
|
+
*/
|
|
51
|
+
private toWidthUnit;
|
|
44
52
|
close(): Promise<string>;
|
|
45
53
|
area(left: number, width: number, _right: number): Promise<string>;
|
|
46
54
|
align(align: number): Promise<string>;
|
package/package.json
CHANGED