ms-types 0.9.17 → 0.9.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-types",
3
- "version": "0.9.17",
3
+ "version": "0.9.19",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
package/types/global.d.ts CHANGED
@@ -35,6 +35,10 @@ declare const __bundleId__: string;
35
35
  * 当前线程名称
36
36
  */
37
37
  declare const __threadName__: string;
38
+ /**
39
+ * 子线程启动参数;仅在线程脚本中可用,未传参数时为空对象
40
+ */
41
+ declare const __threadParams__: Record<string, any>;
38
42
  /**
39
43
  * 脚本信息
40
44
  */
package/types/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference path="action.d.ts" />
2
- /// <reference path="appleOcr.d.ts" />
2
+ /// <reference path="appleocr.d.ts" />
3
3
  /// <reference path="cloud.d.ts" />
4
4
  /// <reference path="config.d.ts" />
5
5
  /// <reference path="cryptoUtils.d.ts" />
@@ -16,11 +16,11 @@
16
16
  /// <reference path="mysql.d.ts" />
17
17
  /// <reference path="netCard.d.ts" />
18
18
  /// <reference path="node.d.ts" />
19
- /// <reference path="paddleOcr.d.ts" />
19
+ /// <reference path="paddleocr.d.ts" />
20
20
  /// <reference path="pip.d.ts" />
21
21
  /// <reference path="system.d.ts" />
22
22
  /// <reference path="thread.d.ts" />
23
- /// <reference path="tomatoOcr.d.ts" />
23
+ /// <reference path="tomatoocr.d.ts" />
24
24
  /// <reference path="tts.d.ts" />
25
25
  /// <reference path="ui.d.ts" />
26
26
  /// <reference path="utils.d.ts" />
package/types/pip.d.ts CHANGED
@@ -27,7 +27,7 @@ declare namespace pip {
27
27
  function closeWindow(): boolean;
28
28
  /**
29
29
  * 设置日志模式或自定义模式的悬浮窗内容尺寸
30
- * 日志模式和自定义模式会分别持久化尺寸;悬浮窗关闭或保活模式返回 false
30
+ * 日志模式和自定义模式会分别持久化尺寸;保活模式返回 false
31
31
  * @param width 目标内容宽度
32
32
  * @param height 目标内容高度
33
33
  * @returns true代表尺寸已提交,false代表当前模式不允许设置或宽高无效
package/types/thread.d.ts CHANGED
@@ -27,11 +27,12 @@ declare namespace thread {
27
27
  /**
28
28
  * 异步执行线程代码
29
29
  * @param threadJsFileName 线程js文件路径
30
+ * @param params 注入子线程全局变量 __threadParams__ 的启动参数,只能传 Object
30
31
  * @returns 线程对象
31
32
  * @example
32
- * thread.run("test_thread.js")
33
+ * thread.run("test_thread.js", { taskId: 1 })
33
34
  */
34
- function run(threadJsFileName: string): Thread;
35
+ function run(threadJsFileName: string, params?: Record<string, any>): Thread;
35
36
  /**
36
37
  * 停止所有线程
37
38
  * @returns 是否停止成功
@@ -20,7 +20,7 @@
20
20
  /// <reference path="悬浮窗模块.d.ts" />
21
21
  /// <reference path="HID模块.d.ts" />
22
22
  /// <reference path="HTTP模块.d.ts" />
23
- /// <reference path="MySQL模块.d.ts" />
23
+ /// <reference path="MySql模块.d.ts" />
24
24
  /// <reference path="PaddleOCR模块.d.ts" />
25
25
  /// <reference path="YOLO模块.d.ts" />
26
26
  /// <reference path="YOLO分类模块.d.ts" />
@@ -43,6 +43,10 @@ declare const $APP应用包名: 字符串;
43
43
  * 当前线程名称
44
44
  */
45
45
  declare const $线程名称: 字符串;
46
+ /**
47
+ * 子线程启动参数;仅在线程脚本中可用,未传参数时为空对象
48
+ */
49
+ declare const $线程参数: 字典<任意类型>;
46
50
  /**
47
51
  * 脚本信息
48
52
  */
@@ -1,6 +1,6 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
2
  /**
3
- * 悬浮窗模块 包含悬浮窗日志窗口的显示、关闭、状态查询等功能
3
+ * 悬浮窗模块 包含悬浮窗日志窗口的显示、模式切换、状态查询等功能
4
4
  */
5
5
  declare namespace $悬浮窗 {
6
6
  /**
@@ -24,14 +24,9 @@ declare namespace $悬浮窗 {
24
24
  * @returns true代表已提交切换请求
25
25
  */
26
26
  function 切换到自定义模式(): 布尔值;
27
- /**
28
- * 关闭悬浮窗
29
- * @returns true代表已提交关闭请求
30
- */
31
- function 关闭悬浮窗(): 布尔值;
32
27
  /**
33
28
  * 设置日志模式或自定义模式的悬浮窗内容尺寸
34
- * 日志模式和自定义模式会分别持久化尺寸;悬浮窗关闭或保活模式返回 false
29
+ * 日志模式和自定义模式会分别持久化尺寸;保活模式返回 false
35
30
  * @param 宽度 目标内容宽度
36
31
  * @param 高度 目标内容高度
37
32
  * @returns true代表尺寸已提交,false代表当前模式不允许设置或宽高无效
@@ -28,11 +28,12 @@ declare namespace $线程 {
28
28
  /**
29
29
  * 异步执行线程代码
30
30
  * @param 线程js文件名 线程js文件路径
31
+ * @param 启动参数 注入子线程全局变量 $线程参数 的启动参数,只能传 Object
31
32
  * @returns 线程对象
32
33
  * @example
33
- * $线程.运行("test_thread.js")
34
+ * $线程.运行("test_thread.js", { 任务编号: 1 })
34
35
  */
35
- function 运行(线程js文件名: 字符串): 线程;
36
+ function 运行(线程js文件名: 字符串, 启动参数?: 字典<任意类型>): 线程;
36
37
  /**
37
38
  * 停止所有线程
38
39
  * @returns 是否停止成功