react-native-touch-id icon indicating copy to clipboard operation
react-native-touch-id copied to clipboard

TypeScript issue with return type of TouchID.authenticate

Open jbinda opened this issue 6 years ago • 4 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 ?

jbinda avatar Jul 10 '19 06:07 jbinda

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 avatar Aug 14 '19 10:08 Aidurber

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

jbinda avatar Aug 14 '19 11:08 jbinda

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 avatar Aug 28 '19 07:08 SaeedZhiany

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

Aidurber avatar Aug 28 '19 08:08 Aidurber