react-native-esc-pos-printer
Version:
An unofficial React Native library for printing on an EPSON TM printer with the Epson ePOS SDK for iOS and Epson ePOS SDK for Android
17 lines (16 loc) • 805 B
JavaScript
;
import { PrinterGetSettingsType, GetPrinterSettingsPaperWidthValuesMapping, GetPrinterSettingsPrintDencityValuesMapping, GetPrinterSettingsPrintSpeendValuesMapping } from "../../constants/index.js";
export function parsePrinterSettings(response) {
let valueMapping = GetPrinterSettingsPaperWidthValuesMapping;
if (response.type === PrinterGetSettingsType.PRINTER_SETTING_PRINTDENSITY) {
valueMapping = GetPrinterSettingsPrintDencityValuesMapping;
} else if (response.type === PrinterGetSettingsType.PRINTER_SETTING_PRINTSPEED) {
valueMapping = GetPrinterSettingsPrintSpeendValuesMapping;
}
return {
typeCode: response.type,
type: PrinterGetSettingsType[response.type],
value: valueMapping[response.value]
};
}
//# sourceMappingURL=parsePrinterSettings.js.map