forked from SelfLender/react-native-biometrics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
82 lines (82 loc) · 2.63 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
declare module 'react-native-biometrics' {
/**
* Enum for touch id sensor type
*/
const TouchID: string;
/**
* Enum for face id sensor type
*/
const FaceID: string;
/**
* Returns promise that resolves to null, TouchID, or FaceID
* @returns {Promise} Promise that resolves to null, TouchID, or FaceID
*/
function isSensorAvailable(): Promise<string>;
/**
* Prompts user with biometrics dialog using the passed in prompt message if
* it is provided, returns promise that resolves to the public key of the
* newly generated key pair
* @param {string} title
* @param {string} cancelButtonText
* @param {string} messageText
* @param {string} hintText
* @param {string} recognizedText
* @param {string} notRecognizedText
* @returns {Promise} Promise that resolves to newly generated public key
*/
function createKeys(
title: string,
cancelButtonText: string,
messageText: string,
hintText: string,
recognizedText: string,
notRecognizedText: string): Promise<string>;
/**
* Returns promise that resolves to true or false indicating if the keys
* were properly deleted
* @returns {Promise} Promise that resolves to true or false
*/
function deleteKeys(): Promise<boolean>;
/**
* Prompts user with biometrics dialog using the passed in prompt message and
* returns promise that resolves to a cryptographic signature of the payload
* @param {string} title
* @param {string} cancelButtonText
* @param {string} messageText
* @param {string} hintText
* @param {string} recognizedText
* @param {string} notRecognizedText
* @param {string} payload
* @returns {Promise} Promise that resolves to cryptographic signature
*/
function createSignature(
title: string,
cancelButtonText: string,
messageText: string,
hintText: string,
recognizedText: string,
notRecognizedText: string,
payload: string
): Promise<string>;
/**
* Prompts user with biometrics dialog using the passed in prompt resources and
* returns promise that resolves if the user passes, and
* rejects if the user fails or cancels
* @param {string} title
* @param {string} cancelButtonText
* @param {string} messageText
* @param {string} hintText
* @param {string} recognizedText
* @param {string} notRecognizedText
* @returns {Promise} Promise that resolves if the user passes, and
* rejects if the user fails or cancels
*/
function simplePrompt(
title: string,
cancelButtonText: string,
messageText: string,
hintText: string,
recognizedText: string,
notRecognizedText: string,
): Promise<boolean>;
}