Skip to content

Change TS types to use string literals instead enums, and added missing methods #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2019

Conversation

savelichalex
Copy link
Contributor

RNSensitiveInfoAccessControlOptions and RNSensitiveInfoAttrAccessibleOptions was changed to string literals by following reasons:

  • enums in declaration files should be declared as const to be able to import it to source code, but it works not well for instance with babel;
  • String literals using heavily in RN types, so it's a common practice.

Some available methods was missing, but are using in docs and examples.


module.exports = {
...RNSensitiveInfo,
setInvalidatedByBiometricEnrollment() {
Copy link
Contributor Author

@savelichalex savelichalex Apr 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since that method is not available on iOS it's needed to add a guard in user code, but I think it's better to handle that in the library. (At least we have them on TS typings, and can't separate that for different OS).

Btw, there are isHardwareDetected() and hasEnrolledFingerprints() methods, that needed to be guarded in a same way, but it will be unfair to do nothing, and it will be hard to debug, why nothing happened.

Copy link
Owner

@mCodex mCodex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, man!

@mCodex mCodex merged commit 2b585e4 into mCodex:master Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants