assistsx-js 0.1.41 → 0.2.0
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/README.md +32 -0
- package/dist/index.cjs +7957 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +4231 -0
- package/dist/index.d.ts +4231 -30
- package/dist/index.global.js +46 -0
- package/dist/index.global.js.map +1 -0
- package/dist/index.js +7879 -30
- package/dist/index.js.map +1 -0
- package/package.json +11 -5
- package/src/{AssistsXAsync.ts → assistsx-async.ts} +8 -8
- package/src/{AssistsX.ts → assistsx.ts} +8 -8
- package/src/barutils/bar-utils.ts +3 -3
- package/src/filesystem/fileio/file-io.ts +2 -2
- package/src/filesystem/fileutils/file-utils.ts +2 -2
- package/src/filesystem/path.ts +2 -2
- package/src/floatingwindow/float.ts +4 -4
- package/src/gallery/gallery.ts +2 -2
- package/src/global.d.ts +6 -1
- package/src/imageutils/image-utils.ts +2 -2
- package/src/ime/ime.ts +2 -2
- package/src/index.ts +21 -20
- package/src/log/log-call-method.ts +28 -0
- package/src/log/log.ts +445 -0
- package/src/mlkit/mlkit.ts +3 -3
- package/src/network/http.ts +2 -2
- package/src/{NodeAsync.ts → node-async.ts} +5 -5
- package/src/{Node.ts → node.ts} +5 -5
- package/src/{StepAsync.ts → step-async.ts} +8 -8
- package/src/{Step.ts → step.ts} +7 -7
- package/dist/AccessibilityEventFilter.d.ts +0 -105
- package/dist/AccessibilityEventFilter.js +0 -89
- package/dist/AppInfo.d.ts +0 -45
- package/dist/AppInfo.js +0 -38
- package/dist/AssistsX.d.ts +0 -484
- package/dist/AssistsX.js +0 -828
- package/dist/AssistsXAsync.d.ts +0 -532
- package/dist/AssistsXAsync.js +0 -874
- package/dist/Bounds.d.ts +0 -48
- package/dist/Bounds.js +0 -68
- package/dist/CallMethod.d.ts +0 -69
- package/dist/CallMethod.js +0 -71
- package/dist/CallResponse.d.ts +0 -10
- package/dist/CallResponse.js +0 -28
- package/dist/DeviceInfo.d.ts +0 -69
- package/dist/DeviceInfo.js +0 -50
- package/dist/Node.d.ts +0 -334
- package/dist/Node.js +0 -369
- package/dist/NodeAsync.d.ts +0 -213
- package/dist/NodeAsync.js +0 -313
- package/dist/NodeClassValue.d.ts +0 -15
- package/dist/NodeClassValue.js +0 -15
- package/dist/Step.d.ts +0 -355
- package/dist/Step.js +0 -689
- package/dist/StepAsync.d.ts +0 -162
- package/dist/StepAsync.js +0 -264
- package/dist/StepError.d.ts +0 -35
- package/dist/StepError.js +0 -26
- package/dist/StepStateStore.d.ts +0 -14
- package/dist/StepStateStore.js +0 -37
- package/dist/Utils.d.ts +0 -3
- package/dist/Utils.js +0 -20
- package/dist/WindowFlags.d.ts +0 -75
- package/dist/WindowFlags.js +0 -97
- package/dist/barutils/BarUtilsCallMethod.d.ts +0 -24
- package/dist/barutils/BarUtilsCallMethod.js +0 -26
- package/dist/barutils/bar-utils.d.ts +0 -41
- package/dist/barutils/bar-utils.js +0 -205
- package/dist/filesystem/fileio/file-io.d.ts +0 -101
- package/dist/filesystem/fileio/file-io.js +0 -235
- package/dist/filesystem/fileutils/file-utils.d.ts +0 -242
- package/dist/filesystem/fileutils/file-utils.js +0 -493
- package/dist/filesystem/path.d.ts +0 -252
- package/dist/filesystem/path.js +0 -589
- package/dist/floatingwindow/FloatCallMethod.d.ts +0 -19
- package/dist/floatingwindow/FloatCallMethod.js +0 -18
- package/dist/floatingwindow/float.d.ts +0 -29
- package/dist/floatingwindow/float.js +0 -149
- package/dist/gallery/gallery.d.ts +0 -60
- package/dist/gallery/gallery.js +0 -142
- package/dist/imageutils/image-utils.d.ts +0 -442
- package/dist/imageutils/image-utils.js +0 -543
- package/dist/ime/ime.d.ts +0 -80
- package/dist/ime/ime.js +0 -141
- package/dist/mlkit/MlkitCallMethod.d.ts +0 -27
- package/dist/mlkit/MlkitCallMethod.js +0 -26
- package/dist/mlkit/mlkit.d.ts +0 -86
- package/dist/mlkit/mlkit.js +0 -169
- package/dist/network/http.d.ts +0 -127
- package/dist/network/http.js +0 -202
- /package/src/{AccessibilityEventFilter.ts → accessibility-event-filter.ts} +0 -0
- /package/src/{AppInfo.ts → app-info.ts} +0 -0
- /package/src/barutils/{BarUtilsCallMethod.ts → bar-utils-call-method.ts} +0 -0
- /package/src/{Bounds.ts → bounds.ts} +0 -0
- /package/src/{CallMethod.ts → call-method.ts} +0 -0
- /package/src/{CallResponse.ts → call-response.ts} +0 -0
- /package/src/{DeviceInfo.ts → device-info.ts} +0 -0
- /package/src/floatingwindow/{FloatCallMethod.ts → float-call-method.ts} +0 -0
- /package/src/mlkit/{MlkitCallMethod.ts → mlkit-call-method.ts} +0 -0
- /package/src/{NodeClassValue.ts → node-class-value.ts} +0 -0
- /package/src/{StepError.ts → step-error.ts} +0 -0
- /package/src/{StepStateStore.ts → step-state-store.ts} +0 -0
- /package/src/{Utils.ts → utils.ts} +0 -0
- /package/src/{WindowFlags.ts → window-flags.ts} +0 -0
package/dist/StepAsync.d.ts
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { Node } from "./Node";
|
|
2
|
-
import { Step } from "./Step";
|
|
3
|
-
export declare class StepAsync {
|
|
4
|
-
private step;
|
|
5
|
-
/**
|
|
6
|
-
* 构造函数
|
|
7
|
-
* @param step Step实例
|
|
8
|
-
*/
|
|
9
|
-
constructor(step: Step);
|
|
10
|
-
/**
|
|
11
|
-
* 对单个节点进行截图
|
|
12
|
-
* @param node 目标节点
|
|
13
|
-
* @param overlayHiddenScreenshotDelayMillis 截图延迟时间(毫秒)
|
|
14
|
-
* @returns 截图路径
|
|
15
|
-
*/
|
|
16
|
-
takeScreenshotByNode(node: Node, overlayHiddenScreenshotDelayMillis?: number): Promise<string>;
|
|
17
|
-
/**
|
|
18
|
-
* 对多个节点进行截图
|
|
19
|
-
* @param nodes 目标节点数组
|
|
20
|
-
* @param overlayHiddenScreenshotDelayMillis 截图延迟时间(毫秒)
|
|
21
|
-
* @returns 截图路径数组
|
|
22
|
-
*/
|
|
23
|
-
takeScreenshotNodes(nodes: Node[], overlayHiddenScreenshotDelayMillis?: number): Promise<string[]>;
|
|
24
|
-
/**
|
|
25
|
-
* 获取所有符合条件的节点
|
|
26
|
-
* @param filterClass 类名过滤
|
|
27
|
-
* @param filterViewId 视图ID过滤
|
|
28
|
-
* @param filterDes 描述过滤
|
|
29
|
-
* @param filterText 文本过滤
|
|
30
|
-
* @returns 节点数组
|
|
31
|
-
*/
|
|
32
|
-
getAllNodes({ filterClass, filterViewId, filterDes, filterText, }?: {
|
|
33
|
-
filterClass?: string;
|
|
34
|
-
filterViewId?: string;
|
|
35
|
-
filterDes?: string;
|
|
36
|
-
filterText?: string;
|
|
37
|
-
}): Promise<Node[]>;
|
|
38
|
-
/**
|
|
39
|
-
* 启动应用
|
|
40
|
-
* @param packageName 应用包名
|
|
41
|
-
* @returns 是否启动成功
|
|
42
|
-
*/
|
|
43
|
-
launchApp(packageName: string): Promise<boolean>;
|
|
44
|
-
/**
|
|
45
|
-
* 获取当前应用包名
|
|
46
|
-
* @returns 包名
|
|
47
|
-
*/
|
|
48
|
-
getPackageName(): Promise<string>;
|
|
49
|
-
/**
|
|
50
|
-
* 通过ID查找节点
|
|
51
|
-
* @param id 节点ID
|
|
52
|
-
* @param filterClass 类名过滤
|
|
53
|
-
* @param filterText 文本过滤
|
|
54
|
-
* @param filterDes 描述过滤
|
|
55
|
-
* @returns 节点数组
|
|
56
|
-
*/
|
|
57
|
-
findById(id: string, { filterClass, filterText, filterDes, }?: {
|
|
58
|
-
filterClass?: string;
|
|
59
|
-
filterText?: string;
|
|
60
|
-
filterDes?: string;
|
|
61
|
-
}): Promise<Node[]>;
|
|
62
|
-
/**
|
|
63
|
-
* 通过文本查找节点
|
|
64
|
-
* @param text 要查找的文本
|
|
65
|
-
* @param filterClass 类名过滤
|
|
66
|
-
* @param filterViewId 视图ID过滤
|
|
67
|
-
* @param filterDes 描述过滤
|
|
68
|
-
* @returns 节点数组
|
|
69
|
-
*/
|
|
70
|
-
findByText(text: string, { filterClass, filterViewId, filterDes, }?: {
|
|
71
|
-
filterClass?: string;
|
|
72
|
-
filterViewId?: string;
|
|
73
|
-
filterDes?: string;
|
|
74
|
-
}): Promise<Node[]>;
|
|
75
|
-
/**
|
|
76
|
-
* 通过标签查找节点
|
|
77
|
-
* @param className 类名
|
|
78
|
-
* @param filterText 文本过滤
|
|
79
|
-
* @param filterViewId 视图ID过滤
|
|
80
|
-
* @param filterDes 描述过滤
|
|
81
|
-
* @returns 节点数组
|
|
82
|
-
*/
|
|
83
|
-
findByTags(className: string, { filterText, filterViewId, filterDes, }?: {
|
|
84
|
-
filterText?: string;
|
|
85
|
-
filterViewId?: string;
|
|
86
|
-
filterDes?: string;
|
|
87
|
-
}): Promise<Node[]>;
|
|
88
|
-
/**
|
|
89
|
-
* 查找所有匹配文本的节点
|
|
90
|
-
* @param text 要查找的文本
|
|
91
|
-
* @returns 节点数组
|
|
92
|
-
*/
|
|
93
|
-
findByTextAllMatch(text: string): Promise<Node[]>;
|
|
94
|
-
/**
|
|
95
|
-
* 检查是否包含指定文本
|
|
96
|
-
* @param text 要检查的文本
|
|
97
|
-
* @returns 是否包含
|
|
98
|
-
*/
|
|
99
|
-
containsText(text: string): Promise<boolean>;
|
|
100
|
-
/**
|
|
101
|
-
* 获取所有文本
|
|
102
|
-
* @returns 文本数组
|
|
103
|
-
*/
|
|
104
|
-
getAllText(): Promise<string[]>;
|
|
105
|
-
/**
|
|
106
|
-
* 执行点击手势
|
|
107
|
-
* @param x 横坐标
|
|
108
|
-
* @param y 纵坐标
|
|
109
|
-
* @param duration 持续时间(毫秒)
|
|
110
|
-
* @returns 是否成功
|
|
111
|
-
*/
|
|
112
|
-
clickByGesture(x: number, y: number, duration: number): Promise<boolean>;
|
|
113
|
-
longPressGestureAutoPaste(point: {
|
|
114
|
-
x: number;
|
|
115
|
-
y: number;
|
|
116
|
-
}, text: string, { matchedPackageName, matchedText, timeoutMillis, longPressDuration, }?: {
|
|
117
|
-
matchedPackageName?: string;
|
|
118
|
-
matchedText?: string;
|
|
119
|
-
timeoutMillis?: number;
|
|
120
|
-
longPressDuration?: number;
|
|
121
|
-
}): Promise<boolean>;
|
|
122
|
-
getAppInfo(packageName: string): Promise<any>;
|
|
123
|
-
performLinearGesture(startPoint: {
|
|
124
|
-
x: number;
|
|
125
|
-
y: number;
|
|
126
|
-
}, endPoint: {
|
|
127
|
-
x: number;
|
|
128
|
-
y: number;
|
|
129
|
-
}, { duration }?: {
|
|
130
|
-
duration?: number;
|
|
131
|
-
}): Promise<boolean>;
|
|
132
|
-
/**
|
|
133
|
-
* 返回操作
|
|
134
|
-
* @returns 是否成功
|
|
135
|
-
*/
|
|
136
|
-
back(): Promise<boolean>;
|
|
137
|
-
/**
|
|
138
|
-
* 回到主页
|
|
139
|
-
* @returns 是否成功
|
|
140
|
-
*/
|
|
141
|
-
home(): Promise<boolean>;
|
|
142
|
-
/**
|
|
143
|
-
* 打开通知栏
|
|
144
|
-
* @returns 是否成功
|
|
145
|
-
*/
|
|
146
|
-
notifications(): Promise<boolean>;
|
|
147
|
-
/**
|
|
148
|
-
* 显示最近应用
|
|
149
|
-
* @returns 是否成功
|
|
150
|
-
*/
|
|
151
|
-
recentApps(): Promise<boolean>;
|
|
152
|
-
/**
|
|
153
|
-
* 获取屏幕尺寸
|
|
154
|
-
* @returns 屏幕尺寸对象
|
|
155
|
-
*/
|
|
156
|
-
getScreenSize(): Promise<any>;
|
|
157
|
-
/**
|
|
158
|
-
* 获取应用窗口尺寸
|
|
159
|
-
* @returns 应用窗口尺寸对象
|
|
160
|
-
*/
|
|
161
|
-
getAppScreenSize(): Promise<any>;
|
|
162
|
-
}
|
package/dist/StepAsync.js
DELETED
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
import { AssistsXAsync } from "./AssistsXAsync";
|
|
2
|
-
import { Step } from "./Step";
|
|
3
|
-
export class StepAsync {
|
|
4
|
-
/**
|
|
5
|
-
* 构造函数
|
|
6
|
-
* @param step Step实例
|
|
7
|
-
*/
|
|
8
|
-
constructor(step) {
|
|
9
|
-
this.step = step;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* 对单个节点进行截图
|
|
13
|
-
* @param node 目标节点
|
|
14
|
-
* @param overlayHiddenScreenshotDelayMillis 截图延迟时间(毫秒)
|
|
15
|
-
* @returns 截图路径
|
|
16
|
-
*/
|
|
17
|
-
async takeScreenshotByNode(node, overlayHiddenScreenshotDelayMillis = 250) {
|
|
18
|
-
Step.assert(this.step.stepId);
|
|
19
|
-
const result = await AssistsXAsync.takeScreenshotNodes([node], overlayHiddenScreenshotDelayMillis);
|
|
20
|
-
Step.assert(this.step.stepId);
|
|
21
|
-
return result[0];
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* 对多个节点进行截图
|
|
25
|
-
* @param nodes 目标节点数组
|
|
26
|
-
* @param overlayHiddenScreenshotDelayMillis 截图延迟时间(毫秒)
|
|
27
|
-
* @returns 截图路径数组
|
|
28
|
-
*/
|
|
29
|
-
async takeScreenshotNodes(nodes, overlayHiddenScreenshotDelayMillis = 250) {
|
|
30
|
-
Step.assert(this.step.stepId);
|
|
31
|
-
const result = await AssistsXAsync.takeScreenshotNodes(nodes, overlayHiddenScreenshotDelayMillis);
|
|
32
|
-
Step.assert(this.step.stepId);
|
|
33
|
-
return result;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* 获取所有符合条件的节点
|
|
37
|
-
* @param filterClass 类名过滤
|
|
38
|
-
* @param filterViewId 视图ID过滤
|
|
39
|
-
* @param filterDes 描述过滤
|
|
40
|
-
* @param filterText 文本过滤
|
|
41
|
-
* @returns 节点数组
|
|
42
|
-
*/
|
|
43
|
-
async getAllNodes({ filterClass, filterViewId, filterDes, filterText, } = {}) {
|
|
44
|
-
Step.assert(this.step.stepId);
|
|
45
|
-
const nodes = await AssistsXAsync.getAllNodes({
|
|
46
|
-
filterClass,
|
|
47
|
-
filterViewId,
|
|
48
|
-
filterDes,
|
|
49
|
-
filterText,
|
|
50
|
-
});
|
|
51
|
-
Step.assert(this.step.stepId);
|
|
52
|
-
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
53
|
-
return nodes;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* 启动应用
|
|
57
|
-
* @param packageName 应用包名
|
|
58
|
-
* @returns 是否启动成功
|
|
59
|
-
*/
|
|
60
|
-
async launchApp(packageName) {
|
|
61
|
-
Step.assert(this.step.stepId);
|
|
62
|
-
const result = await AssistsXAsync.launchApp(packageName);
|
|
63
|
-
Step.assert(this.step.stepId);
|
|
64
|
-
return result;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* 获取当前应用包名
|
|
68
|
-
* @returns 包名
|
|
69
|
-
*/
|
|
70
|
-
async getPackageName() {
|
|
71
|
-
Step.assert(this.step.stepId);
|
|
72
|
-
const result = await AssistsXAsync.getPackageName();
|
|
73
|
-
Step.assert(this.step.stepId);
|
|
74
|
-
return result;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* 通过ID查找节点
|
|
78
|
-
* @param id 节点ID
|
|
79
|
-
* @param filterClass 类名过滤
|
|
80
|
-
* @param filterText 文本过滤
|
|
81
|
-
* @param filterDes 描述过滤
|
|
82
|
-
* @returns 节点数组
|
|
83
|
-
*/
|
|
84
|
-
async findById(id, { filterClass, filterText, filterDes, } = {}) {
|
|
85
|
-
Step.assert(this.step.stepId);
|
|
86
|
-
const nodes = await AssistsXAsync.findById(id, {
|
|
87
|
-
filterClass,
|
|
88
|
-
filterText,
|
|
89
|
-
filterDes,
|
|
90
|
-
});
|
|
91
|
-
Step.assert(this.step.stepId);
|
|
92
|
-
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
93
|
-
return nodes;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* 通过文本查找节点
|
|
97
|
-
* @param text 要查找的文本
|
|
98
|
-
* @param filterClass 类名过滤
|
|
99
|
-
* @param filterViewId 视图ID过滤
|
|
100
|
-
* @param filterDes 描述过滤
|
|
101
|
-
* @returns 节点数组
|
|
102
|
-
*/
|
|
103
|
-
async findByText(text, { filterClass, filterViewId, filterDes, } = {}) {
|
|
104
|
-
Step.assert(this.step.stepId);
|
|
105
|
-
const nodes = await AssistsXAsync.findByText(text, {
|
|
106
|
-
filterClass,
|
|
107
|
-
filterViewId,
|
|
108
|
-
filterDes,
|
|
109
|
-
});
|
|
110
|
-
Step.assert(this.step.stepId);
|
|
111
|
-
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
112
|
-
return nodes;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* 通过标签查找节点
|
|
116
|
-
* @param className 类名
|
|
117
|
-
* @param filterText 文本过滤
|
|
118
|
-
* @param filterViewId 视图ID过滤
|
|
119
|
-
* @param filterDes 描述过滤
|
|
120
|
-
* @returns 节点数组
|
|
121
|
-
*/
|
|
122
|
-
async findByTags(className, { filterText, filterViewId, filterDes, } = {}) {
|
|
123
|
-
Step.assert(this.step.stepId);
|
|
124
|
-
const nodes = await AssistsXAsync.findByTags(className, {
|
|
125
|
-
filterText,
|
|
126
|
-
filterViewId,
|
|
127
|
-
filterDes,
|
|
128
|
-
});
|
|
129
|
-
Step.assert(this.step.stepId);
|
|
130
|
-
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
131
|
-
return nodes;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* 查找所有匹配文本的节点
|
|
135
|
-
* @param text 要查找的文本
|
|
136
|
-
* @returns 节点数组
|
|
137
|
-
*/
|
|
138
|
-
async findByTextAllMatch(text) {
|
|
139
|
-
Step.assert(this.step.stepId);
|
|
140
|
-
const nodes = await AssistsXAsync.findByTextAllMatch(text);
|
|
141
|
-
Step.assert(this.step.stepId);
|
|
142
|
-
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
143
|
-
return nodes;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* 检查是否包含指定文本
|
|
147
|
-
* @param text 要检查的文本
|
|
148
|
-
* @returns 是否包含
|
|
149
|
-
*/
|
|
150
|
-
async containsText(text) {
|
|
151
|
-
Step.assert(this.step.stepId);
|
|
152
|
-
const result = await AssistsXAsync.containsText(text);
|
|
153
|
-
Step.assert(this.step.stepId);
|
|
154
|
-
return result;
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* 获取所有文本
|
|
158
|
-
* @returns 文本数组
|
|
159
|
-
*/
|
|
160
|
-
async getAllText() {
|
|
161
|
-
Step.assert(this.step.stepId);
|
|
162
|
-
const texts = await AssistsXAsync.getAllText();
|
|
163
|
-
Step.assert(this.step.stepId);
|
|
164
|
-
return texts;
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* 执行点击手势
|
|
168
|
-
* @param x 横坐标
|
|
169
|
-
* @param y 纵坐标
|
|
170
|
-
* @param duration 持续时间(毫秒)
|
|
171
|
-
* @returns 是否成功
|
|
172
|
-
*/
|
|
173
|
-
async clickByGesture(x, y, duration) {
|
|
174
|
-
Step.assert(this.step.stepId);
|
|
175
|
-
const result = await AssistsXAsync.clickByGesture(x, y, duration);
|
|
176
|
-
Step.assert(this.step.stepId);
|
|
177
|
-
return result;
|
|
178
|
-
}
|
|
179
|
-
async longPressGestureAutoPaste(point, text, { matchedPackageName, matchedText, timeoutMillis, longPressDuration, } = { matchedText: "粘贴", timeoutMillis: 1500, longPressDuration: 600 }) {
|
|
180
|
-
Step.assert(this.step.stepId);
|
|
181
|
-
const result = await AssistsXAsync.longPressGestureAutoPaste(point, text, {
|
|
182
|
-
matchedPackageName,
|
|
183
|
-
matchedText,
|
|
184
|
-
timeoutMillis,
|
|
185
|
-
longPressDuration,
|
|
186
|
-
});
|
|
187
|
-
Step.assert(this.step.stepId);
|
|
188
|
-
return result;
|
|
189
|
-
}
|
|
190
|
-
async getAppInfo(packageName) {
|
|
191
|
-
Step.assert(this.step.stepId);
|
|
192
|
-
const result = await AssistsXAsync.getAppInfo(packageName);
|
|
193
|
-
Step.assert(this.step.stepId);
|
|
194
|
-
return result;
|
|
195
|
-
}
|
|
196
|
-
async performLinearGesture(startPoint, endPoint, { duration } = {}) {
|
|
197
|
-
Step.assert(this.step.stepId);
|
|
198
|
-
const result = await AssistsXAsync.performLinearGesture(startPoint, endPoint, {
|
|
199
|
-
duration,
|
|
200
|
-
});
|
|
201
|
-
Step.assert(this.step.stepId);
|
|
202
|
-
return result;
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* 返回操作
|
|
206
|
-
* @returns 是否成功
|
|
207
|
-
*/
|
|
208
|
-
async back() {
|
|
209
|
-
Step.assert(this.step.stepId);
|
|
210
|
-
const result = await AssistsXAsync.back();
|
|
211
|
-
Step.assert(this.step.stepId);
|
|
212
|
-
return result;
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* 回到主页
|
|
216
|
-
* @returns 是否成功
|
|
217
|
-
*/
|
|
218
|
-
async home() {
|
|
219
|
-
Step.assert(this.step.stepId);
|
|
220
|
-
const result = await AssistsXAsync.home();
|
|
221
|
-
Step.assert(this.step.stepId);
|
|
222
|
-
return result;
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* 打开通知栏
|
|
226
|
-
* @returns 是否成功
|
|
227
|
-
*/
|
|
228
|
-
async notifications() {
|
|
229
|
-
Step.assert(this.step.stepId);
|
|
230
|
-
const result = await AssistsXAsync.notifications();
|
|
231
|
-
Step.assert(this.step.stepId);
|
|
232
|
-
return result;
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* 显示最近应用
|
|
236
|
-
* @returns 是否成功
|
|
237
|
-
*/
|
|
238
|
-
async recentApps() {
|
|
239
|
-
Step.assert(this.step.stepId);
|
|
240
|
-
const result = await AssistsXAsync.recentApps();
|
|
241
|
-
Step.assert(this.step.stepId);
|
|
242
|
-
return result;
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* 获取屏幕尺寸
|
|
246
|
-
* @returns 屏幕尺寸对象
|
|
247
|
-
*/
|
|
248
|
-
async getScreenSize() {
|
|
249
|
-
Step.assert(this.step.stepId);
|
|
250
|
-
const data = await AssistsXAsync.getScreenSize();
|
|
251
|
-
Step.assert(this.step.stepId);
|
|
252
|
-
return data;
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* 获取应用窗口尺寸
|
|
256
|
-
* @returns 应用窗口尺寸对象
|
|
257
|
-
*/
|
|
258
|
-
async getAppScreenSize() {
|
|
259
|
-
Step.assert(this.step.stepId);
|
|
260
|
-
const data = await AssistsXAsync.getAppScreenSize();
|
|
261
|
-
Step.assert(this.step.stepId);
|
|
262
|
-
return data;
|
|
263
|
-
}
|
|
264
|
-
}
|
package/dist/StepError.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 步骤执行错误类
|
|
3
|
-
* 用于携带步骤执行过程中的错误信息和当前步骤对象
|
|
4
|
-
* 支持传入可选数据:message,data任何类型的数据
|
|
5
|
-
*/
|
|
6
|
-
export declare class StepError extends Error {
|
|
7
|
-
/**
|
|
8
|
-
* 步骤实现函数名
|
|
9
|
-
*/
|
|
10
|
-
readonly impl?: string;
|
|
11
|
-
/**
|
|
12
|
-
* 步骤标签
|
|
13
|
-
*/
|
|
14
|
-
readonly tag?: string | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* 步骤数据,可以是任何类型
|
|
17
|
-
*/
|
|
18
|
-
readonly data?: any;
|
|
19
|
-
/**
|
|
20
|
-
* 原始错误
|
|
21
|
-
*/
|
|
22
|
-
readonly originalError?: any;
|
|
23
|
-
/**
|
|
24
|
-
* 当前步骤对象
|
|
25
|
-
*/
|
|
26
|
-
readonly currentStep?: any;
|
|
27
|
-
constructor(message?: string, data?: any, impl?: string, tag?: string | undefined, originalError?: any, currentStep?: any | undefined);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* 主动停止异常类
|
|
31
|
-
* 用于表示步骤被主动停止执行
|
|
32
|
-
*/
|
|
33
|
-
export declare class StepStopError extends StepError {
|
|
34
|
-
constructor(message?: string, data?: any);
|
|
35
|
-
}
|
package/dist/StepError.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 步骤执行错误类
|
|
3
|
-
* 用于携带步骤执行过程中的错误信息和当前步骤对象
|
|
4
|
-
* 支持传入可选数据:message,data任何类型的数据
|
|
5
|
-
*/
|
|
6
|
-
export class StepError extends Error {
|
|
7
|
-
constructor(message, data, impl, tag, originalError, currentStep) {
|
|
8
|
-
super(message);
|
|
9
|
-
this.name = "StepError";
|
|
10
|
-
this.data = data;
|
|
11
|
-
this.impl = impl;
|
|
12
|
-
this.tag = tag;
|
|
13
|
-
this.originalError = originalError;
|
|
14
|
-
this.currentStep = currentStep;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* 主动停止异常类
|
|
19
|
-
* 用于表示步骤被主动停止执行
|
|
20
|
-
*/
|
|
21
|
-
export class StepStopError extends StepError {
|
|
22
|
-
constructor(message, data) {
|
|
23
|
-
super(message || "主动中断步骤", data);
|
|
24
|
-
this.name = "StepStopError";
|
|
25
|
-
}
|
|
26
|
-
}
|
package/dist/StepStateStore.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type StepStatus = 'idle' | 'running' | 'completed' | 'error';
|
|
2
|
-
export interface StepState {
|
|
3
|
-
status: StepStatus;
|
|
4
|
-
stepId?: string;
|
|
5
|
-
tag?: string;
|
|
6
|
-
data?: any;
|
|
7
|
-
error?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const useStepStore: import("pinia").StoreDefinition<"step", StepState, {}, {
|
|
10
|
-
startStep(stepId: string, tag?: string, data?: any): void;
|
|
11
|
-
completeStep(): void;
|
|
12
|
-
setError(error: string): void;
|
|
13
|
-
reset(): void;
|
|
14
|
-
}>;
|
package/dist/StepStateStore.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { defineStore } from 'pinia';
|
|
2
|
-
export const useStepStore = defineStore('step', {
|
|
3
|
-
state: () => ({
|
|
4
|
-
status: 'idle',
|
|
5
|
-
stepId: undefined,
|
|
6
|
-
tag: undefined,
|
|
7
|
-
data: undefined,
|
|
8
|
-
error: undefined
|
|
9
|
-
}),
|
|
10
|
-
actions: {
|
|
11
|
-
// 开始执行步骤
|
|
12
|
-
startStep(stepId, tag, data) {
|
|
13
|
-
this.status = 'running';
|
|
14
|
-
this.stepId = stepId;
|
|
15
|
-
this.tag = tag;
|
|
16
|
-
this.data = data;
|
|
17
|
-
this.error = undefined;
|
|
18
|
-
},
|
|
19
|
-
// 完成步骤
|
|
20
|
-
completeStep() {
|
|
21
|
-
this.status = 'completed';
|
|
22
|
-
},
|
|
23
|
-
// 步骤出错
|
|
24
|
-
setError(error) {
|
|
25
|
-
this.status = 'error';
|
|
26
|
-
this.error = error;
|
|
27
|
-
},
|
|
28
|
-
// 重置状态
|
|
29
|
-
reset() {
|
|
30
|
-
this.status = 'idle';
|
|
31
|
-
this.stepId = undefined;
|
|
32
|
-
this.tag = undefined;
|
|
33
|
-
this.data = undefined;
|
|
34
|
-
this.error = undefined;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
});
|
package/dist/Utils.d.ts
DELETED
package/dist/Utils.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// 导出工具函数
|
|
2
|
-
export function sleep(ms) {
|
|
3
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
4
|
-
}
|
|
5
|
-
// 生成UUID
|
|
6
|
-
export function generateUUID() {
|
|
7
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
|
|
8
|
-
const r = (Math.random() * 16) | 0;
|
|
9
|
-
const v = c === "x" ? r : (r & 0x3) | 0x8;
|
|
10
|
-
return v.toString(16);
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
export function decodeBase64UTF8(base64) {
|
|
14
|
-
const binary = atob(base64);
|
|
15
|
-
const bytes = new Uint8Array(binary.length);
|
|
16
|
-
for (let i = 0; i < binary.length; i++) {
|
|
17
|
-
bytes[i] = binary.charCodeAt(i);
|
|
18
|
-
}
|
|
19
|
-
return new TextDecoder("utf-8").decode(bytes);
|
|
20
|
-
}
|
package/dist/WindowFlags.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 窗口标志位常量类
|
|
3
|
-
* 定义了各种窗口行为和属性的标志位
|
|
4
|
-
*/
|
|
5
|
-
export declare class WindowFlags {
|
|
6
|
-
/** 不获取焦点 */
|
|
7
|
-
static readonly FLAG_NOT_FOCUSABLE = 8;
|
|
8
|
-
/** 不响应触摸 */
|
|
9
|
-
static readonly FLAG_NOT_TOUCHABLE = 16;
|
|
10
|
-
/** 不拦截触摸 */
|
|
11
|
-
static readonly FLAG_NOT_TOUCH_MODAL = 32;
|
|
12
|
-
/** 监听窗外点击 */
|
|
13
|
-
static readonly FLAG_WATCH_OUTSIDE_TOUCH = 4;
|
|
14
|
-
/** 可绘制超出屏幕 */
|
|
15
|
-
static readonly FLAG_LAYOUT_NO_LIMITS = 512;
|
|
16
|
-
/** 屏幕全区域布局 */
|
|
17
|
-
static readonly FLAG_LAYOUT_IN_SCREEN = 256;
|
|
18
|
-
/** 全屏显示 */
|
|
19
|
-
static readonly FLAG_FULLSCREEN = 1024;
|
|
20
|
-
/** 背景变暗 */
|
|
21
|
-
static readonly FLAG_DIM_BEHIND = 2;
|
|
22
|
-
/** 防录屏防截图 */
|
|
23
|
-
static readonly FLAG_SECURE = 8192;
|
|
24
|
-
/** 保持常亮 */
|
|
25
|
-
static readonly FLAG_KEEP_SCREEN_ON = 128;
|
|
26
|
-
/** 锁屏时可见 */
|
|
27
|
-
static readonly FLAG_SHOW_WHEN_LOCKED = 524288;
|
|
28
|
-
/** 解锁屏幕 */
|
|
29
|
-
static readonly FLAG_DISMISS_KEYGUARD = 4194304;
|
|
30
|
-
/** 点亮屏幕 */
|
|
31
|
-
static readonly FLAG_TURN_SCREEN_ON = 2097152;
|
|
32
|
-
/** 自动锁屏(不常用) */
|
|
33
|
-
static readonly FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 128;
|
|
34
|
-
/** 显示墙纸 */
|
|
35
|
-
static readonly FLAG_SHOW_WALLPAPER = 1048576;
|
|
36
|
-
/** 强制硬件加速 */
|
|
37
|
-
static readonly FLAG_HARDWARE_ACCELERATED = 16777216;
|
|
38
|
-
/**
|
|
39
|
-
* 获取标志位的十六进制表示
|
|
40
|
-
* @param flag 标志位值
|
|
41
|
-
* @returns 十六进制字符串
|
|
42
|
-
*/
|
|
43
|
-
static toHex(flag: number): string;
|
|
44
|
-
/**
|
|
45
|
-
* 检查是否包含指定标志位
|
|
46
|
-
* @param flags 当前标志位组合
|
|
47
|
-
* @param flag 要检查的标志位
|
|
48
|
-
* @returns 是否包含该标志位
|
|
49
|
-
*/
|
|
50
|
-
static hasFlag(flags: number, flag: number): boolean;
|
|
51
|
-
/**
|
|
52
|
-
* 添加标志位
|
|
53
|
-
* @param flags 当前标志位组合
|
|
54
|
-
* @param flag 要添加的标志位
|
|
55
|
-
* @returns 新的标志位组合
|
|
56
|
-
*/
|
|
57
|
-
static addFlag(flags: number, flag: number): number;
|
|
58
|
-
/**
|
|
59
|
-
* 移除标志位
|
|
60
|
-
* @param flags 当前标志位组合
|
|
61
|
-
* @param flag 要移除的标志位
|
|
62
|
-
* @returns 新的标志位组合
|
|
63
|
-
*/
|
|
64
|
-
static removeFlag(flags: number, flag: number): number;
|
|
65
|
-
/**
|
|
66
|
-
* 获取所有标志位的描述信息
|
|
67
|
-
* @returns 标志位描述对象数组
|
|
68
|
-
*/
|
|
69
|
-
static getAllFlags(): Array<{
|
|
70
|
-
name: string;
|
|
71
|
-
value: number;
|
|
72
|
-
hex: string;
|
|
73
|
-
description: string;
|
|
74
|
-
}>;
|
|
75
|
-
}
|