UNPKG

capacitor-plugin-scanbot-sdk

Version:

Scanbot Document and Barcode Scanner SDK for Capacitor

110 lines (103 loc) 4.86 kB
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten. /// Generated from xplatforms/schemas/document_scanner/SdkConfiguration.yaml /** Initialize configuration for the Scanbot SDK. */ export class SdkConfiguration { /** @param source {@displayType `DeepPartial<SdkConfiguration>`} */ constructor(source = {}) { /** Optional boolean flag to enable logging. See the "Logging" section below. Default is false */ this.loggingEnabled = false; /** Optional boolean flag that enables Scanbot SDK Core native logging (default is false, Android only). Default is false */ this.enableNativeLogging = false; /** Optional directory as file URI to override the default storage base directory of the Scanbot SDK. Refer to the section "Storage" for more details. */ this.storageBaseDirectory = null; /** Optional image quality value. It defines the quality factor of JPEG images. The value must be between 1 and 100, where 100 means maximum quality and largest file size. The recommended default value is 80 which is a good compromise between image file size and document legibility. Default is 80 */ this.storageImageQuality = 80; /** Optional image format, either 'JPG' or 'PNG'. The recommended default value is 'JPG'. Please note that 'PNG' will result in larger image files! Also, the storageImageQuality value does not apply for 'PNG'. Default is JPG */ this.storageImageFormat = 'JPG'; /** Optional file encryption mode, 'AES128' or 'AES256'. */ this.fileEncryptionMode = null; /** Optional file encryption password. Refer to the section "Storage Encryption" for more details. */ this.fileEncryptionPassword = null; /** If set to `true`, PerformanceHintApi is enabled, which lead to increase of performance due of increased use of top CPU cores (Android only), also increase battery usage. Default is true */ this.performanceHintApi = true; /** If set to `true`, GPU Acceleration will be enabled for Barcode Scanner, Document Scanner and Generic Document Recognizer (Android only). Default is true */ this.allowGpuAcceleration = true; /** Enables/disables XNNPACK acceleration for TensorFlow ML models, which provides highly optimized implementations of floating-point neural network operators (Android only). Default is true */ this.allowXnnpackAcceleration = true; if (source.licenseKey !== undefined) { this.licenseKey = source.licenseKey; } else { throw new Error('licenseKey must be present in constructor argument'); } if (source.loggingEnabled !== undefined) { this.loggingEnabled = source.loggingEnabled; } if (source.enableNativeLogging !== undefined) { this.enableNativeLogging = source.enableNativeLogging; } if (source.storageBaseDirectory !== undefined) { this.storageBaseDirectory = source.storageBaseDirectory != null ? source.storageBaseDirectory : null; } if (source.storageImageQuality !== undefined) { this.storageImageQuality = source.storageImageQuality; } if (source.storageImageFormat !== undefined) { this.storageImageFormat = source.storageImageFormat; } if (source.fileEncryptionMode !== undefined) { this.fileEncryptionMode = source.fileEncryptionMode != null ? FileEncryptionModeValues.includes(source.fileEncryptionMode) ? source.fileEncryptionMode : null : null; } if (source.fileEncryptionPassword !== undefined) { this.fileEncryptionPassword = source.fileEncryptionPassword != null ? source.fileEncryptionPassword : null; } if (source.performanceHintApi !== undefined) { this.performanceHintApi = source.performanceHintApi; } if (source.allowGpuAcceleration !== undefined) { this.allowGpuAcceleration = source.allowGpuAcceleration; } if (source.allowXnnpackAcceleration !== undefined) { this.allowXnnpackAcceleration = source.allowXnnpackAcceleration; } } } /** @hidden */ export const StorageImageFormatValues = ['JPG', 'PNG']; /** @hidden */ export const FileEncryptionModeValues = ['AES128', 'AES256']; //# sourceMappingURL=SdkConfiguration.js.map