assistsx-js 0.0.2032 → 0.0.2034

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.
@@ -381,5 +381,6 @@ export declare class AssistsXAsync {
381
381
  */
382
382
  static openUrlInBrowser(url: string, timeout?: number): Promise<boolean>;
383
383
  static download(url: string, timeout?: number): Promise<string | null | undefined>;
384
- static audioPlayFromFile(filePath: string, timeout?: number): Promise<string | null | undefined>;
384
+ static audioPlayFromFile(filePath: string, volume?: number | undefined, timeout?: number): Promise<string | null | undefined>;
385
+ static audioStop(timeout?: number): Promise<boolean | null | undefined>;
385
386
  }
@@ -645,11 +645,17 @@ export class AssistsXAsync {
645
645
  });
646
646
  return response.getDataOrDefault(null);
647
647
  }
648
- static async audioPlayFromFile(filePath, timeout) {
648
+ static async audioPlayFromFile(filePath, volume = undefined, timeout) {
649
649
  const response = await this.asyncCall(CallMethod.audioPlayFromFile, {
650
650
  args: { filePath },
651
651
  timeout,
652
652
  });
653
653
  return response.getDataOrDefault(null);
654
654
  }
655
+ static async audioStop(timeout) {
656
+ const response = await this.asyncCall(CallMethod.audioStop, {
657
+ timeout,
658
+ });
659
+ return response.getDataOrDefault(false);
660
+ }
655
661
  }
@@ -54,5 +54,6 @@ export declare const CallMethod: {
54
54
  readonly clearKeepScreenOn: "clearKeepScreenOn";
55
55
  readonly download: "download";
56
56
  readonly audioPlayFromFile: "audioPlayFromFile";
57
+ readonly audioStop: "audioStop";
57
58
  };
58
59
  export type CallMethodType = (typeof CallMethod)[keyof typeof CallMethod];
@@ -55,4 +55,5 @@ export const CallMethod = {
55
55
  clearKeepScreenOn: "clearKeepScreenOn",
56
56
  download: "download",
57
57
  audioPlayFromFile: "audioPlayFromFile",
58
+ audioStop: "audioStop",
58
59
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assistsx-js",
3
- "version": "0.0.2032",
3
+ "version": "0.0.2034",
4
4
  "description": "assistsx-js自动化开发SDK",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -927,6 +927,7 @@ export class AssistsXAsync {
927
927
  }
928
928
  public static async audioPlayFromFile(
929
929
  filePath: string,
930
+ volume: number | undefined = undefined,
930
931
  timeout?: number
931
932
  ): Promise<string | null | undefined> {
932
933
  const response = await this.asyncCall(CallMethod.audioPlayFromFile, {
@@ -935,6 +936,14 @@ export class AssistsXAsync {
935
936
  });
936
937
  return response.getDataOrDefault(null);
937
938
  }
939
+ public static async audioStop(
940
+ timeout?: number
941
+ ): Promise<boolean | null | undefined> {
942
+ const response = await this.asyncCall(CallMethod.audioStop, {
943
+ timeout,
944
+ });
945
+ return response.getDataOrDefault(false);
946
+ }
938
947
 
939
948
  /**
940
949
  * 发送HTTP请求
package/src/CallMethod.ts CHANGED
@@ -59,6 +59,7 @@ export const CallMethod = {
59
59
  clearKeepScreenOn: "clearKeepScreenOn",
60
60
  download: "download",
61
61
  audioPlayFromFile: "audioPlayFromFile",
62
+ audioStop: "audioStop",
62
63
  } as const;
63
64
 
64
65
  // 导出类型定义