@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 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": "Face Detector",
3
+ "faceDetectorDescription": "Detects faces in an image",
4
+ "image": "Image: File path or Base64 with pattern data:image/<type>;base64,<data>",
5
+ "options": "Options: Json with properties. Not used for now."
6
+ }
@@ -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)();
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@cronapp/mlkit-api",
3
+ "version": "1.0.0",
4
+ "description": "Cronapp ML Kit",
5
+ "keywords": [
6
+ "cronapp",
7
+ "mlkit",
8
+ "mobile",
9
+ "plugin"
10
+ ],
11
+ "author": "Cronapp Studio",
12
+ "license": "ISC"
13
+ }