capacitor-plugin-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK for Capacitor
36 lines • 1.29 kB
JavaScript
import { AnalyticsEvent, LicenseInfo, OcrConfigsResult, withSBErrorHandling } from '../types';
import { ScanbotSDKPlugin } from './Definitions';
/**
* @internal
* @hidden
*/
export const ScanbotSdkImpl = {
async initialize(config) {
return withSBErrorHandling(async () => new LicenseInfo(await ScanbotSDKPlugin.initialize(config)));
},
async getLicenseInfo() {
return withSBErrorHandling(async () => new LicenseInfo(await ScanbotSDKPlugin.getLicenseInfo()));
},
async getOcrConfigs() {
return withSBErrorHandling(async () => new OcrConfigsResult(await ScanbotSDKPlugin.getOcrConfigs()));
},
async cleanupStorage() {
return withSBErrorHandling(ScanbotSDKPlugin.cleanupStorage);
},
async setAnalyticsSubscriber(subscriber) {
if (subscriber) {
return ScanbotSDKPlugin.setAnalyticsServiceCallback({}, (event) => {
if (event) {
subscriber(new AnalyticsEvent(event));
}
});
}
else {
return ScanbotSDKPlugin.removeAnalyticsServiceCallback();
}
},
async mockCamera(params) {
return withSBErrorHandling(() => ScanbotSDKPlugin.mockCamera(params));
},
};
//# sourceMappingURL=SdkImpl.js.map