capacitor-biometric-auth icon indicating copy to clipboard operation
capacitor-biometric-auth copied to clipboard

Interface 'CapacitorInstance' incorrectly extends interface 'CapacitorGlobal'

Open mr-uzair opened this issue 3 years ago • 1 comments

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(); } }

}

mr-uzair avatar Aug 04 '21 03:08 mr-uzair

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

JoseKook avatar Dec 18 '21 22:12 JoseKook