UNPKG

react-native-scanbot-barcode-scanner-sdk

Version:

Scanbot Barcode Scanner SDK React Native Plugin for Android and iOS

29 lines (24 loc) 882 B
import { LicenseInfo, SdkConfiguration, withSBErrorHandling } from '../types'; import { ScanbotBarcodeSDKModule } from './scanbotBarcodeSDKModule'; /** * @internal * @hidden */ export const ScanbotBarcodeSdkImpl = { initialize(config: SdkConfiguration): Promise<LicenseInfo> { return withSBErrorHandling( async () => new LicenseInfo(await ScanbotBarcodeSDKModule.initialize(config)) ); }, getLicenseInfo(): Promise<LicenseInfo> { return withSBErrorHandling( async () => new LicenseInfo(await ScanbotBarcodeSDKModule.getLicenseInfo()) ); }, cleanupStorage() { return withSBErrorHandling(ScanbotBarcodeSDKModule.cleanupStorage) as Promise<void>; }, mockCamera(params: { imageFileUri: string; refreshOnEachFrame?: boolean }): Promise<void> { return withSBErrorHandling(() => ScanbotBarcodeSDKModule.mockCamera(params)); }, };