ms-types 0.0.9 → 0.0.11
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 +1 -1
- package/types/config.d.ts +13 -19
- package/types/file.d.ts +1 -1
- package/types/image.d.ts +41 -17
- package/types/logger.d.ts +9 -7
- package/types/ui.d.ts +14 -0
package/package.json
CHANGED
package/types/config.d.ts
CHANGED
|
@@ -2,25 +2,6 @@
|
|
|
2
2
|
* 配置相关函数
|
|
3
3
|
*/
|
|
4
4
|
declare namespace config {
|
|
5
|
-
/**
|
|
6
|
-
* 读取配置
|
|
7
|
-
* @param key 配置key
|
|
8
|
-
* @returns 配置值
|
|
9
|
-
*/
|
|
10
|
-
function readConfig(key: string): any;
|
|
11
|
-
/**
|
|
12
|
-
* 删除配置
|
|
13
|
-
* @param key 配置key
|
|
14
|
-
* @returns 删除是否成功
|
|
15
|
-
*/
|
|
16
|
-
function deleteConfig(key: string): boolean;
|
|
17
|
-
/**
|
|
18
|
-
* 更新配置
|
|
19
|
-
* @param key 配置key
|
|
20
|
-
* @param value 配置值
|
|
21
|
-
* @returns 更新是否成功
|
|
22
|
-
*/
|
|
23
|
-
function updateConfig(key: string, value: any): boolean;
|
|
24
5
|
/**
|
|
25
6
|
* 读取配置Int
|
|
26
7
|
* @param key 配置key
|
|
@@ -50,4 +31,17 @@ declare namespace config {
|
|
|
50
31
|
* @returns 所有配置JSON
|
|
51
32
|
*/
|
|
52
33
|
function getConfigJSON(): Record<string, any>;
|
|
34
|
+
/**
|
|
35
|
+
* 更新配置
|
|
36
|
+
* @param key 配置key
|
|
37
|
+
* @param value 配置值
|
|
38
|
+
* @returns 更新是否成功
|
|
39
|
+
*/
|
|
40
|
+
function updateConfig(key: string, value: any): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* 删除配置
|
|
43
|
+
* @param key 配置key
|
|
44
|
+
* @returns 删除是否成功
|
|
45
|
+
*/
|
|
46
|
+
function deleteConfig(key: string): boolean;
|
|
53
47
|
}
|
package/types/file.d.ts
CHANGED
package/types/image.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare namespace image {
|
|
|
6
6
|
function captureFullScreen(): string | null;
|
|
7
7
|
/**
|
|
8
8
|
* 保存图片
|
|
9
|
-
* @param imageId 图片id
|
|
9
|
+
* @param imageId 图片id 路径 http地址或者 screen 实时截屏
|
|
10
10
|
* @param filePath 保存路径
|
|
11
11
|
*/
|
|
12
12
|
function saveTo(imageId: string, filePath: string): void;
|
|
@@ -40,7 +40,7 @@ declare namespace image {
|
|
|
40
40
|
/**
|
|
41
41
|
* 旋转图片
|
|
42
42
|
* @param imageId 图片id
|
|
43
|
-
* @param degree 旋转角度
|
|
43
|
+
* @param degree 旋转角度 只能是 90 -90 180
|
|
44
44
|
* @returns 旋转后的图片id ,如果旋转失败则返回null
|
|
45
45
|
*/
|
|
46
46
|
function rotateImage(imageId: string, degree: number): string | null;
|
|
@@ -49,10 +49,10 @@ declare namespace image {
|
|
|
49
49
|
* @param imageId 图片id
|
|
50
50
|
* @param points 颜色点
|
|
51
51
|
* @param threshold 阈值
|
|
52
|
-
* @param x
|
|
53
|
-
* @param y
|
|
54
|
-
* @param ex
|
|
55
|
-
* @param ey
|
|
52
|
+
* @param x 左上角x
|
|
53
|
+
* @param y 左上角y
|
|
54
|
+
* @param ex 右下角x
|
|
55
|
+
* @param ey 右下角y
|
|
56
56
|
* @returns true 相同 false 不同
|
|
57
57
|
*/
|
|
58
58
|
function cmpColor(
|
|
@@ -64,18 +64,42 @@ declare namespace image {
|
|
|
64
64
|
ex: number,
|
|
65
65
|
ey: number
|
|
66
66
|
): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* 查找颜色
|
|
69
|
+
* @param imageId 图片id
|
|
70
|
+
* @param color 颜色 支持"主色-偏色"格式,如"0x6DD1E6-0x101010"
|
|
71
|
+
* @param threshold 阈值
|
|
72
|
+
* @param x 左上角x
|
|
73
|
+
* @param y 左上角y
|
|
74
|
+
* @param ex 右下角x
|
|
75
|
+
* @param ey 右下角y
|
|
76
|
+
* @param limit 限制数量
|
|
77
|
+
* @param orz 查找方向1-8
|
|
78
|
+
* @returns 颜色点数组
|
|
79
|
+
*/
|
|
80
|
+
function findColor(
|
|
81
|
+
imageId: string,
|
|
82
|
+
color: string,
|
|
83
|
+
threshold: number,
|
|
84
|
+
x: number,
|
|
85
|
+
y: number,
|
|
86
|
+
ex: number,
|
|
87
|
+
ey: number,
|
|
88
|
+
limit: number,
|
|
89
|
+
orz: number
|
|
90
|
+
): { x: number; y: number }[];
|
|
67
91
|
/**
|
|
68
92
|
* 查找多颜色
|
|
69
93
|
* @param imageId 图片id
|
|
70
94
|
* @param firstColor 第一个颜色
|
|
71
95
|
* @param threshold 阈值
|
|
72
96
|
* @param points 颜色点
|
|
73
|
-
* @param x
|
|
74
|
-
* @param y
|
|
75
|
-
* @param ex
|
|
76
|
-
* @param ey
|
|
97
|
+
* @param x 左上角x
|
|
98
|
+
* @param y 左上角y
|
|
99
|
+
* @param ex 右下角x
|
|
100
|
+
* @param ey 右下角y
|
|
77
101
|
* @param limit 限制数量
|
|
78
|
-
* @param orz
|
|
102
|
+
* @param orz 查找方向1-8
|
|
79
103
|
* @returns 颜色点数组
|
|
80
104
|
*/
|
|
81
105
|
function findMultiColor(
|
|
@@ -94,11 +118,11 @@ declare namespace image {
|
|
|
94
118
|
* 查找图片
|
|
95
119
|
* @param imageId 图片id
|
|
96
120
|
* @param templateImageId 模板图片id
|
|
97
|
-
* @param x
|
|
98
|
-
* @param y
|
|
99
|
-
* @param ex
|
|
100
|
-
* @param ey
|
|
101
|
-
* @param
|
|
121
|
+
* @param x 左上角x
|
|
122
|
+
* @param y 左上角y
|
|
123
|
+
* @param ex 右下角x
|
|
124
|
+
* @param ey 右下角y
|
|
125
|
+
* @param threshold 阈值
|
|
102
126
|
* @param limit 限制数量
|
|
103
127
|
* @param method 方法
|
|
104
128
|
* @returns 图片数组
|
|
@@ -110,7 +134,7 @@ declare namespace image {
|
|
|
110
134
|
y: number,
|
|
111
135
|
ex: number,
|
|
112
136
|
ey: number,
|
|
113
|
-
|
|
137
|
+
threshold: number,
|
|
114
138
|
limit: number,
|
|
115
139
|
method: number
|
|
116
140
|
): {
|
package/types/logger.d.ts
CHANGED
|
@@ -3,34 +3,36 @@ declare namespace logger {
|
|
|
3
3
|
* 设置日志等级
|
|
4
4
|
* @param level 日志等级
|
|
5
5
|
*/
|
|
6
|
-
function setLoggerLevel(
|
|
6
|
+
function setLoggerLevel(
|
|
7
|
+
level: "error" | "warn" | "debug" | "info" | "off"
|
|
8
|
+
): void;
|
|
7
9
|
/**
|
|
8
10
|
* 设置是否输出到文件
|
|
9
11
|
* @param enabled 是否输出到文件
|
|
10
12
|
*/
|
|
11
|
-
function setLogToFile(enabled: boolean);
|
|
13
|
+
function setLogToFile(enabled: boolean): void;
|
|
12
14
|
/**
|
|
13
15
|
* 重置日志文件
|
|
14
16
|
*/
|
|
15
|
-
function resetLogFile();
|
|
17
|
+
function resetLogFile(): void;
|
|
16
18
|
/**
|
|
17
19
|
* 调试日志
|
|
18
20
|
* @param log 日志内容
|
|
19
21
|
*/
|
|
20
|
-
function debug(log: string);
|
|
22
|
+
function debug(log: string): void;
|
|
21
23
|
/**
|
|
22
24
|
* 信息日志
|
|
23
25
|
* @param log 日志内容
|
|
24
26
|
*/
|
|
25
|
-
function info(log: string);
|
|
27
|
+
function info(log: string): void;
|
|
26
28
|
/**
|
|
27
29
|
* 警告日志
|
|
28
30
|
* @param log 日志内容
|
|
29
31
|
*/
|
|
30
|
-
function warn(log: string);
|
|
32
|
+
function warn(log: string): void;
|
|
31
33
|
/**
|
|
32
34
|
* 错误日志
|
|
33
35
|
* @param log 日志内容
|
|
34
36
|
*/
|
|
35
|
-
function error(log: string);
|
|
37
|
+
function error(log: string): void;
|
|
36
38
|
}
|
package/types/ui.d.ts
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 注册 UI 函数
|
|
3
|
+
* @param name 函数名称
|
|
4
|
+
* @param func 函数
|
|
5
|
+
*/
|
|
6
|
+
declare function registerUIFunc(name: string, func: (data: any) => void): void;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 发送事件
|
|
10
|
+
* @param event 事件名称
|
|
11
|
+
* @param data 事件参数
|
|
12
|
+
*/
|
|
13
|
+
declare function emitEvent(event: string, data: any): void;
|
|
14
|
+
|
|
1
15
|
declare namespace ui {
|
|
2
16
|
interface WebView {
|
|
3
17
|
/**
|