bech-angular-k3a-functions
v0.0.2
Published
## How to use this package?
Downloads
3
Maintainers
Readme
Banco Estado de Chile - Angular K3A Functions Library
How to use this package?
- Import package module in your App Module.
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { BechAngularK3aFunctionsModule } from 'bech-angular-k3a-functions'; // -> Add this line
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule
],
providers: [BechAngularK3aFunctionsModule], // -> Add this line
bootstrap: [AppComponent]
})
export class AppModule { }
- Inject the package service in your application
import { Component } from '@angular/core';
import { K3AGlobals, K3APinpadService } from 'bech-angular-k3a-functions'; // -> Add this line
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
title = 'k3a-webapp-testing';
// -> Inject services
constructor(private k3aGlobals: K3AGlobals, private k3aPinpadService: K3APinpadService) {}
// -> Try Global functions
tryK3aGlobals() {
return this.k3aGlobals.activateComunication()
}
// -> Try Pinpad functions
tryK3aPinpad() {
return this.k3aPinpadService.getStatus()
}
}
Functions/Methods
Globals
activateComunication()
fromK3ACommandEvent(): Observable<K3ACommandDetail>
fromConnectEvent(): Observable<boolean>
sendInput(command: string | number): void
getProperty(propertyName: any): Promise<any>
setScratchPad(e: ScratchPad): void
getScratchPad(idScratchPad: any): Promise<any>
async waitForConnect(): Promise<boolean>
Pinpad
init()
getStatus(): Promise<PinpadStatus>
fromAllEvents(): Observable<K3ACommandDetail>
fromEvent(targetEvent:keyof typeof PinpadEvents): Observable<K3ACommandDetail>
readPinpad(): Promise<string>
readAllPinpadEntry(): Promise<string>