Skip to content

Commit

Permalink
feat(firebase-vision): add plugin (#3400)
Browse files Browse the repository at this point in the history
  • Loading branch information
alon22 authored May 5, 2020
1 parent 3099b8c commit a3d54a3
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/@ionic-native/plugins/firebase-vision/index.ts
Original file line number Diff line number Diff line change
@@ -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<string>} Returns a promise that fulfills with the text in the image
*/
@Cordova()
onDeviceTextRecognizer(file_uri: string): Promise<string> {
return;
}
}

0 comments on commit a3d54a3

Please sign in to comment.