react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
73 lines (66 loc) • 2.08 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.BarcodeItem = void 0;
var _utils = require("../../utils");
var _GenericDocument = require("../../documents/GenericDocument");
/**
Data about the scanned barcode.
*/
class BarcodeItem extends _utils.PartiallyConstructible {
/**
Recognized barcode symbology.
*/
/**
Number of recognized barcodes of this symbology and value.
*/
/**
Recognized value of the barcode.
*/
/**
Recognized barcode value with extension (if available).
*/
/**
Representation of the raw data that is contained the recognized barcode.
*/
/**
The parsed known document format (if parsed successfully).
*/
/** @param source {@displayType `DeepPartial<BarcodeItem>`} */
constructor(source = {}) {
super();
if (source.type !== undefined) {
this.type = source.type != null ? source.type : null;
} else {
throw new Error('type must be present in constructor argument');
}
if (source.count !== undefined) {
this.count = source.count;
} else {
throw new Error('count must be present in constructor argument');
}
if (source.text !== undefined) {
this.text = source.text;
} else {
throw new Error('text must be present in constructor argument');
}
if (source.textWithExtension !== undefined) {
this.textWithExtension = source.textWithExtension;
} else {
throw new Error('textWithExtension must be present in constructor argument');
}
if (source.rawBytes !== undefined) {
this.rawBytes = source.rawBytes;
} else {
throw new Error('rawBytes must be present in constructor argument');
}
if (source.parsedDocument !== undefined) {
this.parsedDocument = source.parsedDocument != null ? new _GenericDocument.GenericDocument(source.parsedDocument) : null;
} else {
throw new Error('parsedDocument must be present in constructor argument');
}
}
}
exports.BarcodeItem = BarcodeItem;
//# sourceMappingURL=BarcodeItem.js.map
;