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.
- package/dist/AssistsXAsync.d.ts +2 -1
- package/dist/AssistsXAsync.js +7 -1
- package/dist/CallMethod.d.ts +1 -0
- package/dist/CallMethod.js +1 -0
- package/package.json +1 -1
- package/src/AssistsXAsync.ts +9 -0
- package/src/CallMethod.ts +1 -0
package/dist/AssistsXAsync.d.ts
CHANGED
|
@@ -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
|
}
|
package/dist/AssistsXAsync.js
CHANGED
|
@@ -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
|
}
|
package/dist/CallMethod.d.ts
CHANGED
|
@@ -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];
|
package/dist/CallMethod.js
CHANGED
package/package.json
CHANGED
package/src/AssistsXAsync.ts
CHANGED
|
@@ -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请求
|