UNPKG

react-native-scanbot-sdk

Version:

Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS

76 lines (69 loc) 2.26 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TextPatternScannerUiResult = void 0; var _TextPatternScannerTypes = require("../../text_pattern_scanner/TextPatternScannerTypes"); var _JsonSerializationTypes = require("../../utils/json/JsonSerializationTypes"); var _utils = require("../../utils/utils"); /// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten. /// Generated from rtu-ui-v2/schemas/textpattern/TextPatternScannerUIResult.yaml /** Configuration of the generic text scanner RTU UI result. */ class TextPatternScannerUiResult extends _utils.PartiallyConstructible { /** Raw recognized string. */ /** Boxes for each recognized word. */ /** Boxes for each recognized symbol. */ /** Confidence of the recognition. Default is 0.0 */ confidence = 0.0; /** @param source {@displayType `DeepPartial<TextPatternScannerUiResult>`} */ constructor(source = {}) { super(); if (source.rawText !== undefined) { this.rawText = source.rawText; } else { throw new Error('rawText must be present in constructor argument'); } if (source.wordBoxes !== undefined) { this.wordBoxes = source.wordBoxes.map(it => { return new _TextPatternScannerTypes.WordBox(it); }); } else { throw new Error('wordBoxes must be present in constructor argument'); } if (source.symbolBoxes !== undefined) { this.symbolBoxes = source.symbolBoxes.map(it => { return new _TextPatternScannerTypes.SymbolBox(it); }); } else { throw new Error('symbolBoxes must be present in constructor argument'); } if (source.confidence !== undefined) { this.confidence = source.confidence; } } serialize(config = new _JsonSerializationTypes.ToJsonConfiguration()) { return { rawText: this.rawText, wordBoxes: this.wordBoxes.map(it => { return it.serialize(config); }), symbolBoxes: this.symbolBoxes.map(it => { return it.serialize(config); }), confidence: this.confidence }; } } exports.TextPatternScannerUiResult = TextPatternScannerUiResult; //# sourceMappingURL=TextPatternScannerUIResult.js.map