When converting a JavaScript function to TypeScript, I encountered an issue. The function works fine in JS but in TS, I receive the following error:
[ts] Cannot find name 'PasscodeAuth'. Did you mean 'passcodeAuth'?
function passcodeAuth() {
return PasscodeAuth.isSupported()
.then(() => {
return PasscodeAuth.authenticate()
})
.then(success => {
AlertIOS.alert('Authenticated Successfully');
})
.catch(error => {
console.log(error)
AlertIOS.alert(error.message);
});
}
The 'PasscodeAuth' entity is not imported or defined anywhere, yet it functions correctly in JavaScript. How can I make it recognizable for TypeScript? In JavaScript, I can use any word as a parameter and still have access to 'isSupported' and 'authenticate', even if it's not a real parameter. Any suggestions on how to resolve this for TypeScript?
Appreciate any insights! Thanks!