8000 chore: format fingerprint-auth · NativeScript/plugins@d19ca0a · GitHub
[go: up one dir, main page]

Skip to content

Commit d19ca0a

Browse files
committed
chore: format fingerprint-auth
1 parent 01060e8 commit d19ca0a

File tree

5 files changed

+439
-472
lines changed

5 files changed

+439
-472
lines changed

packages/fingerprint-auth/common.ts

Lines changed: 57 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,74 @@
11
export enum ERROR_CODES {
2-
PASSWORD_FALLBACK_SELECTED = -3, // historically this is what iOS uses, so using that as well
3-
DEVELOPER_ERROR = 10,
4-
NOT_AVAILABLE = 20,
5-
NOT_CONFIGURED = 30,
6-
NOT_RECOGNIZED = 40,
7-
RECOVERABLE_ERROR = 50,
8-
USER_CANCELLED = 60,
9-
UNEXPECTED_ERROR = 70
2+
PASSWORD_FALLBACK_SELECTED = -3, // historically this is what iOS uses, so using that as well
3+
DEVELOPER_ERROR = 10,
4+
NOT_AVAILABLE = 20,
5+
NOT_CONFIGURED = 30,
6+
NOT_RECOGNIZED = 40,
7+
RECOVERABLE_ERROR = 50,
8+
USER_CANCELLED = 60,
9+
UNEXPECTED_ERROR = 70,
1010
}
1111

1212
export interface VerifyFingerprintOptions {
13-
/**
14-
* The required title in the fingerprint page for android.
15-
* Default: whatever the device default is ('Confirm your password' is likely)
16-
*/
17-
title?: string;
18-
/**
19-
* The optional subtitle in the fingerprint page for android.
20-
* Default: Empty
21-
*/
22-
subTitle?: string;
23-
/**
24-
* The optional message in the fingerprint dialog on ios and page description on android.
25-
* Default: 'Scan your finger' on iOS and the device default on Android (which is likely 'Enter your device password to continue').
26-
*/
27-
message?: string;
28-
/**
29-
* The optional negative button text in the fingerprint page for android.
30-
* Default: "Cancel"
31-
*/
32-
cancelText?: string;
33-
/**
34-
* The optional confirm button after biometrics have been verified in the fingerprint page for android.
35-
* Default: False
36-
*/
37-
confirm?: boolean;
13+
/**
14+
* The required title in the fingerprint page for android.
15+
* Default: whatever the device default is ('Confirm your password' is likely)
16+
*/
17+
title?: string;
18+
/**
19+
* The optional subtitle in the fingerprint page for android.
20+
* Default: Empty
21+
*/
22+
subTitle?: string;
23+
/**
24+
* The optional message in the fingerprint dialog on ios and page description on android.
25+
* Default: 'Scan your finger' on iOS and the device default on Android (which is likely 'Enter your device password to continue').
26+
*/
27+
message?: string;
28+
/**
29+
* The optional negative button text in the fingerprint page for android.
30+
* Default: "Cancel"
31+
*/
32+
cancelText?: string;
33+
/**
34+
* The optional confirm button after biometrics have been verified in the fingerprint page for android.
35+
* Default: False
36+
*/
37+
confirm?: boolean;
3838
}
3939

40-
export interface VerifyFingerprintWithCustomFallbackOptions extends VerifyFingerprintOptions{
41-
/**
42-
* The optional button label when scanning the fingerprint fails.
43-
* Default: 'Enter password'.
44-
*/
45-
fallbackMessage?: string;
40+
export interface VerifyFingerprintWithCustomFallbackOptions extends VerifyFingerprintOptions {
41+
/**
42+
* The optional button label when scanning the fingerprint fails.
43+
* Default: 'Enter password'.
44+
*/
45+
fallbackMessage?: string;
4646
}
4747

4848
export interface BiometricIDAvailableResult {
49-
any: boolean;
50-
touch?: boolean;
51-
face?: boolean;
52-
biometrics?: boolean;
49+
any: boolean;
50+
touch?: boolean;
51+
face?: boolean;
52+
biometrics?: boolean;
5353
}
5454

5555
//noinspection JSUnusedGlobalSymbols
5656
export interface FingerprintAuthApi {
57-
available(): Promise<BiometricIDAvailableResult>;
57+
available(): Promise<BiometricIDAvailableResult>;
5858

59-
didFingerprintDatabaseChange(): Promise<boolean>;
60-
/**
61-
* This (recommended) method uses keychain instead of localauth so the passcode fallback can be used.
62-
* On Android, when 'useCustomAndroidUI' is set to 'true', and the user opted for manually entering the password,
63-
* this method may return a string (the entered password) for you to compare to the actual password.
64-
*/
65-
verifyFingerprint(options: VerifyFingerprintOptions): Promise<void | string>;
59+
didFingerprintDatabaseChange(): Promise<boolean>;
60+
/**
61+
* This (recommended) method uses keychain instead of localauth so the passcode fallback can be used.
62+
* On Android, when 'useCustomAndroidUI' is set to 'true', and the user opted for manually entering the password,
63+
* this method may return a string (the entered password) for you to compare to the actual password.
64+
*/
65+
verifyFingerprint(options: VerifyFingerprintOptions): Promise<void | string>;
6666

67-
/**
68-
* This implementation uses LocalAuthentication and has no built-in passcode fallback on iOS.
69-
* On Android this is exactly the same as 'verifyFingerprint'
70-
*/
71-
verifyFingerprintWithCustomFallback(
72-
options: VerifyFingerprintWithCustomFallbackOptions
73-
): Promise<void>;
67+
/**
68+
* This implementation uses LocalAuthentication and has no built-in passcode fallback on iOS.
69+
* On Android this is exactly the same as 'verifyFingerprint'
70+
*/
71+
verifyFingerprintWithCustomFallback(options: VerifyFingerprintWithCustomFallbackOptions): Promise<void>;
7472

75-
close(): void;
73+
close(): void;
7674
}

0 commit comments

Comments
 (0)
0