1.0.0 • Published 4 years ago
psm-face-captcha v1.0.0
PsmFaceCaptcha
This library was generated with Angular CLI version 10.0.14.
This library is for educational purposes and is in development.
Getting started
Instalation
npm i psm-face-captchaUsage 1
Opens a device's camera, a photo is captured, and returns information that determines whether the photo contains a face. In case of not having a face, a prediction of the element of the captured photo is made.
Import
In the file necessary example.module.ts import the module.
In this case app.module.ts
import { PsmFaceCaptchaModule } from 'psm-face-captcha';
.
.
.
... imports: [
...,
PsmFaceCaptchaModule
]...HTML
Add the selector inside some component and configure the input parameters:
<lib-psm-face-captcha
[companySrc]="companySrc"
(onloader)="onloader($event)"
(ondata)="ondata($event)"
(onerror)="onerror($event)">
</lib-psm-face-captcha>Typescript
Listen to the events and execute methods:
onloader(loader: boolean) {
// error handling
}
onerror(error: object) {
// loader handling
}
ondata(data: object) {
// data handling
}Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| companySrc | string | true | undefined | Image of company to paint in screen |
| backgroundIcon | string | false | "white" | Camera buttons background color |
| switchCamera | boolean | false | true | switch between front camera and rear camera |
Outputs
| Name | Return | Description |
|---|---|---|
| ondata | object | Is called after the user captured the photo |
| onloader | boolean | Is called when the process is asynchronous |
| onerror | object | Is called when an error happens |