react-native-rdservice-fingerprintscanner 1.1.4 → 1.1.5
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 +3 -3
- package/src/index.d.ts +28 -0
- package/src/{index.tsx → index.js} +6 -29
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-rdservice-fingerprintscanner",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "FingerPrint Scanner RD Service",
|
|
5
|
-
"main": "src/index.
|
|
5
|
+
"main": "src/index.js",
|
|
6
6
|
"module": "lib/module/index",
|
|
7
|
-
"types": "
|
|
7
|
+
"types": "src/index.d.ts",
|
|
8
8
|
"react-native": "src/index",
|
|
9
9
|
"source": "src/index",
|
|
10
10
|
"files": [
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare module "react-native-rdservice-fingerprintscanner" {
|
|
2
|
+
export type deviceInfoProps = {
|
|
3
|
+
isWhitelisted: boolean,
|
|
4
|
+
rdServiceInfoJson: JSON,
|
|
5
|
+
rdServiceInfoXML: string,
|
|
6
|
+
rdServicePackage: string ,
|
|
7
|
+
status: number,
|
|
8
|
+
message: string,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type optionalInfo ={
|
|
12
|
+
status: number,
|
|
13
|
+
message: string,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type fingerprintDataProps = {
|
|
17
|
+
pidDataJson: JSON,
|
|
18
|
+
pidDataXML: string,
|
|
19
|
+
rdServicePackage: string,
|
|
20
|
+
status: number,
|
|
21
|
+
errInfo: string,
|
|
22
|
+
errorCode: number,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function getDeviceInfo(): Promise<deviceInfoProps | optionalInfo>;
|
|
26
|
+
export function captureFinger(pidOptions: string):Promise<fingerprintDataProps>;
|
|
27
|
+
|
|
28
|
+
}
|
|
@@ -17,33 +17,10 @@ const RdserviceFingerprintscanner = NativeModules.RdserviceFingerprintscanner
|
|
|
17
17
|
}
|
|
18
18
|
);
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
isWhitelisted: boolean,
|
|
22
|
-
rdServiceInfoJson: JSON,
|
|
23
|
-
rdServiceInfoXML: string,
|
|
24
|
-
rdServicePackage: string ,
|
|
25
|
-
status: number,
|
|
26
|
-
message: string,
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
type optionalInfo ={
|
|
30
|
-
status: number,
|
|
31
|
-
message: string,
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
type fingerprintDataProps = {
|
|
35
|
-
pidDataJson: JSON,
|
|
36
|
-
pidDataXML: string,
|
|
37
|
-
rdServicePackage: string,
|
|
38
|
-
status: number,
|
|
39
|
-
errInfo: string,
|
|
40
|
-
errorCode: number,
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function getDeviceInfo():Promise<deviceInfoProps | optionalInfo> {
|
|
20
|
+
export function getDeviceInfo(){
|
|
44
21
|
return new Promise((resolve, reject) => {
|
|
45
22
|
RdserviceFingerprintscanner.getDeviceInfo()
|
|
46
|
-
.then((res
|
|
23
|
+
.then((res) => {
|
|
47
24
|
if (res.status === -1) {
|
|
48
25
|
const resObj = {
|
|
49
26
|
status: res.status,
|
|
@@ -62,16 +39,16 @@ export function getDeviceInfo():Promise<deviceInfoProps | optionalInfo> {
|
|
|
62
39
|
resolve(resObj);
|
|
63
40
|
}
|
|
64
41
|
})
|
|
65
|
-
.catch((err
|
|
42
|
+
.catch((err) => {
|
|
66
43
|
reject(err);
|
|
67
44
|
});
|
|
68
45
|
});
|
|
69
46
|
}
|
|
70
47
|
|
|
71
|
-
export function captureFinger(pidOptions
|
|
48
|
+
export function captureFinger(pidOptions) {
|
|
72
49
|
return new Promise((resolve, reject) => {
|
|
73
50
|
RdserviceFingerprintscanner.captureFinger(pidOptions)
|
|
74
|
-
.then((res
|
|
51
|
+
.then((res) => {
|
|
75
52
|
const resObj = {
|
|
76
53
|
pidDataJson: JSON.parse(res.pidDataJsonString),
|
|
77
54
|
pidDataXML: res.pidDataXML,
|
|
@@ -83,7 +60,7 @@ export function captureFinger(pidOptions: string):Promise<fingerprintDataProps>
|
|
|
83
60
|
};
|
|
84
61
|
resolve(resObj);
|
|
85
62
|
})
|
|
86
|
-
.catch((err
|
|
63
|
+
.catch((err) => {
|
|
87
64
|
reject(err);
|
|
88
65
|
});
|
|
89
66
|
});
|