|
| 1 | +export enum RNSensitiveInfoBiometryType { |
| 2 | + "Touch ID", |
| 3 | + "Face ID", |
| 4 | +} |
| 5 | + |
| 6 | +export enum RNSensitiveInfoAccessControlOptions { |
| 7 | + 'kSecAccessControlApplicationPassword', |
| 8 | + 'kSecAccessControlPrivateKeyUsage', |
| 9 | + 'kSecAccessControlDevicePasscode', |
| 10 | + 'kSecAccessControlTouchIDAny', |
| 11 | + 'kSecAccessControlTouchIDCurrentSet', |
| 12 | + 'kSecAccessControlUserPresence', |
| 13 | +} |
| 14 | + |
| 15 | +export enum RNSensitiveInfoAttrAccessibleOptions { |
| 16 | + 'kSecAttrAccessibleAfterFirstUnlock', |
| 17 | + 'kSecAttrAccessibleAlways', |
| 18 | + 'kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly', |
| 19 | + 'kSecAttrAccessibleWhenUnlockedThisDeviceOnly', |
| 20 | + 'kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly', |
| 21 | + 'kSecAttrAccessibleAlwaysThisDeviceOnly', |
| 22 | + 'kSecAttrAccessibleWhenUnlocked', |
| 23 | +} |
| 24 | + |
| 25 | +export interface RNSensitiveInfoOptions { |
| 26 | + kSecAccessControl: RNSensitiveInfoAccessControlOptions; |
| 27 | + kSecAttrAccessible: RNSensitiveInfoAttrAccessibleOptions; |
| 28 | + keychainService: string; |
| 29 | + kSecUseOperationPrompt: string; |
| 30 | + sharedPreferencesName: string; |
| 31 | + touchID: boolean; |
| 32 | +} |
| 33 | + |
| 34 | +declare class RNSensitiveInfo { |
| 35 | + setItem( |
| 36 | + key: string, |
| 37 | + value: string, |
| 38 | + options: RNSensitiveInfoOptions, |
| 39 | + ): Promise<null>; |
| 40 | + |
| 41 | + getItem(key: string, options: RNSensitiveInfoOptions): Promise<string>; |
| 42 | + |
| 43 | + getAllItems(options: RNSensitiveInfoOptions): Promise<Object>; |
| 44 | + |
| 45 | + deleteItem(key: string, options: RNSensitiveInfoOptions): Promise<null>; |
| 46 | + |
| 47 | + isSensorAvailable(): Promise<RNSensitiveInfoBiometryType | boolean>; |
| 48 | + |
| 49 | + isHardwareDetected(): Promise<boolean>; |
| 50 | + |
| 51 | + hasEnrolledFingerprints(): Promise<boolean>; |
| 52 | + |
| 53 | + cancelFingerprintAuth(): void; |
| 54 | +} |
| 55 | + |
| 56 | +declare const rnSensitiveInfo: RNSensitiveInfo; |
| 57 | +export default rnSensitiveInfo; |
0 commit comments