import { CheckScannerConfiguration, CheckScannerScreenConfiguration, CheckScannerUiResult, CheckScanningResult, handleImageInput, ImageInput, mapRTUUIResult, ResultWrapper, withSBErrorHandling, } from '../types'; import { isIOS, ScanbotSDKNativeModule, ScanbotSDKUINativeModule } from './ScanbotSDKModule'; /** * @internal * @hidden */ export const ScanbotCheckImpl = { async scanFromImage(params: { image: ImageInput; configuration: CheckScannerConfiguration; }): Promise { return withSBErrorHandling( async () => new CheckScanningResult( await ScanbotSDKNativeModule.scanCheckFromImage({ configuration: params.configuration, image: handleImageInput(params.image), }) ) ); }, async startScanner( configuration: CheckScannerScreenConfiguration ): Promise> { return withSBErrorHandling(async () => mapRTUUIResult( await ScanbotSDKUINativeModule.startCheckScanner( isIOS ? JSON.stringify(configuration) : configuration ), CheckScannerUiResult ) ); }, };