UNPKG

react-native-scanbot-sdk

Version:

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

108 lines (94 loc) 3.92 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ResultAccumulationConfiguration = exports.ConfirmationMethodValues = exports.AccumulatedResultsVerifierConfiguration = void 0; var _utils = require("../utils/utils"); /// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten. /// Generated from core/schemas/FrameAccumulationTypes.yaml /** Method used to confirm a result. - `EXACT`: Require seeing the same result multiple times to confirm it. E.g. if the seen values are "John B. Doe", "John B.", "B. Doe", "John B. Doe" then the confirmation count for the value "John B. Doe" is 2 and for the rest it's 1. A field's value is considered CONFIRMED if its confirmation count is greater or equal to minConfirmations. - `INTERPOLATE`: Interpolate between seen values to generate the most likely true value. E.g. if the seen values are "John X. Doe", "John B.", "B. Doe" then the most likely true value can be interpolated to be "John B. Doe". The interpolated value is considered CONFIRMED if each character in it has been seen at least minConfirmations times. */ const ConfirmationMethodValues = exports.ConfirmationMethodValues = ['EXACT', 'INTERPOLATE']; /** Configuration for how to accumulate results. */ class ResultAccumulationConfiguration extends _utils.PartiallyConstructible { /** Method used to confirm a result. Default is EXACT */ confirmationMethod = 'EXACT'; /** Number of confirmations required to consider a result confirmed (see ConfirmationMethod). Requiring more confirmations will increase the reliability of the result but also the time to gather enough confirmations. Default is 3 */ minConfirmations = 3; /** Minimum confidence required to consider a field confirmed. Default is 0.8 */ minConfidenceForStableField = 0.8; /** Will auto-clear the cache if this number of frames have been a different document type or empty. Default is 4 */ autoClearThreshold = 4; /** @param source {@displayType `DeepPartial<ResultAccumulationConfiguration>`} */ constructor(source = {}) { super(); if (source.confirmationMethod !== undefined) { this.confirmationMethod = source.confirmationMethod; } if (source.minConfirmations !== undefined) { this.minConfirmations = source.minConfirmations; } if (source.minConfidenceForStableField !== undefined) { this.minConfidenceForStableField = source.minConfidenceForStableField; } if (source.autoClearThreshold !== undefined) { this.autoClearThreshold = source.autoClearThreshold; } } } /** Configure the frame accumulation process. */ exports.ResultAccumulationConfiguration = ResultAccumulationConfiguration; class AccumulatedResultsVerifierConfiguration extends _utils.PartiallyConstructible { /** Maximum number of accumulated frames to inspect to verify a scan result. Default is 3 */ maximumNumberOfAccumulatedFrames = 3; /** Minimum number of accumulated frames that have an equal result in order for the result to be considered verified. Default is 2 */ minimumNumberOfRequiredFramesWithEqualScanningResult = 2; /** @param source {@displayType `DeepPartial<AccumulatedResultsVerifierConfiguration>`} */ constructor(source = {}) { super(); if (source.maximumNumberOfAccumulatedFrames !== undefined) { this.maximumNumberOfAccumulatedFrames = source.maximumNumberOfAccumulatedFrames; } if (source.minimumNumberOfRequiredFramesWithEqualScanningResult !== undefined) { this.minimumNumberOfRequiredFramesWithEqualScanningResult = source.minimumNumberOfRequiredFramesWithEqualScanningResult; } } } exports.AccumulatedResultsVerifierConfiguration = AccumulatedResultsVerifierConfiguration; //# sourceMappingURL=FrameAccumulationTypes.js.map