gamelet-pixui-frame
Version:
pixui开发者框架
501 lines • 28.1 kB
JavaScript
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.JSSDKGameletAPI = void 0;
var utilities_1 = require("../../utilities/utilities");
var appwindow_gameletapi_1 = require("./appwindowimpl/appwindow_gameletapi");
var preprocessor_gameletapi_1 = require("./preprocessorimpl/preprocessor_gameletapi");
var JSSDKGameletAPIImpl = /** @class */ (function () {
function JSSDKGameletAPIImpl() {
if (window["___ns_openplatform"] != undefined) {
// runtime env is js-sdk preprocessor
this.gameletAPIInst = preprocessor_gameletapi_1.JSSDKPreprocessorGameletAPI.getInstance();
}
else {
// runtime env is js-sdk appwindow
this.gameletAPIInst = appwindow_gameletapi_1.JSSDKAppWindowGameletAPI.getInstance();
}
}
JSSDKGameletAPIImpl.prototype.canUsePlatformAPI = function () {
return this.gameletAPIInst.canUsePlatformAPI();
};
JSSDKGameletAPIImpl.prototype.getRuntimeEnv = function () {
return this.gameletAPIInst.getRuntimeEnv();
};
JSSDKGameletAPIImpl.prototype.genAppScopeEventName = function (evt) {
return this.gameletAPIInst.genAppScopeEventName(evt);
};
JSSDKGameletAPIImpl.prototype.getAppID = function () {
return this.gameletAPIInst.getAppID();
};
JSSDKGameletAPIImpl.prototype.getAppId = function () {
return this.gameletAPIInst.getAppID();
};
JSSDKGameletAPIImpl.prototype.getAppKey = function () {
return this.gameletAPIInst.getAppKey();
};
JSSDKGameletAPIImpl.prototype.getAppName = function () {
return this.gameletAPIInst.getAppName();
};
JSSDKGameletAPIImpl.prototype.getAppVersion = function () {
return this.gameletAPIInst.getAppVersion();
};
JSSDKGameletAPIImpl.prototype.getAppEntranceConfig = function (key) {
return this.gameletAPIInst.getAppEntranceConfig(key);
};
JSSDKGameletAPIImpl.prototype.getOpenArgs = function () {
return this.gameletAPIInst.getOpenArgs();
};
JSSDKGameletAPIImpl.prototype.getIsProductEnvironment = function () {
return this.gameletAPIInst.getIsProductEnvironment();
};
JSSDKGameletAPIImpl.prototype.getIsHitBackendWhitelist = function () {
return this.gameletAPIInst.getIsHitBackendWhitelist();
};
JSSDKGameletAPIImpl.prototype.getIsSupportCallbroker = function () {
return this.gameletAPIInst.getIsSupportCallbroker();
};
JSSDKGameletAPIImpl.prototype.getPlatformDesc = function () {
return this.gameletAPIInst.getPlatformDesc();
};
JSSDKGameletAPIImpl.prototype.getEntryInfo = function () {
return this.gameletAPIInst.getEntryInfo();
};
JSSDKGameletAPIImpl.prototype.getFaasAddr = function () {
return this.gameletAPIInst.getFaasAddr();
};
JSSDKGameletAPIImpl.prototype.getUserData = function () {
return __awaiter(this, void 0, void 0, function () {
var ud;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.gameletAPIInst.getUserData()
// /**
// * member不为 undefined|null 时取member,否则取backupMember
// * js 中会把 0, "" 当做 false ,所以不能简单判断
// */
// function checkUserDataMember(member, backupMember): string | undefined{
// if(member == undefined){
// // member === undefined | null
// return backupMember;
// }
// return member;
// }
// ud["sOpenId"] = checkUserDataMember(ud["sOpenId"], ud.openID);
// ud["sServiceType"] = checkUserDataMember(ud["sServiceType"], ud.serviceType);
// ud["sAppId"] = checkUserDataMember(ud["sAppId"] , ud.appID);
// ud["sRoleId"] = checkUserDataMember(ud["sRoleId"] , ud.roleID);
// ud["sPlatID"] = checkUserDataMember(ud["sPlatID"] , ud.platID);
// ud["sAcountType"] = checkUserDataMember(ud["sAcountType"] , ud.accountType);
// ud["sArea"] = checkUserDataMember(ud["sArea"] , ud.area);
// ud["sPartition"] = checkUserDataMember(ud["sPartition"] , ud.partition);
// ud["sAccessToken"] = checkUserDataMember(ud["sAccessToken"] , ud.accessToken);
// ud["sGameVer"] = checkUserDataMember(ud["sGameVer"] , ud.gameVer);
// ud["sPayToken"] = checkUserDataMember(ud["sPayToken"] , ud.payToken);
// ud["sChannelID"] = checkUserDataMember( ud["sChannelID"], ud.channelID);
// ud["sSdkVersion"] = checkUserDataMember(ud["sSdkVersion"] , ud.sdkVersion);
// ud["sSign"] = checkUserDataMember(ud["sSign"] , ud.sign);
// ud["sLoginChannel"] = checkUserDataMember(ud["sLoginChannel"] , ud.loginChannel);
// ud["sCountry"] = checkUserDataMember(ud["sCountry"] , ud.country);
// ud["sIntlSdkParam"] = checkUserDataMember(ud["sIntlSdkParam"] , ud.intlSdkParam);
// ud["sLanguage"] = checkUserDataMember(ud["sLanguage"] , ud.language);
// ud["sQQInstalled"] = checkUserDataMember(ud["sQQInstalled"] , ud.qq_installed);
// ud["sWXInstalled"] = checkUserDataMember(ud["sWXInstalled"] , ud.wx_installed);
// ud["sExtend"] = checkUserDataMember(ud["sExtend"] , ud.extend_args);
// ud["openID"] = checkUserDataMember(ud["sOpenId"] , ud.openID);
// ud["serviceType"] = checkUserDataMember(ud["sServiceType"] , ud.serviceType);
// ud["appID"] = checkUserDataMember(ud["sAppId"] , ud.appID);
// ud["roleID"] = checkUserDataMember(ud["sRoleId"] , ud.roleID);
// ud["platID"] = checkUserDataMember(ud["sPlatID"] , ud.platID);
// ud["accountType"] = checkUserDataMember(ud["sAcountType"] , ud.accountType);
// ud["area"] = checkUserDataMember(ud["sArea"] , ud.area);
// ud["partition"] = checkUserDataMember(ud["sPartition"] , ud.partition);
// ud["accessToken"] = checkUserDataMember(ud["sAccessToken"] , ud.accessToken);
// ud["gameVer"] = checkUserDataMember(ud["sGameVer"] , ud.gameVer);
// ud["payToken"] = checkUserDataMember(ud["sPayToken"] , ud.payToken);
// ud["channelID"] = checkUserDataMember(ud["sChannelID"] , ud.channelID);
// ud["sdkVersion"] = checkUserDataMember(ud["sSdkVersion"] , ud.sdkVersion);
// ud["sign"] = checkUserDataMember(ud["sSign"] , ud.sign);
// ud["loginChannel"] = checkUserDataMember(ud["sLoginChannel"] , ud.loginChannel);
// ud["country"] = checkUserDataMember(ud["sCountry"] , ud.country);
// ud["intlSdkParam"] = checkUserDataMember(ud["sIntlSdkParam"] , ud.intlSdkParam);
// ud["language"] = checkUserDataMember(ud["sLanguage"] , ud.language);
// ud["qqInstalled"] = checkUserDataMember(ud["sQQInstalled"] , ud.qq_installed);
// ud["wxInstalled"] = checkUserDataMember(ud["sWXInstalled"] , ud.wx_installed);
// ud["extend"] = checkUserDataMember(ud["sExtend"] , ud.extend_args);
];
case 1:
ud = _a.sent();
// /**
// * member不为 undefined|null 时取member,否则取backupMember
// * js 中会把 0, "" 当做 false ,所以不能简单判断
// */
// function checkUserDataMember(member, backupMember): string | undefined{
// if(member == undefined){
// // member === undefined | null
// return backupMember;
// }
// return member;
// }
// ud["sOpenId"] = checkUserDataMember(ud["sOpenId"], ud.openID);
// ud["sServiceType"] = checkUserDataMember(ud["sServiceType"], ud.serviceType);
// ud["sAppId"] = checkUserDataMember(ud["sAppId"] , ud.appID);
// ud["sRoleId"] = checkUserDataMember(ud["sRoleId"] , ud.roleID);
// ud["sPlatID"] = checkUserDataMember(ud["sPlatID"] , ud.platID);
// ud["sAcountType"] = checkUserDataMember(ud["sAcountType"] , ud.accountType);
// ud["sArea"] = checkUserDataMember(ud["sArea"] , ud.area);
// ud["sPartition"] = checkUserDataMember(ud["sPartition"] , ud.partition);
// ud["sAccessToken"] = checkUserDataMember(ud["sAccessToken"] , ud.accessToken);
// ud["sGameVer"] = checkUserDataMember(ud["sGameVer"] , ud.gameVer);
// ud["sPayToken"] = checkUserDataMember(ud["sPayToken"] , ud.payToken);
// ud["sChannelID"] = checkUserDataMember( ud["sChannelID"], ud.channelID);
// ud["sSdkVersion"] = checkUserDataMember(ud["sSdkVersion"] , ud.sdkVersion);
// ud["sSign"] = checkUserDataMember(ud["sSign"] , ud.sign);
// ud["sLoginChannel"] = checkUserDataMember(ud["sLoginChannel"] , ud.loginChannel);
// ud["sCountry"] = checkUserDataMember(ud["sCountry"] , ud.country);
// ud["sIntlSdkParam"] = checkUserDataMember(ud["sIntlSdkParam"] , ud.intlSdkParam);
// ud["sLanguage"] = checkUserDataMember(ud["sLanguage"] , ud.language);
// ud["sQQInstalled"] = checkUserDataMember(ud["sQQInstalled"] , ud.qq_installed);
// ud["sWXInstalled"] = checkUserDataMember(ud["sWXInstalled"] , ud.wx_installed);
// ud["sExtend"] = checkUserDataMember(ud["sExtend"] , ud.extend_args);
// ud["openID"] = checkUserDataMember(ud["sOpenId"] , ud.openID);
// ud["serviceType"] = checkUserDataMember(ud["sServiceType"] , ud.serviceType);
// ud["appID"] = checkUserDataMember(ud["sAppId"] , ud.appID);
// ud["roleID"] = checkUserDataMember(ud["sRoleId"] , ud.roleID);
// ud["platID"] = checkUserDataMember(ud["sPlatID"] , ud.platID);
// ud["accountType"] = checkUserDataMember(ud["sAcountType"] , ud.accountType);
// ud["area"] = checkUserDataMember(ud["sArea"] , ud.area);
// ud["partition"] = checkUserDataMember(ud["sPartition"] , ud.partition);
// ud["accessToken"] = checkUserDataMember(ud["sAccessToken"] , ud.accessToken);
// ud["gameVer"] = checkUserDataMember(ud["sGameVer"] , ud.gameVer);
// ud["payToken"] = checkUserDataMember(ud["sPayToken"] , ud.payToken);
// ud["channelID"] = checkUserDataMember(ud["sChannelID"] , ud.channelID);
// ud["sdkVersion"] = checkUserDataMember(ud["sSdkVersion"] , ud.sdkVersion);
// ud["sign"] = checkUserDataMember(ud["sSign"] , ud.sign);
// ud["loginChannel"] = checkUserDataMember(ud["sLoginChannel"] , ud.loginChannel);
// ud["country"] = checkUserDataMember(ud["sCountry"] , ud.country);
// ud["intlSdkParam"] = checkUserDataMember(ud["sIntlSdkParam"] , ud.intlSdkParam);
// ud["language"] = checkUserDataMember(ud["sLanguage"] , ud.language);
// ud["qqInstalled"] = checkUserDataMember(ud["sQQInstalled"] , ud.qq_installed);
// ud["wxInstalled"] = checkUserDataMember(ud["sWXInstalled"] , ud.wx_installed);
// ud["extend"] = checkUserDataMember(ud["sExtend"] , ud.extend_args);
return [2 /*return*/, new Promise(function (resolve) {
resolve(ud);
})];
}
});
});
};
JSSDKGameletAPIImpl.prototype.refreshUserDataTokens = function () {
return this.gameletAPIInst.refreshUserDataTokens();
};
JSSDKGameletAPIImpl.prototype.reportJSExceptionStringToTDM = function (content) {
this.gameletAPIInst.reportJSExceptionStringToTDM(content);
};
JSSDKGameletAPIImpl.prototype.reportStringToTDM = function (content, tag) {
this.gameletAPIInst.reportStringToTDM(content, tag);
};
JSSDKGameletAPIImpl.prototype.reportNumberToTDM = function (tag) {
this.gameletAPIInst.reportNumberToTDM(tag);
};
JSSDKGameletAPIImpl.prototype.faasReportStringToTDM = function (content, tag) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.gameletAPIInst.faasReportStringToTDM(content, tag)];
});
});
};
JSSDKGameletAPIImpl.prototype.faasReportNumberToTDM = function (tag) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.gameletAPIInst.faasReportNumberToTDM(tag)];
});
});
};
JSSDKGameletAPIImpl.prototype.reportStatsV2 = function (iType, iChangjingId, iGoodsId, iCountId, iFee, iFlowId, extendList, appId) {
this.gameletAPIInst.reportStatsV2(iType, iChangjingId, iGoodsId, iCountId, iFee, iFlowId, extendList, appId);
};
JSSDKGameletAPIImpl.prototype.reportMonitorV2 = function (tag, content, itype) {
this.gameletAPIInst.reportMonitorV2(tag, content, itype);
};
JSSDKGameletAPIImpl.prototype.setDataStash = function (key, value) {
return this.gameletAPIInst.setDataStash(key, value);
};
JSSDKGameletAPIImpl.prototype.getDataStash = function (key) {
return this.gameletAPIInst.getDataStash(key);
};
JSSDKGameletAPIImpl.prototype.clearDataStash = function () {
return this.gameletAPIInst.clearDataStash();
};
JSSDKGameletAPIImpl.prototype.writeCookie = function (customerName, content, appId) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.gameletAPIInst.writeCookie(customerName, content, appId)];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
JSSDKGameletAPIImpl.prototype.writeRoleCookie = function (customerName, content, appId) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.gameletAPIInst.writeRoleCookie(customerName, content, appId)];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
JSSDKGameletAPIImpl.prototype.readCookie = function (customerName, appId) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.gameletAPIInst.readCookie(customerName, appId)];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
JSSDKGameletAPIImpl.prototype.readRoleCookie = function (customerName, appId) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.gameletAPIInst.readRoleCookie(customerName, appId)];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
JSSDKGameletAPIImpl.prototype.deleteCookie = function (customerName, appId) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.gameletAPIInst.deleteCookie(customerName, appId)];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
JSSDKGameletAPIImpl.prototype.addOnGameCommandListener = function (func) {
this.gameletAPIInst.addOnGameCommandListener(func);
};
JSSDKGameletAPIImpl.prototype.removeOnGameCommandListener = function (func) {
this.gameletAPIInst.removeOnGameCommandListener(func);
};
JSSDKGameletAPIImpl.prototype.addOnSrvPushDataListener = function (func) {
this.gameletAPIInst.addOnSrvPushDataListener(func);
};
JSSDKGameletAPIImpl.prototype.removeOnSrvPushDataListener = function (func) {
this.gameletAPIInst.removeOnSrvPushDataListener(func);
};
JSSDKGameletAPIImpl.prototype.addEventListener = function (evt, func) {
this.gameletAPIInst.addEventListener(evt, func);
};
JSSDKGameletAPIImpl.prototype.removeEventListener = function (evt, func) {
this.gameletAPIInst.removeEventListener(evt, func);
};
JSSDKGameletAPIImpl.prototype.dispatchEvent = function (evt) {
var _a;
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
(_a = this.gameletAPIInst).dispatchEvent.apply(_a, __spreadArray([evt], args, false));
};
JSSDKGameletAPIImpl.prototype.addLocalEventListener = function (evt, func) {
this.gameletAPIInst.addLocalEventListener(evt, func);
};
JSSDKGameletAPIImpl.prototype.removeLocalEventListener = function (evt, func) {
this.gameletAPIInst.removeLocalEventListener(evt, func);
};
JSSDKGameletAPIImpl.prototype.dispatchLocalEvent = function (evt) {
var _a;
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
(_a = this.gameletAPIInst).dispatchLocalEvent.apply(_a, __spreadArray([evt], args, false));
};
JSSDKGameletAPIImpl.prototype.callGame = function (msg) {
this.gameletAPIInst.callGame(msg);
};
JSSDKGameletAPIImpl.prototype.open = function (appID, extend) {
this.gameletAPIInst.open(appID, extend);
};
JSSDKGameletAPIImpl.prototype.close = function (appID, extend) {
this.gameletAPIInst.close(appID, extend);
};
JSSDKGameletAPIImpl.prototype.reportStats = function (usredata, iModule, iChannelID, iType, iActId, iJumpType, sJumpURL, sRecommendID, sChangjingID, iGoodsID, iCountID, iFee, iActStyle, iFlowID, sExtendList) {
this.gameletAPIInst.reportStats(usredata, iModule, iChannelID, iType, iActId, iJumpType, sJumpURL, sRecommendID, sChangjingID, iGoodsID, iCountID, iFee, iActStyle, iFlowID, sExtendList);
};
JSSDKGameletAPIImpl.prototype.getAppInfo = function (appId, appKey) {
return __awaiter(this, void 0, void 0, function () {
var ret;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
ret = {};
return [4 /*yield*/, this.gameletAPIInst.getAppInfo(appId, appKey)];
case 1:
// @ts-ignore
ret = _a.sent();
return [2 /*return*/, ret];
}
});
});
};
JSSDKGameletAPIImpl.prototype.queryAppStatus = function (appId) {
return __awaiter(this, void 0, void 0, function () {
var ret;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
ret = {};
return [4 /*yield*/, this.gameletAPIInst.queryAppStatus(appId)];
case 1:
// @ts-ignore
ret = _a.sent();
return [2 /*return*/, ret];
}
});
});
};
JSSDKGameletAPIImpl.prototype.callApplicationBroker = function (commandId, subCommandId, req, callback) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
this.gameletAPIInst.callApplicationBroker(commandId, subCommandId, req, callback);
return [2 /*return*/];
});
});
};
JSSDKGameletAPIImpl.prototype.gameCustomFunction = function (functionName) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
};
JSSDKGameletAPIImpl.prototype.getArchivePath = function () {
//@ts-ignore
return this.gameletAPIInst.getArchivePath();
};
JSSDKGameletAPIImpl.prototype.loadFileToArrayBuffer = function (path) {
//@ts-ignore
return this.gameletAPIInst.loadFileToArrayBuffer(path);
};
JSSDKGameletAPIImpl.prototype.loadFileToString = function (path) {
//@ts-ignore
return this.gameletAPIInst.loadFileToString(path);
};
JSSDKGameletAPIImpl.prototype.saveArrayBufferToFile = function (path, arrayBuffer) {
//@ts-ignore
return this.gameletAPIInst.saveArrayBufferToFile(path, arrayBuffer);
};
JSSDKGameletAPIImpl.prototype.saveStringToFile = function (path, str) {
//@ts-ignore
return this.gameletAPIInst.saveStringToFile(path, str);
};
JSSDKGameletAPIImpl.prototype.setGameletAppEnv = function (appInfo, _isProductEnvironment) {
this.gameletAPIInst.setGameletAppEnv(appInfo, _isProductEnvironment);
};
JSSDKGameletAPIImpl.prototype.getResourcePath = function () {
//@ts-ignore
return this.gameletAPIInst.getResourcePath();
};
JSSDKGameletAPIImpl.prototype.cacheAsset = function (url, callback) {
return this.gameletAPIInst.cacheAsset(url, callback);
};
JSSDKGameletAPIImpl.prototype.isAssetCached = function (url) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.gameletAPIInst.isAssetCached(url)];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
JSSDKGameletAPIImpl.prototype.getAssetCachePath = function (url) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.gameletAPIInst.getAssetCachePath(url)];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
JSSDKGameletAPIImpl.prototype.storeAsset = function (url, callback) {
return this.gameletAPIInst.storeAsset(url, callback);
};
JSSDKGameletAPIImpl.prototype.isAssetStored = function (url) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.gameletAPIInst.isAssetStored(url)];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
JSSDKGameletAPIImpl.prototype.getAssetStorePath = function (url) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.gameletAPIInst.getAssetStorePath(url)];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
JSSDKGameletAPIImpl.prototype.getJSSDKVersion = function () {
return this.gameletAPIInst.getJSSDKVersion();
};
return JSSDKGameletAPIImpl;
}());
exports.JSSDKGameletAPI = (0, utilities_1.singleton)(JSSDKGameletAPIImpl);
//# sourceMappingURL=jssdk_gameletapi.js.map