Repository navigation
[1.2.0]
π Bug Fixes
- Fixed image alignment on Android β
printImageandprintImageBase64were incorrectly passingimageHeightinto thealignparameter of the Java layer. Alignment was always ignored (defaulted to center). Now correctly passesopts.align ?? 'center'as a string.
β¨ New Features
-
New
Alignmenttype β AddedAlignment = 'left' | 'center' | 'right'string literal type as the recommended way to specify alignment. Works for both image printing (PrinterImageOptions.align) and column printing (IPrintExpandColumn.columnAlignment). -
printColumnsTextnow accepts string alignment β ThecolumnAlignmentparameter now acceptsAlignment[](string) in addition to the legacyColumnAlignment[](enum). Both are supported simultaneously for backward compatibility.
β οΈ Deprecations
-
ColumnAlignmentenum is deprecated β Use the newAlignmentstring literal type instead.ColumnAlignmentwill be removed in a future major version.// Before (deprecated) import { ColumnAlignment } from '@haroldtran/react-native-thermal-printer'; columnAlignment: [ColumnAlignment.LEFT, ColumnAlignment.CENTER, ColumnAlignment.RIGHT] // After β columnAlignment: ['left', 'center', 'right']
π§ Internal / Android
- Java layer:
printImageDataandprintImageBase64signature changed fromint align(magic number 0/1/2) toString align("left"/"center"/"right") across all modules (RNUSBPrinterModule,RNBLEPrinterModule,RNNetPrinterModule,RNBasePrinterModule,BasePrinterAdapter,PrinterAdapter,RNPrinterModule). BasePrinterAdapter.getAlignCommand()now uses readable string comparison instead of magic integer checks.
π οΈ Code Quality
- Added
.eslintrc.jsand.prettierrcfor consistent code style enforcement. - Formatted all TypeScript source files to use single quotes, 120-char line width, and trailing commas (per Prettier config).
Full Changelog: v1.1.0...v1.2.0