mobile-native-barcode-generator
Version:
Library to generate barcodes and qr codes natively using Kotlin and Swift, integrated with react native.
25 lines (24 loc) • 942 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = saveBarcodeToGallery;
var _MobileNativeBarcodeGenerator = _interopRequireDefault(require("./MobileNativeBarcodeGenerator.js"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
async function saveBarcodeToGallery(value, width, height, fileName) {
if (value === "") {
throw new Error("Value cannot be empty");
}
if (width <= 0 || typeof width !== "number") {
throw new Error("Width must be a positive number");
}
if (height <= 0 || typeof height !== "number") {
throw new Error("Height must be a positive number");
}
if (fileName.trim() === "") {
throw new Error("Filename cannot be empty");
}
const result = await _MobileNativeBarcodeGenerator.default.saveBarcodeToGallery(value, width, height, fileName);
return result;
}
//# sourceMappingURL=saveBarcodeToGallery.js.map