1export type LocalAuthenticationResult = 2 | { success: true } 3 | { success: false; error: string; warning?: string }; 4 5// @needsAudit 6export enum AuthenticationType { 7 /** 8 * Indicates fingerprint support. 9 */ 10 FINGERPRINT = 1, 11 /** 12 * Indicates facial recognition support. 13 */ 14 FACIAL_RECOGNITION = 2, 15 /** 16 * __Android-only.__ Indicates iris recognition support. 17 */ 18 IRIS = 3, 19} 20 21// @needsAudit 22export enum SecurityLevel { 23 /** 24 * Indicates no enrolled authentication. 25 */ 26 NONE = 0, 27 /** 28 * Indicates non-biometric authentication (e.g. PIN, Pattern). 29 */ 30 SECRET = 1, 31 /** 32 * Indicates biometric authentication. 33 */ 34 BIOMETRIC = 2, 35} 36 37// @needsAudit 38export type LocalAuthenticationOptions = { 39 /** 40 * A message that is shown alongside the TouchID or FaceID prompt. 41 */ 42 promptMessage?: string; 43 /** 44 * Allows to customize the default `Cancel` label shown. 45 */ 46 cancelLabel?: string; 47 /** 48 * After several failed attempts the system will fallback to the device passcode. This setting 49 * allows you to disable this option and instead handle the fallback yourself. This can be 50 * preferable in certain custom authentication workflows. This behaviour maps to using the iOS 51 * [LAPolicyDeviceOwnerAuthenticationWithBiometrics](https://developer.apple.com/documentation/localauthentication/lapolicy/lapolicydeviceownerauthenticationwithbiometrics?language=objc) 52 * policy rather than the [LAPolicyDeviceOwnerAuthentication](https://developer.apple.com/documentation/localauthentication/lapolicy/lapolicydeviceownerauthentication?language=objc) 53 * policy. Defaults to `false`. 54 */ 55 disableDeviceFallback?: boolean; 56 /** 57 * **iOS only.** Allows to customize the default `Use Passcode` label shown after several failed 58 * authentication attempts. Setting this option to an empty string disables this button from 59 * showing in the prompt. 60 */ 61 fallbackLabel?: string; 62}; 63