naoufal / react-native-touch-id

React Native authentication with the native Touch ID popup.

Home Page:https://www.npmjs.com/package/react-native-touch-id

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeScript issue with return type of TouchID.authenticate

jbinda opened this issue · comments

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 ?

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?

@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.

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.

@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.