assistsx-js 0.0.131 → 0.0.132

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.
@@ -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
  * 执行同步调用
@@ -54,7 +66,7 @@ export declare class AssistsX {
54
66
  */
55
67
  static takeScreenshotNodes(nodes: Node[], overlayHiddenScreenshotDelayMillis?: number): Promise<string[]>;
56
68
  static scanQR(): Promise<string>;
57
- static addWebFloatingWindow(url: string): Promise<any>;
69
+ static addWebFloatingWindow(url: string, options?: WebFloatingWindowOptions): Promise<any>;
58
70
  /**
59
71
  * 点击节点
60
72
  * @param node 要点击的节点
@@ -286,3 +298,4 @@ export declare class AssistsX {
286
298
  */
287
299
  static getAppScreenSize(): any;
288
300
  }
301
+ export {};
package/dist/AssistsX.js CHANGED
@@ -119,8 +119,9 @@ export class AssistsX {
119
119
  const data = response.getDataOrDefault({ value: "" });
120
120
  return data.value;
121
121
  }
122
- static async addWebFloatingWindow(url) {
123
- const response = await this.asyncCall(CallMethod.addWebFloatingWindow, { args: { url } });
122
+ static async addWebFloatingWindow(url, options = {}) {
123
+ const { initialWidth, initialHeight, minWidth, minHeight, maxWidth, maxHeight, initialCenter } = options;
124
+ const response = await this.asyncCall(CallMethod.addWebFloatingWindow, { args: { url, initialWidth, initialHeight, minWidth, minHeight, maxWidth, maxHeight, initialCenter } });
124
125
  const data = response.getDataOrDefault({});
125
126
  return data;
126
127
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assistsx-js",
3
- "version": "0.0.131",
3
+ "version": "0.0.132",
4
4
  "description": "assistsx-js自动化开发SDK",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
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
 
@@ -136,8 +149,12 @@ export class AssistsX {
136
149
  const data = response.getDataOrDefault({ value: "" });
137
150
  return data.value;
138
151
  }
139
- public static async addWebFloatingWindow(url: string): Promise<any> {
140
- const response = await this.asyncCall(CallMethod.addWebFloatingWindow, { args: { url } });
152
+ public static async addWebFloatingWindow(url: string, options: WebFloatingWindowOptions = {}): Promise<any> {
153
+ const { initialWidth, initialHeight, minWidth, minHeight, maxWidth, maxHeight, initialCenter } = options;
154
+ const response = await this.asyncCall(
155
+ CallMethod.addWebFloatingWindow,
156
+ { args: { url, initialWidth, initialHeight, minWidth, minHeight, maxWidth, maxHeight, initialCenter } }
157
+ );
141
158
  const data = response.getDataOrDefault({});
142
159
  return data;
143
160
  }