From a3d54a34b83d1c0515839cfbc39021dedccb3454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Alonso=20Silvestre?= Date: Tue, 5 May 2020 11:04:21 +0200 Subject: [PATCH] feat(firebase-vision): add plugin (#3400) --- .../plugins/firebase-vision/index.ts | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/@ionic-native/plugins/firebase-vision/index.ts diff --git a/src/@ionic-native/plugins/firebase-vision/index.ts b/src/@ionic-native/plugins/firebase-vision/index.ts new file mode 100644 index 0000000000..e19ec9f058 --- /dev/null +++ b/src/@ionic-native/plugins/firebase-vision/index.ts @@ -0,0 +1,44 @@ +import { Injectable } from '@angular/core'; +import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; + +/** + * @name Firebase Vision + * @description + * Cordova plugin for Firebase MLKit Vision + * + * @usage + * ```typescript + * import { FirebaseVision } from '@ionic-native/firebase-vision/ngx'; + * + * + * constructor(private firebaseVision: FirebaseVision) { } + * + * ... + * + * + * this.firebaseVision.onDeviceTextRecognizer(FILE_URI) + * .then((res: string) => console.log(res)) + * .catch((error: string) => console.error(error)); + * + * ``` + */ +@Plugin({ + pluginName: 'FirebaseVision', + plugin: 'cordova-plugin-firebase-mlvision', + pluginRef: 'FirebaseVisionPlugin', + repo: 'https://github.com/alon22/cordova-plugin-firebase-mlvision', + platforms: ['Android', 'iOS'] +}) +@Injectable() +export class FirebaseVision extends IonicNativePlugin { + + /** + * Recognize text in image + * @param file_uri {string} Image URI + * @return {Promise} Returns a promise that fulfills with the text in the image + */ + @Cordova() + onDeviceTextRecognizer(file_uri: string): Promise { + return; + } +}