react-native-thermal-pos-printer
Version:
React Native thermal printer package for POS systems supporting Xprinter and other popular brands
28 lines (27 loc) • 1.23 kB
JavaScript
;
import { NativeModules } from 'react-native';
const {
PosPrinter
} = NativeModules;
if (!PosPrinter) {
throw new Error('PosPrinter native module is not available. Make sure the library is properly linked.');
}
const PosPrinterModule = {
init: options => PosPrinter.init(options),
getDeviceList: () => PosPrinter.getDeviceList(),
connectPrinter: (address, type) => PosPrinter.connectPrinter(address, type),
disconnectPrinter: () => PosPrinter.disconnectPrinter(),
isConnected: () => PosPrinter.isConnected(),
printText: (text, options) => PosPrinter.printText(text, options),
printImage: (base64Image, options) => PosPrinter.printImage(base64Image, options),
printBitmap: base64Data => PosPrinter.printBitmap(base64Data),
printBarcode: (data, type, options) => PosPrinter.printBarcode(data, type, options),
printQRCode: (data, options) => PosPrinter.printQRCode(data, options),
cutPaper: () => PosPrinter.cutPaper(),
openCashDrawer: () => PosPrinter.openCashDrawer(),
sendRawCommand: command => PosPrinter.sendRawCommand(command),
getStatus: () => PosPrinter.getStatus()
};
export { PosPrinterModule as PosPrinter };
export default PosPrinterModule;
//# sourceMappingURL=native.js.map