assistsx-js 0.0.131 → 0.0.133
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 +20 -1
- package/dist/AssistsX.js +12 -2
- package/package.json +1 -1
- package/src/AssistsX.ts +28 -2
package/dist/AssistsX.d.ts
CHANGED
|
@@ -4,6 +4,18 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Node } from './Node';
|
|
6
6
|
import { Bounds } from './Bounds';
|
|
7
|
+
/**
|
|
8
|
+
* Web浮动窗口选项接口定义
|
|
9
|
+
*/
|
|
10
|
+
interface WebFloatingWindowOptions {
|
|
11
|
+
initialWidth?: number;
|
|
12
|
+
initialHeight?: number;
|
|
13
|
+
minWidth?: number;
|
|
14
|
+
minHeight?: number;
|
|
15
|
+
maxWidth?: number;
|
|
16
|
+
maxHeight?: number;
|
|
17
|
+
initialCenter?: boolean;
|
|
18
|
+
}
|
|
7
19
|
export declare class AssistsX {
|
|
8
20
|
/**
|
|
9
21
|
* 执行同步调用
|
|
@@ -25,6 +37,12 @@ export declare class AssistsX {
|
|
|
25
37
|
* @returns 是否设置成功
|
|
26
38
|
*/
|
|
27
39
|
static setOverlayFlags(flags: number): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* 设置悬浮窗标志
|
|
42
|
+
* @param flags 标志
|
|
43
|
+
* @returns 是否设置成功
|
|
44
|
+
*/
|
|
45
|
+
static setOverlayFlagList(flags: number[]): boolean;
|
|
28
46
|
/**
|
|
29
47
|
* 获取所有符合条件的节点
|
|
30
48
|
* @param filterClass 类名过滤
|
|
@@ -54,7 +72,7 @@ export declare class AssistsX {
|
|
|
54
72
|
*/
|
|
55
73
|
static takeScreenshotNodes(nodes: Node[], overlayHiddenScreenshotDelayMillis?: number): Promise<string[]>;
|
|
56
74
|
static scanQR(): Promise<string>;
|
|
57
|
-
static addWebFloatingWindow(url: string): Promise<any>;
|
|
75
|
+
static addWebFloatingWindow(url: string, options?: WebFloatingWindowOptions): Promise<any>;
|
|
58
76
|
/**
|
|
59
77
|
* 点击节点
|
|
60
78
|
* @param node 要点击的节点
|
|
@@ -286,3 +304,4 @@ export declare class AssistsX {
|
|
|
286
304
|
*/
|
|
287
305
|
static getAppScreenSize(): any;
|
|
288
306
|
}
|
|
307
|
+
export {};
|
package/dist/AssistsX.js
CHANGED
|
@@ -81,6 +81,15 @@ export class AssistsX {
|
|
|
81
81
|
const response = this.call(CallMethod.setOverlayFlags, { args: { flags: flags } });
|
|
82
82
|
return response.getDataOrDefault(false);
|
|
83
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* 设置悬浮窗标志
|
|
86
|
+
* @param flags 标志
|
|
87
|
+
* @returns 是否设置成功
|
|
88
|
+
*/
|
|
89
|
+
static setOverlayFlagList(flags) {
|
|
90
|
+
const response = this.call(CallMethod.setOverlayFlags, { args: { flags: flags } });
|
|
91
|
+
return response.getDataOrDefault(false);
|
|
92
|
+
}
|
|
84
93
|
/**
|
|
85
94
|
* 获取所有符合条件的节点
|
|
86
95
|
* @param filterClass 类名过滤
|
|
@@ -119,8 +128,9 @@ export class AssistsX {
|
|
|
119
128
|
const data = response.getDataOrDefault({ value: "" });
|
|
120
129
|
return data.value;
|
|
121
130
|
}
|
|
122
|
-
static async addWebFloatingWindow(url) {
|
|
123
|
-
const
|
|
131
|
+
static async addWebFloatingWindow(url, options = {}) {
|
|
132
|
+
const { initialWidth, initialHeight, minWidth, minHeight, maxWidth, maxHeight, initialCenter } = options;
|
|
133
|
+
const response = await this.asyncCall(CallMethod.addWebFloatingWindow, { args: { url, initialWidth, initialHeight, minWidth, minHeight, maxWidth, maxHeight, initialCenter } });
|
|
124
134
|
const data = response.getDataOrDefault({});
|
|
125
135
|
return data;
|
|
126
136
|
}
|
package/package.json
CHANGED
package/src/AssistsX.ts
CHANGED
|
@@ -18,6 +18,19 @@ interface Gesture {
|
|
|
18
18
|
duration?: number;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Web浮动窗口选项接口定义
|
|
23
|
+
*/
|
|
24
|
+
interface WebFloatingWindowOptions {
|
|
25
|
+
initialWidth?: number;
|
|
26
|
+
initialHeight?: number;
|
|
27
|
+
minWidth?: number;
|
|
28
|
+
minHeight?: number;
|
|
29
|
+
maxWidth?: number;
|
|
30
|
+
maxHeight?: number;
|
|
31
|
+
initialCenter?: boolean;
|
|
32
|
+
}
|
|
33
|
+
|
|
21
34
|
// 回调函数存储对象
|
|
22
35
|
const callbacks: { [key: string]: (data: any) => void } = {};
|
|
23
36
|
|
|
@@ -96,6 +109,15 @@ export class AssistsX {
|
|
|
96
109
|
const response = this.call(CallMethod.setOverlayFlags, { args: { flags: flags } });
|
|
97
110
|
return response.getDataOrDefault(false);
|
|
98
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* 设置悬浮窗标志
|
|
114
|
+
* @param flags 标志
|
|
115
|
+
* @returns 是否设置成功
|
|
116
|
+
*/
|
|
117
|
+
public static setOverlayFlagList(flags: number[]): boolean {
|
|
118
|
+
const response = this.call(CallMethod.setOverlayFlags, { args: { flags: flags } });
|
|
119
|
+
return response.getDataOrDefault(false);
|
|
120
|
+
}
|
|
99
121
|
/**
|
|
100
122
|
* 获取所有符合条件的节点
|
|
101
123
|
* @param filterClass 类名过滤
|
|
@@ -136,8 +158,12 @@ export class AssistsX {
|
|
|
136
158
|
const data = response.getDataOrDefault({ value: "" });
|
|
137
159
|
return data.value;
|
|
138
160
|
}
|
|
139
|
-
public static async addWebFloatingWindow(url: string): Promise<any> {
|
|
140
|
-
const
|
|
161
|
+
public static async addWebFloatingWindow(url: string, options: WebFloatingWindowOptions = {}): Promise<any> {
|
|
162
|
+
const { initialWidth, initialHeight, minWidth, minHeight, maxWidth, maxHeight, initialCenter } = options;
|
|
163
|
+
const response = await this.asyncCall(
|
|
164
|
+
CallMethod.addWebFloatingWindow,
|
|
165
|
+
{ args: { url, initialWidth, initialHeight, minWidth, minHeight, maxWidth, maxHeight, initialCenter } }
|
|
166
|
+
);
|
|
141
167
|
const data = response.getDataOrDefault({});
|
|
142
168
|
return data;
|
|
143
169
|
}
|