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; + } +}