gamelet-pixui-frame
Version:
pixui开发者框架
21 lines • 1.01 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GameletAPI = exports.currentImpl = void 0;
var preprocessor_gameletapi_1 = require("./framework/impl/jssdkimpl/preprocessorimpl/preprocessor_gameletapi");
var appwindow_gameletapi_1 = require("./framework/impl/jssdkimpl/appwindowimpl/appwindow_gameletapi");
// 初始化 currentImpl
exports.currentImpl = (function () {
return window["___ns_openplatform"] != undefined
? preprocessor_gameletapi_1.JSSDKPreprocessorGameletAPI.getInstance() // preprocessor 环境
: appwindow_gameletapi_1.JSSDKAppWindowGameletAPI.getInstance(); // appwindow 环境
})();
exports.GameletAPI = new Proxy({}, {
get: function (_, prop) {
if (!exports.currentImpl) {
throw new Error("GameletAPI 未初始化");
}
var value = exports.currentImpl[prop];
return typeof value === "function" ? value.bind(exports.currentImpl) : value;
},
});
//# sourceMappingURL=GameletAPIProxy.js.map