From 7b94d4fccf94a54f40ddd04150cdf0d22e450607 Mon Sep 17 00:00:00 2001 From: Dmitry Smolyakov Date: Wed, 27 Sep 2017 23:58:31 +0300 Subject: [PATCH] feat(document-reader): add cordova-plugin-documentreader (#1996) --- .../plugins/document-reader/index.ts | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/@ionic-native/plugins/document-reader/index.ts diff --git a/src/@ionic-native/plugins/document-reader/index.ts b/src/@ionic-native/plugins/document-reader/index.ts new file mode 100644 index 000000000..1bf9a328f --- /dev/null +++ b/src/@ionic-native/plugins/document-reader/index.ts @@ -0,0 +1,36 @@ +import { Injectable } from '@angular/core'; +import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; + +/** + * @name DocumentReader + * @description + * Plugin for reading and validation of identification documents. + * + * @usage + * ```typescript + * import { DocumentReader } from 'ionic-native'; + * var license; // read regula.license file + * DocumentReader.scanDocument(license).then((result) => { + * // read result + * }) + * ``` + */ +@Plugin({ + pluginName: 'DocumentReader', + plugin: 'cordova-plugin-documentreader', + pluginRef: 'DocumentReader', + repo: 'https://github.com/regulaforensics/cordova-plugin-documentreader.git', + platforms: ['iOS'], + install: 'ionic plugin add cordova-plugin-documentreader --variable CAMERA_USAGE_DESCRIPTION="To take photo"', +}) +@Injectable() +export class DocumentReader extends IonicNativePlugin { + + /** + * Run the scanner + * @param license {any} License data + * @return {Promise} Returns a promise that resolves when results was got, and fails when not + */ + @Cordova() + scanDocument(license: any): Promise { return; } +}