capacitor-plugin-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK for Capacitor
65 lines • 2.21 kB
JavaScript
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from xplatforms/schemas/document_scanner/OCREngineResult.yaml
import { ToJsonConfiguration } from '../core/common/JsonSerializationTypes';
import { OcrPage } from '../core/ocr/OcrTypes';
/**
OCR configurations result.
*/
export class OcrConfigsResult {
/** @param source {@displayType `DeepPartial<OcrConfigsResult>`} */
constructor(source = {}) {
if (source.languageDataPath !== undefined) {
this.languageDataPath = source.languageDataPath;
}
else {
throw new Error('languageDataPath must be present in constructor argument');
}
if (source.installedLanguages !== undefined) {
this.installedLanguages = source.installedLanguages.map((it) => {
return it;
});
}
else {
throw new Error('installedLanguages must be present in constructor argument');
}
}
serialize(config = new ToJsonConfiguration()) {
return {
languageDataPath: this.languageDataPath,
installedLanguages: this.installedLanguages.map((it) => {
return it;
}),
};
}
}
/**
The result of OCR recognition.
*/
export class PerformOcrResult {
/** @param source {@displayType `DeepPartial<PerformOcrResult>`} */
constructor(source = {}) {
if (source.recognizedText !== undefined) {
this.recognizedText = source.recognizedText;
}
else {
throw new Error('recognizedText must be present in constructor argument');
}
if (source.pages !== undefined) {
this.pages = source.pages.map((it) => {
return new OcrPage(it);
});
}
else {
throw new Error('pages must be present in constructor argument');
}
}
serialize(config = new ToJsonConfiguration()) {
return {
recognizedText: this.recognizedText,
pages: this.pages.map((it) => {
return it.serialize(config);
}),
};
}
}
//# sourceMappingURL=OcrEngineResult.js.map