UNPKG

react-native-vision-camera-ocr-plus

Version:

React Native Vision Camera plugin for on-device text recognition (OCR) and translation using ML Kit. Maintained fork of react-native-vision-camera-text-recognition

25 lines (24 loc) 649 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PhotoRecognizer = PhotoRecognizer; var _reactNative = require("react-native"); async function PhotoRecognizer(options) { const { PhotoRecognizerModule } = _reactNative.NativeModules; const { uri, orientation } = options; if (!uri) { throw Error("Can't resolve img uri"); } if (_reactNative.Platform.OS === 'ios') { return await PhotoRecognizerModule.process(uri.replace('file://', ''), orientation || 'portrait'); } else { return await PhotoRecognizerModule.process(uri); } } //# sourceMappingURL=PhotoRecognizer.js.map