ms-vite-plugin 1.4.70 → 1.4.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/luaObfuscator/addVararg.js +1 -1
- package/dist/luaObfuscator/flatten.js +1 -1
- package/dist/luaObfuscator/rename.js +1 -1
- package/dist/luaObfuscator/scope.js +1 -1
- package/docs/api/hid.md +20 -0
- package/docs/apicn/hid.md +20 -0
- package/docs/apilua/hid.md +22 -0
- package/docs/apipython/hid.md +21 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addVararg=c;function s(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addVararg=c;function s(r){r.vararg=!0,t(r.body.body)}function a(r){switch(r.type){case"FuncExpr":s(r);break;case"UnaryExpr":a(r.arg);break;case"BinaryExpr":a(r.left),a(r.right);break;case"TableExpr":for(const e of r.fields)e.kind==="index"&&a(e.key),a(e.value);break;case"IndexExpr":a(r.object),a(r.index);break;case"MemberExpr":a(r.object);break;case"CallExpr":a(r.callee);for(const e of r.args)a(e);break;case"MethodCallExpr":a(r.object);for(const e of r.args)a(e);break;case"ParenExpr":a(r.exp);break;default:break}}function t(r){for(const e of r)switch(e.type){case"DoStat":case"WhileStat":case"RepeatStat":case"ForNumStat":case"ForInStat":if(e.type==="WhileStat"&&a(e.cond),e.type==="RepeatStat"&&a(e.cond),e.type==="ForNumStat"&&(a(e.start),a(e.end),e.step&&a(e.step)),e.type==="ForInStat")for(const o of e.exps)a(o);t(e.body.body);break;case"IfStat":for(const o of e.clauses)a(o.cond),t(o.body.body);e.elseBody&&t(e.elseBody.body);break;case"FuncStat":case"LocalFuncStat":s(e.func);break;case"LocalStat":if(e.exps)for(const o of e.exps)a(o);break;case"AssignStat":for(const o of e.vars)a(o);for(const o of e.exps)a(o);break;case"CallStat":a(e.exp);break;case"ReturnStat":for(const o of e.exps)a(o);break;default:break}}function c(r){t(r.body)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.flattenControlFlow=C;function m(t){return{type:"NumberLiteral",raw:String(t),value:t}}function p(t){return{type:"NameExpr",name:t}}function f(t,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.flattenControlFlow=C;function m(t){return{type:"NumberLiteral",raw:String(t),value:t}}function p(t){return{type:"NameExpr",name:t}}function f(t,s){return{type:"AssignStat",vars:t.map(e=>p(e)),exps:s}}function u(t,s){return f([t.stateName],[typeof s=="number"?m(s):s])}function k(t,s,e){return{type:"BinaryExpr",op:"or",left:{type:"BinaryExpr",op:"and",left:p(t),right:m(s)},right:m(e)}}function E(t,s,e){return{type:"BinaryExpr",op:t,left:s,right:e}}function S(t){const s=`__t${t.nextTemp}`;return t.nextTemp+=1,t.temps.push(s),s}function x(t){const s=t.nextState;return t.nextState+=1,t.states.set(s,[]),s}function n(t,s,e){t.states.get(s).push(e)}function F(t,s){for(const e of t)if(e.type==="LocalStat")for(const a of e.names)s.push(a.name);else if(e.type==="LocalFuncStat")s.push(e.name);else if(e.type==="ForNumStat")s.push(e.name),F(e.body.body,s);else if(e.type==="ForInStat")s.push(...e.names),F(e.body.body,s);else if(e.type==="DoStat"||e.type==="WhileStat"||e.type==="RepeatStat")F(e.body.body,s);else if(e.type==="IfStat"){for(const a of e.clauses)F(a.body.body,s);e.elseBody&&F(e.elseBody.body,s)}}function h(t,s,e,a){if(t.length===0)return s;const y=t.map(()=>x(e));for(let o=0;o<t.length;o+=1){const r=t[o];r.type==="LabelStat"&&e.userLabels.set(r.name,y[o])}for(let o=0;o<t.length;o+=1){const r=o+1<t.length?y[o+1]:s;I(e,y[o],t[o],r,a)}return y[0]}function I(t,s,e,a,y){switch(e.type){case"EmptyStat":case"LabelStat":n(t,s,u(t,a));return;case"AssignStat":case"CallStat":case"FuncStat":n(t,s,e),n(t,s,u(t,a));return;case"LocalStat":e.exps&&e.exps.length>0&&n(t,s,f(e.names.map(o=>o.name),e.exps)),n(t,s,u(t,a));return;case"LocalFuncStat":n(t,s,f([e.name],[e.func])),n(t,s,u(t,a));return;case"ReturnStat":n(t,s,e);return;case"BreakStat":n(t,s,u(t,y));return;case"GotoStat":{const o=t.userLabels.get(e.name);if(o===void 0)throw new Error(`goto \u672A\u5B9A\u4E49\u6807\u7B7E ::${e.name}::`);n(t,s,u(t,o));return}case"DoStat":n(t,s,u(t,h(e.body.body,a,t,y)));return;case"IfStat":{const o=S(t);let r=s;for(let l=0;l<e.clauses.length;l+=1){const b=l===e.clauses.length-1,d=h(e.clauses[l].body.body,a,t,y);let i=a;b?e.elseBody&&(i=h(e.elseBody.body,a,t,y)):i=x(t),n(t,r,f([o],[e.clauses[l].cond])),n(t,r,u(t,k(o,d,i))),b||(r=i)}e.clauses.length===0&&n(t,s,u(t,a));return}case"WhileStat":{const o=S(t),r=h(e.body.body,s,t,a);n(t,s,f([o],[e.cond])),n(t,s,u(t,k(o,r,a)));return}case"RepeatStat":{const o=S(t),r=x(t),l=h(e.body.body,r,t,a);n(t,s,u(t,l)),n(t,r,f([o],[e.cond])),n(t,r,u(t,k(o,a,l)));return}case"ForNumStat":{const o=e.name,r=S(t),l=S(t),b=S(t),d=x(t),i=x(t),L=x(t),g=x(t),N=h(e.body.body,g,t,a);n(t,s,f([o],[e.start])),n(t,s,f([r],[e.end])),n(t,s,f([l],[e.step??m(1)])),n(t,s,u(t,d)),n(t,d,f([b],[E(">=",p(l),m(0))])),n(t,d,u(t,k(b,i,L))),n(t,i,f([b],[E("<=",p(o),p(r))])),n(t,i,u(t,k(b,N,a))),n(t,L,f([b],[E(">=",p(o),p(r))])),n(t,L,u(t,k(b,N,a))),n(t,g,f([o],[E("+",p(o),p(l))])),n(t,g,u(t,d));return}case"ForInStat":{const o=S(t),r=S(t),l=S(t),b=S(t),d=x(t),i=[f([l],[p(e.names[0])]),...e.body.body],L=h(i,d,t,a),g=e.exps.slice();for(;g.length<3;)g.push({type:"NilLiteral"});n(t,s,f([o,r,l],g.slice(0,3))),n(t,s,u(t,d)),n(t,d,{type:"AssignStat",vars:e.names.map(N=>p(N)),exps:[{type:"CallExpr",callee:p(o),args:[p(r),p(l)]}]}),n(t,d,f([b],[E("~=",p(e.names[0]),{type:"NilLiteral"})])),n(t,d,u(t,k(b,L,a)));return}default:n(t,s,u(t,a))}}function v(t,s){const e=t.slice();let a=s>>>0||1;for(let y=e.length-1;y>0;y-=1){a=Math.imul(a,1664525)+1013904223>>>0;const o=a%(y+1),r=e[y];e[y]=e[o],e[o]=r}return e}function w(t,s){if(t.length===0)return t;const e={states:new Map,temps:[],nextState:1,nextTemp:1,stateName:"__s",userLabels:new Map},a=[];F(t,a);const y=h(t,0,e,0),o=[...new Set([...a,...e.temps,e.stateName])],r=v([...e.states.keys()],s).map(l=>({cond:E("==",p(e.stateName),m(l)),body:{type:"Block",body:e.states.get(l)}}));return[{type:"LocalStat",names:o.map(l=>({name:l}))},f([e.stateName],[m(y)]),{type:"WhileStat",cond:E("~=",p(e.stateName),m(0)),body:{type:"Block",body:[{type:"IfStat",clauses:r}]}}]}function c(t,s){switch(t.type){case"FuncExpr":B(t.body.body,s),t.body.body=w(t.body.body,s);break;case"UnaryExpr":c(t.arg,s);break;case"BinaryExpr":c(t.left,s),c(t.right,s);break;case"TableExpr":for(const e of t.fields)e.kind==="index"&&c(e.key,s),c(e.value,s);break;case"IndexExpr":c(t.object,s),c(t.index,s);break;case"MemberExpr":c(t.object,s);break;case"CallExpr":c(t.callee,s);for(const e of t.args)c(e,s);break;case"MethodCallExpr":c(t.object,s);for(const e of t.args)c(e,s);break;case"ParenExpr":c(t.exp,s);break;default:break}}function B(t,s){for(const e of t)switch(e.type){case"DoStat":case"WhileStat":case"RepeatStat":case"ForNumStat":case"ForInStat":if((e.type==="WhileStat"||e.type==="RepeatStat")&&c(e.cond,s),e.type==="ForNumStat"&&(c(e.start,s),c(e.end,s),e.step&&c(e.step,s)),e.type==="ForInStat")for(const a of e.exps)c(a,s);B(e.body.body,s);break;case"IfStat":for(const a of e.clauses)c(a.cond,s),B(a.body.body,s);e.elseBody&&B(e.elseBody.body,s);break;case"FuncStat":case"LocalFuncStat":B(e.func.body.body,s),e.func.body.body=w(e.func.body.body,s);break;case"LocalStat":if(e.exps)for(const a of e.exps)c(a,s);break;case"AssignStat":for(const a of e.vars)c(a,s);for(const a of e.exps)c(a,s);break;case"CallStat":c(e.exp,s);break;case"ReturnStat":for(const a of e.exps)c(a,s);break;default:break}}function C(t,s){B(t.body,s),t.body=w(t.body,s)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.shortName=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.shortName=a,exports.renameLocals=c;const u=require("./reserved"),d=require("./scope"),l="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function a(r){let e=r,t="";do t=l[e%l.length]+t,e=Math.floor(e/l.length)-1;while(e>=0);return u.luaKeywords.has(t)?`_${t}`:t}function c(r){let e=0;const t=new Set;(0,d.collectAndRename)(r,(o,s)=>{if(o.newName!==o.original)return;let n=a(e);for(e+=1;s.has(n)||t.has(n)||u.luaKeywords.has(n);)n=a(e),e+=1;o.newName=n,t.add(n),s.add(n)})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.resolveLocal=i,exports.collectAndRename=x;function i(t,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.resolveLocal=i,exports.collectAndRename=x;function i(t,s){let r=t;for(;r;){const e=r.locals.get(s);if(e)return e;r=r.parent}}function c(t){return{parent:t,locals:new Map}}function f(t,s){const r=t.locals.get(s);if(r)return r;const e={original:s,newName:s};return t.locals.set(s,e),e}function x(t,s){const r=new Set,e={locals:new Map};d(t.body,e,r,s)}function l(t,s,r,e){d(t.body,s,r,e)}function d(t,s,r,e){for(const o of t)b(o,s,r,e)}function m(t,s,r,e){const o=c(s),a=t.params.slice();for(let u=0;u<a.length;u+=1){const p=f(o,a[u]);e(p,r),t.params[u]=p.newName}l(t.body,o,r,e)}function b(t,s,r,e){switch(t.type){case"EmptyStat":case"BreakStat":case"GotoStat":case"LabelStat":return;case"DoStat":l(t.body,c(s),r,e);return;case"WhileStat":n(t.cond,s,r,e),l(t.body,c(s),r,e);return;case"RepeatStat":{const o=c(s);l(t.body,o,r,e),n(t.cond,o,r,e);return}case"IfStat":for(const o of t.clauses)n(o.cond,s,r,e),l(o.body,c(s),r,e);t.elseBody&&l(t.elseBody,c(s),r,e);return;case"ForNumStat":{n(t.start,s,r,e),n(t.end,s,r,e),t.step&&n(t.step,s,r,e);const o=c(s),a=f(o,t.name);e(a,r),t.name=a.newName,l(t.body,o,r,e);return}case"ForInStat":{for(const a of t.exps)n(a,s,r,e);const o=c(s);for(let a=0;a<t.names.length;a+=1){const u=f(o,t.names[a]);e(u,r),t.names[a]=u.newName}l(t.body,o,r,e);return}case"FuncStat":{const o=i(s,t.name.base);o&&(t.name.base=o.newName),m(t.func,s,r,e);return}case"LocalFuncStat":{const o=f(s,t.name);e(o,r),t.name=o.newName,m(t.func,s,r,e);return}case"LocalStat":if(t.exps)for(const o of t.exps)n(o,s,r,e);for(let o=0;o<t.names.length;o+=1){const a=f(s,t.names[o].name);e(a,r),t.names[o].name=a.newName}return;case"AssignStat":for(const o of t.vars)n(o,s,r,e);for(const o of t.exps)n(o,s,r,e);return;case"CallStat":n(t.exp,s,r,e);return;case"ReturnStat":for(const o of t.exps)n(o,s,r,e);return}}function n(t,s,r,e){switch(t.type){case"NilLiteral":case"BoolLiteral":case"NumberLiteral":case"StringLiteral":case"VarargExpr":return;case"NameExpr":{const o=i(s,t.name);o&&(t.name=o.newName);return}case"UnaryExpr":n(t.arg,s,r,e);return;case"BinaryExpr":n(t.left,s,r,e),n(t.right,s,r,e);return;case"FuncExpr":m(t,s,r,e);return;case"TableExpr":for(const o of t.fields)o.kind==="index"&&n(o.key,s,r,e),n(o.value,s,r,e);return;case"IndexExpr":n(t.object,s,r,e),n(t.index,s,r,e);return;case"MemberExpr":n(t.object,s,r,e);return;case"CallExpr":n(t.callee,s,r,e);for(const o of t.args)n(o,s,r,e);return;case"MethodCallExpr":n(t.object,s,r,e);for(const o of t.args)n(o,s,r,e);return;case"ParenExpr":n(t.exp,s,r,e);return}}
|
package/docs/api/hid.md
CHANGED
|
@@ -310,6 +310,26 @@ hid.click(100, 200);
|
|
|
310
310
|
hid.click(300, 400);
|
|
311
311
|
```
|
|
312
312
|
|
|
313
|
+
### setMoveDelay - 设置移动延迟
|
|
314
|
+
|
|
315
|
+
设置移动完成后的等待毫秒。不调用时固件默认 40ms。可设为 0 关闭等待。
|
|
316
|
+
|
|
317
|
+
```typescript
|
|
318
|
+
function setMoveDelay(milliseconds: number): boolean;
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
**参数:**
|
|
322
|
+
| 参数 | 类型 | 必需 | 默认值 | 描述 |
|
|
323
|
+
| ---- | ---- | ---- | ------ | ---- |
|
|
324
|
+
| `milliseconds` | number | 是 | `40` | `0` 关闭,`>0` 覆盖毫秒,`<0` 恢复默认 |
|
|
325
|
+
|
|
326
|
+
**示例:**
|
|
327
|
+
|
|
328
|
+
```javascript
|
|
329
|
+
hid.setMoveDelay(0);
|
|
330
|
+
hid.move(100, 200);
|
|
331
|
+
```
|
|
332
|
+
|
|
313
333
|
## 基础触摸操作
|
|
314
334
|
|
|
315
335
|
### click - 点击操作
|
package/docs/apicn/hid.md
CHANGED
|
@@ -310,6 +310,26 @@ $HID.点击(100, 200);
|
|
|
310
310
|
$HID.点击(300, 400);
|
|
311
311
|
```
|
|
312
312
|
|
|
313
|
+
### 设置移动延迟
|
|
314
|
+
|
|
315
|
+
设置移动完成后的等待毫秒。不调用时固件默认 40ms。可设为 0 关闭等待。
|
|
316
|
+
|
|
317
|
+
```typescript
|
|
318
|
+
function 设置移动延迟(毫秒: 数字): 布尔值;
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
**参数:**
|
|
322
|
+
| 参数 | 类型 | 必需 | 默认值 | 描述 |
|
|
323
|
+
| ---- | ---- | ---- | ------ | ---- |
|
|
324
|
+
| `毫秒` | 数字 | 是 | `40` | `0` 关闭,`>0` 覆盖毫秒,`<0` 恢复默认 |
|
|
325
|
+
|
|
326
|
+
**示例:**
|
|
327
|
+
|
|
328
|
+
```javascript
|
|
329
|
+
$HID.设置移动延迟(0);
|
|
330
|
+
$HID.移动(100, 200);
|
|
331
|
+
```
|
|
332
|
+
|
|
313
333
|
## 基础触摸操作
|
|
314
334
|
|
|
315
335
|
### 点击
|
package/docs/apilua/hid.md
CHANGED
|
@@ -281,6 +281,28 @@ hid.click(100, 200)
|
|
|
281
281
|
hid.click(300, 400)
|
|
282
282
|
```
|
|
283
283
|
|
|
284
|
+
### setMoveDelay - 设置移动延迟
|
|
285
|
+
|
|
286
|
+
设置移动完成后的等待毫秒。不调用时固件默认 40ms。可设为 0 关闭等待。
|
|
287
|
+
|
|
288
|
+
```lua
|
|
289
|
+
---@param milliseconds number
|
|
290
|
+
---@return boolean
|
|
291
|
+
function setMoveDelay(milliseconds) end
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
**参数:**
|
|
295
|
+
| 参数 | 类型 | 必需 | 默认值 | 描述 |
|
|
296
|
+
| ---- | ---- | ---- | ------ | ---- |
|
|
297
|
+
| `milliseconds` | number | 是 | `40` | `0` 关闭,`>0` 覆盖毫秒,`<0` 恢复默认 |
|
|
298
|
+
|
|
299
|
+
**示例:**
|
|
300
|
+
|
|
301
|
+
```lua
|
|
302
|
+
hid.setMoveDelay(0)
|
|
303
|
+
hid.move(100, 200)
|
|
304
|
+
```
|
|
305
|
+
|
|
284
306
|
## 基础触摸操作
|
|
285
307
|
|
|
286
308
|
### click - 点击操作
|
package/docs/apipython/hid.md
CHANGED
|
@@ -320,6 +320,27 @@ hid.click(100, 200)
|
|
|
320
320
|
hid.click(300, 400)
|
|
321
321
|
```
|
|
322
322
|
|
|
323
|
+
### setMoveDelay - 设置移动延迟
|
|
324
|
+
|
|
325
|
+
设置移动完成后的等待毫秒。不调用时固件默认 40ms。可设为 0 关闭等待。
|
|
326
|
+
|
|
327
|
+
```python
|
|
328
|
+
def setMoveDelay(milliseconds: int) -> bool
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
**参数:**
|
|
332
|
+
| 参数 | 类型 | 必需 | 默认值 | 描述 |
|
|
333
|
+
| ---- | ---- | ---- | ------ | ---- |
|
|
334
|
+
| `milliseconds` | int | 是 | `40` | `0` 关闭,`>0` 覆盖毫秒,`<0` 恢复默认 |
|
|
335
|
+
|
|
336
|
+
**示例:**
|
|
337
|
+
|
|
338
|
+
```python
|
|
339
|
+
from kuaijs import hid
|
|
340
|
+
hid.setMoveDelay(0)
|
|
341
|
+
hid.move(100, 200)
|
|
342
|
+
```
|
|
343
|
+
|
|
323
344
|
## 基础触摸操作
|
|
324
345
|
|
|
325
346
|
### click - 点击操作
|