hieuvp / react-native-fingerprint-scanner

Provide Fingerprint, Touch ID, and Face ID Scanner for React Native (Compatible with both Android and iOS)
https://www.npmjs.com/package/react-native-fingerprint-scanner
870 stars 298 forks source link

Incorrect Typescript type for isSensorAvailable and onAttempt #102

Closed CochiorasBogdan closed 4 years ago

CochiorasBogdan commented 4 years ago

Hello, the promise response type should be Biometrics instead of string at the following line: https://github.com/hieuvp/react-native-fingerprint-scanner/blob/9a698e2a137188a220d09c5259aa2de1e88944b7/index.d.ts#L90

Alos the typing for onAttempt is incorrect since it can return an error ('UserCancel', 'UserFallback', etc.) like described in the documentation so the correct typing for: https://github.com/hieuvp/react-native-fingerprint-scanner/blob/9a698e2a137188a220d09c5259aa2de1e88944b7/index.d.ts#L5 would be:

export type AuthenticateAndroid = { onAttempt: (error: FingerprintScannerError) => void };
salomaoluiz commented 4 years ago

Hi, I send a PR to fix this problem, now we just need wait the accept.

phillbaker commented 4 years ago

Fixed in #103