diff --git a/types/react-native-touch-id/index.d.ts b/types/react-native-touch-id/index.d.ts index f1fc4f7a71..e222b87b59 100644 --- a/types/react-native-touch-id/index.d.ts +++ b/types/react-native-touch-id/index.d.ts @@ -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 +// Nikolay Polukhin // 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; - export const authenticate: (reason: string) => Promise; + export interface AuthenticateConfig { + title: string; + color: string; + } + + export const isSupported: () => Promise; + export const authenticate: (reason: string, config?: AuthenticateConfig) => Promise; } diff --git a/types/react-native-touch-id/react-native-touch-id-tests.ts b/types/react-native-touch-id/react-native-touch-id-tests.ts index 0b431ecc85..8ad30c1390 100644 --- a/types/react-native-touch-id/react-native-touch-id-tests.ts +++ b/types/react-native-touch-id/react-native-touch-id-tests.ts @@ -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) => {});