assistsx-js 0.0.2031 → 0.0.2032

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.
@@ -380,4 +380,6 @@ export declare class AssistsXAsync {
380
380
  * @returns 是否成功打开
381
381
  */
382
382
  static openUrlInBrowser(url: string, timeout?: number): Promise<boolean>;
383
+ static download(url: string, timeout?: number): Promise<string | null | undefined>;
384
+ static audioPlayFromFile(filePath: string, timeout?: number): Promise<string | null | undefined>;
383
385
  }
@@ -638,4 +638,18 @@ export class AssistsXAsync {
638
638
  });
639
639
  return response.getDataOrDefault(false);
640
640
  }
641
+ static async download(url, timeout) {
642
+ const response = await this.asyncCall(CallMethod.download, {
643
+ args: { url },
644
+ timeout,
645
+ });
646
+ return response.getDataOrDefault(null);
647
+ }
648
+ static async audioPlayFromFile(filePath, timeout) {
649
+ const response = await this.asyncCall(CallMethod.audioPlayFromFile, {
650
+ args: { filePath },
651
+ timeout,
652
+ });
653
+ return response.getDataOrDefault(null);
654
+ }
641
655
  }
@@ -52,5 +52,7 @@ export declare const CallMethod: {
52
52
  readonly openUrlInBrowser: "openUrlInBrowser";
53
53
  readonly keepScreenOn: "keepScreenOn";
54
54
  readonly clearKeepScreenOn: "clearKeepScreenOn";
55
+ readonly download: "download";
56
+ readonly audioPlayFromFile: "audioPlayFromFile";
55
57
  };
56
58
  export type CallMethodType = (typeof CallMethod)[keyof typeof CallMethod];
@@ -53,4 +53,6 @@ export const CallMethod = {
53
53
  openUrlInBrowser: "openUrlInBrowser",
54
54
  keepScreenOn: "keepScreenOn",
55
55
  clearKeepScreenOn: "clearKeepScreenOn",
56
+ download: "download",
57
+ audioPlayFromFile: "audioPlayFromFile",
56
58
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assistsx-js",
3
- "version": "0.0.2031",
3
+ "version": "0.0.2032",
4
4
  "description": "assistsx-js自动化开发SDK",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -915,6 +915,26 @@ export class AssistsXAsync {
915
915
  });
916
916
  return response.getDataOrDefault(false);
917
917
  }
918
+ public static async download(
919
+ url: string,
920
+ timeout?: number
921
+ ): Promise<string | null | undefined> {
922
+ const response = await this.asyncCall(CallMethod.download, {
923
+ args: { url },
924
+ timeout,
925
+ });
926
+ return response.getDataOrDefault(null);
927
+ }
928
+ public static async audioPlayFromFile(
929
+ filePath: string,
930
+ timeout?: number
931
+ ): Promise<string | null | undefined> {
932
+ const response = await this.asyncCall(CallMethod.audioPlayFromFile, {
933
+ args: { filePath },
934
+ timeout,
935
+ });
936
+ return response.getDataOrDefault(null);
937
+ }
918
938
 
919
939
  /**
920
940
  * 发送HTTP请求
package/src/CallMethod.ts CHANGED
@@ -57,6 +57,8 @@ export const CallMethod = {
57
57
  openUrlInBrowser: "openUrlInBrowser",
58
58
  keepScreenOn: "keepScreenOn",
59
59
  clearKeepScreenOn: "clearKeepScreenOn",
60
+ download: "download",
61
+ audioPlayFromFile: "audioPlayFromFile",
60
62
  } as const;
61
63
 
62
64
  // 导出类型定义