mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
add react-native-touch-id
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
// Type definitions for react-native-touch-id 3.0.0
|
||||
// Project: https://github.com/naoufal/react-native-touch-id
|
||||
// Definitions by: huhuanming <https://github.com/huhuanming>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'react-native-touch-id' {
|
||||
|
||||
class TouchIDError {
|
||||
name: 'LAErrorAuthenticationFailed' | 'LAErrorUserCancel' | 'LAErrorUserFallback' | 'LAErrorSystemCancel'
|
||||
| 'LAErrorPasscodeNotSet' | 'LAErrorTouchIDNotAvailable' | 'LAErrorTouchIDNotEnrolled'
|
||||
| 'LAErrorTouchIDNotEnrolled' | 'RCTTouchIDUnknownError' | 'RCTTouchIDNotSupported';
|
||||
message: string;
|
||||
details: any;
|
||||
}
|
||||
|
||||
export const isSupported: () => Promise<boolean | string>;
|
||||
export const authenticate: (reason: string) => Promise<boolean | TouchIDError>;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { isSupported, authenticate } from 'react-native-touch-id';
|
||||
|
||||
isSupported().then(() => {}).catch(() => {});
|
||||
|
||||
authenticate('reason').then(() => {}).catch(() => {});
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-native-touch-id-tests.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user