forked from mCodex/react-native-sensitive-info
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
65 lines (60 loc) · 2.05 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
type RNSensitiveInfoBiometryType = "Touch ID" | "Face ID";
type RNSensitiveInfoAccessControlOptions =
| "kSecAccessControlApplicationPassword"
| "kSecAccessControlPrivateKeyUsage"
| "kSecAccessControlDevicePasscode"
| "kSecAccessControlTouchIDAny"
| "kSecAccessControlTouchIDCurrentSet"
| "kSecAccessControlUserPresence"
| "kSecAccessControlBiometryAny"
| "kSecAccessControlBiometryCurrentSet";
type RNSensitiveInfoAttrAccessibleOptions =
| "kSecAttrAccessibleAfterFirstUnlock"
| "kSecAttrAccessibleAlways"
| "kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly"
| "kSecAttrAccessibleWhenUnlockedThisDeviceOnly"
| "kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly"
| "kSecAttrAccessibleAlwaysThisDeviceOnly"
| "kSecAttrAccessibleWhenUnlocked";
interface RNSensitiveInfoAndroidDialogStrings {
header?: string;
description?: string;
hint?: string;
success?: string;
notRecognized?: string;
cancel?: string;
cancelled?: string;
}
export interface RNSensitiveInfoOptions {
kSecAccessControl?: RNSensitiveInfoAccessControlOptions;
kSecAttrAccessible?: RNSensitiveInfoAttrAccessibleOptions;
keychainService?: string;
sharedPreferencesName?: string;
touchID?: boolean;
showModal?: boolean;
kSecUseOperationPrompt?: string;
strings?: RNSensitiveInfoAndroidDialogStrings;
}
export declare function setItem(
key: string,
value: string,
options: RNSensitiveInfoOptions
): Promise<null>;
export declare function getItem(
key: string,
options: RNSensitiveInfoOptions
): Promise<string>;
export declare function getAllItems(
options: RNSensitiveInfoOptions
): Promise<Object>;
export declare function deleteItem(
key: string,
options: RNSensitiveInfoOptions
): Promise<null>;
export declare function isSensorAvailable(): Promise<
RNSensitiveInfoBiometryType | boolean
>;
export declare function isHardwareDetected(): Promise<boolean>;
export declare function hasEnrolledFingerprints(): Promise<boolean>;
export declare function cancelFingerprintAuth(): void;
export declare function setInvalidatedByBiometricEnrollment(boolean): void;