mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-31 10:36:14 +08:00
feat(firebase-vision): add plugin (#3400)
This commit is contained in:
parent
3099b8c76c
commit
a3d54a34b8
44
src/@ionic-native/plugins/firebase-vision/index.ts
Normal file
44
src/@ionic-native/plugins/firebase-vision/index.ts
Normal file
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user