UNPKG

react-native-scanbot-sdk

Version:

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

126 lines (121 loc) 4.55 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PageData = void 0; var _DocumentScannerTypes = require("../document_scanner/DocumentScannerTypes"); var _PageImageSource = require("../document_scanner/PageImageSource"); var _DocumentQualityAnalyzerTypes = require("../dqa/DocumentQualityAnalyzerTypes"); var _ParametricFilters = require("../image_filters/ParametricFilters"); var _JsonSerializationTypes = require("../utils/json/JsonSerializationTypes"); var _utils = require("../utils/utils"); /// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten. /// Generated from native/schemas/document/PageData.yaml /** The result of the health insurance card recognition. */ class PageData extends _utils.PartiallyConstructible { /** The unique identifier of the page. */ /** The list of filters applied to the page. */ filters = null; /** The polygon of the page. */ polygon = []; /** The detection status of the page. */ documentDetectionStatus = null; /** The quality score of the page. */ documentQuality = null; /** The source of the page image. */ source = null; /** The URI of the original image. */ /** The URI of the document image. */ documentImageURI = null; /** The URI of the unfiltered document image. */ unfilteredDocumentImageURI = null; /** The URI of the document image preview. */ documentImagePreviewURI = null; /** @param source {@displayType `DeepPartial<PageData>`} */ constructor(source = {}) { super(); if (source.uuid !== undefined) { this.uuid = source.uuid; } else { throw new Error('uuid must be present in constructor argument'); } if (source.filters !== undefined) { this.filters = source.filters != null ? source.filters.map(it => { return _ParametricFilters.ParametricFilter.From(it); }) : null; } if (source.polygon !== undefined) { this.polygon = source.polygon.map(it => { return { x: it.x, y: it.y }; }); } if (source.documentDetectionStatus !== undefined) { this.documentDetectionStatus = source.documentDetectionStatus != null ? _DocumentScannerTypes.DocumentDetectionStatusValues.includes(source.documentDetectionStatus) ? source.documentDetectionStatus : null : null; } if (source.documentQuality !== undefined) { this.documentQuality = source.documentQuality != null ? _DocumentQualityAnalyzerTypes.DocumentQualityValues.includes(source.documentQuality) ? source.documentQuality : null : null; } if (source.source !== undefined) { this.source = source.source != null ? _PageImageSource.PageImageSourceValues.includes(source.source) ? source.source : null : null; } if (source.originalImageURI !== undefined) { this.originalImageURI = source.originalImageURI; } else { throw new Error('originalImageURI must be present in constructor argument'); } if (source.documentImageURI !== undefined) { this.documentImageURI = source.documentImageURI != null ? source.documentImageURI : null; } if (source.unfilteredDocumentImageURI !== undefined) { this.unfilteredDocumentImageURI = source.unfilteredDocumentImageURI != null ? source.unfilteredDocumentImageURI : null; } if (source.documentImagePreviewURI !== undefined) { this.documentImagePreviewURI = source.documentImagePreviewURI != null ? source.documentImagePreviewURI : null; } } serialize(config = new _JsonSerializationTypes.ToJsonConfiguration()) { return { uuid: this.uuid, filters: this.filters != null ? this.filters.map(it => { return it.serialize(config); }) : null, polygon: this.polygon.map(it => { return it; }), documentDetectionStatus: this.documentDetectionStatus != null ? this.documentDetectionStatus : null, documentQuality: this.documentQuality != null ? this.documentQuality : null, source: this.source != null ? this.source : null, originalImageURI: this.originalImageURI, documentImageURI: this.documentImageURI != null ? this.documentImageURI : null, unfilteredDocumentImageURI: this.unfilteredDocumentImageURI != null ? this.unfilteredDocumentImageURI : null, documentImagePreviewURI: this.documentImagePreviewURI != null ? this.documentImagePreviewURI : null }; } } exports.PageData = PageData; //# sourceMappingURL=PageData.js.map