assistsx-js 0.1.34 → 0.1.35

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.
@@ -13,5 +13,7 @@ export declare const FloatCallMethod: {
13
13
  readonly toast: "toast";
14
14
  /** Move floating window by x, y */
15
15
  readonly move: "move";
16
+ /** Refresh floating window view config (width, height, x, y) */
17
+ readonly refresh: "refresh";
16
18
  };
17
19
  export type FloatCallMethodType = (typeof FloatCallMethod)[keyof typeof FloatCallMethod];
@@ -13,4 +13,6 @@ export const FloatCallMethod = {
13
13
  toast: "toast",
14
14
  /** Move floating window by x, y */
15
15
  move: "move",
16
+ /** Refresh floating window view config (width, height, x, y) */
17
+ refresh: "refresh",
16
18
  };
@@ -14,5 +14,13 @@ export declare class Float {
14
14
  toast(text: string, delay?: number, timeout?: number): Promise<void>;
15
15
  /** Move floating window to x, y */
16
16
  move(x: number, y: number, timeout?: number): Promise<void>;
17
+ /** Refresh floating window view config. Optional: width, height, x, y (omit to keep current) */
18
+ refresh(options?: {
19
+ width?: number;
20
+ height?: number;
21
+ x?: number;
22
+ y?: number;
23
+ timeout?: number;
24
+ }): Promise<void>;
17
25
  }
18
26
  export declare const float: Float;
@@ -122,5 +122,22 @@ export class Float {
122
122
  throw new Error(this.errorMessage(res, "Float.move failed"));
123
123
  }
124
124
  }
125
+ /** Refresh floating window view config. Optional: width, height, x, y (omit to keep current) */
126
+ async refresh(options = {}) {
127
+ const { width, height, x, y, timeout } = options;
128
+ const args = {};
129
+ if (width !== undefined)
130
+ args.width = width;
131
+ if (height !== undefined)
132
+ args.height = height;
133
+ if (x !== undefined)
134
+ args.x = x;
135
+ if (y !== undefined)
136
+ args.y = y;
137
+ const res = await this.asyncCall(FloatCallMethod.refresh, Object.keys(args).length ? args : undefined, timeout);
138
+ if (!res.isSuccess()) {
139
+ throw new Error(this.errorMessage(res, "Float.refresh failed"));
140
+ }
141
+ }
125
142
  }
126
143
  export const float = new Float();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assistsx-js",
3
- "version": "0.1.34",
3
+ "version": "0.1.35",
4
4
  "description": "assistsx-js自动化开发SDK",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -13,6 +13,8 @@ export const FloatCallMethod = {
13
13
  toast: "toast",
14
14
  /** Move floating window by x, y */
15
15
  move: "move",
16
+ /** Refresh floating window view config (width, height, x, y) */
17
+ refresh: "refresh",
16
18
  } as const;
17
19
 
18
20
  export type FloatCallMethodType =
@@ -188,6 +188,26 @@ export class Float {
188
188
  throw new Error(this.errorMessage(res, "Float.move failed"));
189
189
  }
190
190
  }
191
+
192
+ /** Refresh floating window view config. Optional: width, height, x, y (omit to keep current) */
193
+ async refresh(
194
+ options: { width?: number; height?: number; x?: number; y?: number; timeout?: number } = {}
195
+ ): Promise<void> {
196
+ const { width, height, x, y, timeout } = options;
197
+ const args: Record<string, number | undefined> = {};
198
+ if (width !== undefined) args.width = width;
199
+ if (height !== undefined) args.height = height;
200
+ if (x !== undefined) args.x = x;
201
+ if (y !== undefined) args.y = y;
202
+ const res = await this.asyncCall(
203
+ FloatCallMethod.refresh,
204
+ Object.keys(args).length ? args : undefined,
205
+ timeout
206
+ );
207
+ if (!res.isSuccess()) {
208
+ throw new Error(this.errorMessage(res, "Float.refresh failed"));
209
+ }
210
+ }
191
211
  }
192
212
 
193
213
  export const float = new Float();