Skip to content
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

Interface 'CapacitorInstance' incorrectly extends interface 'CapacitorGlobal' #20

Open
mr-uzair opened this issue Aug 4, 2021 · 1 comment

Comments

@mr-uzair
Copy link

mr-uzair commented Aug 4, 2021

Hi, I'm getting folloing exception when trying to use this plugin.

Please help anyone

Exception:
] Error: node_modules/@capacitor/core/types/definitions-internal.d.ts:16:18 - error TS2430: Interface 'CapacitorInstance' incorrectly extends interface 'CapacitorGlobal'.
[ng] Types of property 'Plugins' are incompatible.
[ng] Property 'BiometricAuth' is missing in type '{ [pluginName: string]: { [prop: string]: any; }; }' but required in type 'PluginRegistry'.
[ng] 16 export interface CapacitorInstance extends CapacitorGlobal {
[ng] ~~~~~~~~~~~~~~~~~
[ng] node_modules/capacitor-biometric-auth/dist/esm/definitions.d.ts:3:9
[ng] 3 BiometricAuth: BiometricAuthPlugin;
[ng] ~~~~~~~~~~~~~
[ng] 'BiometricAuth' is declared here.

Code:

import { BiometricAuth } from 'capacitor-biometric-auth';

@component({
selector: 'app-login',
templateUrl: './login.page.html',
styleUrls: ['./login.page.scss'],
})
export class LoginPage extends BaseComponent implements OnInit {
loginModel: LoginModel;
loginForm = this.fb.group({
username: [, Validators.required],
password: [, Validators.required]
});
showFallback = true;
password = '1234';
hasBiometricAuth = false;
constructor(
injector: Injector,
private modalController: ModalController
) {
super(injector);
}

async ngOnInit() {
const available = await BiometricAuth.isAvailable();
this.hasBiometricAuth = available.has;
if (this.hasBiometricAuth) {

}

}

async openBiometricAuth() {
const authResult = await BiometricAuth.verify({
reason: 'Your session has timed out',
});
if (authResult.verified) {
this.dismissLockScreen();
}
}

dismissLockScreen() {
this.modalController.dismiss({ reset: true });
}

unLock() {
if (this.password === '1234') {
this.dismissLockScreen();
}
}

}

@JoseKook
Copy link

I have the same issue, Still can't fix it?

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

No branches or pull requests

2 participants