mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
feat(anyline): add plugin (#3101)
closes: #3074 Co-authored-by: niconaso
This commit is contained in:
parent
9a46ab1a6d
commit
8badd2943a
51
src/@ionic-native/plugins/anyline/index.ts
Normal file
51
src/@ionic-native/plugins/anyline/index.ts
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user