assistsx-js 0.1.41 → 0.2.0
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/README.md +32 -0
- package/dist/index.cjs +7957 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +4231 -0
- package/dist/index.d.ts +4231 -30
- package/dist/index.global.js +46 -0
- package/dist/index.global.js.map +1 -0
- package/dist/index.js +7879 -30
- package/dist/index.js.map +1 -0
- package/package.json +11 -5
- package/src/{AssistsXAsync.ts → assistsx-async.ts} +8 -8
- package/src/{AssistsX.ts → assistsx.ts} +8 -8
- package/src/barutils/bar-utils.ts +3 -3
- package/src/filesystem/fileio/file-io.ts +2 -2
- package/src/filesystem/fileutils/file-utils.ts +2 -2
- package/src/filesystem/path.ts +2 -2
- package/src/floatingwindow/float.ts +4 -4
- package/src/gallery/gallery.ts +2 -2
- package/src/global.d.ts +6 -1
- package/src/imageutils/image-utils.ts +2 -2
- package/src/ime/ime.ts +2 -2
- package/src/index.ts +21 -20
- package/src/log/log-call-method.ts +28 -0
- package/src/log/log.ts +445 -0
- package/src/mlkit/mlkit.ts +3 -3
- package/src/network/http.ts +2 -2
- package/src/{NodeAsync.ts → node-async.ts} +5 -5
- package/src/{Node.ts → node.ts} +5 -5
- package/src/{StepAsync.ts → step-async.ts} +8 -8
- package/src/{Step.ts → step.ts} +7 -7
- package/dist/AccessibilityEventFilter.d.ts +0 -105
- package/dist/AccessibilityEventFilter.js +0 -89
- package/dist/AppInfo.d.ts +0 -45
- package/dist/AppInfo.js +0 -38
- package/dist/AssistsX.d.ts +0 -484
- package/dist/AssistsX.js +0 -828
- package/dist/AssistsXAsync.d.ts +0 -532
- package/dist/AssistsXAsync.js +0 -874
- package/dist/Bounds.d.ts +0 -48
- package/dist/Bounds.js +0 -68
- package/dist/CallMethod.d.ts +0 -69
- package/dist/CallMethod.js +0 -71
- package/dist/CallResponse.d.ts +0 -10
- package/dist/CallResponse.js +0 -28
- package/dist/DeviceInfo.d.ts +0 -69
- package/dist/DeviceInfo.js +0 -50
- package/dist/Node.d.ts +0 -334
- package/dist/Node.js +0 -369
- package/dist/NodeAsync.d.ts +0 -213
- package/dist/NodeAsync.js +0 -313
- package/dist/NodeClassValue.d.ts +0 -15
- package/dist/NodeClassValue.js +0 -15
- package/dist/Step.d.ts +0 -355
- package/dist/Step.js +0 -689
- package/dist/StepAsync.d.ts +0 -162
- package/dist/StepAsync.js +0 -264
- package/dist/StepError.d.ts +0 -35
- package/dist/StepError.js +0 -26
- package/dist/StepStateStore.d.ts +0 -14
- package/dist/StepStateStore.js +0 -37
- package/dist/Utils.d.ts +0 -3
- package/dist/Utils.js +0 -20
- package/dist/WindowFlags.d.ts +0 -75
- package/dist/WindowFlags.js +0 -97
- package/dist/barutils/BarUtilsCallMethod.d.ts +0 -24
- package/dist/barutils/BarUtilsCallMethod.js +0 -26
- package/dist/barutils/bar-utils.d.ts +0 -41
- package/dist/barutils/bar-utils.js +0 -205
- package/dist/filesystem/fileio/file-io.d.ts +0 -101
- package/dist/filesystem/fileio/file-io.js +0 -235
- package/dist/filesystem/fileutils/file-utils.d.ts +0 -242
- package/dist/filesystem/fileutils/file-utils.js +0 -493
- package/dist/filesystem/path.d.ts +0 -252
- package/dist/filesystem/path.js +0 -589
- package/dist/floatingwindow/FloatCallMethod.d.ts +0 -19
- package/dist/floatingwindow/FloatCallMethod.js +0 -18
- package/dist/floatingwindow/float.d.ts +0 -29
- package/dist/floatingwindow/float.js +0 -149
- package/dist/gallery/gallery.d.ts +0 -60
- package/dist/gallery/gallery.js +0 -142
- package/dist/imageutils/image-utils.d.ts +0 -442
- package/dist/imageutils/image-utils.js +0 -543
- package/dist/ime/ime.d.ts +0 -80
- package/dist/ime/ime.js +0 -141
- package/dist/mlkit/MlkitCallMethod.d.ts +0 -27
- package/dist/mlkit/MlkitCallMethod.js +0 -26
- package/dist/mlkit/mlkit.d.ts +0 -86
- package/dist/mlkit/mlkit.js +0 -169
- package/dist/network/http.d.ts +0 -127
- package/dist/network/http.js +0 -202
- /package/src/{AccessibilityEventFilter.ts → accessibility-event-filter.ts} +0 -0
- /package/src/{AppInfo.ts → app-info.ts} +0 -0
- /package/src/barutils/{BarUtilsCallMethod.ts → bar-utils-call-method.ts} +0 -0
- /package/src/{Bounds.ts → bounds.ts} +0 -0
- /package/src/{CallMethod.ts → call-method.ts} +0 -0
- /package/src/{CallResponse.ts → call-response.ts} +0 -0
- /package/src/{DeviceInfo.ts → device-info.ts} +0 -0
- /package/src/floatingwindow/{FloatCallMethod.ts → float-call-method.ts} +0 -0
- /package/src/mlkit/{MlkitCallMethod.ts → mlkit-call-method.ts} +0 -0
- /package/src/{NodeClassValue.ts → node-class-value.ts} +0 -0
- /package/src/{StepError.ts → step-error.ts} +0 -0
- /package/src/{StepStateStore.ts → step-state-store.ts} +0 -0
- /package/src/{Utils.ts → utils.ts} +0 -0
- /package/src/{WindowFlags.ts → window-flags.ts} +0 -0
package/dist/filesystem/path.js
DELETED
|
@@ -1,589 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 路径相关功能
|
|
3
|
-
* 提供文件系统路径相关的功能
|
|
4
|
-
*/
|
|
5
|
-
import { CallResponse } from "../CallResponse";
|
|
6
|
-
import { decodeBase64UTF8, generateUUID } from "../Utils";
|
|
7
|
-
// 回调函数存储对象
|
|
8
|
-
const callbacks = new Map();
|
|
9
|
-
// 初始化全局回调函数
|
|
10
|
-
if (typeof window !== "undefined" && !window.assistsxPathCallback) {
|
|
11
|
-
window.assistsxPathCallback = (data) => {
|
|
12
|
-
let callbackId;
|
|
13
|
-
try {
|
|
14
|
-
const json = decodeBase64UTF8(data);
|
|
15
|
-
const response = JSON.parse(json);
|
|
16
|
-
callbackId = response.callbackId;
|
|
17
|
-
if (callbackId) {
|
|
18
|
-
const callback = callbacks.get(callbackId);
|
|
19
|
-
if (callback) {
|
|
20
|
-
callback(json);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
catch (e) {
|
|
25
|
-
console.error("Path callback error:", e);
|
|
26
|
-
}
|
|
27
|
-
finally {
|
|
28
|
-
if (callbackId) {
|
|
29
|
-
callbacks.delete(callbackId);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export class Path {
|
|
35
|
-
/**
|
|
36
|
-
* 执行异步调用
|
|
37
|
-
* @param method 方法名
|
|
38
|
-
* @param args 参数对象
|
|
39
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
40
|
-
* @returns Promise<调用响应>
|
|
41
|
-
*/
|
|
42
|
-
async asyncCall(method, args, timeout = 30) {
|
|
43
|
-
const uuid = generateUUID();
|
|
44
|
-
const params = {
|
|
45
|
-
method,
|
|
46
|
-
arguments: args ? args : undefined,
|
|
47
|
-
callbackId: uuid,
|
|
48
|
-
};
|
|
49
|
-
const promise = new Promise((resolve) => {
|
|
50
|
-
callbacks.set(uuid, (data) => {
|
|
51
|
-
resolve(data);
|
|
52
|
-
});
|
|
53
|
-
setTimeout(() => {
|
|
54
|
-
callbacks.delete(uuid);
|
|
55
|
-
resolve(JSON.stringify(new CallResponse(0, null, uuid)));
|
|
56
|
-
}, timeout * 1000);
|
|
57
|
-
});
|
|
58
|
-
const result = window.assistsxPath.call(JSON.stringify(params));
|
|
59
|
-
const promiseResult = await promise;
|
|
60
|
-
if (typeof promiseResult === "string") {
|
|
61
|
-
const responseData = JSON.parse(promiseResult);
|
|
62
|
-
return new CallResponse(responseData.code, responseData.data, responseData.callbackId);
|
|
63
|
-
}
|
|
64
|
-
throw new Error("Call failed");
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* 获取根路径
|
|
68
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
69
|
-
* @returns Promise<路径字符串>
|
|
70
|
-
*/
|
|
71
|
-
async getRootPath(timeout) {
|
|
72
|
-
var _a;
|
|
73
|
-
const response = await this.asyncCall("getRootPath", undefined, timeout);
|
|
74
|
-
if (!response.isSuccess()) {
|
|
75
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get root path failed");
|
|
76
|
-
}
|
|
77
|
-
return response.data;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* 获取数据路径
|
|
81
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
82
|
-
* @returns Promise<路径字符串>
|
|
83
|
-
*/
|
|
84
|
-
async getDataPath(timeout) {
|
|
85
|
-
var _a;
|
|
86
|
-
const response = await this.asyncCall("getDataPath", undefined, timeout);
|
|
87
|
-
if (!response.isSuccess()) {
|
|
88
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get data path failed");
|
|
89
|
-
}
|
|
90
|
-
return response.data;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* 获取下载缓存路径
|
|
94
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
95
|
-
* @returns Promise<路径字符串>
|
|
96
|
-
*/
|
|
97
|
-
async getDownloadCachePath(timeout) {
|
|
98
|
-
var _a;
|
|
99
|
-
const response = await this.asyncCall("getDownloadCachePath", undefined, timeout);
|
|
100
|
-
if (!response.isSuccess()) {
|
|
101
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get download cache path failed");
|
|
102
|
-
}
|
|
103
|
-
return response.data;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* 获取内部应用数据路径
|
|
107
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
108
|
-
* @returns Promise<路径字符串>
|
|
109
|
-
*/
|
|
110
|
-
async getInternalAppDataPath(timeout) {
|
|
111
|
-
var _a;
|
|
112
|
-
const response = await this.asyncCall("getInternalAppDataPath", undefined, timeout);
|
|
113
|
-
if (!response.isSuccess()) {
|
|
114
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get internal app data path failed");
|
|
115
|
-
}
|
|
116
|
-
return response.data;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* 获取内部应用代码缓存目录
|
|
120
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
121
|
-
* @returns Promise<路径字符串>
|
|
122
|
-
*/
|
|
123
|
-
async getInternalAppCodeCacheDir(timeout) {
|
|
124
|
-
var _a;
|
|
125
|
-
const response = await this.asyncCall("getInternalAppCodeCacheDir", undefined, timeout);
|
|
126
|
-
if (!response.isSuccess()) {
|
|
127
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get internal app code cache dir failed");
|
|
128
|
-
}
|
|
129
|
-
return response.data;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* 获取内部应用缓存路径
|
|
133
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
134
|
-
* @returns Promise<路径字符串>
|
|
135
|
-
*/
|
|
136
|
-
async getInternalAppCachePath(timeout) {
|
|
137
|
-
var _a;
|
|
138
|
-
const response = await this.asyncCall("getInternalAppCachePath", undefined, timeout);
|
|
139
|
-
if (!response.isSuccess()) {
|
|
140
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get internal app cache path failed");
|
|
141
|
-
}
|
|
142
|
-
return response.data;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* 获取内部应用数据库路径
|
|
146
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
147
|
-
* @returns Promise<路径字符串>
|
|
148
|
-
*/
|
|
149
|
-
async getInternalAppDbsPath(timeout) {
|
|
150
|
-
var _a;
|
|
151
|
-
const response = await this.asyncCall("getInternalAppDbsPath", undefined, timeout);
|
|
152
|
-
if (!response.isSuccess()) {
|
|
153
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get internal app dbs path failed");
|
|
154
|
-
}
|
|
155
|
-
return response.data;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* 获取内部应用数据库文件路径
|
|
159
|
-
* @param dbName 数据库名称
|
|
160
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
161
|
-
* @returns Promise<路径字符串>
|
|
162
|
-
*/
|
|
163
|
-
async getInternalAppDbPath(dbName, timeout) {
|
|
164
|
-
var _a;
|
|
165
|
-
const response = await this.asyncCall("getInternalAppDbPath", { dbName }, timeout);
|
|
166
|
-
if (!response.isSuccess()) {
|
|
167
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get internal app db path failed");
|
|
168
|
-
}
|
|
169
|
-
return response.data;
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* 获取内部应用文件路径
|
|
173
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
174
|
-
* @returns Promise<路径字符串>
|
|
175
|
-
*/
|
|
176
|
-
async getInternalAppFilesPath(timeout) {
|
|
177
|
-
var _a;
|
|
178
|
-
const response = await this.asyncCall("getInternalAppFilesPath", undefined, timeout);
|
|
179
|
-
if (!response.isSuccess()) {
|
|
180
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get internal app files path failed");
|
|
181
|
-
}
|
|
182
|
-
return response.data;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* 获取内部应用 SharedPreferences 路径
|
|
186
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
187
|
-
* @returns Promise<路径字符串>
|
|
188
|
-
*/
|
|
189
|
-
async getInternalAppSpPath(timeout) {
|
|
190
|
-
var _a;
|
|
191
|
-
const response = await this.asyncCall("getInternalAppSpPath", undefined, timeout);
|
|
192
|
-
if (!response.isSuccess()) {
|
|
193
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get internal app sp path failed");
|
|
194
|
-
}
|
|
195
|
-
return response.data;
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* 获取内部应用无备份文件路径
|
|
199
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
200
|
-
* @returns Promise<路径字符串>
|
|
201
|
-
*/
|
|
202
|
-
async getInternalAppNoBackupFilesPath(timeout) {
|
|
203
|
-
var _a;
|
|
204
|
-
const response = await this.asyncCall("getInternalAppNoBackupFilesPath", undefined, timeout);
|
|
205
|
-
if (!response.isSuccess()) {
|
|
206
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get internal app no backup files path failed");
|
|
207
|
-
}
|
|
208
|
-
return response.data;
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* 获取外部存储路径
|
|
212
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
213
|
-
* @returns Promise<路径字符串>
|
|
214
|
-
*/
|
|
215
|
-
async getExternalStoragePath(timeout) {
|
|
216
|
-
var _a;
|
|
217
|
-
const response = await this.asyncCall("getExternalStoragePath", undefined, timeout);
|
|
218
|
-
if (!response.isSuccess()) {
|
|
219
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external storage path failed");
|
|
220
|
-
}
|
|
221
|
-
return response.data;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* 获取外部音乐路径
|
|
225
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
226
|
-
* @returns Promise<路径字符串>
|
|
227
|
-
*/
|
|
228
|
-
async getExternalMusicPath(timeout) {
|
|
229
|
-
var _a;
|
|
230
|
-
const response = await this.asyncCall("getExternalMusicPath", undefined, timeout);
|
|
231
|
-
if (!response.isSuccess()) {
|
|
232
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external music path failed");
|
|
233
|
-
}
|
|
234
|
-
return response.data;
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* 获取外部播客路径
|
|
238
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
239
|
-
* @returns Promise<路径字符串>
|
|
240
|
-
*/
|
|
241
|
-
async getExternalPodcastsPath(timeout) {
|
|
242
|
-
var _a;
|
|
243
|
-
const response = await this.asyncCall("getExternalPodcastsPath", undefined, timeout);
|
|
244
|
-
if (!response.isSuccess()) {
|
|
245
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external podcasts path failed");
|
|
246
|
-
}
|
|
247
|
-
return response.data;
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* 获取外部铃声路径
|
|
251
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
252
|
-
* @returns Promise<路径字符串>
|
|
253
|
-
*/
|
|
254
|
-
async getExternalRingtonesPath(timeout) {
|
|
255
|
-
var _a;
|
|
256
|
-
const response = await this.asyncCall("getExternalRingtonesPath", undefined, timeout);
|
|
257
|
-
if (!response.isSuccess()) {
|
|
258
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external ringtones path failed");
|
|
259
|
-
}
|
|
260
|
-
return response.data;
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* 获取外部闹钟路径
|
|
264
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
265
|
-
* @returns Promise<路径字符串>
|
|
266
|
-
*/
|
|
267
|
-
async getExternalAlarmsPath(timeout) {
|
|
268
|
-
var _a;
|
|
269
|
-
const response = await this.asyncCall("getExternalAlarmsPath", undefined, timeout);
|
|
270
|
-
if (!response.isSuccess()) {
|
|
271
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external alarms path failed");
|
|
272
|
-
}
|
|
273
|
-
return response.data;
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* 获取外部通知路径
|
|
277
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
278
|
-
* @returns Promise<路径字符串>
|
|
279
|
-
*/
|
|
280
|
-
async getExternalNotificationsPath(timeout) {
|
|
281
|
-
var _a;
|
|
282
|
-
const response = await this.asyncCall("getExternalNotificationsPath", undefined, timeout);
|
|
283
|
-
if (!response.isSuccess()) {
|
|
284
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external notifications path failed");
|
|
285
|
-
}
|
|
286
|
-
return response.data;
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* 获取外部图片路径
|
|
290
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
291
|
-
* @returns Promise<路径字符串>
|
|
292
|
-
*/
|
|
293
|
-
async getExternalPicturesPath(timeout) {
|
|
294
|
-
var _a;
|
|
295
|
-
const response = await this.asyncCall("getExternalPicturesPath", undefined, timeout);
|
|
296
|
-
if (!response.isSuccess()) {
|
|
297
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external pictures path failed");
|
|
298
|
-
}
|
|
299
|
-
return response.data;
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* 获取外部电影路径
|
|
303
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
304
|
-
* @returns Promise<路径字符串>
|
|
305
|
-
*/
|
|
306
|
-
async getExternalMoviesPath(timeout) {
|
|
307
|
-
var _a;
|
|
308
|
-
const response = await this.asyncCall("getExternalMoviesPath", undefined, timeout);
|
|
309
|
-
if (!response.isSuccess()) {
|
|
310
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external movies path failed");
|
|
311
|
-
}
|
|
312
|
-
return response.data;
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* 获取外部下载路径
|
|
316
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
317
|
-
* @returns Promise<路径字符串>
|
|
318
|
-
*/
|
|
319
|
-
async getExternalDownloadsPath(timeout) {
|
|
320
|
-
var _a;
|
|
321
|
-
const response = await this.asyncCall("getExternalDownloadsPath", undefined, timeout);
|
|
322
|
-
if (!response.isSuccess()) {
|
|
323
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external downloads path failed");
|
|
324
|
-
}
|
|
325
|
-
return response.data;
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* 获取外部 DCIM 路径
|
|
329
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
330
|
-
* @returns Promise<路径字符串>
|
|
331
|
-
*/
|
|
332
|
-
async getExternalDcimPath(timeout) {
|
|
333
|
-
var _a;
|
|
334
|
-
const response = await this.asyncCall("getExternalDcimPath", undefined, timeout);
|
|
335
|
-
if (!response.isSuccess()) {
|
|
336
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external dcim path failed");
|
|
337
|
-
}
|
|
338
|
-
return response.data;
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* 获取外部文档路径
|
|
342
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
343
|
-
* @returns Promise<路径字符串>
|
|
344
|
-
*/
|
|
345
|
-
async getExternalDocumentsPath(timeout) {
|
|
346
|
-
var _a;
|
|
347
|
-
const response = await this.asyncCall("getExternalDocumentsPath", undefined, timeout);
|
|
348
|
-
if (!response.isSuccess()) {
|
|
349
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external documents path failed");
|
|
350
|
-
}
|
|
351
|
-
return response.data;
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* 获取外部应用数据路径
|
|
355
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
356
|
-
* @returns Promise<路径字符串>
|
|
357
|
-
*/
|
|
358
|
-
async getExternalAppDataPath(timeout) {
|
|
359
|
-
var _a;
|
|
360
|
-
const response = await this.asyncCall("getExternalAppDataPath", undefined, timeout);
|
|
361
|
-
if (!response.isSuccess()) {
|
|
362
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external app data path failed");
|
|
363
|
-
}
|
|
364
|
-
return response.data;
|
|
365
|
-
}
|
|
366
|
-
/**
|
|
367
|
-
* 获取外部应用缓存路径
|
|
368
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
369
|
-
* @returns Promise<路径字符串>
|
|
370
|
-
*/
|
|
371
|
-
async getExternalAppCachePath(timeout) {
|
|
372
|
-
var _a;
|
|
373
|
-
const response = await this.asyncCall("getExternalAppCachePath", undefined, timeout);
|
|
374
|
-
if (!response.isSuccess()) {
|
|
375
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external app cache path failed");
|
|
376
|
-
}
|
|
377
|
-
return response.data;
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
* 获取外部应用文件路径
|
|
381
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
382
|
-
* @returns Promise<路径字符串>
|
|
383
|
-
*/
|
|
384
|
-
async getExternalAppFilesPath(timeout) {
|
|
385
|
-
var _a;
|
|
386
|
-
const response = await this.asyncCall("getExternalAppFilesPath", undefined, timeout);
|
|
387
|
-
if (!response.isSuccess()) {
|
|
388
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external app files path failed");
|
|
389
|
-
}
|
|
390
|
-
return response.data;
|
|
391
|
-
}
|
|
392
|
-
/**
|
|
393
|
-
* 获取外部应用音乐路径
|
|
394
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
395
|
-
* @returns Promise<路径字符串>
|
|
396
|
-
*/
|
|
397
|
-
async getExternalAppMusicPath(timeout) {
|
|
398
|
-
var _a;
|
|
399
|
-
const response = await this.asyncCall("getExternalAppMusicPath", undefined, timeout);
|
|
400
|
-
if (!response.isSuccess()) {
|
|
401
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external app music path failed");
|
|
402
|
-
}
|
|
403
|
-
return response.data;
|
|
404
|
-
}
|
|
405
|
-
/**
|
|
406
|
-
* 获取外部应用播客路径
|
|
407
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
408
|
-
* @returns Promise<路径字符串>
|
|
409
|
-
*/
|
|
410
|
-
async getExternalAppPodcastsPath(timeout) {
|
|
411
|
-
var _a;
|
|
412
|
-
const response = await this.asyncCall("getExternalAppPodcastsPath", undefined, timeout);
|
|
413
|
-
if (!response.isSuccess()) {
|
|
414
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external app podcasts path failed");
|
|
415
|
-
}
|
|
416
|
-
return response.data;
|
|
417
|
-
}
|
|
418
|
-
/**
|
|
419
|
-
* 获取外部应用铃声路径
|
|
420
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
421
|
-
* @returns Promise<路径字符串>
|
|
422
|
-
*/
|
|
423
|
-
async getExternalAppRingtonesPath(timeout) {
|
|
424
|
-
var _a;
|
|
425
|
-
const response = await this.asyncCall("getExternalAppRingtonesPath", undefined, timeout);
|
|
426
|
-
if (!response.isSuccess()) {
|
|
427
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external app ringtones path failed");
|
|
428
|
-
}
|
|
429
|
-
return response.data;
|
|
430
|
-
}
|
|
431
|
-
/**
|
|
432
|
-
* 获取外部应用闹钟路径
|
|
433
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
434
|
-
* @returns Promise<路径字符串>
|
|
435
|
-
*/
|
|
436
|
-
async getExternalAppAlarmsPath(timeout) {
|
|
437
|
-
var _a;
|
|
438
|
-
const response = await this.asyncCall("getExternalAppAlarmsPath", undefined, timeout);
|
|
439
|
-
if (!response.isSuccess()) {
|
|
440
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external app alarms path failed");
|
|
441
|
-
}
|
|
442
|
-
return response.data;
|
|
443
|
-
}
|
|
444
|
-
/**
|
|
445
|
-
* 获取外部应用通知路径
|
|
446
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
447
|
-
* @returns Promise<路径字符串>
|
|
448
|
-
*/
|
|
449
|
-
async getExternalAppNotificationsPath(timeout) {
|
|
450
|
-
var _a;
|
|
451
|
-
const response = await this.asyncCall("getExternalAppNotificationsPath", undefined, timeout);
|
|
452
|
-
if (!response.isSuccess()) {
|
|
453
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external app notifications path failed");
|
|
454
|
-
}
|
|
455
|
-
return response.data;
|
|
456
|
-
}
|
|
457
|
-
/**
|
|
458
|
-
* 获取外部应用图片路径
|
|
459
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
460
|
-
* @returns Promise<路径字符串>
|
|
461
|
-
*/
|
|
462
|
-
async getExternalAppPicturesPath(timeout) {
|
|
463
|
-
var _a;
|
|
464
|
-
const response = await this.asyncCall("getExternalAppPicturesPath", undefined, timeout);
|
|
465
|
-
if (!response.isSuccess()) {
|
|
466
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external app pictures path failed");
|
|
467
|
-
}
|
|
468
|
-
return response.data;
|
|
469
|
-
}
|
|
470
|
-
/**
|
|
471
|
-
* 获取外部应用电影路径
|
|
472
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
473
|
-
* @returns Promise<路径字符串>
|
|
474
|
-
*/
|
|
475
|
-
async getExternalAppMoviesPath(timeout) {
|
|
476
|
-
var _a;
|
|
477
|
-
const response = await this.asyncCall("getExternalAppMoviesPath", undefined, timeout);
|
|
478
|
-
if (!response.isSuccess()) {
|
|
479
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external app movies path failed");
|
|
480
|
-
}
|
|
481
|
-
return response.data;
|
|
482
|
-
}
|
|
483
|
-
/**
|
|
484
|
-
* 获取外部应用下载路径
|
|
485
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
486
|
-
* @returns Promise<路径字符串>
|
|
487
|
-
*/
|
|
488
|
-
async getExternalAppDownloadPath(timeout) {
|
|
489
|
-
var _a;
|
|
490
|
-
const response = await this.asyncCall("getExternalAppDownloadPath", undefined, timeout);
|
|
491
|
-
if (!response.isSuccess()) {
|
|
492
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external app download path failed");
|
|
493
|
-
}
|
|
494
|
-
return response.data;
|
|
495
|
-
}
|
|
496
|
-
/**
|
|
497
|
-
* 获取外部应用 DCIM 路径
|
|
498
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
499
|
-
* @returns Promise<路径字符串>
|
|
500
|
-
*/
|
|
501
|
-
async getExternalAppDcimPath(timeout) {
|
|
502
|
-
var _a;
|
|
503
|
-
const response = await this.asyncCall("getExternalAppDcimPath", undefined, timeout);
|
|
504
|
-
if (!response.isSuccess()) {
|
|
505
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external app dcim path failed");
|
|
506
|
-
}
|
|
507
|
-
return response.data;
|
|
508
|
-
}
|
|
509
|
-
/**
|
|
510
|
-
* 获取外部应用文档路径
|
|
511
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
512
|
-
* @returns Promise<路径字符串>
|
|
513
|
-
*/
|
|
514
|
-
async getExternalAppDocumentsPath(timeout) {
|
|
515
|
-
var _a;
|
|
516
|
-
const response = await this.asyncCall("getExternalAppDocumentsPath", undefined, timeout);
|
|
517
|
-
if (!response.isSuccess()) {
|
|
518
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external app documents path failed");
|
|
519
|
-
}
|
|
520
|
-
return response.data;
|
|
521
|
-
}
|
|
522
|
-
/**
|
|
523
|
-
* 获取外部应用 OBB 路径
|
|
524
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
525
|
-
* @returns Promise<路径字符串>
|
|
526
|
-
*/
|
|
527
|
-
async getExternalAppObbPath(timeout) {
|
|
528
|
-
var _a;
|
|
529
|
-
const response = await this.asyncCall("getExternalAppObbPath", undefined, timeout);
|
|
530
|
-
if (!response.isSuccess()) {
|
|
531
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get external app obb path failed");
|
|
532
|
-
}
|
|
533
|
-
return response.data;
|
|
534
|
-
}
|
|
535
|
-
/**
|
|
536
|
-
* 获取根路径(优先外部存储)
|
|
537
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
538
|
-
* @returns Promise<路径字符串>
|
|
539
|
-
*/
|
|
540
|
-
async getRootPathExternalFirst(timeout) {
|
|
541
|
-
var _a;
|
|
542
|
-
const response = await this.asyncCall("getRootPathExternalFirst", undefined, timeout);
|
|
543
|
-
if (!response.isSuccess()) {
|
|
544
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get root path external first failed");
|
|
545
|
-
}
|
|
546
|
-
return response.data;
|
|
547
|
-
}
|
|
548
|
-
/**
|
|
549
|
-
* 获取应用数据路径(优先外部存储)
|
|
550
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
551
|
-
* @returns Promise<路径字符串>
|
|
552
|
-
*/
|
|
553
|
-
async getAppDataPathExternalFirst(timeout) {
|
|
554
|
-
var _a;
|
|
555
|
-
const response = await this.asyncCall("getAppDataPathExternalFirst", undefined, timeout);
|
|
556
|
-
if (!response.isSuccess()) {
|
|
557
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get app data path external first failed");
|
|
558
|
-
}
|
|
559
|
-
return response.data;
|
|
560
|
-
}
|
|
561
|
-
/**
|
|
562
|
-
* 获取文件路径(优先外部存储)
|
|
563
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
564
|
-
* @returns Promise<路径字符串>
|
|
565
|
-
*/
|
|
566
|
-
async getFilesPathExternalFirst(timeout) {
|
|
567
|
-
var _a;
|
|
568
|
-
const response = await this.asyncCall("getFilesPathExternalFirst", undefined, timeout);
|
|
569
|
-
if (!response.isSuccess()) {
|
|
570
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get files path external first failed");
|
|
571
|
-
}
|
|
572
|
-
return response.data;
|
|
573
|
-
}
|
|
574
|
-
/**
|
|
575
|
-
* 获取缓存路径(优先外部存储)
|
|
576
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
577
|
-
* @returns Promise<路径字符串>
|
|
578
|
-
*/
|
|
579
|
-
async getCachePathExternalFirst(timeout) {
|
|
580
|
-
var _a;
|
|
581
|
-
const response = await this.asyncCall("getCachePathExternalFirst", undefined, timeout);
|
|
582
|
-
if (!response.isSuccess()) {
|
|
583
|
-
throw new Error(((_a = response.data) === null || _a === void 0 ? void 0 : _a.message) || "Get cache path external first failed");
|
|
584
|
-
}
|
|
585
|
-
return response.data;
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
// 导出常量实例
|
|
589
|
-
export const pathUtils = new Path();
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Float window method constants.
|
|
3
|
-
* Matches FloatCallMethod.kt.
|
|
4
|
-
*/
|
|
5
|
-
export declare const FloatCallMethod: {
|
|
6
|
-
/** Load floating window */
|
|
7
|
-
readonly open: "open";
|
|
8
|
-
/** Close floating window */
|
|
9
|
-
readonly close: "close";
|
|
10
|
-
/** Set overlay flags */
|
|
11
|
-
readonly setFlags: "setFlags";
|
|
12
|
-
/** Show overlay toast */
|
|
13
|
-
readonly toast: "toast";
|
|
14
|
-
/** Move floating window by x, y */
|
|
15
|
-
readonly move: "move";
|
|
16
|
-
/** Refresh floating window view config (width, height, x, y) */
|
|
17
|
-
readonly refresh: "refresh";
|
|
18
|
-
};
|
|
19
|
-
export type FloatCallMethodType = (typeof FloatCallMethod)[keyof typeof FloatCallMethod];
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Float window method constants.
|
|
3
|
-
* Matches FloatCallMethod.kt.
|
|
4
|
-
*/
|
|
5
|
-
export const FloatCallMethod = {
|
|
6
|
-
/** Load floating window */
|
|
7
|
-
open: "open",
|
|
8
|
-
/** Close floating window */
|
|
9
|
-
close: "close",
|
|
10
|
-
/** Set overlay flags */
|
|
11
|
-
setFlags: "setFlags",
|
|
12
|
-
/** Show overlay toast */
|
|
13
|
-
toast: "toast",
|
|
14
|
-
/** Move floating window by x, y */
|
|
15
|
-
move: "move",
|
|
16
|
-
/** Refresh floating window view config (width, height, x, y) */
|
|
17
|
-
refresh: "refresh",
|
|
18
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { WebFloatingWindowOptions } from "../AssistsX";
|
|
2
|
-
export declare class Float {
|
|
3
|
-
private asyncCall;
|
|
4
|
-
private errorMessage;
|
|
5
|
-
/** Load floating window */
|
|
6
|
-
open(url: string, options?: WebFloatingWindowOptions & {
|
|
7
|
-
timeout?: number;
|
|
8
|
-
}): Promise<boolean>;
|
|
9
|
-
/** Close current floating window */
|
|
10
|
-
close(timeout?: number): Promise<boolean>;
|
|
11
|
-
/** Set overlay flags */
|
|
12
|
-
setFlags(flags: number | number[], timeout?: number): Promise<void>;
|
|
13
|
-
/** Show overlay toast */
|
|
14
|
-
toast(text: string, delay?: number, timeout?: number): Promise<void>;
|
|
15
|
-
/** Move floating window to x, y */
|
|
16
|
-
move(x: number, y: number, timeout?: number): Promise<void>;
|
|
17
|
-
/** Refresh floating window view config. Optional: showTopOperationArea, showBottomOperationArea, backgroundColor, width, height, x, y (omit to keep current) */
|
|
18
|
-
refresh(options?: {
|
|
19
|
-
showTopOperationArea?: boolean;
|
|
20
|
-
showBottomOperationArea?: boolean;
|
|
21
|
-
backgroundColor?: string | number;
|
|
22
|
-
width?: number;
|
|
23
|
-
height?: number;
|
|
24
|
-
x?: number;
|
|
25
|
-
y?: number;
|
|
26
|
-
timeout?: number;
|
|
27
|
-
}): Promise<void>;
|
|
28
|
-
}
|
|
29
|
-
export declare const float: Float;
|