"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const web_1=__importDefault(require("../bridge/platform/web")),api_1=require("../baseSdk/api");class BaseBridgeManager{constructor(){this.mainBridge=new web_1.default}chooseFolder(){return new Promise((e,s)=>{this.mainBridge.subscribe(api_1.TransferApi.chooseFolder,{success(s){e(s)},fail(e){s(e)}})})}openProject(e){return new Promise((s,i)=>{this.mainBridge.subscribe(api_1.TransferApi.openProject,Object.assign(Object.assign({},e),{success(e){s(e)},fail(e){i(e)}}))})}checkProject(e){return new Promise((s,i)=>{this.mainBridge.subscribe(api_1.TransferApi.checkProject,{compilePath:e.compilePath,appType:e.appType,success(){s()},fail(e){i(e)}})})}getSystemPathInfo(e){return new Promise((s,i)=>{this.mainBridge.subscribe(api_1.TransferApi.getSystemPathInfo,{path:e.path,success(e){s(e)},fail(e){i(e)}})})}openFile(e){this.mainBridge.subscribe(api_1.TransferApi.openFile,{dir:e})}getUUID(){return new Promise(e=>{this.mainBridge.subscribe(api_1.TransferApi.getUUID,{success(s){e(s)}})})}accountInfo(){return new Promise(e=>{this.mainBridge.subscribe(api_1.TransferApi.accountInfo,{success(s){e(s)}})})}accountLogin(e){return new Promise((s,i)=>{this.mainBridge.subscribe(api_1.TransferApi.accountLogin,{environment:e,success(e){s(e)},fail(e){i(e)}})})}accountLogout(){return new Promise(e=>{this.mainBridge.subscribe(api_1.TransferApi.accountLogout,{success(){e()}})})}accountTenant(){return new Promise((e,s)=>{this.mainBridge.subscribe(api_1.TransferApi.accountTenant,{success(s){e(s)},fail(e){s(e)}})})}accountTenantSwitch(e){return new Promise(s=>{this.mainBridge.subscribe(api_1.TransferApi.accountTenantSwitch,{account:e,success(e){s(e)}})})}openPage(e){return new Promise((s,i)=>{this.mainBridge.subscribe(api_1.TransferApi.openPage,{url:e,success(){s()},fail(e){i(e)}})})}getRecentProject(){return new Promise((e,s)=>{this.mainBridge.subscribe(api_1.TransferApi.recentProject,{success(s){e(s)},fail(e){s(e)}})})}deleteProjects(e){return new Promise((s,i)=>{this.mainBridge.subscribe(api_1.TransferApi.deleteProjects,{compilePaths:e.compilePaths,appType:e.appType,success(e){s(e)},fail(e){i(e)}})})}templateList(e){return new Promise((s,i)=>{this.mainBridge.subscribe(api_1.TransferApi.templateList,{appType:e,success(e){s(e)},fail(e){i(e)}})})}createProject(e){return new Promise((s,i)=>{this.mainBridge.subscribe(api_1.TransferApi.createProject,{targetPath:e.targetPath,templateName:e.templateName,projectName:e.projectName,appID:e.appID,blockTypeId:e.blockTypeId,success(e){s(e)},fail(e){i(e)}})})}getHelpDocUrl(){return new Promise((e,s)=>{this.mainBridge.subscribe(api_1.TransferApi.helpDocUrl,{success(s){e(s)},fail(e){s(e)}})})}feedBack(){return new Promise((e,s)=>{this.mainBridge.subscribe(api_1.TransferApi.feedback,{success(s){e(s)},fail(e){s(e)}})})}featureGating(e){return new Promise((s,i)=>{this.mainBridge.subscribe(api_1.TransferApi.featureGating,{keys:e,success(e){s(e)},fail(e){i(e)}})})}enableBlock(){return new Promise(e=>{this.mainBridge.subscribe(api_1.TransferApi.enableBlock,{success(s){e(s)}})})}enableH5Block(){return new Promise(e=>{this.mainBridge.subscribe(api_1.TransferApi.enableH5Block,{success(s){e(s)}})})}eventTracker(e,s){this.mainBridge.subscribe(api_1.TransferApi.eventTracker,{name:e,tags:s})}eventTrackV2(e,s,i,r){this.mainBridge.subscribe(api_1.TransferApi.eventTrackV2,{name:e,tags:s,traceId:i,timingName:r})}reportResult(e,s,i,r){this.mainBridge.subscribe(api_1.TransferApi.reportResult,{name:e,result:s,tags:i,traceId:r})}getSettings(){return new Promise((e,s)=>{this.mainBridge.subscribe(api_1.TransferApi.getSettings,{success(s){e(s)},fail(e){s(e)}})})}setSettings(e){return new Promise((s,i)=>{this.mainBridge.subscribe(api_1.TransferApi.setSettings,{settings:e,success(e){s(e)},fail(e){i(e)}})})}getRoutePath(){return new Promise((e,s)=>{this.mainBridge.subscribe(api_1.TransferApi.getRoutePath,{success(s){e(s)},fail(e){s(e)}})})}getClipboardData(){return new Promise((e,s)=>{this.mainBridge.subscribe(api_1.TransferApi.getClipboardData,{success(s){e(s)},fail(e){s(e)}})})}reportIssue(e){return new Promise(s=>{this.mainBridge.subscribe(api_1.TransferApi.reportIssue,Object.assign(Object.assign({},e),{success(e){s(e)},fail(e){s({flag:!1,message:e})}}))})}}exports.default=BaseBridgeManager;