@cronapp/mlkit-api 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cronapp.json +19 -0
- package/i18n/locale_en_us.json +6 -0
- package/i18n/locale_pt_br.json +6 -0
- package/mlkit-api.cronap.js +39 -0
- package/package.json +13 -0
package/cronapp.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"postUpdate": {
|
|
3
|
+
"ionic": {
|
|
4
|
+
"includes": [
|
|
5
|
+
{
|
|
6
|
+
"file": "index.html",
|
|
7
|
+
"script": "node_modules/@cronapp/mlkit-api/mlkit-api.cronapi.js",
|
|
8
|
+
"type": "script"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"cordova": [
|
|
12
|
+
{
|
|
13
|
+
"name": "cronapp-plugin-mlkit",
|
|
14
|
+
"version": "1.0.0"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"faceDetector": "Detector de Rosto",
|
|
3
|
+
"faceDetectorDescription": "Detecta rostos em uma imagem",
|
|
4
|
+
"image": "Imagem: Caminho do arquivo ou Base64 com padrão data:image/<type>;base64,<data>",
|
|
5
|
+
"options": "Opções: Json com propriedades. Não utilizado por enquanto."
|
|
6
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
(function () {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
this.cronapi = this.cronapi || {};
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @categoryName ML Kit
|
|
8
|
+
*/
|
|
9
|
+
this.cronapi.mlkit = this.cronapi.mlkit || {};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @type function
|
|
13
|
+
* @name {{faceDetector}}
|
|
14
|
+
* @nameTags Face Detetor | Detecção de Faces
|
|
15
|
+
* @platform M
|
|
16
|
+
* @returns {ObjectType.Object}
|
|
17
|
+
* @description {{faceDetectorDescription}}
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
this.cronapi.mlkit.faceDetector = async function (/** @type {ObjectType.STRING} @description {{image}} */ image, /** @type {ObjectType.OBJECT} @description {{options}} */ options) {
|
|
21
|
+
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
try {
|
|
24
|
+
CronappMLKitPlugin.faceDetector(
|
|
25
|
+
image,
|
|
26
|
+
options || {},
|
|
27
|
+
(json) => {
|
|
28
|
+
resolve(json);
|
|
29
|
+
},
|
|
30
|
+
(error) => {
|
|
31
|
+
reject(error);
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
} catch (e) {
|
|
35
|
+
reject(e);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
}).bind(window)();
|