/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten. /// Generated from xplatforms/schemas/document_scanner/SdkConfiguration.yaml import { DeepPartial } from '../core/utils/utils'; /** Initialize configuration for the Scanbot SDK. */ export class SdkConfiguration { /** Your license key for the Scanbot SDK. See the "License Key" section below. */ public licenseKey: string; /** Optional boolean flag to enable logging. See the "Logging" section below. Default is false */ public loggingEnabled: boolean = false; /** Optional boolean flag that enables Scanbot SDK Core native logging (default is false, Android only). Default is false */ public enableNativeLogging: boolean = 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. */ public storageBaseDirectory: string | null = 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 */ public storageImageQuality: number = 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 */ public storageImageFormat: StorageImageFormat = 'JPG'; /** Optional file encryption mode, 'AES128' or 'AES256'. */ public fileEncryptionMode: FileEncryptionMode | null = null; /** Optional file encryption password. Refer to the section "Storage Encryption" for more details. */ public fileEncryptionPassword: string | null = 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 */ public performanceHintApi: boolean = true; /** If set to `true`, GPU Acceleration will be enabled for Barcode Scanner, Document Scanner and Generic Document Recognizer (Android only). Default is true */ public allowGpuAcceleration: boolean = 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 */ public allowXnnpackAcceleration: boolean = true; /** @param source {@displayType `DeepPartial`} */ public constructor(source: DeepPartial = {}) { 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; } } } /** Image format for storing images. - `JPG`: JPG image format. - `PNG`: PNG image format. */ export type StorageImageFormat = /** JPG image format. */ | 'JPG' /** PNG image format. */ | 'PNG'; /** @hidden */ export const StorageImageFormatValues: ReadonlyArray = ['JPG', 'PNG'] as const; /** File encryption mode. - `AES128`: AES 128-bit encryption. - `AES256`: AES 256-bit encryption. */ export type FileEncryptionMode = /** AES 128-bit encryption. */ | 'AES128' /** AES 256-bit encryption. */ | 'AES256'; /** @hidden */ export const FileEncryptionModeValues: ReadonlyArray = [ 'AES128', 'AES256', ] as const;