react-native-biometric-verifier 0.0.64 → 0.0.65
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/package.json +2 -1
- package/src/index.d.ts +303 -0
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-biometric-verifier",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.65",
|
|
4
4
|
"description": "A React Native module for biometric verification with face recognition and QR code scanning",
|
|
5
5
|
"main": "src/index.js",
|
|
6
|
+
"types": "src/index.d.ts",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
9
|
},
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Animated, NavigationProp } from 'react-native';
|
|
3
|
+
|
|
4
|
+
// ============ COMPONENTS ============
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Card component props
|
|
8
|
+
*/
|
|
9
|
+
export interface CardProps {
|
|
10
|
+
employeeData: {
|
|
11
|
+
facename: string;
|
|
12
|
+
faceid: string;
|
|
13
|
+
imageurl?: string;
|
|
14
|
+
};
|
|
15
|
+
apiurl: string;
|
|
16
|
+
fileurl?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Card component - displays employee information
|
|
21
|
+
*/
|
|
22
|
+
export const Card: React.FC<CardProps>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Loader component props
|
|
26
|
+
*/
|
|
27
|
+
export interface LoaderProps {
|
|
28
|
+
state: {
|
|
29
|
+
isLoading: boolean;
|
|
30
|
+
loadingType: string;
|
|
31
|
+
currentStep: string;
|
|
32
|
+
animationState: string;
|
|
33
|
+
};
|
|
34
|
+
gifSource: { uri: string } | null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Loader component - displays loading animation
|
|
39
|
+
*/
|
|
40
|
+
export const Loader: React.FC<LoaderProps>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* CountdownTimer component props
|
|
44
|
+
*/
|
|
45
|
+
export interface CountdownTimerProps {
|
|
46
|
+
duration: number;
|
|
47
|
+
currentTime: number;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* CountdownTimer component - displays countdown timer
|
|
52
|
+
*/
|
|
53
|
+
export const CountdownTimer: React.FC<CountdownTimerProps>;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Notification component props
|
|
57
|
+
*/
|
|
58
|
+
export interface NotificationProps {
|
|
59
|
+
notification: {
|
|
60
|
+
visible: boolean;
|
|
61
|
+
message: string;
|
|
62
|
+
type: 'success' | 'error' | 'info' | 'warning';
|
|
63
|
+
};
|
|
64
|
+
fadeAnim: Animated.Value;
|
|
65
|
+
slideAnim: Animated.Value;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Notification component - displays notifications
|
|
70
|
+
*/
|
|
71
|
+
export const Notification: React.FC<NotificationProps>;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* CaptureImageWithoutEdit component props
|
|
75
|
+
*/
|
|
76
|
+
export interface CaptureImageWithoutEditProps {
|
|
77
|
+
cameraType: 'front' | 'back';
|
|
78
|
+
onCapture: (capturedData: any) => void;
|
|
79
|
+
showCodeScanner?: boolean;
|
|
80
|
+
isLoading?: boolean;
|
|
81
|
+
frameProcessorFps?: number;
|
|
82
|
+
livenessLevel?: string;
|
|
83
|
+
antispooflevel?: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* CaptureImageWithoutEdit component - captures images from camera
|
|
88
|
+
*/
|
|
89
|
+
export const CaptureImageWithoutEdit: React.FC<CaptureImageWithoutEditProps>;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* StepIndicator component props
|
|
93
|
+
*/
|
|
94
|
+
export interface StepIndicatorProps {
|
|
95
|
+
currentStep: string;
|
|
96
|
+
qrscan?: boolean;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* StepIndicator component - shows current verification step
|
|
101
|
+
*/
|
|
102
|
+
export const StepIndicator: React.FC<StepIndicatorProps>;
|
|
103
|
+
|
|
104
|
+
// ============ HOOKS ============
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* useCountdown hook return type
|
|
108
|
+
*/
|
|
109
|
+
export interface UseCountdownReturn {
|
|
110
|
+
countdown: number;
|
|
111
|
+
startCountdown: (onExpireCallback?: () => void) => void;
|
|
112
|
+
resetCountdown: () => void;
|
|
113
|
+
pauseCountdown: () => void;
|
|
114
|
+
resumeCountdown: () => void;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Custom hook for countdown timer with pause/resume functionality
|
|
119
|
+
*/
|
|
120
|
+
export function useCountdown(duration: number, onExpire?: () => void): UseCountdownReturn;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* useGeolocation hook return type
|
|
124
|
+
*/
|
|
125
|
+
export interface UseGeolocationReturn {
|
|
126
|
+
requestLocationPermission: () => Promise<boolean>;
|
|
127
|
+
getCurrentLocation: () => Promise<{
|
|
128
|
+
latitude: number;
|
|
129
|
+
longitude: number;
|
|
130
|
+
accuracy: number;
|
|
131
|
+
altitude?: number;
|
|
132
|
+
speed?: number;
|
|
133
|
+
heading?: number;
|
|
134
|
+
} | null>;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Custom hook for geolocation functionality
|
|
139
|
+
*/
|
|
140
|
+
export function useGeolocation(): UseGeolocationReturn;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* useImageProcessing hook return type
|
|
144
|
+
*/
|
|
145
|
+
export interface UseImageProcessingReturn {
|
|
146
|
+
convertImageToBase64: (imageUri: string) => Promise<string>;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Custom hook for image processing utilities
|
|
151
|
+
*/
|
|
152
|
+
export function useImageProcessing(): UseImageProcessingReturn;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* useNotifyMessage hook return type
|
|
156
|
+
*/
|
|
157
|
+
export interface UseNotifyMessageReturn {
|
|
158
|
+
notification: {
|
|
159
|
+
visible: boolean;
|
|
160
|
+
message: string;
|
|
161
|
+
type: 'success' | 'error' | 'info' | 'warning';
|
|
162
|
+
};
|
|
163
|
+
fadeAnim: Animated.Value;
|
|
164
|
+
slideAnim: Animated.Value;
|
|
165
|
+
notifyMessage: (message: string, type?: 'success' | 'error' | 'info' | 'warning') => void;
|
|
166
|
+
clearNotification: () => void;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Custom hook for notification management
|
|
171
|
+
*/
|
|
172
|
+
export function useNotifyMessage(): UseNotifyMessageReturn;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* useSafeCallback hook return type
|
|
176
|
+
*/
|
|
177
|
+
export type SafeCallback = (data: any) => void;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Custom hook for safe callback execution
|
|
181
|
+
*/
|
|
182
|
+
export function useSafeCallback(callback: SafeCallback, notifyMessage: (msg: string, type?: string) => void): (data: any) => void;
|
|
183
|
+
|
|
184
|
+
// ============ UTILITIES ============
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Global constants and configuration
|
|
188
|
+
*/
|
|
189
|
+
export class Global {
|
|
190
|
+
static AppTheme: {
|
|
191
|
+
primary: string;
|
|
192
|
+
primaryLight: string;
|
|
193
|
+
success: string;
|
|
194
|
+
error: string;
|
|
195
|
+
warning: string;
|
|
196
|
+
info: string;
|
|
197
|
+
dark: string;
|
|
198
|
+
light: string;
|
|
199
|
+
gray: string;
|
|
200
|
+
background: string;
|
|
201
|
+
cardBackground: string;
|
|
202
|
+
textLight: string;
|
|
203
|
+
shadow: string;
|
|
204
|
+
modalBackground: string;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
static LoadingTypes: {
|
|
208
|
+
none: string;
|
|
209
|
+
imageProcessing: string;
|
|
210
|
+
faceRecognition: string;
|
|
211
|
+
networkRequest: string;
|
|
212
|
+
locationPermission: string;
|
|
213
|
+
gettingLocation: string;
|
|
214
|
+
calculateDistance: string;
|
|
215
|
+
locationVerification: string;
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
static AnimationStates: {
|
|
219
|
+
faceScan: string;
|
|
220
|
+
qrScan: string;
|
|
221
|
+
processing: string;
|
|
222
|
+
success: string;
|
|
223
|
+
error: string;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
static ImageResize: {
|
|
227
|
+
width: number;
|
|
228
|
+
height: number;
|
|
229
|
+
format: 'JPEG' | 'PNG';
|
|
230
|
+
quality: number;
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
static CountdownDuration: number;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Calculates distance between two geographical points using Haversine formula
|
|
238
|
+
*/
|
|
239
|
+
export function getDistanceInMeters(lat1: number, lng1: number, lat2: number, lng2: number): number | null;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Network service call options
|
|
243
|
+
*/
|
|
244
|
+
export interface NetworkServiceCallResponse {
|
|
245
|
+
httpstatus?: number;
|
|
246
|
+
data?: any;
|
|
247
|
+
message?: string;
|
|
248
|
+
[key: string]: any;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Makes HTTP requests with method, URL, headers, and body
|
|
253
|
+
*/
|
|
254
|
+
export function networkServiceCall(
|
|
255
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH',
|
|
256
|
+
url: string,
|
|
257
|
+
extraHeaders?: Record<string, string>,
|
|
258
|
+
body?: Record<string, any>
|
|
259
|
+
): Promise<NetworkServiceCallResponse>;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Helper function for GET API calls
|
|
263
|
+
*/
|
|
264
|
+
export function getApiCall(url: string, extraHeaders?: Record<string, string>): Promise<NetworkServiceCallResponse>;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Get appropriate loader GIF based on animation state
|
|
268
|
+
*/
|
|
269
|
+
export function getLoaderGif(
|
|
270
|
+
animationState: string,
|
|
271
|
+
currentStep: string,
|
|
272
|
+
apiurl: string,
|
|
273
|
+
imageurl?: string
|
|
274
|
+
): { uri: string } | null;
|
|
275
|
+
|
|
276
|
+
// ============ MAIN COMPONENT ============
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* BiometricModal component props
|
|
280
|
+
*/
|
|
281
|
+
export interface BiometricModalProps {
|
|
282
|
+
data: any;
|
|
283
|
+
depKey: string;
|
|
284
|
+
qrscan?: boolean;
|
|
285
|
+
callback: (result: any) => void;
|
|
286
|
+
apiurl: string;
|
|
287
|
+
onclose: () => void;
|
|
288
|
+
frameProcessorFps?: number;
|
|
289
|
+
livenessLevel?: string;
|
|
290
|
+
fileurl?: string;
|
|
291
|
+
imageurl?: string;
|
|
292
|
+
navigation: NavigationProp<any>;
|
|
293
|
+
duration?: number;
|
|
294
|
+
MaxDistanceMeters?: number;
|
|
295
|
+
antispooflevel?: string;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Main biometric verification modal component
|
|
300
|
+
*/
|
|
301
|
+
declare const BiometricModal: React.MemoExoticComponent<React.FC<BiometricModalProps>>;
|
|
302
|
+
|
|
303
|
+
export default BiometricModal;
|