expo-ocr-kit 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -78,11 +78,9 @@ npx expo run:android
78
78
  npx expo run:ios
79
79
  ```
80
80
 
81
- ## Camera support
81
+ `expo-ocr-kit` does not provide camera capture. The OCR API is image-based, so your app should capture or pick an image first, then pass that image to OCR.
82
82
 
83
- The OCR API is image-based. Camera capture should stay in your app layer or use a helper package such as `expo-image-picker`.
84
-
85
- If your Expo app captures images with the camera, add the bundled config plugin:
83
+ If your Expo app already uses the camera and you want this package to add the native camera permission entries during prebuild, you can use the bundled config plugin:
86
84
 
87
85
  ```json
88
86
  {
@@ -99,7 +97,7 @@ If your Expo app captures images with the camera, add the bundled config plugin:
99
97
  }
100
98
  ```
101
99
 
102
- The plugin adds:
100
+ The config plugin adds:
103
101
 
104
102
  - iOS: `NSCameraUsageDescription`
105
103
  - Android: `android.permission.CAMERA`
@@ -3,6 +3,9 @@ import { ExpoOcrKitModuleEvents, OcrResult } from './ExpoOcrKit.types';
3
3
  declare class ExpoOcrKitModule extends NativeModule<ExpoOcrKitModuleEvents> {
4
4
  recognizeText(uri: string): Promise<OcrResult>;
5
5
  }
6
- declare const _default: ExpoOcrKitModule;
6
+ declare class UnavailableExpoOcrKitModule extends NativeModule<ExpoOcrKitModuleEvents> {
7
+ recognizeText(): Promise<OcrResult>;
8
+ }
9
+ declare const _default: ExpoOcrKitModule | UnavailableExpoOcrKitModule;
7
10
  export default _default;
8
11
  //# sourceMappingURL=ExpoOcrKitModule.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoOcrKitModule.d.ts","sourceRoot":"","sources":["../src/ExpoOcrKitModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;AAEzD,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEvE,OAAO,OAAO,gBAAiB,SAAQ,YAAY,CAAC,sBAAsB,CAAC;IACzE,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;CAC/C;;AAGD,wBAAmE"}
1
+ {"version":3,"file":"ExpoOcrKitModule.d.ts","sourceRoot":"","sources":["../src/ExpoOcrKitModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA+B,MAAM,MAAM,CAAC;AAEjE,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEvE,OAAO,OAAO,gBAAiB,SAAQ,YAAY,CAAC,sBAAsB,CAAC;IACzE,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;CAC/C;AAID,cAAM,2BAA4B,SAAQ,YAAY,CAAC,sBAAsB,CAAC;IAC5E,aAAa,IAAI,OAAO,CAAC,SAAS,CAAC;CAKpC;;AAED,wBAAiE"}
@@ -1,4 +1,9 @@
1
- import { requireNativeModule } from 'expo';
2
- // This call loads the native module object from the JSI.
3
- export default requireNativeModule('ExpoOcrKit');
1
+ import { NativeModule, requireOptionalNativeModule } from 'expo';
2
+ const nativeModule = requireOptionalNativeModule('ExpoOcrKit');
3
+ class UnavailableExpoOcrKitModule extends NativeModule {
4
+ recognizeText() {
5
+ throw new Error("Native module 'ExpoOcrKit' is not available. Rebuild your app after installing expo-ocr-kit, and use a development build or bare React Native instead of Expo Go.");
6
+ }
7
+ }
8
+ export default nativeModule ?? new UnavailableExpoOcrKitModule();
4
9
  //# sourceMappingURL=ExpoOcrKitModule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoOcrKitModule.js","sourceRoot":"","sources":["../src/ExpoOcrKitModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAQzD,yDAAyD;AACzD,eAAe,mBAAmB,CAAmB,YAAY,CAAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from 'expo';\n\nimport { ExpoOcrKitModuleEvents, OcrResult } from './ExpoOcrKit.types';\n\ndeclare class ExpoOcrKitModule extends NativeModule<ExpoOcrKitModuleEvents> {\n recognizeText(uri: string): Promise<OcrResult>;\n}\n\n// This call loads the native module object from the JSI.\nexport default requireNativeModule<ExpoOcrKitModule>('ExpoOcrKit');\n"]}
1
+ {"version":3,"file":"ExpoOcrKitModule.js","sourceRoot":"","sources":["../src/ExpoOcrKitModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,2BAA2B,EAAE,MAAM,MAAM,CAAC;AAQjE,MAAM,YAAY,GAAG,2BAA2B,CAAmB,YAAY,CAAC,CAAC;AAEjF,MAAM,2BAA4B,SAAQ,YAAoC;IAC5E,aAAa;QACX,MAAM,IAAI,KAAK,CACb,mKAAmK,CACpK,CAAC;IACJ,CAAC;CACF;AAED,eAAe,YAAY,IAAI,IAAI,2BAA2B,EAAE,CAAC","sourcesContent":["import { NativeModule, requireOptionalNativeModule } from 'expo';\n\nimport { ExpoOcrKitModuleEvents, OcrResult } from './ExpoOcrKit.types';\n\ndeclare class ExpoOcrKitModule extends NativeModule<ExpoOcrKitModuleEvents> {\n recognizeText(uri: string): Promise<OcrResult>;\n}\n\nconst nativeModule = requireOptionalNativeModule<ExpoOcrKitModule>('ExpoOcrKit');\n\nclass UnavailableExpoOcrKitModule extends NativeModule<ExpoOcrKitModuleEvents> {\n recognizeText(): Promise<OcrResult> {\n throw new Error(\n \"Native module 'ExpoOcrKit' is not available. Rebuild your app after installing expo-ocr-kit, and use a development build or bare React Native instead of Expo Go.\"\n );\n }\n}\n\nexport default nativeModule ?? new UnavailableExpoOcrKitModule();\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-ocr-kit",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "On-device OCR module for Expo and React Native using ML Kit (Android) and Vision (iOS)",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",