DefinitelyTyped/types/react-native-touch-id/index.d.ts
Jin Shin 7f9d41cfbb @types/react-native-touch-id: Updated the module to version 4.0.2, adding new config option (#27007)
* Updated the module to version 4.0.2

* Updated Contributor name

* Fix header
2018-07-12 10:03:53 -07:00

27 lines
1.1 KiB
TypeScript

// Type definitions for react-native-touch-id 4.0.2
// Project: https://github.com/naoufal/react-native-touch-id
// Definitions by: huhuanming <https://github.com/huhuanming>
// Nikolay Polukhin <https://github.com/gazaret>
// Jin Shin <https://github.com/jinshin1013>
// 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 interface AuthenticateConfig {
title?: string;
color?: string;
fallbackTitle: string;
}
export const isSupported: () => Promise<boolean | string | TouchIDError>;
export const authenticate: (reason: string, config?: AuthenticateConfig) => Promise<boolean | TouchIDError>;
}