mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-09 06:17:11 +08:00
Merge pull request #23977 from gazaret/react-native-touch-id-4
[react-native-touch-id] Update to 4.0.0
This commit is contained in:
12
types/react-native-touch-id/index.d.ts
vendored
12
types/react-native-touch-id/index.d.ts
vendored
@@ -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) => {});
|
||||
|
||||
Reference in New Issue
Block a user