var exec = require('cordova/exec');

var PLUGIN_NAME = 'IminPrinter';

var IminPrinter = {

    print: function (text) {
        return new Promise(function (resolve, reject) {
            //cordova.exec(resolve, reject, "Printer", "getPrinterVersion", []);
            exec(resolve, reject, PLUGIN_NAME, 'print', [text]);
        });
    },
    scan: function () {
       return new Promise(function (resolve, reject) {
           exec(resolve, reject, PLUGIN_NAME, 'scan', []);
       });
    },
    checkStatus: function () {
       return new Promise(function (resolve, reject) {
           exec(resolve, reject, PLUGIN_NAME, 'checkStatus', []);
       });
    },
    initNfcCard: function () {
   return new Promise(function (resolve, reject) {
       exec(resolve, reject, PLUGIN_NAME, 'initNfcCard', []);
   });
 },
    readNfc: function () {
   return new Promise(function (resolve, reject) {
       exec(resolve, reject, PLUGIN_NAME, 'readNfc', []);
   });
}
};

module.exports = IminPrinter;
