UNPKG

t-comm

Version:

专业、稳定、纯粹的工具库

89 lines (86 loc) 2.62 kB
import { b as __awaiter, c as __generator, _ as __assign } from '../../tslib.es6-096fffdd.js'; import { initAegis } from './core.js'; import '../env.js'; import '../gamelet.js'; var AegisReportInPixui = /** @class */function () { function AegisReportInPixui() {} AegisReportInPixui.init = function (options) { return __awaiter(this, void 0, void 0, function () { var aegis; return __generator(this, function (_a) { switch (_a.label) { case 0: if (this.aegis) { return [2 /*return*/, this.aegis]; } this.options = options; _a.label = 1; case 1: _a.trys.push([1, 3,, 4]); return [4 /*yield*/, initAegis(options)]; case 2: aegis = _a.sent(); return [3 /*break*/, 4]; case 3: _a.sent(); return [3 /*break*/, 4]; case 4: if (aegis) { this.aegis = aegis; } return [2 /*return*/, aegis]; } }); }); }; AegisReportInPixui.report = function (info) { var _a; return __awaiter(this, void 0, void 0, function () { var aegis; return __generator(this, function (_b) { switch (_b.label) { case 0: _b.trys.push([0, 3,, 4]); return [4 /*yield*/, this.init(this.options)]; case 1: aegis = _b.sent(); return [4 /*yield*/, (_a = aegis.report) === null || _a === void 0 ? void 0 : _a.call(aegis, __assign({}, info))]; case 2: _b.sent(); return [3 /*break*/, 4]; case 3: _b.sent(); return [3 /*break*/, 4]; case 4: return [2 /*return*/]; } }); }); }; AegisReportInPixui.info = function (info) { var _a; return __awaiter(this, void 0, void 0, function () { var aegis; return __generator(this, function (_b) { switch (_b.label) { case 0: _b.trys.push([0, 3,, 4]); return [4 /*yield*/, this.init(this.options)]; case 1: aegis = _b.sent(); return [4 /*yield*/, (_a = aegis.info) === null || _a === void 0 ? void 0 : _a.call(aegis, __assign({}, info))]; case 2: _b.sent(); return [3 /*break*/, 4]; case 3: _b.sent(); return [3 /*break*/, 4]; case 4: return [2 /*return*/]; } }); }); }; return AegisReportInPixui; }(); export { AegisReportInPixui };