ms-vite-plugin 1.4.58 → 1.4.60

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.
Files changed (83) hide show
  1. package/dist/luaBundle.js +1 -1
  2. package/dist/luaObfuscator/addVararg.d.ts +2 -0
  3. package/dist/luaObfuscator/addVararg.js +1 -0
  4. package/dist/luaObfuscator/antiTamper.d.ts +2 -0
  5. package/dist/luaObfuscator/antiTamper.js +26 -0
  6. package/dist/luaObfuscator/ast.d.ts +191 -0
  7. package/dist/luaObfuscator/ast.js +1 -0
  8. package/dist/luaObfuscator/cipher.d.ts +10 -0
  9. package/dist/luaObfuscator/cipher.js +28 -0
  10. package/dist/luaObfuscator/compiler.d.ts +31 -0
  11. package/dist/luaObfuscator/compiler.js +1 -0
  12. package/dist/luaObfuscator/constantArray.d.ts +5 -0
  13. package/dist/luaObfuscator/constantArray.js +1 -0
  14. package/dist/luaObfuscator/flatten.d.ts +2 -0
  15. package/dist/luaObfuscator/flatten.js +1 -0
  16. package/dist/luaObfuscator/index.d.ts +6 -0
  17. package/dist/luaObfuscator/index.js +1 -0
  18. package/dist/luaObfuscator/lexer.d.ts +14 -0
  19. package/dist/luaObfuscator/lexer.js +10 -0
  20. package/dist/luaObfuscator/minify.d.ts +3 -0
  21. package/dist/luaObfuscator/minify.js +1 -0
  22. package/dist/luaObfuscator/numbers.d.ts +2 -0
  23. package/dist/luaObfuscator/numbers.js +1 -0
  24. package/dist/luaObfuscator/opcodes.d.ts +3 -0
  25. package/dist/luaObfuscator/opcodes.js +1 -0
  26. package/dist/luaObfuscator/parser.d.ts +8 -0
  27. package/dist/luaObfuscator/parser.js +1 -0
  28. package/dist/luaObfuscator/rename.d.ts +3 -0
  29. package/dist/luaObfuscator/rename.js +1 -0
  30. package/dist/luaObfuscator/reserved.d.ts +5 -0
  31. package/dist/luaObfuscator/reserved.js +1 -0
  32. package/dist/luaObfuscator/scope.d.ts +11 -0
  33. package/dist/luaObfuscator/scope.js +1 -0
  34. package/dist/luaObfuscator/selftest.d.ts +1 -0
  35. package/dist/luaObfuscator/selftest.js +39 -0
  36. package/dist/luaObfuscator/splitStrings.d.ts +2 -0
  37. package/dist/luaObfuscator/splitStrings.js +1 -0
  38. package/dist/luaObfuscator/strings.d.ts +4 -0
  39. package/dist/luaObfuscator/strings.js +1 -0
  40. package/dist/luaObfuscator/visit.d.ts +5 -0
  41. package/dist/luaObfuscator/visit.js +1 -0
  42. package/dist/luaObfuscator/vmEmit.d.ts +2 -0
  43. package/dist/luaObfuscator/vmEmit.js +281 -0
  44. package/dist/luaObfuscator/wrapInFunction.d.ts +2 -0
  45. package/dist/luaObfuscator/wrapInFunction.js +1 -0
  46. package/docs/AGENTS.md +1 -1
  47. package/docs/SKILL.md +1 -1
  48. package/docs/api/media.md +22 -0
  49. package/docs/apicn/media.md +22 -0
  50. package/docs/apilua/action.md +2 -27
  51. package/docs/apilua/appleocr.md +41 -126
  52. package/docs/apilua/cloud.md +2 -6
  53. package/docs/apilua/config.md +2 -6
  54. package/docs/apilua/cryptoUtils.md +2 -7
  55. package/docs/apilua/device.md +2 -19
  56. package/docs/apilua/dotocr.md +2 -5
  57. package/docs/apilua/file.md +2 -17
  58. package/docs/apilua/global.md +1 -1
  59. package/docs/apilua/hid.md +2 -44
  60. package/docs/apilua/hotUpdate.md +2 -3
  61. package/docs/apilua/http.md +2 -7
  62. package/docs/apilua/image.md +16 -107
  63. package/docs/apilua/ime.md +2 -10
  64. package/docs/apilua/logger.md +3 -9
  65. package/docs/apilua/media.md +2 -9
  66. package/docs/apilua/mysql.md +2 -10
  67. package/docs/apilua/netCard.md +2 -6
  68. package/docs/apilua/node.md +2 -3
  69. package/docs/apilua/opencv.md +4 -30
  70. package/docs/apilua/paddleocr.md +20 -126
  71. package/docs/apilua/pip.md +2 -12
  72. package/docs/apilua/system.md +2 -40
  73. package/docs/apilua/tomatoocr.md +2 -16
  74. package/docs/apilua/tts.md +2 -9
  75. package/docs/apilua/ui.md +3 -22
  76. package/docs/apilua/utils.md +2 -9
  77. package/docs/apilua/yolo.md +25 -119
  78. package/docs/apilua/yolocls.md +2 -5
  79. package/docs/apipython/media.md +20 -0
  80. package/docs/mcp-agent-description.md +1 -1
  81. package/docs/quick/vscode/createProject.md +1 -1
  82. package/docs/quick/vscode/packProject.md +1 -1
  83. package/package.json +1 -1
@@ -1,5 +1,7 @@
1
1
  # 文件模块 (File)
2
2
 
3
+ 模块表是内置全局 `file`,直接调用即可。不要 `require` 宿主模块。
4
+
3
5
  文件模块提供了完整的文件和目录操作功能,包括文件的创建、读写、删除、复制等操作,以及目录的管理和遍历功能。
4
6
 
5
7
  ## 功能概览
@@ -41,7 +43,6 @@ function getInternalDir(type) end
41
43
  **示例:**
42
44
 
43
45
  ```lua
44
- local file = require("file")
45
46
  local documentsDir = file.getInternalDir("documents")
46
47
  local tempDir = file.getInternalDir("temp")
47
48
  print("文档目录: " .. tostring(documentsDir))
@@ -71,7 +72,6 @@ function mkdirs(path) end
71
72
  **示例:**
72
73
 
73
74
  ```lua
74
- local file = require("file")
75
75
  local success = file.mkdirs("/path/to/nested/directory")
76
76
  if success then
77
77
  print("目录创建成功")
@@ -103,7 +103,6 @@ function listDir(path, recursion) end
103
103
  **示例:**
104
104
 
105
105
  ```lua
106
- local file = require("file")
107
106
  -- 列出目录内容(不递归)
108
107
  local files = file.listDir("/path/to/directory", false)
109
108
  print("目录内容: " .. tostring(ToJsonString(files)))
@@ -137,7 +136,6 @@ function create(path) end
137
136
  **示例:**
138
137
 
139
138
  ```lua
140
- local file = require("file")
141
139
  local created = file.create("/path/to/newfile.txt")
142
140
  if created then
143
141
  print("文件创建成功")
@@ -167,7 +165,6 @@ function exists(path) end
167
165
  **示例:**
168
166
 
169
167
  ```lua
170
- local file = require("file")
171
168
  if file.exists("/path/to/file.txt") then
172
169
  print("文件存在")
173
170
  else
@@ -200,7 +197,6 @@ function copy(src, dest) end
200
197
  **示例:**
201
198
 
202
199
  ```lua
203
- local file = require("file")
204
200
  local copied = file.copy("/path/to/source.txt", "/path/to/destination.txt")
205
201
  if copied then
206
202
  print("文件复制成功")
@@ -230,7 +226,6 @@ function deleteAllFile(path) end
230
226
  **示例:**
231
227
 
232
228
  ```lua
233
- local file = require("file")
234
229
  local deleted = file.deleteAllFile("/path/to/file.txt")
235
230
  if deleted then
236
231
  print("文件删除成功")
@@ -262,7 +257,6 @@ function readFile(path) end
262
257
  **示例:**
263
258
 
264
259
  ```lua
265
- local file = require("file")
266
260
  local content = file.readFile("/path/to/file.txt")
267
261
  if content ~= nil then
268
262
  print("文件内容: " .. tostring(content))
@@ -299,7 +293,6 @@ function readResFile(fileName) end
299
293
  **示例:**
300
294
 
301
295
  ```lua
302
- local file = require("file")
303
296
  -- 读取配置文件
304
297
  local config = file.readResFile("config.json")
305
298
  if config ~= "" then
@@ -322,7 +315,6 @@ function getResFile(fileName) end
322
315
  **示例:**
323
316
 
324
317
  ```lua
325
- local file = require("file")
326
318
  local path = file.getResFile("model.bin")
327
319
  if path then
328
320
  file.cleanupResFile(path)
@@ -345,7 +337,6 @@ function cleanupResFile(path) end
345
337
  **示例:**
346
338
 
347
339
  ```lua
348
- local file = require("file")
349
340
  file.cleanupResFile(path)
350
341
  ```
351
342
 
@@ -374,7 +365,6 @@ function writeFile(path, content) end
374
365
  **示例:**
375
366
 
376
367
  ```lua
377
- local file = require("file")
378
368
  local success = file.writeFile("/path/to/file.txt", "Hello, World!")
379
369
  if success then
380
370
  print("文件写入成功")
@@ -406,7 +396,6 @@ function appendLine(path, content) end
406
396
  **示例:**
407
397
 
408
398
  ```lua
409
- local file = require("file")
410
399
  local appended = file.appendLine("/path/to/log.txt", "新的日志条目")
411
400
  if appended then
412
401
  print("内容追加成功")
@@ -440,7 +429,6 @@ function readLine(path, lineNo) end
440
429
  **示例:**
441
430
 
442
431
  ```lua
443
- local file = require("file")
444
432
  local firstLine = file.readLine("/path/to/file.txt", 1)
445
433
  if firstLine ~= nil then
446
434
  print("第一行内容: " .. tostring(firstLine))
@@ -472,7 +460,6 @@ function readAllLines(path) end
472
460
  **示例:**
473
461
 
474
462
  ```lua
475
- local file = require("file")
476
463
  local lines = file.readAllLines("/path/to/file.txt")
477
464
  if lines ~= nil then
478
465
  for index, line in ipairs(lines) do
@@ -510,7 +497,6 @@ function deleteLine(path, line, contains) end
510
497
  **示例:**
511
498
 
512
499
  ```lua
513
- local file = require("file")
514
500
  -- 删除第3行
515
501
  file.deleteLine("/path/to/file.txt", 3, nil)
516
502
  -- 删除包含"error"的行
@@ -544,7 +530,6 @@ function fileMD5(path) end
544
530
  **示例:**
545
531
 
546
532
  ```lua
547
- local file = require("file")
548
533
  local md5 = file.fileMD5("/path/to/file.txt")
549
534
  if md5 then
550
535
  print("文件MD5 = " .. tostring(md5))
@@ -655,7 +655,7 @@ print(ToJsonString({ a = 1, b = 2 }))
655
655
 
656
656
  ## 全局日志函数
657
657
 
658
- 全局日志函数是 `logger` 模块对应方法的便捷别名,可以直接调用而无需 `require("logger")`。可变参会按空格拼接为一行。级别和是否写文件仍由 `logger.setLoggerLevel` / `logger.setLogToFile` 控制。
658
+ 全局日志函数是 `logger` 模块对应方法的便捷别名,可以直接调用而无需再取模块表。可变参会按空格拼接为一行。级别和是否写文件仍由 `logger.setLoggerLevel` / `logger.setLogToFile` 控制。
659
659
 
660
660
  `print` 仍可用,默认走信息级别;需要调试 / 警告 / 错误级别时用下面这些函数。
661
661
 
@@ -1,5 +1,7 @@
1
1
  # HID 模块
2
2
 
3
+ 模块表是内置全局 `hid`,直接调用即可。不要 `require` 宿主模块。
4
+
3
5
  HID 模块提供基于 HID 设备的触控与按键能力,包括点击、滑动、系统导航、文本输入、组合键以及剪贴板与应用控制。
4
6
 
5
7
  ## 常量
@@ -51,7 +53,6 @@ HidKey = {}
51
53
  **示例:**
52
54
 
53
55
  ```lua
54
- local hid = require("hid")
55
56
  hid.sendKey({ HidKey.COMMAND, "c" })
56
57
  hid.sendKey({ HidKey.HOME })
57
58
  ```
@@ -68,7 +69,6 @@ function isBLEConnected() end
68
69
  **示例:**
69
70
 
70
71
  ```lua
71
- local hid = require("hid")
72
72
  print(hid.isBLEConnected())
73
73
  ```
74
74
 
@@ -82,7 +82,6 @@ function isUSBConnected() end
82
82
  **示例:**
83
83
 
84
84
  ```lua
85
- local hid = require("hid")
86
85
  print(hid.isUSBConnected())
87
86
  ```
88
87
 
@@ -96,7 +95,6 @@ function getBLEHIDDeviceName() end
96
95
  **示例:**
97
96
 
98
97
  ```lua
99
- local hid = require("hid")
100
98
  print(hid.getBLEHIDDeviceName())
101
99
  ```
102
100
 
@@ -116,7 +114,6 @@ function setBLEHIDDeviceName(name) end
116
114
  **示例:**
117
115
 
118
116
  ```lua
119
- local hid = require("hid")
120
117
  print(hid.setBLEHIDDeviceName("KuaiJS-HID"))
121
118
  ```
122
119
 
@@ -130,7 +127,6 @@ function getDeviceMac() end
130
127
  **示例:**
131
128
 
132
129
  ```lua
133
- local hid = require("hid")
134
130
  print(hid.getDeviceMac())
135
131
  ```
136
132
 
@@ -144,7 +140,6 @@ function getDeviceModel() end
144
140
  **示例:**
145
141
 
146
142
  ```lua
147
- local hid = require("hid")
148
143
  print(hid.getDeviceModel())
149
144
  ```
150
145
 
@@ -158,7 +153,6 @@ function getDeviceVersion() end
158
153
  **示例:**
159
154
 
160
155
  ```lua
161
- local hid = require("hid")
162
156
  print(hid.getDeviceVersion())
163
157
  ```
164
158
 
@@ -181,7 +175,6 @@ function resetPosition() end
181
175
  **示例:**
182
176
 
183
177
  ```lua
184
- local hid = require("hid")
185
178
  -- 复位坐标到左上角
186
179
  local ok = hid.resetPosition()
187
180
  print(ok) -- 输出: true 或 false
@@ -204,7 +197,6 @@ function restartDevice() end
204
197
  **示例:**
205
198
 
206
199
  ```lua
207
- local hid = require("hid")
208
200
  print(hid.restartDevice())
209
201
  ```
210
202
 
@@ -222,7 +214,6 @@ function openRecordScreen() end
222
214
  **示例:**
223
215
 
224
216
  ```lua
225
- local hid = require("hid")
226
217
  hid.openRecordScreen()
227
218
  ```
228
219
 
@@ -241,7 +232,6 @@ function isRecording() end
241
232
  **示例:**
242
233
 
243
234
  ```lua
244
- local hid = require("hid")
245
235
  print(hid.isRecording())
246
236
  ```
247
237
 
@@ -264,7 +254,6 @@ function setJitterValue(value) end
264
254
  **示例:**
265
255
 
266
256
  ```lua
267
- local hid = require("hid")
268
257
  -- 设置抖动值为5像素
269
258
  hid.setJitterValue(5)
270
259
  ```
@@ -300,7 +289,6 @@ function click(x, y, duration, jitter) end
300
289
  **示例:**
301
290
 
302
291
  ```lua
303
- local hid = require("hid")
304
292
  -- 简单点击
305
293
  hid.click(100, 200)
306
294
  -- 带持续时间和抖动的点击
@@ -338,7 +326,6 @@ function clickRandom(x1, y1, x2, y2, duration) end
338
326
  **示例:**
339
327
 
340
328
  ```lua
341
- local hid = require("hid")
342
329
  -- 在区域内随机点击
343
330
  hid.clickRandom(100, 100, 200, 200, 20)
344
331
  ```
@@ -368,7 +355,6 @@ function move(x, y) end
368
355
  **示例:**
369
356
 
370
357
  ```lua
371
- local hid = require("hid")
372
358
  -- 移动到 (100, 200)
373
359
  hid.move(100, 200)
374
360
  ```
@@ -385,7 +371,6 @@ function mouseDown() end
385
371
  **示例:**
386
372
 
387
373
  ```lua
388
- local hid = require("hid")
389
374
  hid.mouseDown()
390
375
  ```
391
376
 
@@ -401,7 +386,6 @@ function mouseUp() end
401
386
  **示例:**
402
387
 
403
388
  ```lua
404
- local hid = require("hid")
405
389
  hid.mouseUp()
406
390
  ```
407
391
 
@@ -436,7 +420,6 @@ function doubleClick(x, y, duration, interval, jitter) end
436
420
  **示例:**
437
421
 
438
422
  ```lua
439
- local hid = require("hid")
440
423
  -- 带抖动的双击
441
424
  hid.doubleClick(100, 100, 20, 20, true)
442
425
  ```
@@ -474,7 +457,6 @@ function doubleClickRandom(x1, y1, x2, y2, duration, interval) end
474
457
  **示例:**
475
458
 
476
459
  ```lua
477
- local hid = require("hid")
478
460
  -- 在区域内随机双击
479
461
  hid.doubleClickRandom(100, 100, 200, 200, 20, 20)
480
462
  ```
@@ -514,7 +496,6 @@ function swipe(x, y, ex, ey, jitter, steps) end
514
496
  **示例:**
515
497
 
516
498
  ```lua
517
- local hid = require("hid")
518
499
  -- 简单滑动
519
500
  hid.swipe(100, 100, 200, 200)
520
501
  -- 带抖动和自定义步数的滑动
@@ -556,7 +537,6 @@ function swipe(x, y, ex, ey, duration, jitter, steps) end
556
537
  **示例:**
557
538
 
558
539
  ```lua
559
- local hid = require("hid")
560
540
  -- 长按 1 秒后滑动
561
541
  hid.pressAndSwipe(100, 100, 200, 200, 1000)
562
542
  -- 长按 1 秒后带抖动和自定义步数的滑动
@@ -596,7 +576,6 @@ function swipeCurve(startX, startY, midX, midY, endX, endY) end
596
576
  **示例:**
597
577
 
598
578
  ```lua
599
- local hid = require("hid")
600
579
  -- 通过三个点的曲线滑动
601
580
  hid.swipeCurve(100, 100, 150, 50, 200, 100)
602
581
  ```
@@ -620,7 +599,6 @@ function homeScreen() end
620
599
  **示例:**
621
600
 
622
601
  ```lua
623
- local hid = require("hid")
624
602
  -- 回到主屏幕
625
603
  hid.homeScreen()
626
604
  ```
@@ -645,7 +623,6 @@ function input(text) end
645
623
  **示例:**
646
624
 
647
625
  ```lua
648
- local hid = require("hid")
649
626
  hid.input("Hello World")
650
627
  hid.input("测试")
651
628
  ```
@@ -673,7 +650,6 @@ function inputSimple(text) end
673
650
  **示例:**
674
651
 
675
652
  ```lua
676
- local hid = require("hid")
677
653
  -- 输入英文与数字
678
654
  hid.inputSimple("hello_123")
679
655
  ```
@@ -697,7 +673,6 @@ function space() end
697
673
  **示例:**
698
674
 
699
675
  ```lua
700
- local hid = require("hid")
701
676
  hid.space()
702
677
  ```
703
678
 
@@ -725,7 +700,6 @@ function backspace(count) end
725
700
  **示例:**
726
701
 
727
702
  ```lua
728
- local hid = require("hid")
729
703
  hid.backspace()
730
704
  hid.backspace(3)
731
705
  ```
@@ -747,7 +721,6 @@ function enter() end
747
721
  **示例:**
748
722
 
749
723
  ```lua
750
- local hid = require("hid")
751
724
  hid.enter()
752
725
  ```
753
726
 
@@ -768,7 +741,6 @@ function pressButton(button) end
768
741
  **示例:**
769
742
 
770
743
  ```lua
771
- local hid = require("hid")
772
744
  hid.pressButton("home")
773
745
  hid.pressButton("volumeup")
774
746
  hid.pressButton("snapshot")
@@ -799,7 +771,6 @@ function sendKey(key) end
799
771
  **示例:**
800
772
 
801
773
  ```lua
802
- local hid = require("hid")
803
774
  -- 发送Cmd+C
804
775
  hid.sendKey({ HidKey.COMMAND, "c" })
805
776
  -- 发送Ctrl+Alt+Delete
@@ -823,7 +794,6 @@ function copyText() end
823
794
  **示例:**
824
795
 
825
796
  ```lua
826
- local hid = require("hid")
827
797
  hid.copyText()
828
798
  ```
829
799
 
@@ -844,7 +814,6 @@ function pasteText() end
844
814
  **示例:**
845
815
 
846
816
  ```lua
847
- local hid = require("hid")
848
817
  hid.pasteText()
849
818
  ```
850
819
 
@@ -867,7 +836,6 @@ function back() end
867
836
  **示例:**
868
837
 
869
838
  ```lua
870
- local hid = require("hid")
871
839
  hid.back()
872
840
  ```
873
841
 
@@ -888,7 +856,6 @@ function recent() end
888
856
  **示例:**
889
857
 
890
858
  ```lua
891
- local hid = require("hid")
892
859
  hid.recent()
893
860
  ```
894
861
 
@@ -909,7 +876,6 @@ function lock() end
909
876
  **示例:**
910
877
 
911
878
  ```lua
912
- local hid = require("hid")
913
879
  hid.lock()
914
880
  ```
915
881
 
@@ -930,7 +896,6 @@ function unlock() end
930
896
  **示例:**
931
897
 
932
898
  ```lua
933
- local hid = require("hid")
934
899
  hid.unlock()
935
900
  ```
936
901
 
@@ -959,7 +924,6 @@ function openURL(url) end
959
924
  **示例:**
960
925
 
961
926
  ```lua
962
- local hid = require("hid")
963
927
  -- 打开网站
964
928
  hid.openURL("https://www.example.com")
965
929
  -- 使用自定义scheme打开应用
@@ -989,7 +953,6 @@ function openApp(name) end
989
953
  **示例:**
990
954
 
991
955
  ```lua
992
- local hid = require("hid")
993
956
  -- 打开Safari
994
957
  hid.openApp("Safari")
995
958
  -- 打开设置
@@ -1016,7 +979,6 @@ function closeApp(name) end
1016
979
  **示例:**
1017
980
 
1018
981
  ```lua
1019
- local hid = require("hid")
1020
982
  hid.closeApp("Safari")
1021
983
  hid.closeApp("com.example.myapp")
1022
984
  ```
@@ -1038,7 +1000,6 @@ function takeMeToFront() end
1038
1000
  **示例:**
1039
1001
 
1040
1002
  ```lua
1041
- local hid = require("hid")
1042
1003
  hid.takeMeToFront()
1043
1004
  ```
1044
1005
 
@@ -1065,7 +1026,6 @@ function currentAppInfo() end
1065
1026
  **示例:**
1066
1027
 
1067
1028
  ```lua
1068
- local hid = require("hid")
1069
1029
  local appInfo = hid.currentAppInfo()
1070
1030
  if appInfo then
1071
1031
  print("当前应用: " .. tostring(appInfo.name) .. " (" .. tostring(appInfo.bundleId) .. ")")
@@ -1097,7 +1057,6 @@ function setClipboard(text) end
1097
1057
  **示例:**
1098
1058
 
1099
1059
  ```lua
1100
- local hid = require("hid")
1101
1060
  hid.setClipboard("你好,世界!")
1102
1061
  ```
1103
1062
 
@@ -1118,7 +1077,6 @@ function getClipboard() end
1118
1077
  **示例:**
1119
1078
 
1120
1079
  ```lua
1121
- local hid = require("hid")
1122
1080
  local clipboardText = hid.getClipboard()
1123
1081
  if clipboardText then
1124
1082
  print("剪贴板内容:", clipboardText)
@@ -1,5 +1,7 @@
1
1
  # 热更新模块 (HotUpdate)
2
2
 
3
+ 模块表是内置全局 `hotupdate`,直接调用即可。不要 `require` 宿主模块。
4
+
3
5
  热更新模块提供了完整的应用热更新功能,支持检查更新、下载更新包、MD5 校验、对话框展示等核心功能。
4
6
 
5
7
  ## 自动检查更新
@@ -78,7 +80,6 @@ function checkUpdate() end
78
80
  **示例:**
79
81
 
80
82
  ```lua
81
- local hotupdate = require("hotupdate")
82
83
  -- 检查更新
83
84
  local result = hotupdate.checkUpdate()
84
85
 
@@ -121,7 +122,6 @@ function downloadAndInstall() end
121
122
  **示例:**
122
123
 
123
124
  ```lua
124
- local hotupdate = require("hotupdate")
125
125
  -- 先检查更新,再手动下载安装
126
126
  local result = hotupdate.checkUpdate()
127
127
 
@@ -161,7 +161,6 @@ function getCurrentVersion() end
161
161
  **示例:**
162
162
 
163
163
  ```lua
164
- local hotupdate = require("hotupdate")
165
164
  local version = hotupdate.getCurrentVersion()
166
165
  print("当前版本:", version)
167
166
  ```
@@ -1,5 +1,7 @@
1
1
  # HTTP 模块 (HTTP)
2
2
 
3
+ 模块表是内置全局 `http`,直接调用即可。不要 `require` 宿主模块。
4
+
3
5
  HTTP 模块提供了完整的网络请求功能,包括 HTTP 请求、文件下载、WebSocket 连接等。
4
6
 
5
7
  ## 通用 HTTP 请求
@@ -48,7 +50,6 @@ function request(params) end
48
50
  **示例:**
49
51
 
50
52
  ```lua
51
- local http = require("http")
52
53
  -- GET 请求
53
54
  local response = http.request({
54
55
  url = "https://api.example.com/users",
@@ -117,7 +118,6 @@ function httpGet(url, params, timeout, headers) end
117
118
  **示例:**
118
119
 
119
120
  ```lua
120
- local http = require("http")
121
121
  -- 简单 GET 请求
122
122
  local html = http.httpGet("https://www.example.com")
123
123
  print(html)
@@ -162,7 +162,6 @@ function httpPost(url, params, files, timeout, headers) end
162
162
  **示例:**
163
163
 
164
164
  ```lua
165
- local http = require("http")
166
165
  -- 发送表单数据
167
166
  local response = http.httpPost("https://api.example.com/submit", {
168
167
  username = "admin",
@@ -209,7 +208,6 @@ function postJSON(url, json, timeout, headers) end
209
208
  **示例:**
210
209
 
211
210
  ```lua
212
- local http = require("http")
213
211
  -- 发送 JSON 数据
214
212
  local response = http.postJSON(
215
213
  "https://api.example.com/api/users",
@@ -255,8 +253,6 @@ function downloadFile(url, file, timeout, headers) end
255
253
  **示例:**
256
254
 
257
255
  ```lua
258
- local http = require("http")
259
- local file = require("file")
260
256
  local documentsDir = file.getInternalDir("documents")
261
257
  -- 下载文件
262
258
  local success = http.downloadFile(
@@ -379,7 +375,6 @@ function stopHeartbeatInterval() end
379
375
  **WebSocket 完整示例:**
380
376
 
381
377
  ```lua
382
- local http = require("http")
383
378
 
384
379
  local function createWebSocketConnection()
385
380
  local ws = http.newWebsocket("wss://echo.websocket.org", {