naoufal / react-native-touch-id

React Native authentication with the native Touch ID popup.
https://www.npmjs.com/package/react-native-touch-id
1.47k stars 477 forks source link

TypeScript issue with return type of TouchID.authenticate #237

Open jbinda opened 4 years ago

jbinda commented 4 years ago

Hi guys!

I have TypeScript configured in my project and receive below error during type checking: image

The issue is that authenticate function in TouchID object does not have return type defined inside index.d.ts in library root director: image

According to documentation which says:

Attempts to authenticate with Face ID/Touch ID. Returns a Promise object.

Shouldn't it looks more like that: image

I'm not sure if any inside Promise if correct - maybe it should be also defined to one of existing type e.g. boolean

Currently my workaround is to override types for 'react-native-touch-id' module in my project and set types as presented above.

Is there any more elegant solution or anybody has idea how else I can sort it ?

Aidurber commented 4 years ago

Hi @jbinda

This appears to have been resolved already: https://github.com/naoufal/react-native-touch-id/blob/master/index.d.ts#L103

Are you on the latest version?

jbinda commented 4 years ago

@Aidurber

I'm on 4.4.1 version which seems to be the latest version on npm: 4.4.1

but you're right it seems that it is already covered on the master branch.

SaeedZhiany commented 4 years ago

Does anyone know why @naoufal or other repository maintainers does not review and merge the PRs or release merged PR as a new version? I have this issue too.

Aidurber commented 4 years ago

@SaeedZhiany It's open source. It's people volunteering their free time, they have no obligation to work for free. I recommend you maintain your own fork.