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   * Indicates iris recognition support.
17   * @platform android
18   */
19  IRIS = 3,
20}
21
22// @needsAudit
23export enum SecurityLevel {
24  /**
25   * Indicates no enrolled authentication.
26   */
27  NONE = 0,
28  /**
29   * Indicates non-biometric authentication (e.g. PIN, Pattern).
30   */
31  SECRET = 1,
32  /**
33   * Indicates biometric authentication.
34   */
35  BIOMETRIC = 2,
36}
37
38// @needsAudit
39export type LocalAuthenticationOptions = {
40  /**
41   * A message that is shown alongside the TouchID or FaceID prompt.
42   */
43  promptMessage?: string;
44  /**
45   * Allows to customize the default `Cancel` label shown.
46   */
47  cancelLabel?: string;
48  /**
49   * After several failed attempts the system will fallback to the device passcode. This setting
50   * allows you to disable this option and instead handle the fallback yourself. This can be
51   * preferable in certain custom authentication workflows. This behaviour maps to using the iOS
52   * [LAPolicyDeviceOwnerAuthenticationWithBiometrics](https://developer.apple.com/documentation/localauthentication/lapolicy/lapolicydeviceownerauthenticationwithbiometrics?language=objc)
53   * policy rather than the [LAPolicyDeviceOwnerAuthentication](https://developer.apple.com/documentation/localauthentication/lapolicy/lapolicydeviceownerauthentication?language=objc)
54   * policy. Defaults to `false`.
55   */
56  disableDeviceFallback?: boolean;
57  /**
58   * Sets a hint to the system for whether to require user confirmation after authentication.
59   * This may be ignored by the system if the user has disabled implicit authentication in Settings
60   * or if it does not apply to a particular biometric modality. Defaults to `true`.
61   * @platform android
62   */
63  requireConfirmation?: boolean;
64  /**
65   * Allows to customize the default `Use Passcode` label shown after several failed
66   * authentication attempts. Setting this option to an empty string disables this button from
67   * showing in the prompt.
68   * @platform ios
69   */
70  fallbackLabel?: string;
71};
72