feat(anyline): add plugin (#3101)

closes: #3074
Co-authored-by: niconaso
This commit is contained in:
Daniel Sogl 2019-07-12 20:26:22 +02:00 committed by GitHub
parent 9a46ab1a6d
commit 8badd2943a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,51 @@
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
export interface AnylineOptions {
// Valid License Key
licenseKey: string;
// Scanning options
config: any;
}
/**
* @name Anyline
* @description
* Anyline provides an easy-to-use SDK for applications to enable Optical Character Recognition (OCR) on mobile devices.
*
* @usage
* ```typescript
* import { Anyline } from '@ionic-native/anyline/ngx';
*
*
* constructor(private anyline: Anyline) { }
*
* ...
*
*
* this.anyline.scan(options)
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* ```
*/
@Plugin({
pluginName: 'Anyline',
plugin: 'cordova-plugin-anyline',
pluginRef: 'Anyline',
repo: 'https://github.com/niconaso/anyline-ocr-cordova-module',
platforms: ['Android', 'iOS']
})
@Injectable()
export class Anyline extends IonicNativePlugin {
/**
* Scan
* @param options {AnylineOptions} Scanning options
* @return {Promise<any>} Returns a promise that resolves when Code is captured
*/
@Cordova()
scan(options: AnylineOptions): Promise<any> {
return;
}
}