From 8badd2943a56c04d5e2317573df7519905b5283d Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Fri, 12 Jul 2019 20:26:22 +0200 Subject: [PATCH] feat(anyline): add plugin (#3101) closes: #3074 Co-authored-by: niconaso --- src/@ionic-native/plugins/anyline/index.ts | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/@ionic-native/plugins/anyline/index.ts diff --git a/src/@ionic-native/plugins/anyline/index.ts b/src/@ionic-native/plugins/anyline/index.ts new file mode 100644 index 000000000..528c98ff2 --- /dev/null +++ b/src/@ionic-native/plugins/anyline/index.ts @@ -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} Returns a promise that resolves when Code is captured + */ + @Cordova() + scan(options: AnylineOptions): Promise { + return; + } +}