Skip to content

Commit aa769ea

Browse files
committed
feat(ts): add typescript declaration file
1 parent e32fb79 commit aa769ea

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

index.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
declare const RNBiometrics: {
2+
/**
3+
* request biometric authentication
4+
*
5+
* note: promise will resolve when successful
6+
* but will be rejected when not with an error message
7+
*/
8+
requestBioAuth: (
9+
/** title of prompt (can be an empty string) */
10+
promptTitle: string,
11+
/** The app-provided reason for requesting authentication, which displays in the authentication dialog presented to the user. */
12+
promptMessage: string
13+
) => Promise<boolean>;
14+
15+
/**
16+
* check if authentication is possible
17+
*/
18+
canAuthenticate: () => Promise<boolean>;
19+
};
20+
21+
export default RNBiometrics;

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NativeModules, Platform } from "react-native";
1+
import { NativeModules } from "react-native";
22

33
const { RNBiometrics: RNBiometricsNative } = NativeModules;
44

0 commit comments

Comments
 (0)