uni.automator.js 1.2 KB
Newer Older
fxy060608's avatar
fxy060608 已提交
1
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=e(require("licia/isWindows")),n=e(require("jimp"));require("licia/isStr");require("qrcode-terminal");const a=require("qrcode-reader");const r={devtools:{name:"Wechat web devTools",remote:!0,automator:!0,paths:[t?"C:/Program Files (x86)/Tencent/微信web开发者工具/cli.bat":"/Applications/wechatwebdevtools.app/Contents/MacOS/cli"],required:["project.config.json","app.json","app.js"],defaultPort:9420},adapter:{"Tool.enableRemoteDebug":{reflect:async(e,t)=>{let{qrCode:r}=await e("Tool.enableRemoteDebug",t,!1);return r&&(r=await function(e){const t=new Buffer(e,"base64");return new Promise(async(e,r)=>{const o=await n.read(t),c=new a;c.callback=function(t,n){if(t)return r(t);e(n.result)},c.decode(o.bitmap)})}(r)),{qrCode:r}}},"App.callUniMethod":{reflect:"App.callWxMethod"},"App.callFunction":{reflect:async(e,t)=>{return e("App.callFunction",Object.assign(Object.assign({},t),{functionDeclaration:(n=t.functionDeclaration,"}"===n[n.length-1]?n.replace("{","{\nvar uni = wx;\n"):n.replace("=>","=>{\nvar uni = wx;\nreturn ")+"}")}),!1);var n}},"Element.getHTML":{reflect:async(e,t)=>({html:(await e("Element.getWXML",t,!1)).wxml})}}};module.exports=r;