@trustchex/react-native-sdk 1.374.0 → 1.381.0

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 (35) hide show
  1. package/android/src/main/java/com/trustchex/reactnativesdk/camera/TrustchexCameraView.kt +0 -9
  2. package/android/src/main/java/com/trustchex/reactnativesdk/opencv/OpenCVModule.kt +636 -301
  3. package/ios/Camera/TrustchexCameraView.swift +8 -8
  4. package/ios/OpenCV/OpenCVHelper.h +0 -7
  5. package/ios/OpenCV/OpenCVHelper.mm +0 -60
  6. package/ios/OpenCV/OpenCVModule.h +0 -4
  7. package/ios/OpenCV/OpenCVModule.mm +440 -358
  8. package/lib/module/Shared/Components/DebugOverlay.js +541 -0
  9. package/lib/module/Shared/Components/IdentityDocumentCamera.constants.js +44 -0
  10. package/lib/module/Shared/Components/IdentityDocumentCamera.flows.js +270 -0
  11. package/lib/module/Shared/Components/IdentityDocumentCamera.js +679 -1701
  12. package/lib/module/Shared/Components/IdentityDocumentCamera.types.js +3 -0
  13. package/lib/module/Shared/Components/IdentityDocumentCamera.utils.js +273 -0
  14. package/lib/module/version.js +1 -1
  15. package/lib/typescript/src/Shared/Components/DebugOverlay.d.ts +30 -0
  16. package/lib/typescript/src/Shared/Components/DebugOverlay.d.ts.map +1 -0
  17. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.constants.d.ts +35 -0
  18. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.constants.d.ts.map +1 -0
  19. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts +3 -56
  20. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts.map +1 -1
  21. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.flows.d.ts +88 -0
  22. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.flows.d.ts.map +1 -0
  23. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.types.d.ts +116 -0
  24. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.types.d.ts.map +1 -0
  25. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.utils.d.ts +93 -0
  26. package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.utils.d.ts.map +1 -0
  27. package/lib/typescript/src/version.d.ts +1 -1
  28. package/package.json +1 -1
  29. package/src/Shared/Components/DebugOverlay.tsx +656 -0
  30. package/src/Shared/Components/IdentityDocumentCamera.constants.ts +44 -0
  31. package/src/Shared/Components/IdentityDocumentCamera.flows.ts +342 -0
  32. package/src/Shared/Components/IdentityDocumentCamera.tsx +1065 -2462
  33. package/src/Shared/Components/IdentityDocumentCamera.types.ts +136 -0
  34. package/src/Shared/Components/IdentityDocumentCamera.utils.ts +364 -0
  35. package/src/version.ts +1 -1
@@ -0,0 +1,93 @@
1
+ import type { ScanStep, ScanStatus, DocumentType, Face } from './IdentityDocumentCamera.types';
2
+ import type { MRZFields } from '../Types/mrzFields';
3
+ /**
4
+ * Frame-to-screen coordinate transform using FILL_CENTER scaling
5
+ */
6
+ export declare function getFrameToScreenTransform(frameWidth: number, frameHeight: number): {
7
+ scale: number;
8
+ offsetX: number;
9
+ offsetY: number;
10
+ screen: import("react-native").ScaledSize;
11
+ };
12
+ /**
13
+ * Compute scan area bounds in frame coordinates
14
+ */
15
+ export declare function getScanAreaBounds(frameWidth: number, frameHeight: number): {
16
+ scanLeft: number;
17
+ scanTop: number;
18
+ scanRight: number;
19
+ scanBottom: number;
20
+ isInsideScan: (x: number, y: number, w: number, h: number) => boolean;
21
+ };
22
+ /**
23
+ * Transform frame-space bounds to screen-space bounds
24
+ */
25
+ export declare function transformBoundsToScreen(bounds: {
26
+ x: number;
27
+ y: number;
28
+ width: number;
29
+ height: number;
30
+ }, scale: number, offsetX: number, offsetY: number): {
31
+ x: number;
32
+ y: number;
33
+ width: number;
34
+ height: number;
35
+ };
36
+ /**
37
+ * Unified status message logic used by both voice guidance and render text.
38
+ * Returns the appropriate i18n key arguments for the current scan state.
39
+ */
40
+ export declare function getStatusMessage(nextStep: ScanStep, status: ScanStatus, detectedDocumentType: DocumentType, isBrightnessLow: boolean, isFrameBlurry: boolean, allElementsDetected: boolean, elementsOutsideScanArea: string[], t: (key: string, params?: Record<string, unknown>) => string): string;
41
+ /**
42
+ * Calculate angle from two points in degrees
43
+ */
44
+ export declare function angleBetweenPoints(p1: {
45
+ x: number;
46
+ y: number;
47
+ }, p2: {
48
+ x: number;
49
+ y: number;
50
+ }): number;
51
+ /**
52
+ * Calculate distance between two points
53
+ */
54
+ export declare function distanceBetweenPoints(p1: {
55
+ x: number;
56
+ y: number;
57
+ }, p2: {
58
+ x: number;
59
+ y: number;
60
+ }): number;
61
+ /**
62
+ * Detect document type based on faces, OCR text, and MRZ fields
63
+ */
64
+ export declare function detectDocumentType(faces: Face[], ocrText: string, mrzFields?: MRZFields, frameWidth?: number, mrzText?: string | null): DocumentType;
65
+ /**
66
+ * Determine the document type to set based on current frame analysis
67
+ * Handles correction of misdetections and passport pattern checking
68
+ */
69
+ export declare function determineDocumentTypeToSet(documentType: DocumentType, cardSizedFaces: Face[], parsedMRZFields?: MRZFields, mrzText?: string | null): DocumentType;
70
+ /**
71
+ * Compare MRZ field values (ignore raw text variations)
72
+ */
73
+ export declare function areMRZFieldsEqual(fields1: any, fields2: any): boolean;
74
+ /**
75
+ * Check if all required MRZ fields are present
76
+ */
77
+ export declare function hasRequiredMRZFields(fields: any): boolean;
78
+ /**
79
+ * Validate if face position has changed within acceptable tolerance
80
+ * Returns true if position is valid (within tolerance)
81
+ */
82
+ export declare function validateFacePosition(currentBounds: {
83
+ x: number;
84
+ y: number;
85
+ width: number;
86
+ height: number;
87
+ }, referenceBounds: {
88
+ x: number;
89
+ y: number;
90
+ width: number;
91
+ height: number;
92
+ }, isHologramStep: boolean): boolean;
93
+ //# sourceMappingURL=IdentityDocumentCamera.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdentityDocumentCamera.utils.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/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.374.0";
1
+ export declare const SDK_VERSION = "1.381.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trustchex/react-native-sdk",
3
- "version": "1.374.0",
3
+ "version": "1.381.0",
4
4
  "description": "Trustchex mobile app react native SDK for android or ios devices",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",