capacitor-plugin-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK for Capacitor
58 lines (57 loc) • 2.12 kB
JavaScript
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from rtu-ui-v2/schemas/textpattern/TextPatternScannerUIResult.yaml
import { SymbolBox, WordBox } from '../../text_pattern_scanner/TextPatternScannerTypes';
import { ToJsonConfiguration } from '../../utils/json/JsonSerializationTypes';
import { PartiallyConstructible } from '../../utils/utils';
/**
Configuration of the generic text scanner RTU UI result.
*/
export class TextPatternScannerUiResult extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<TextPatternScannerUiResult>`} */
constructor(source = {}) {
super();
/**
Confidence of the recognition.
Default is 0.0
*/
this.confidence = 0.0;
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 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 SymbolBox(it);
});
}
else {
throw new Error('symbolBoxes must be present in constructor argument');
}
if (source.confidence !== undefined) {
this.confidence = source.confidence;
}
}
serialize(config = new 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,
};
}
}
//# sourceMappingURL=TextPatternScannerUIResult.js.map