import { handleImageInput, ImageInput, OcrConfiguration, PerformOcrResult, withSBErrorHandling, } from '../types'; import { ScanbotSDKNativeModule } from './ScanbotSDKModule'; /** * @internal * @hidden */ export const ScanbotOcrEngineImpl = { async recognizeOnImages(params: { images: ImageInput[]; configuration?: OcrConfiguration; }): Promise { return withSBErrorHandling( async () => new PerformOcrResult( await ScanbotSDKNativeModule.recognizeOcrOnImages({ configuration: params.configuration, images: handleImageInput(params.images), }) ) ); }, async recognizeOnDocument(params: { documentUuid: string; configuration?: OcrConfiguration; }): Promise { return withSBErrorHandling( async () => new PerformOcrResult(await ScanbotSDKNativeModule.recognizeOcrOnDocument(params)) ); }, };