assistsx-js 0.0.11 → 0.0.13
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/AssistsX.d.ts +1 -0
- package/dist/AssistsX.js +8 -3
- package/dist/CallMethod.d.ts +1 -0
- package/dist/CallMethod.js +2 -1
- package/package.json +1 -1
- package/src/AssistsX.ts +8 -3
- package/src/CallMethod.ts +2 -1
package/dist/AssistsX.d.ts
CHANGED
package/dist/AssistsX.js
CHANGED
|
@@ -114,6 +114,11 @@ export class AssistsX {
|
|
|
114
114
|
const data = response.getDataOrDefault("");
|
|
115
115
|
return data.images;
|
|
116
116
|
}
|
|
117
|
+
static async scanQR() {
|
|
118
|
+
const response = await this.asyncCall(CallMethod.scanQR);
|
|
119
|
+
const data = response.getDataOrDefault({ value: "" });
|
|
120
|
+
return data.value;
|
|
121
|
+
}
|
|
117
122
|
/**
|
|
118
123
|
* 点击节点
|
|
119
124
|
* @param node 要点击的节点
|
|
@@ -204,7 +209,7 @@ export class AssistsX {
|
|
|
204
209
|
* @returns 节点数组
|
|
205
210
|
*/
|
|
206
211
|
static findByTextAllMatch(text) {
|
|
207
|
-
const response = this.call(CallMethod.findByTextAllMatch, { args: text });
|
|
212
|
+
const response = this.call(CallMethod.findByTextAllMatch, { args: { text } });
|
|
208
213
|
return Node.fromJSONArray(response.getDataOrDefault("[]"));
|
|
209
214
|
}
|
|
210
215
|
/**
|
|
@@ -213,7 +218,7 @@ export class AssistsX {
|
|
|
213
218
|
* @returns 是否包含
|
|
214
219
|
*/
|
|
215
220
|
static containsText(text) {
|
|
216
|
-
const response = this.call(CallMethod.containsText, { args: text });
|
|
221
|
+
const response = this.call(CallMethod.containsText, { args: { text } });
|
|
217
222
|
return response.getDataOrDefault(false);
|
|
218
223
|
}
|
|
219
224
|
/**
|
|
@@ -230,7 +235,7 @@ export class AssistsX {
|
|
|
230
235
|
* @returns 父节点
|
|
231
236
|
*/
|
|
232
237
|
static findFirstParentByTags(className) {
|
|
233
|
-
const response = this.call(CallMethod.findFirstParentByTags, { args: className });
|
|
238
|
+
const response = this.call(CallMethod.findFirstParentByTags, { args: { className } });
|
|
234
239
|
return Node.create(response.getDataOrDefault("{}"));
|
|
235
240
|
}
|
|
236
241
|
/**
|
package/dist/CallMethod.d.ts
CHANGED
|
@@ -34,5 +34,6 @@ export declare const CallMethod: {
|
|
|
34
34
|
readonly nodeGestureClickByDouble: "nodeGestureClickByDouble";
|
|
35
35
|
readonly scrollBackward: "scrollBackward";
|
|
36
36
|
readonly setOverlayFlags: "setOverlayFlags";
|
|
37
|
+
readonly scanQR: "scanQR";
|
|
37
38
|
};
|
|
38
39
|
export type CallMethodType = typeof CallMethod[keyof typeof CallMethod];
|
package/dist/CallMethod.js
CHANGED
|
@@ -34,5 +34,6 @@ export const CallMethod = {
|
|
|
34
34
|
nodeGestureClick: "nodeGestureClick",
|
|
35
35
|
nodeGestureClickByDouble: "nodeGestureClickByDouble",
|
|
36
36
|
scrollBackward: "scrollBackward",
|
|
37
|
-
setOverlayFlags: "setOverlayFlags"
|
|
37
|
+
setOverlayFlags: "setOverlayFlags",
|
|
38
|
+
scanQR: "scanQR"
|
|
38
39
|
};
|
package/package.json
CHANGED
package/src/AssistsX.ts
CHANGED
|
@@ -131,6 +131,11 @@ export class AssistsX {
|
|
|
131
131
|
const data = response.getDataOrDefault("");
|
|
132
132
|
return data.images;
|
|
133
133
|
}
|
|
134
|
+
public static async scanQR(): Promise<string> {
|
|
135
|
+
const response = await this.asyncCall(CallMethod.scanQR);
|
|
136
|
+
const data = response.getDataOrDefault({ value: "" });
|
|
137
|
+
return data.value;
|
|
138
|
+
}
|
|
134
139
|
|
|
135
140
|
/**
|
|
136
141
|
* 点击节点
|
|
@@ -230,7 +235,7 @@ export class AssistsX {
|
|
|
230
235
|
* @returns 节点数组
|
|
231
236
|
*/
|
|
232
237
|
public static findByTextAllMatch(text: string): Node[] {
|
|
233
|
-
const response = this.call(CallMethod.findByTextAllMatch, { args: text });
|
|
238
|
+
const response = this.call(CallMethod.findByTextAllMatch, { args: { text } });
|
|
234
239
|
return Node.fromJSONArray(response.getDataOrDefault("[]"));
|
|
235
240
|
}
|
|
236
241
|
|
|
@@ -240,7 +245,7 @@ export class AssistsX {
|
|
|
240
245
|
* @returns 是否包含
|
|
241
246
|
*/
|
|
242
247
|
public static containsText(text: string): boolean {
|
|
243
|
-
const response = this.call(CallMethod.containsText, { args: text });
|
|
248
|
+
const response = this.call(CallMethod.containsText, { args: { text } });
|
|
244
249
|
return response.getDataOrDefault(false);
|
|
245
250
|
}
|
|
246
251
|
|
|
@@ -259,7 +264,7 @@ export class AssistsX {
|
|
|
259
264
|
* @returns 父节点
|
|
260
265
|
*/
|
|
261
266
|
public static findFirstParentByTags(className: string): Node {
|
|
262
|
-
const response = this.call(CallMethod.findFirstParentByTags, { args: className });
|
|
267
|
+
const response = this.call(CallMethod.findFirstParentByTags, { args: { className } });
|
|
263
268
|
return Node.create(response.getDataOrDefault("{}"));
|
|
264
269
|
}
|
|
265
270
|
|
package/src/CallMethod.ts
CHANGED
|
@@ -34,7 +34,8 @@ export const CallMethod = {
|
|
|
34
34
|
nodeGestureClick: "nodeGestureClick",
|
|
35
35
|
nodeGestureClickByDouble: "nodeGestureClickByDouble",
|
|
36
36
|
scrollBackward: "scrollBackward",
|
|
37
|
-
setOverlayFlags: "setOverlayFlags"
|
|
37
|
+
setOverlayFlags: "setOverlayFlags",
|
|
38
|
+
scanQR: "scanQR"
|
|
38
39
|
} as const;
|
|
39
40
|
|
|
40
41
|
// 导出类型定义
|