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