[react-native-touch-id] Update to 4.0.0

This commit is contained in:
Nikolay Polukhin
2018-02-28 15:03:58 +04:00
parent c300e37b1e
commit e3261f05e9
2 changed files with 14 additions and 3 deletions
+9 -3
View File
@@ -1,6 +1,7 @@
// Type definitions for react-native-touch-id 3.0.0
// Type definitions for react-native-touch-id 4.0.0
// Project: https://github.com/naoufal/react-native-touch-id
// Definitions by: huhuanming <https://github.com/huhuanming>
// Nikolay Polukhin <https://github.com/gazaret>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'react-native-touch-id' {
@@ -13,6 +14,11 @@ declare module 'react-native-touch-id' {
details: any;
}
export const isSupported: () => Promise<boolean | TouchIDError>;
export const authenticate: (reason: string) => Promise<boolean | TouchIDError>;
export interface AuthenticateConfig {
title: string;
color: string;
}
export const isSupported: () => Promise<boolean | string | TouchIDError>;
export const authenticate: (reason: string, config?: AuthenticateConfig) => Promise<boolean | TouchIDError>;
}
@@ -3,3 +3,8 @@ import { isSupported, authenticate, TouchIDError } from 'react-native-touch-id';
isSupported().then((isOk: boolean) => {}).catch((error: TouchIDError) => {});
authenticate('reason').then((isOk: boolean) => {}).catch((error: TouchIDError) => {});
authenticate('reason', {
title: 'Authentication Required',
color: '#1306ff'
}).then((isOk: boolean) => {}).catch((error: TouchIDError) => {});