"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var electron_1 = require("electron");
var ElectronBaseService = /** @class */ (function () {
    function ElectronBaseService(_win) {
        this._win = _win;
    }
    ElectronBaseService.prototype.setWin = function (win) {
        this._win = win;
    };
    ElectronBaseService.prototype._IpcMainListener = function (seqId) {
        return new Promise(function (resolve, reject) {
            electron_1.ipcMain.once(seqId, function (_, res) {
                if (res.error) {
                    reject(res.error);
                }
                else {
                    resolve(res.result);
                }
            });
        });
    };
    return ElectronBaseService;
}());
exports.default = ElectronBaseService;