@masumdev/rn-camera-ai-mlkit 0.0.0-stage → 0.1.1

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.
Files changed (71) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +250 -2
  3. package/lib/commonjs/detector/MLKitTextRecognizer.js +387 -0
  4. package/lib/commonjs/detector/MLKitTextRecognizer.js.map +1 -0
  5. package/lib/commonjs/detector/index.js +17 -0
  6. package/lib/commonjs/detector/index.js.map +1 -0
  7. package/lib/commonjs/index.js +39 -0
  8. package/lib/commonjs/index.js.map +1 -0
  9. package/lib/commonjs/package.json +1 -0
  10. package/lib/commonjs/parser/documentFraming.js +279 -0
  11. package/lib/commonjs/parser/documentFraming.js.map +1 -0
  12. package/lib/commonjs/parser/index.js +28 -0
  13. package/lib/commonjs/parser/index.js.map +1 -0
  14. package/lib/commonjs/parser/mlkitTextParser.js +287 -0
  15. package/lib/commonjs/parser/mlkitTextParser.js.map +1 -0
  16. package/lib/commonjs/types/index.js +17 -0
  17. package/lib/commonjs/types/index.js.map +1 -0
  18. package/lib/commonjs/types/mlkit.js +6 -0
  19. package/lib/commonjs/types/mlkit.js.map +1 -0
  20. package/lib/module/detector/MLKitTextRecognizer.js +380 -0
  21. package/lib/module/detector/MLKitTextRecognizer.js.map +1 -0
  22. package/lib/module/detector/index.js +4 -0
  23. package/lib/module/detector/index.js.map +1 -0
  24. package/lib/module/index.js +6 -0
  25. package/lib/module/index.js.map +1 -0
  26. package/lib/module/package.json +1 -0
  27. package/lib/module/parser/documentFraming.js +272 -0
  28. package/lib/module/parser/documentFraming.js.map +1 -0
  29. package/lib/module/parser/index.js +5 -0
  30. package/lib/module/parser/index.js.map +1 -0
  31. package/lib/module/parser/mlkitTextParser.js +281 -0
  32. package/lib/module/parser/mlkitTextParser.js.map +1 -0
  33. package/lib/module/types/index.js +4 -0
  34. package/lib/module/types/index.js.map +1 -0
  35. package/lib/module/types/mlkit.js +4 -0
  36. package/lib/module/types/mlkit.js.map +1 -0
  37. package/lib/typescript/commonjs/detector/MLKitTextRecognizer.d.ts +59 -0
  38. package/lib/typescript/commonjs/detector/MLKitTextRecognizer.d.ts.map +1 -0
  39. package/lib/typescript/commonjs/detector/index.d.ts +2 -0
  40. package/lib/typescript/commonjs/detector/index.d.ts.map +1 -0
  41. package/lib/typescript/commonjs/index.d.ts +4 -0
  42. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  43. package/lib/typescript/commonjs/package.json +1 -0
  44. package/lib/typescript/commonjs/parser/documentFraming.d.ts +66 -0
  45. package/lib/typescript/commonjs/parser/documentFraming.d.ts.map +1 -0
  46. package/lib/typescript/commonjs/parser/index.d.ts +3 -0
  47. package/lib/typescript/commonjs/parser/index.d.ts.map +1 -0
  48. package/lib/typescript/commonjs/parser/mlkitTextParser.d.ts +18 -0
  49. package/lib/typescript/commonjs/parser/mlkitTextParser.d.ts.map +1 -0
  50. package/lib/typescript/commonjs/types/index.d.ts +2 -0
  51. package/lib/typescript/commonjs/types/index.d.ts.map +1 -0
  52. package/lib/typescript/commonjs/types/mlkit.d.ts +241 -0
  53. package/lib/typescript/commonjs/types/mlkit.d.ts.map +1 -0
  54. package/lib/typescript/module/detector/MLKitTextRecognizer.d.ts +59 -0
  55. package/lib/typescript/module/detector/MLKitTextRecognizer.d.ts.map +1 -0
  56. package/lib/typescript/module/detector/index.d.ts +2 -0
  57. package/lib/typescript/module/detector/index.d.ts.map +1 -0
  58. package/lib/typescript/module/index.d.ts +4 -0
  59. package/lib/typescript/module/index.d.ts.map +1 -0
  60. package/lib/typescript/module/package.json +1 -0
  61. package/lib/typescript/module/parser/documentFraming.d.ts +66 -0
  62. package/lib/typescript/module/parser/documentFraming.d.ts.map +1 -0
  63. package/lib/typescript/module/parser/index.d.ts +3 -0
  64. package/lib/typescript/module/parser/index.d.ts.map +1 -0
  65. package/lib/typescript/module/parser/mlkitTextParser.d.ts +18 -0
  66. package/lib/typescript/module/parser/mlkitTextParser.d.ts.map +1 -0
  67. package/lib/typescript/module/types/index.d.ts +2 -0
  68. package/lib/typescript/module/types/index.d.ts.map +1 -0
  69. package/lib/typescript/module/types/mlkit.d.ts +241 -0
  70. package/lib/typescript/module/types/mlkit.d.ts.map +1 -0
  71. package/package.json +110 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mlkitTextParser.d.ts","sourceRoot":"","sources":["../../../../src/parser/mlkitTextParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EAIvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAGV,0BAA0B,EAE1B,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,mBAAgB,CAAC;AAoBxB;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CA8GpE;AAmED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,0BAA0B,GAAG,IAAI,GAAG,SAAS,EACxD,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,qBAA0B,GAClC,eAAe,EAAE,CAsKnB;AAeD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,qBAAqB,CA6ChF"}
@@ -0,0 +1,2 @@
1
+ export * from './mlkit.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAS,CAAC"}
@@ -0,0 +1,241 @@
1
+ import type { CameraPixelFormatPreference, CameraProcessor, DetectionResult, FrameOrientation, OcrEntityCategory, OcrGranularity } from '@masumdev/rn-camera-ai';
2
+ /**
3
+ * Supported on-device Google ML Kit text recognition scripts.
4
+ */
5
+ export type TextRecognitionLanguage = 'LATIN' | 'CHINESE' | 'DEVANAGARI' | 'JAPANESE' | 'KOREAN';
6
+ /**
7
+ * Filter restricting emitted OCR detections to a specific semantic entity class.
8
+ */
9
+ export type OcrEntityFilter = 'all' | OcrEntityCategory;
10
+ /**
11
+ * Region of interest crop specification matching react-native-vision-camera-mlkit.
12
+ */
13
+ export interface MLKitRegionOfInterest {
14
+ x: number;
15
+ y: number;
16
+ width: number;
17
+ height: number;
18
+ unit?: 'percentage' | 'pixel';
19
+ }
20
+ /**
21
+ * Raw bounding box returned by ML Kit Nitro TextRecognizer.
22
+ * Note: bounds.left / bounds.top represent top-left pixel coordinates, while
23
+ * bounds.x / bounds.y represent center coordinates in MLKitTextAdapter.
24
+ */
25
+ export interface MLKitBoundingBox {
26
+ x: number;
27
+ y: number;
28
+ centerX?: number;
29
+ centerY?: number;
30
+ width: number;
31
+ height: number;
32
+ top?: number;
33
+ left?: number;
34
+ bottom?: number;
35
+ right?: number;
36
+ }
37
+ /**
38
+ * 2D pixel corner point emitted by ML Kit OCR elements and lines.
39
+ */
40
+ export interface MLKitCorner {
41
+ x: number;
42
+ y: number;
43
+ }
44
+ /**
45
+ * Character symbol prediction emitted by Google ML Kit on Android.
46
+ */
47
+ export interface MLKitTextSymbol {
48
+ text: string;
49
+ bounds?: MLKitBoundingBox | null;
50
+ corners?: MLKitCorner[] | null;
51
+ confidence?: number | null;
52
+ angle?: number | null;
53
+ languages?: string[];
54
+ }
55
+ /**
56
+ * Word/token element emitted by Google ML Kit text recognition.
57
+ */
58
+ export interface MLKitTextElement {
59
+ text: string;
60
+ bounds?: MLKitBoundingBox | null;
61
+ corners?: MLKitCorner[] | null;
62
+ confidence?: number | null;
63
+ angle?: number | null;
64
+ languages?: string[];
65
+ symbols?: MLKitTextSymbol[];
66
+ }
67
+ /**
68
+ * Single text line emitted by Google ML Kit text recognition.
69
+ */
70
+ export interface MLKitTextLine {
71
+ text: string;
72
+ bounds?: MLKitBoundingBox | null;
73
+ corners?: MLKitCorner[] | null;
74
+ confidence?: number | null;
75
+ angle?: number | null;
76
+ languages?: string[];
77
+ elements?: MLKitTextElement[];
78
+ }
79
+ /**
80
+ * Paragraph or block emitted by Google ML Kit text recognition.
81
+ */
82
+ export interface MLKitTextBlock {
83
+ text: string;
84
+ bounds?: MLKitBoundingBox | null;
85
+ corners?: MLKitCorner[] | null;
86
+ languages?: string[];
87
+ lines?: MLKitTextLine[];
88
+ }
89
+ /**
90
+ * Root result returned by native ML Kit TextRecognizer.recognize(frame).
91
+ */
92
+ export interface MLKitTextRecognitionResult {
93
+ text: string | null | undefined;
94
+ blocks: MLKitTextBlock[];
95
+ }
96
+ /**
97
+ * Native options forwarded to VisionCameraMLKit.createTextRecognizer.
98
+ */
99
+ export interface MLKitNativeRecognizerOptions {
100
+ language?: TextRecognitionLanguage;
101
+ scaleFactor?: number;
102
+ invertColors?: boolean;
103
+ frameProcessInterval?: number;
104
+ roi?: MLKitRegionOfInterest;
105
+ orientation?: FrameOrientation;
106
+ }
107
+ /**
108
+ * Structural Nitro HybridObject interface compatible with react-native-vision-camera-mlkit TextRecognizer.
109
+ */
110
+ export interface MLKitTextRecognizerNative {
111
+ recognize(frame: unknown, args?: {
112
+ orientation?: FrameOrientation;
113
+ }): MLKitTextRecognitionResult;
114
+ recognizeImage?(uri: string): Promise<MLKitTextRecognitionResult>;
115
+ dispose?(): void;
116
+ }
117
+ /**
118
+ * Native module shape resolved at runtime from react-native-vision-camera-mlkit.
119
+ */
120
+ export interface MLKitNativeModuleLike {
121
+ VisionCameraMLKit?: {
122
+ isFeatureAvailable?: (feature: string) => boolean;
123
+ createTextRecognizer?: (options: MLKitNativeRecognizerOptions) => MLKitTextRecognizerNative;
124
+ };
125
+ PluginFactory?: {
126
+ initPlugin?: (feature: string, options: MLKitNativeRecognizerOptions) => MLKitTextRecognizerNative;
127
+ isFeatureAvailable?: (feature: string) => boolean;
128
+ };
129
+ isFeatureAvailable?: (feature: string) => boolean;
130
+ processImageTextRecognition?: (uri: string, options?: MLKitNativeRecognizerOptions & {
131
+ language?: TextRecognitionLanguage;
132
+ }) => Promise<MLKitTextRecognitionResult>;
133
+ }
134
+ /**
135
+ * Options controlling worklet normalization and entity filtering of raw ML Kit OCR results.
136
+ */
137
+ export interface ParseMLKitTextOptions {
138
+ /** Hierarchy granularity for emitted DetectionResult bounding boxes (default: 'line') */
139
+ granularity?: OcrGranularity;
140
+ /** Semantic entity filter ('all', 'nik', 'email', 'phone', 'url', 'currency', 'number') */
141
+ entityFilter?: OcrEntityFilter;
142
+ /** Minimum trimmed character count required per item (default: 1) */
143
+ minTextLength?: number;
144
+ /** Minimum recognition confidence in [0, 1] when reported by Android ML Kit (default: 0) */
145
+ minConfidence?: number;
146
+ /** Maximum number of detections to emit per frame (default: 30) */
147
+ maxResults?: number;
148
+ /** Fallback default confidence when platform (e.g. iOS Vision) omits per-line confidence (default: 0.92) */
149
+ defaultConfidence?: number;
150
+ }
151
+ /**
152
+ * Deduplicated structured entities extracted from recognized OCR transcript text.
153
+ */
154
+ export interface StructuredOcrEntities {
155
+ niks: string[];
156
+ emails: string[];
157
+ phones: string[];
158
+ urls: string[];
159
+ currencies: string[];
160
+ }
161
+ /**
162
+ * Combined static/live OCR document result with normalized detections and structured entities.
163
+ */
164
+ export interface MLKitOcrDocumentResult {
165
+ fullText: string;
166
+ detections: DetectionResult[];
167
+ entities: StructuredOcrEntities;
168
+ rawResult: MLKitTextRecognitionResult;
169
+ }
170
+ /**
171
+ * Configuration options for initializing createMLKitTextRecognizer.
172
+ */
173
+ export interface MLKitTextRecognizerConfig {
174
+ /** Text recognition script model (default: 'LATIN') */
175
+ language?: TextRecognitionLanguage;
176
+ /** Hierarchy level emitted as overlay bounding boxes: 'block' | 'line' | 'element' (default: 'line') */
177
+ granularity?: OcrGranularity;
178
+ /** Semantic entity filter (default: 'all') */
179
+ entityFilter?: OcrEntityFilter;
180
+ /** Optional downscale factor in [0.9, 1.0] before OCR processing (default: 1.0) */
181
+ scaleFactor?: number;
182
+ /** Invert image colors for light text on dark backgrounds (default: false) */
183
+ invertColors?: boolean;
184
+ /** Optional Region of Interest crop before running OCR */
185
+ roi?: MLKitRegionOfInterest;
186
+ /** Target OCR execution rate in FPS (default: 10) */
187
+ targetFps?: number;
188
+ /** Minimum trimmed character length per recognized segment (default: 1) */
189
+ minTextLength?: number;
190
+ /** Minimum confidence score in [0, 1] (default: 0) */
191
+ minConfidence?: number;
192
+ /** Maximum number of OCR boxes returned per frame (default: 30) */
193
+ maxResults?: number;
194
+ /** Preferred camera pixel format: 'yuv' (zero-copy ML Kit fast path on Android) or 'rgb' (default: 'yuv') */
195
+ preferredPixelFormat?: CameraPixelFormatPreference;
196
+ /** Optional dependency injection override returning an initialized native ML Kit recognizer */
197
+ createRecognizer?: (options: MLKitNativeRecognizerOptions) => MLKitTextRecognizerNative | Promise<MLKitTextRecognizerNative>;
198
+ }
199
+ /**
200
+ * Configuration options for one-shot recognizeTextFromUri static photo OCR.
201
+ */
202
+ export interface RecognizeTextFromUriOptions extends ParseMLKitTextOptions {
203
+ language?: TextRecognitionLanguage;
204
+ scaleFactor?: number;
205
+ invertColors?: boolean;
206
+ roi?: MLKitRegionOfInterest;
207
+ orientation?: FrameOrientation;
208
+ /** Known pixel width of the static image for normalized [0..1] box coordinates */
209
+ imageWidth?: number;
210
+ /** Known pixel height of the static image for normalized [0..1] box coordinates */
211
+ imageHeight?: number;
212
+ /** Optional DI override for testing static OCR */
213
+ processImage?: (uri: string, options?: MLKitNativeRecognizerOptions) => Promise<MLKitTextRecognitionResult>;
214
+ }
215
+ /**
216
+ * Worklet-capable Google ML Kit OCR CameraProcessor returned by createMLKitTextRecognizer.
217
+ */
218
+ export interface MLKitTextRecognizer extends CameraProcessor {
219
+ readonly language: TextRecognitionLanguage;
220
+ readonly granularity: OcrGranularity;
221
+ readonly entityFilter: OcrEntityFilter;
222
+ readonly invertColors: boolean;
223
+ readonly minConfidence: number;
224
+ /** Dynamically switch OCR box granularity ('block' | 'line' | 'element') at runtime */
225
+ setGranularity(granularity: OcrGranularity): void;
226
+ /** Dynamically switch semantic entity filter ('all' | 'nik' | 'email' | 'phone' | 'url' | 'currency' | 'number') */
227
+ setEntityFilter(filter: OcrEntityFilter): void;
228
+ /** Dynamically update color inversion for dark-background text */
229
+ setInvertColors(invert: boolean): Promise<void> | void;
230
+ /** Dynamically update minimum confidence cutoff [0, 1] */
231
+ setMinConfidence(confidence: number): void;
232
+ /** Dynamically update maximum emitted boxes per frame */
233
+ setMaxResults(maxResults: number): void;
234
+ /** Returns the full multi-line transcript recognized in the most recent active frame */
235
+ getLastFullText(): string;
236
+ /** Returns deduplicated structured entities extracted from the most recent frame */
237
+ getLastStructuredEntities(): StructuredOcrEntities;
238
+ /** Runs Google ML Kit text recognition on a static photo URI or local file path */
239
+ recognizeImage(uri: string, options?: Pick<RecognizeTextFromUriOptions, 'imageWidth' | 'imageHeight'>): Promise<MLKitOcrDocumentResult>;
240
+ }
241
+ //# sourceMappingURL=mlkit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mlkit.d.ts","sourceRoot":"","sources":["../../../../src/types/mlkit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACf,MAAM,wBAAwB,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAC/B,OAAO,GACP,SAAS,GACT,YAAY,GACZ,UAAU,GACV,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,iBAAiB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC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,EAAE,CACb,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,4BAA4B,KACnC,OAAO,CAAC,0BAA0B,CAAC,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,eAAe;IAC1D,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,CAAC;IAC3C,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;IACrC,QAAQ,CAAC,YAAY,EAAE,eAAe,CAAC;IACvC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,uFAAuF;IACvF,cAAc,CAAC,WAAW,EAAE,cAAc,GAAG,IAAI,CAAC;IAClD,oHAAoH;IACpH,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;IAC/C,kEAAkE;IAClE,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACvD,0DAA0D;IAC1D,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,yDAAyD;IACzD,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,wFAAwF;IACxF,eAAe,IAAI,MAAM,CAAC;IAC1B,oFAAoF;IACpF,yBAAyB,IAAI,qBAAqB,CAAC;IACnD,mFAAmF;IACnF,cAAc,CACZ,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,IAAI,CAAC,2BAA2B,EAAE,YAAY,GAAG,aAAa,CAAC,GACxE,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACpC"}
package/package.json CHANGED
@@ -1,6 +1,112 @@
1
1
  {
2
2
  "name": "@masumdev/rn-camera-ai-mlkit",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "Google ML Kit on-device OCR & Vision adapter for @masumdev/rn-camera-ai using react-native-vision-camera-mlkit.",
5
+ "main": "lib/commonjs/index.js",
6
+ "module": "lib/module/index.js",
7
+ "types": "lib/typescript/module/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": {
11
+ "types": "./lib/typescript/module/index.d.ts",
12
+ "default": "./lib/module/index.js"
13
+ },
14
+ "require": {
15
+ "types": "./lib/typescript/commonjs/index.d.ts",
16
+ "default": "./lib/commonjs/index.js"
17
+ }
18
+ }
19
+ },
20
+ "files": [
21
+ "lib",
22
+ "README.md",
23
+ "LICENSE"
24
+ ],
25
+ "scripts": {
26
+ "build": "bob build",
27
+ "clean": "rm -rf lib",
28
+ "prepublishOnly": "bun run build",
29
+ "test": "bun test",
30
+ "test:coverage": "bun test --coverage"
31
+ },
32
+ "keywords": [
33
+ "react-native",
34
+ "expo",
35
+ "mlkit",
36
+ "google-ml-kit",
37
+ "ocr",
38
+ "text-recognition",
39
+ "vision-camera",
40
+ "ai"
41
+ ],
42
+ "author": "Ma'sum",
43
+ "license": "MIT",
44
+ "homepage": "https://lib.masumdev.id/rn-camera-ai/mlkit-ocr/",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/masumrpg/nodejs-lib.git",
48
+ "directory": "packages/rn-camera-ai-mlkit"
49
+ },
50
+ "bugs": {
51
+ "url": "https://github.com/masumrpg/nodejs-lib/issues"
52
+ },
53
+ "devDependencies": {
54
+ "@babel/core": "^7.25.0",
55
+ "@babel/preset-env": "^7.25.0",
56
+ "@masumdev/rn-camera-ai": "workspace:*",
57
+ "@react-native/babel-preset": "^0.86.0",
58
+ "@types/react": "~19.3.0",
59
+ "react-native-builder-bob": "^0.43.0",
60
+ "react-native-nitro-modules": "^0.37.0",
61
+ "react-native-vision-camera": "5.2.4",
62
+ "react-native-worklets": "0.13.0",
63
+ "typescript": "^5.0.0"
64
+ },
65
+ "peerDependencies": {
66
+ "@masumdev/rn-camera-ai": ">=0.4.0",
67
+ "react": ">=18",
68
+ "react-native": "*",
69
+ "react-native-nitro-modules": ">=0.37.0",
70
+ "react-native-vision-camera": ">=5.0.0",
71
+ "react-native-vision-camera-mlkit": ">=2.0.0",
72
+ "react-native-worklets": "*"
73
+ },
74
+ "peerDependenciesMeta": {
75
+ "react-native-nitro-modules": {
76
+ "optional": true
77
+ },
78
+ "react-native-vision-camera": {
79
+ "optional": true
80
+ },
81
+ "react-native-worklets": {
82
+ "optional": true
83
+ }
84
+ },
85
+ "publishConfig": {
86
+ "access": "public"
87
+ },
88
+ "react-native-builder-bob": {
89
+ "source": "src",
90
+ "output": "lib",
91
+ "targets": [
92
+ [
93
+ "commonjs",
94
+ {
95
+ "esm": true
96
+ }
97
+ ],
98
+ [
99
+ "module",
100
+ {
101
+ "esm": true
102
+ }
103
+ ],
104
+ [
105
+ "typescript",
106
+ {
107
+ "project": "tsconfig.json"
108
+ }
109
+ ]
110
+ ]
111
+ }
112
+ }