1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { Facial } from './libvbar-m-dxfacial.so'; // Placeholder for native module import
 
const dxCapcal = {};
 
// --- Constants & Enums ---
 
 
// Instantiate the native object immediately.
// Thanks to ES module caching, this will only run once.
const _native = new Facial();
 
 
// --- Public API ---
 
dxCapcal.init = function () {
    _native.initCapcal(); // Throws on error
};
 
dxCapcal.deinit = function () {
    _native.deinitCapcal();
};
 
dxCapcal.calculate = function (cnt) {
    return _native.calculateCapcal(cnt);
};
 
dxCapcal.getBox = function (cnt) {
    return _native.getBoxCapcal(cnt);
};
 
/**
 * Gets the native module instance.
 * @returns {object|null}
 */
dxCapcal.getNative = function () {
    return _native;
};
 
export default dxCapcal;