assistsx-js 0.2.1 → 0.2.3
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 +50 -2
- package/dist/index.cjs +483 -358
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +616 -1717
- package/dist/index.d.ts +616 -1717
- package/dist/index.global.js +3 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +480 -358
- package/dist/index.js.map +1 -1
- package/dist/step-DnFA4DEb.d.mts +1196 -0
- package/dist/step-DnFA4DEb.d.ts +1196 -0
- package/dist/step-flow/index.cjs +4367 -0
- package/dist/step-flow/index.cjs.map +1 -0
- package/dist/step-flow/index.d.mts +83 -0
- package/dist/step-flow/index.d.ts +83 -0
- package/dist/step-flow/index.js +4331 -0
- package/dist/step-flow/index.js.map +1 -0
- package/package.json +6 -1
- package/src/assistsx-async.ts +83 -8
- package/src/assistsx.ts +54 -11
- package/src/index.ts +2 -0
- package/src/log/log.ts +20 -0
- package/src/node-lookup-scope.ts +10 -0
- package/src/pinia-ensure.ts +15 -0
- package/src/step-async.ts +71 -9
- package/src/step-flow/index.ts +5 -0
- package/src/step-flow/legacy-handoff.ts +50 -0
- package/src/step-flow/outcome.ts +16 -0
- package/src/step-flow/payload.ts +23 -0
- package/src/step-flow/runner.ts +128 -0
- package/src/step-flow/types.ts +41 -0
- package/src/step.ts +90 -24
package/dist/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// src/node-lookup-scope.ts
|
|
2
|
+
var NODE_LOOKUP_SCOPE_ACTIVE_WINDOW = "active_window";
|
|
3
|
+
var NODE_LOOKUP_SCOPE_ALL_WINDOWS = "all_windows";
|
|
4
|
+
|
|
1
5
|
// src/bounds.ts
|
|
2
6
|
var Bounds = class _Bounds {
|
|
3
7
|
// 构造函数
|
|
@@ -195,8 +199,8 @@ var CallResponse = class {
|
|
|
195
199
|
}
|
|
196
200
|
// 获取数据,如果数据为空则返回默认值
|
|
197
201
|
getDataOrDefault(defaultValue) {
|
|
198
|
-
var
|
|
199
|
-
return (
|
|
202
|
+
var _a2;
|
|
203
|
+
return (_a2 = this.data) != null ? _a2 : defaultValue;
|
|
200
204
|
}
|
|
201
205
|
};
|
|
202
206
|
|
|
@@ -237,9 +241,9 @@ var AppInfo = class _AppInfo {
|
|
|
237
241
|
* @returns AppInfo实例
|
|
238
242
|
*/
|
|
239
243
|
static fromJSON(data) {
|
|
240
|
-
var
|
|
244
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
|
241
245
|
return new _AppInfo(
|
|
242
|
-
(
|
|
246
|
+
(_a2 = data.isSystem) != null ? _a2 : false,
|
|
243
247
|
(_b = data.minSdkVersion) != null ? _b : 0,
|
|
244
248
|
(_c = data.name) != null ? _c : "",
|
|
245
249
|
(_d = data.packageName) != null ? _d : "",
|
|
@@ -288,9 +292,9 @@ var DeviceInfo = class _DeviceInfo {
|
|
|
288
292
|
* @returns DeviceInfo实例
|
|
289
293
|
*/
|
|
290
294
|
static fromJSON(data) {
|
|
291
|
-
var
|
|
295
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
292
296
|
return new _DeviceInfo(
|
|
293
|
-
(
|
|
297
|
+
(_a2 = data.uniqueDeviceId) != null ? _a2 : "",
|
|
294
298
|
(_b = data.androidID) != null ? _b : "",
|
|
295
299
|
(_c = data.macAddress) != null ? _c : "",
|
|
296
300
|
(_d = data.isDeviceRooted) != null ? _d : false,
|
|
@@ -413,10 +417,17 @@ var AssistsXAsync = class {
|
|
|
413
417
|
filterViewId,
|
|
414
418
|
filterDes,
|
|
415
419
|
filterText,
|
|
416
|
-
timeout
|
|
420
|
+
timeout,
|
|
421
|
+
scope
|
|
417
422
|
} = {}) {
|
|
418
423
|
const response = await this.asyncCall(CallMethod.getAllNodes, {
|
|
419
|
-
args: {
|
|
424
|
+
args: {
|
|
425
|
+
filterClass,
|
|
426
|
+
filterViewId,
|
|
427
|
+
filterDes,
|
|
428
|
+
filterText,
|
|
429
|
+
...scope !== void 0 ? { scope } : {}
|
|
430
|
+
},
|
|
420
431
|
timeout
|
|
421
432
|
});
|
|
422
433
|
const data = response.getDataOrDefault([]);
|
|
@@ -641,13 +652,11 @@ var AssistsXAsync = class {
|
|
|
641
652
|
});
|
|
642
653
|
return response.getDataOrDefault(false);
|
|
643
654
|
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
* @returns 包名
|
|
648
|
-
*/
|
|
649
|
-
static async getPackageName(timeout) {
|
|
655
|
+
static async getPackageName(timeoutOrOptions) {
|
|
656
|
+
const normalized = typeof timeoutOrOptions === "number" ? { timeout: timeoutOrOptions } : timeoutOrOptions != null ? timeoutOrOptions : {};
|
|
657
|
+
const { timeout, scope } = normalized;
|
|
650
658
|
const response = await this.asyncCall(CallMethod.getPackageName, {
|
|
659
|
+
args: scope !== void 0 ? { scope } : void 0,
|
|
651
660
|
timeout
|
|
652
661
|
});
|
|
653
662
|
return response.getDataOrDefault("");
|
|
@@ -681,10 +690,17 @@ var AssistsXAsync = class {
|
|
|
681
690
|
filterText,
|
|
682
691
|
filterDes,
|
|
683
692
|
node,
|
|
684
|
-
timeout
|
|
693
|
+
timeout,
|
|
694
|
+
scope
|
|
685
695
|
} = {}) {
|
|
686
696
|
const response = await this.asyncCall(CallMethod.findById, {
|
|
687
|
-
args: {
|
|
697
|
+
args: {
|
|
698
|
+
id,
|
|
699
|
+
filterClass,
|
|
700
|
+
filterText,
|
|
701
|
+
filterDes,
|
|
702
|
+
...scope !== void 0 ? { scope } : {}
|
|
703
|
+
},
|
|
688
704
|
node,
|
|
689
705
|
timeout
|
|
690
706
|
});
|
|
@@ -711,10 +727,17 @@ var AssistsXAsync = class {
|
|
|
711
727
|
filterViewId,
|
|
712
728
|
filterDes,
|
|
713
729
|
node,
|
|
714
|
-
timeout
|
|
730
|
+
timeout,
|
|
731
|
+
scope
|
|
715
732
|
} = {}) {
|
|
716
733
|
const response = await this.asyncCall(CallMethod.findByText, {
|
|
717
|
-
args: {
|
|
734
|
+
args: {
|
|
735
|
+
text,
|
|
736
|
+
filterClass,
|
|
737
|
+
filterViewId,
|
|
738
|
+
filterDes,
|
|
739
|
+
...scope !== void 0 ? { scope } : {}
|
|
740
|
+
},
|
|
718
741
|
node,
|
|
719
742
|
timeout
|
|
720
743
|
});
|
|
@@ -741,10 +764,17 @@ var AssistsXAsync = class {
|
|
|
741
764
|
filterViewId,
|
|
742
765
|
filterDes,
|
|
743
766
|
node,
|
|
744
|
-
timeout
|
|
767
|
+
timeout,
|
|
768
|
+
scope
|
|
745
769
|
} = {}) {
|
|
746
770
|
const response = await this.asyncCall(CallMethod.findByTags, {
|
|
747
|
-
args: {
|
|
771
|
+
args: {
|
|
772
|
+
className,
|
|
773
|
+
filterText,
|
|
774
|
+
filterViewId,
|
|
775
|
+
filterDes,
|
|
776
|
+
...scope !== void 0 ? { scope } : {}
|
|
777
|
+
},
|
|
748
778
|
node,
|
|
749
779
|
timeout
|
|
750
780
|
});
|
|
@@ -756,15 +786,14 @@ var AssistsXAsync = class {
|
|
|
756
786
|
}
|
|
757
787
|
return Node.fromJSONArray(data);
|
|
758
788
|
}
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
763
|
-
* @returns 节点数组
|
|
764
|
-
*/
|
|
765
|
-
static async findByTextAllMatch(text, timeout) {
|
|
789
|
+
static async findByTextAllMatch(text, timeoutOrOptions) {
|
|
790
|
+
const normalized = typeof timeoutOrOptions === "number" ? { timeout: timeoutOrOptions } : timeoutOrOptions != null ? timeoutOrOptions : {};
|
|
791
|
+
const { timeout, scope } = normalized;
|
|
766
792
|
const response = await this.asyncCall(CallMethod.findByTextAllMatch, {
|
|
767
|
-
args: {
|
|
793
|
+
args: {
|
|
794
|
+
text,
|
|
795
|
+
...scope !== void 0 ? { scope } : {}
|
|
796
|
+
},
|
|
768
797
|
timeout
|
|
769
798
|
});
|
|
770
799
|
const data = response.getDataOrDefault([]);
|
|
@@ -1285,18 +1314,21 @@ var AssistsXAsync = class {
|
|
|
1285
1314
|
* @param options.filePath 文件路径(可选,不提供则自动生成)
|
|
1286
1315
|
* @param options.prettyPrint 是否格式化输出,默认为 true
|
|
1287
1316
|
* @param options.timeout 超时时间(秒),默认30秒
|
|
1317
|
+
* @param options.scope 节点查找范围(可选)
|
|
1288
1318
|
* @returns 保存的文件路径
|
|
1289
1319
|
*/
|
|
1290
1320
|
static async saveRootNodeTreeJson(options = {}) {
|
|
1291
1321
|
const {
|
|
1292
1322
|
filePath,
|
|
1293
1323
|
prettyPrint = true,
|
|
1294
|
-
timeout
|
|
1324
|
+
timeout,
|
|
1325
|
+
scope
|
|
1295
1326
|
} = options;
|
|
1296
1327
|
const response = await this.asyncCall(CallMethod.saveRootNodeTreeJson, {
|
|
1297
1328
|
args: {
|
|
1298
1329
|
filePath,
|
|
1299
|
-
prettyPrint
|
|
1330
|
+
prettyPrint,
|
|
1331
|
+
...scope !== void 0 ? { scope } : {}
|
|
1300
1332
|
},
|
|
1301
1333
|
timeout
|
|
1302
1334
|
});
|
|
@@ -1375,6 +1407,17 @@ var useStepStore = defineStore("step", {
|
|
|
1375
1407
|
}
|
|
1376
1408
|
});
|
|
1377
1409
|
|
|
1410
|
+
// src/pinia-ensure.ts
|
|
1411
|
+
import { createPinia, getActivePinia, setActivePinia } from "pinia";
|
|
1412
|
+
var fallbackPinia = null;
|
|
1413
|
+
function ensureAssistsXPinia() {
|
|
1414
|
+
if (getActivePinia() !== void 0) return;
|
|
1415
|
+
if (fallbackPinia === null) {
|
|
1416
|
+
fallbackPinia = createPinia();
|
|
1417
|
+
}
|
|
1418
|
+
setActivePinia(fallbackPinia);
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1378
1421
|
// src/step-error.ts
|
|
1379
1422
|
var StepError = class extends Error {
|
|
1380
1423
|
constructor(message, data, impl, tag, originalError, currentStep) {
|
|
@@ -1445,14 +1488,16 @@ var StepAsync = class {
|
|
|
1445
1488
|
filterClass,
|
|
1446
1489
|
filterViewId,
|
|
1447
1490
|
filterDes,
|
|
1448
|
-
filterText
|
|
1491
|
+
filterText,
|
|
1492
|
+
scope
|
|
1449
1493
|
} = {}) {
|
|
1450
1494
|
Step.assert(this.step.stepId);
|
|
1451
1495
|
const nodes = await AssistsXAsync.getAllNodes({
|
|
1452
1496
|
filterClass,
|
|
1453
1497
|
filterViewId,
|
|
1454
1498
|
filterDes,
|
|
1455
|
-
filterText
|
|
1499
|
+
filterText,
|
|
1500
|
+
scope
|
|
1456
1501
|
});
|
|
1457
1502
|
Step.assert(this.step.stepId);
|
|
1458
1503
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
@@ -1469,13 +1514,9 @@ var StepAsync = class {
|
|
|
1469
1514
|
Step.assert(this.step.stepId);
|
|
1470
1515
|
return result;
|
|
1471
1516
|
}
|
|
1472
|
-
|
|
1473
|
-
* 获取当前应用包名
|
|
1474
|
-
* @returns 包名
|
|
1475
|
-
*/
|
|
1476
|
-
async getPackageName() {
|
|
1517
|
+
async getPackageName(timeoutOrOptions) {
|
|
1477
1518
|
Step.assert(this.step.stepId);
|
|
1478
|
-
const result = await AssistsXAsync.getPackageName();
|
|
1519
|
+
const result = typeof timeoutOrOptions === "number" ? await AssistsXAsync.getPackageName(timeoutOrOptions) : await AssistsXAsync.getPackageName(timeoutOrOptions != null ? timeoutOrOptions : {});
|
|
1479
1520
|
Step.assert(this.step.stepId);
|
|
1480
1521
|
return result;
|
|
1481
1522
|
}
|
|
@@ -1490,13 +1531,15 @@ var StepAsync = class {
|
|
|
1490
1531
|
async findById(id, {
|
|
1491
1532
|
filterClass,
|
|
1492
1533
|
filterText,
|
|
1493
|
-
filterDes
|
|
1534
|
+
filterDes,
|
|
1535
|
+
scope
|
|
1494
1536
|
} = {}) {
|
|
1495
1537
|
Step.assert(this.step.stepId);
|
|
1496
1538
|
const nodes = await AssistsXAsync.findById(id, {
|
|
1497
1539
|
filterClass,
|
|
1498
1540
|
filterText,
|
|
1499
|
-
filterDes
|
|
1541
|
+
filterDes,
|
|
1542
|
+
scope
|
|
1500
1543
|
});
|
|
1501
1544
|
Step.assert(this.step.stepId);
|
|
1502
1545
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
@@ -1513,13 +1556,15 @@ var StepAsync = class {
|
|
|
1513
1556
|
async findByText(text, {
|
|
1514
1557
|
filterClass,
|
|
1515
1558
|
filterViewId,
|
|
1516
|
-
filterDes
|
|
1559
|
+
filterDes,
|
|
1560
|
+
scope
|
|
1517
1561
|
} = {}) {
|
|
1518
1562
|
Step.assert(this.step.stepId);
|
|
1519
1563
|
const nodes = await AssistsXAsync.findByText(text, {
|
|
1520
1564
|
filterClass,
|
|
1521
1565
|
filterViewId,
|
|
1522
|
-
filterDes
|
|
1566
|
+
filterDes,
|
|
1567
|
+
scope
|
|
1523
1568
|
});
|
|
1524
1569
|
Step.assert(this.step.stepId);
|
|
1525
1570
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
@@ -1536,26 +1581,23 @@ var StepAsync = class {
|
|
|
1536
1581
|
async findByTags(className, {
|
|
1537
1582
|
filterText,
|
|
1538
1583
|
filterViewId,
|
|
1539
|
-
filterDes
|
|
1584
|
+
filterDes,
|
|
1585
|
+
scope
|
|
1540
1586
|
} = {}) {
|
|
1541
1587
|
Step.assert(this.step.stepId);
|
|
1542
1588
|
const nodes = await AssistsXAsync.findByTags(className, {
|
|
1543
1589
|
filterText,
|
|
1544
1590
|
filterViewId,
|
|
1545
|
-
filterDes
|
|
1591
|
+
filterDes,
|
|
1592
|
+
scope
|
|
1546
1593
|
});
|
|
1547
1594
|
Step.assert(this.step.stepId);
|
|
1548
1595
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
1549
1596
|
return nodes;
|
|
1550
1597
|
}
|
|
1551
|
-
|
|
1552
|
-
* 查找所有匹配文本的节点
|
|
1553
|
-
* @param text 要查找的文本
|
|
1554
|
-
* @returns 节点数组
|
|
1555
|
-
*/
|
|
1556
|
-
async findByTextAllMatch(text) {
|
|
1598
|
+
async findByTextAllMatch(text, timeoutOrOptions) {
|
|
1557
1599
|
Step.assert(this.step.stepId);
|
|
1558
|
-
const nodes = await AssistsXAsync.findByTextAllMatch(text);
|
|
1600
|
+
const nodes = typeof timeoutOrOptions === "number" ? await AssistsXAsync.findByTextAllMatch(text, timeoutOrOptions) : timeoutOrOptions !== void 0 ? await AssistsXAsync.findByTextAllMatch(text, timeoutOrOptions) : await AssistsXAsync.findByTextAllMatch(text);
|
|
1559
1601
|
Step.assert(this.step.stepId);
|
|
1560
1602
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
1561
1603
|
return nodes;
|
|
@@ -1737,13 +1779,31 @@ var _Step = class _Step {
|
|
|
1737
1779
|
this.delayMs = _Step.delayMsDefault;
|
|
1738
1780
|
this.tag = tag;
|
|
1739
1781
|
this.stepId = stepId;
|
|
1740
|
-
this.data = data
|
|
1782
|
+
this.data = _Step.resolveStepData(data);
|
|
1741
1783
|
this.impl = impl;
|
|
1742
1784
|
this.delayMs = delayMs;
|
|
1743
1785
|
this.repeatCountMax = repeatCountMax;
|
|
1744
1786
|
this.exceptionRetryCountMax = exceptionRetryCountMax;
|
|
1745
1787
|
this.isEnd = isEnd;
|
|
1746
1788
|
}
|
|
1789
|
+
/**
|
|
1790
|
+
* 判断步骤数据是否有效(非空且为普通对象)
|
|
1791
|
+
*/
|
|
1792
|
+
static isValidStepData(data) {
|
|
1793
|
+
return data !== null && data !== void 0 && typeof data === "object" && !Array.isArray(data);
|
|
1794
|
+
}
|
|
1795
|
+
/**
|
|
1796
|
+
* 解析步骤数据:优先使用传入值,否则使用当前值,均无效时返回空对象
|
|
1797
|
+
*/
|
|
1798
|
+
static resolveStepData(provided, fallback) {
|
|
1799
|
+
if (provided !== void 0 && _Step.isValidStepData(provided)) {
|
|
1800
|
+
return provided;
|
|
1801
|
+
}
|
|
1802
|
+
if (fallback !== void 0 && _Step.isValidStepData(fallback)) {
|
|
1803
|
+
return fallback;
|
|
1804
|
+
}
|
|
1805
|
+
return {};
|
|
1806
|
+
}
|
|
1747
1807
|
/**
|
|
1748
1808
|
* 运行步骤实现
|
|
1749
1809
|
* @param impl 步骤实现函数
|
|
@@ -1758,9 +1818,11 @@ var _Step = class _Step {
|
|
|
1758
1818
|
delayMs = _Step.delayMsDefault,
|
|
1759
1819
|
exceptionRetryCountMax = _Step.exceptionRetryCountMaxDefault
|
|
1760
1820
|
} = {}) {
|
|
1761
|
-
var
|
|
1821
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
1762
1822
|
this.exception = void 0;
|
|
1823
|
+
ensureAssistsXPinia();
|
|
1763
1824
|
const stepStore = useStepStore();
|
|
1825
|
+
const resolvedData = _Step.resolveStepData(data);
|
|
1764
1826
|
let implnName = impl.name;
|
|
1765
1827
|
let currentStep;
|
|
1766
1828
|
let nextStep;
|
|
@@ -1776,12 +1838,12 @@ var _Step = class _Step {
|
|
|
1776
1838
|
console.log(`\u751F\u6210\u6B65\u9AA4ID: ${this._stepId}`);
|
|
1777
1839
|
}
|
|
1778
1840
|
}
|
|
1779
|
-
stepStore.startStep(this._stepId, tag,
|
|
1841
|
+
stepStore.startStep(this._stepId, tag, resolvedData);
|
|
1780
1842
|
currentStep = new _Step({
|
|
1781
1843
|
stepId: this._stepId,
|
|
1782
1844
|
impl,
|
|
1783
1845
|
tag,
|
|
1784
|
-
data,
|
|
1846
|
+
data: resolvedData,
|
|
1785
1847
|
delayMs,
|
|
1786
1848
|
exceptionRetryCountMax
|
|
1787
1849
|
});
|
|
@@ -1796,7 +1858,7 @@ var _Step = class _Step {
|
|
|
1796
1858
|
await currentStep.delay(currentStep.delayMs);
|
|
1797
1859
|
_Step.assert(currentStep.stepId);
|
|
1798
1860
|
}
|
|
1799
|
-
implnName = (_b = (
|
|
1861
|
+
implnName = (_b = (_a2 = currentStep.impl) == null ? void 0 : _a2.name) != null ? _b : "undefined";
|
|
1800
1862
|
if (_Step.showLog) {
|
|
1801
1863
|
console.log(
|
|
1802
1864
|
`\u6267\u884C\u6B65\u9AA4${implnName}\uFF0C\u91CD\u590D\u6B21\u6570${currentStep.repeatCount}`
|
|
@@ -1890,7 +1952,7 @@ var _Step = class _Step {
|
|
|
1890
1952
|
const errorMsg = JSON.stringify({
|
|
1891
1953
|
impl: implnName,
|
|
1892
1954
|
tag,
|
|
1893
|
-
data,
|
|
1955
|
+
data: resolvedData,
|
|
1894
1956
|
error: (_f = e == null ? void 0 : e.message) != null ? _f : String(e)
|
|
1895
1957
|
});
|
|
1896
1958
|
stepStore.setError(errorMsg);
|
|
@@ -2033,13 +2095,12 @@ var _Step = class _Step {
|
|
|
2033
2095
|
repeatCountMax = _Step.repeatCountMaxDefault,
|
|
2034
2096
|
exceptionRetryCountMax = _Step.exceptionRetryCountMaxDefault
|
|
2035
2097
|
} = {}) {
|
|
2036
|
-
var _a;
|
|
2037
2098
|
_Step.assert(this.stepId);
|
|
2038
2099
|
return new _Step({
|
|
2039
2100
|
stepId: this.stepId,
|
|
2040
2101
|
impl,
|
|
2041
2102
|
tag,
|
|
2042
|
-
data: (
|
|
2103
|
+
data: _Step.resolveStepData(data, this.data),
|
|
2043
2104
|
delayMs,
|
|
2044
2105
|
repeatCountMax,
|
|
2045
2106
|
exceptionRetryCountMax
|
|
@@ -2052,13 +2113,12 @@ var _Step = class _Step {
|
|
|
2052
2113
|
repeatCountMax = _Step.repeatCountMaxDefault,
|
|
2053
2114
|
exceptionRetryCountMax = _Step.exceptionRetryCountMaxDefault
|
|
2054
2115
|
} = {}) {
|
|
2055
|
-
var _a;
|
|
2056
2116
|
_Step.assert(this.stepId);
|
|
2057
2117
|
return new _Step({
|
|
2058
2118
|
stepId: this.stepId,
|
|
2059
2119
|
impl: void 0,
|
|
2060
2120
|
tag,
|
|
2061
|
-
data: (
|
|
2121
|
+
data: _Step.resolveStepData(data, this.data),
|
|
2062
2122
|
delayMs,
|
|
2063
2123
|
repeatCountMax,
|
|
2064
2124
|
exceptionRetryCountMax,
|
|
@@ -2076,7 +2136,7 @@ var _Step = class _Step {
|
|
|
2076
2136
|
repeat({
|
|
2077
2137
|
stepId = this.stepId,
|
|
2078
2138
|
tag = this.tag,
|
|
2079
|
-
data
|
|
2139
|
+
data,
|
|
2080
2140
|
delayMs = this.delayMs,
|
|
2081
2141
|
repeatCountMax = this.repeatCountMax,
|
|
2082
2142
|
exceptionRetryCountMax = this.exceptionRetryCountMax
|
|
@@ -2085,7 +2145,7 @@ var _Step = class _Step {
|
|
|
2085
2145
|
this.repeatCount++;
|
|
2086
2146
|
this.stepId = stepId;
|
|
2087
2147
|
this.tag = tag;
|
|
2088
|
-
this.data = data;
|
|
2148
|
+
this.data = _Step.resolveStepData(data, this.data);
|
|
2089
2149
|
this.delayMs = delayMs;
|
|
2090
2150
|
this.repeatCountMax = repeatCountMax;
|
|
2091
2151
|
this.exceptionRetryCountMax = exceptionRetryCountMax;
|
|
@@ -2160,14 +2220,16 @@ var _Step = class _Step {
|
|
|
2160
2220
|
filterClass,
|
|
2161
2221
|
filterViewId,
|
|
2162
2222
|
filterDes,
|
|
2163
|
-
filterText
|
|
2223
|
+
filterText,
|
|
2224
|
+
scope
|
|
2164
2225
|
} = {}) {
|
|
2165
2226
|
_Step.assert(this.stepId);
|
|
2166
2227
|
const nodes = AssistsX2.getAllNodes({
|
|
2167
2228
|
filterClass,
|
|
2168
2229
|
filterViewId,
|
|
2169
2230
|
filterDes,
|
|
2170
|
-
filterText
|
|
2231
|
+
filterText,
|
|
2232
|
+
scope
|
|
2171
2233
|
});
|
|
2172
2234
|
_Step.assert(this.stepId);
|
|
2173
2235
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
@@ -2186,11 +2248,11 @@ var _Step = class _Step {
|
|
|
2186
2248
|
}
|
|
2187
2249
|
/**
|
|
2188
2250
|
* 获取当前应用包名
|
|
2189
|
-
* @
|
|
2251
|
+
* @param options.scope 节点查找范围(可选)
|
|
2190
2252
|
*/
|
|
2191
|
-
getPackageName() {
|
|
2253
|
+
getPackageName(options = {}) {
|
|
2192
2254
|
_Step.assert(this.stepId);
|
|
2193
|
-
const result = AssistsX2.getPackageName();
|
|
2255
|
+
const result = AssistsX2.getPackageName(options);
|
|
2194
2256
|
_Step.assert(this.stepId);
|
|
2195
2257
|
return result;
|
|
2196
2258
|
}
|
|
@@ -2205,10 +2267,16 @@ var _Step = class _Step {
|
|
|
2205
2267
|
findById(id, {
|
|
2206
2268
|
filterClass,
|
|
2207
2269
|
filterText,
|
|
2208
|
-
filterDes
|
|
2270
|
+
filterDes,
|
|
2271
|
+
scope
|
|
2209
2272
|
} = {}) {
|
|
2210
2273
|
_Step.assert(this.stepId);
|
|
2211
|
-
const nodes = AssistsX2.findById(id, {
|
|
2274
|
+
const nodes = AssistsX2.findById(id, {
|
|
2275
|
+
filterClass,
|
|
2276
|
+
filterText,
|
|
2277
|
+
filterDes,
|
|
2278
|
+
scope
|
|
2279
|
+
});
|
|
2212
2280
|
_Step.assert(this.stepId);
|
|
2213
2281
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
2214
2282
|
return nodes;
|
|
@@ -2224,13 +2292,15 @@ var _Step = class _Step {
|
|
|
2224
2292
|
findByText(text, {
|
|
2225
2293
|
filterClass,
|
|
2226
2294
|
filterViewId,
|
|
2227
|
-
filterDes
|
|
2295
|
+
filterDes,
|
|
2296
|
+
scope
|
|
2228
2297
|
} = {}) {
|
|
2229
2298
|
_Step.assert(this.stepId);
|
|
2230
2299
|
const nodes = AssistsX2.findByText(text, {
|
|
2231
2300
|
filterClass,
|
|
2232
2301
|
filterViewId,
|
|
2233
|
-
filterDes
|
|
2302
|
+
filterDes,
|
|
2303
|
+
scope
|
|
2234
2304
|
});
|
|
2235
2305
|
_Step.assert(this.stepId);
|
|
2236
2306
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
@@ -2247,13 +2317,15 @@ var _Step = class _Step {
|
|
|
2247
2317
|
findByTags(className, {
|
|
2248
2318
|
filterText,
|
|
2249
2319
|
filterViewId,
|
|
2250
|
-
filterDes
|
|
2320
|
+
filterDes,
|
|
2321
|
+
scope
|
|
2251
2322
|
} = {}) {
|
|
2252
2323
|
_Step.assert(this.stepId);
|
|
2253
2324
|
const nodes = AssistsX2.findByTags(className, {
|
|
2254
2325
|
filterText,
|
|
2255
2326
|
filterViewId,
|
|
2256
|
-
filterDes
|
|
2327
|
+
filterDes,
|
|
2328
|
+
scope
|
|
2257
2329
|
});
|
|
2258
2330
|
_Step.assert(this.stepId);
|
|
2259
2331
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
@@ -2262,11 +2334,11 @@ var _Step = class _Step {
|
|
|
2262
2334
|
/**
|
|
2263
2335
|
* 查找所有匹配文本的节点
|
|
2264
2336
|
* @param text 要查找的文本
|
|
2265
|
-
* @
|
|
2337
|
+
* @param options.scope 节点查找范围(可选)
|
|
2266
2338
|
*/
|
|
2267
|
-
findByTextAllMatch(text) {
|
|
2339
|
+
findByTextAllMatch(text, { scope } = {}) {
|
|
2268
2340
|
_Step.assert(this.stepId);
|
|
2269
|
-
const nodes = AssistsX2.findByTextAllMatch(text);
|
|
2341
|
+
const nodes = AssistsX2.findByTextAllMatch(text, { scope });
|
|
2270
2342
|
_Step.assert(this.stepId);
|
|
2271
2343
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
2272
2344
|
return nodes;
|
|
@@ -2782,7 +2854,7 @@ var Node = class _Node {
|
|
|
2782
2854
|
* @param params 节点参数对象
|
|
2783
2855
|
*/
|
|
2784
2856
|
constructor(params) {
|
|
2785
|
-
var
|
|
2857
|
+
var _a2;
|
|
2786
2858
|
this.nodeId = params.nodeId;
|
|
2787
2859
|
this.text = params.text;
|
|
2788
2860
|
this.des = params.des;
|
|
@@ -2802,7 +2874,7 @@ var Node = class _Node {
|
|
|
2802
2874
|
this.isSelected = params.isSelected;
|
|
2803
2875
|
this.isVisibleToUser = params.isVisibleToUser;
|
|
2804
2876
|
this.drawingOrder = params.drawingOrder;
|
|
2805
|
-
const rawBounds = (
|
|
2877
|
+
const rawBounds = (_a2 = params.bounds) != null ? _a2 : params.boundsInScreen;
|
|
2806
2878
|
this.bounds = rawBounds instanceof Bounds ? rawBounds : Bounds.fromData(rawBounds);
|
|
2807
2879
|
}
|
|
2808
2880
|
get async() {
|
|
@@ -3165,7 +3237,7 @@ var Node = class _Node {
|
|
|
3165
3237
|
// src/assistsx.ts
|
|
3166
3238
|
var callbacks = /* @__PURE__ */ new Map();
|
|
3167
3239
|
var accessibilityEventListeners = [];
|
|
3168
|
-
var screen
|
|
3240
|
+
var screen;
|
|
3169
3241
|
if (typeof window !== "undefined" && !window.assistsxCallback) {
|
|
3170
3242
|
window.assistsxCallback = (data) => {
|
|
3171
3243
|
let callbackId;
|
|
@@ -3316,10 +3388,17 @@ var AssistsX2 = class {
|
|
|
3316
3388
|
filterClass,
|
|
3317
3389
|
filterViewId,
|
|
3318
3390
|
filterDes,
|
|
3319
|
-
filterText
|
|
3391
|
+
filterText,
|
|
3392
|
+
scope
|
|
3320
3393
|
} = {}) {
|
|
3321
3394
|
const response = this.call(CallMethod.getAllNodes, {
|
|
3322
|
-
args: {
|
|
3395
|
+
args: {
|
|
3396
|
+
filterClass,
|
|
3397
|
+
filterViewId,
|
|
3398
|
+
filterDes,
|
|
3399
|
+
filterText,
|
|
3400
|
+
...scope !== void 0 ? { scope } : {}
|
|
3401
|
+
}
|
|
3323
3402
|
});
|
|
3324
3403
|
const data = response.getDataOrDefault([]);
|
|
3325
3404
|
if (!Array.isArray(data)) {
|
|
@@ -3483,8 +3562,12 @@ var AssistsX2 = class {
|
|
|
3483
3562
|
* 获取当前应用包名
|
|
3484
3563
|
* @returns 包名
|
|
3485
3564
|
*/
|
|
3486
|
-
static getPackageName() {
|
|
3487
|
-
const
|
|
3565
|
+
static getPackageName(options = {}) {
|
|
3566
|
+
const { scope } = options;
|
|
3567
|
+
const response = this.call(
|
|
3568
|
+
CallMethod.getPackageName,
|
|
3569
|
+
scope !== void 0 ? { args: { scope } } : {}
|
|
3570
|
+
);
|
|
3488
3571
|
return response.getDataOrDefault("");
|
|
3489
3572
|
}
|
|
3490
3573
|
/**
|
|
@@ -3512,10 +3595,17 @@ var AssistsX2 = class {
|
|
|
3512
3595
|
filterClass,
|
|
3513
3596
|
filterText,
|
|
3514
3597
|
filterDes,
|
|
3515
|
-
node
|
|
3598
|
+
node,
|
|
3599
|
+
scope
|
|
3516
3600
|
} = {}) {
|
|
3517
3601
|
const response = this.call(CallMethod.findById, {
|
|
3518
|
-
args: {
|
|
3602
|
+
args: {
|
|
3603
|
+
id,
|
|
3604
|
+
filterClass,
|
|
3605
|
+
filterText,
|
|
3606
|
+
filterDes,
|
|
3607
|
+
...scope !== void 0 ? { scope } : {}
|
|
3608
|
+
},
|
|
3519
3609
|
node
|
|
3520
3610
|
});
|
|
3521
3611
|
const data = response.getDataOrDefault([]);
|
|
@@ -3539,10 +3629,17 @@ var AssistsX2 = class {
|
|
|
3539
3629
|
filterClass,
|
|
3540
3630
|
filterViewId,
|
|
3541
3631
|
filterDes,
|
|
3542
|
-
node
|
|
3632
|
+
node,
|
|
3633
|
+
scope
|
|
3543
3634
|
} = {}) {
|
|
3544
3635
|
const response = this.call(CallMethod.findByText, {
|
|
3545
|
-
args: {
|
|
3636
|
+
args: {
|
|
3637
|
+
text,
|
|
3638
|
+
filterClass,
|
|
3639
|
+
filterViewId,
|
|
3640
|
+
filterDes,
|
|
3641
|
+
...scope !== void 0 ? { scope } : {}
|
|
3642
|
+
},
|
|
3546
3643
|
node
|
|
3547
3644
|
});
|
|
3548
3645
|
const data = response.getDataOrDefault([]);
|
|
@@ -3566,10 +3663,17 @@ var AssistsX2 = class {
|
|
|
3566
3663
|
filterText,
|
|
3567
3664
|
filterViewId,
|
|
3568
3665
|
filterDes,
|
|
3569
|
-
node
|
|
3666
|
+
node,
|
|
3667
|
+
scope
|
|
3570
3668
|
} = {}) {
|
|
3571
3669
|
const response = this.call(CallMethod.findByTags, {
|
|
3572
|
-
args: {
|
|
3670
|
+
args: {
|
|
3671
|
+
className,
|
|
3672
|
+
filterText,
|
|
3673
|
+
filterViewId,
|
|
3674
|
+
filterDes,
|
|
3675
|
+
...scope !== void 0 ? { scope } : {}
|
|
3676
|
+
},
|
|
3573
3677
|
node
|
|
3574
3678
|
});
|
|
3575
3679
|
const data = response.getDataOrDefault([]);
|
|
@@ -3583,11 +3687,14 @@ var AssistsX2 = class {
|
|
|
3583
3687
|
/**
|
|
3584
3688
|
* 查找所有匹配文本的节点
|
|
3585
3689
|
* @param text 要查找的文本
|
|
3586
|
-
* @
|
|
3690
|
+
* @param options.scope 节点查找范围(可选)
|
|
3587
3691
|
*/
|
|
3588
|
-
static findByTextAllMatch(text) {
|
|
3692
|
+
static findByTextAllMatch(text, { scope } = {}) {
|
|
3589
3693
|
const response = this.call(CallMethod.findByTextAllMatch, {
|
|
3590
|
-
args: {
|
|
3694
|
+
args: {
|
|
3695
|
+
text,
|
|
3696
|
+
...scope !== void 0 ? { scope } : {}
|
|
3697
|
+
}
|
|
3591
3698
|
});
|
|
3592
3699
|
const data = response.getDataOrDefault([]);
|
|
3593
3700
|
if (!Array.isArray(data)) {
|
|
@@ -4040,10 +4147,11 @@ function normalizeScreen(data) {
|
|
|
4040
4147
|
if (typeof w !== "number" || typeof h !== "number") return null;
|
|
4041
4148
|
return { width: Math.floor(w), height: Math.floor(h) };
|
|
4042
4149
|
}
|
|
4150
|
+
var _a;
|
|
4043
4151
|
if (typeof window !== "undefined") {
|
|
4044
4152
|
try {
|
|
4045
4153
|
if (window.assistsx && typeof window.assistsx.call === "function") {
|
|
4046
|
-
screen = AssistsX2.getScreenSize();
|
|
4154
|
+
screen = (_a = AssistsX2.getScreenSize()) != null ? _a : { width: 0, height: 0 };
|
|
4047
4155
|
}
|
|
4048
4156
|
} catch (e) {
|
|
4049
4157
|
console.log("Failed to initialize screen size:", e);
|
|
@@ -4178,8 +4286,8 @@ WindowFlags.FLAG_HARDWARE_ACCELERATED = 16777216;
|
|
|
4178
4286
|
// src/accessibility-event-filter.ts
|
|
4179
4287
|
var AccessibilityEventFilter = class _AccessibilityEventFilter {
|
|
4180
4288
|
constructor(config = {}) {
|
|
4181
|
-
var
|
|
4182
|
-
this.packageName = (
|
|
4289
|
+
var _a2, _b, _c, _d, _e;
|
|
4290
|
+
this.packageName = (_a2 = config.packageName) != null ? _a2 : null;
|
|
4183
4291
|
this.processInBackground = (_b = config.processInBackground) != null ? _b : true;
|
|
4184
4292
|
this.fetchNodeInfo = (_c = config.fetchNodeInfo) != null ? _c : true;
|
|
4185
4293
|
this.enableLogging = (_d = config.enableLogging) != null ? _d : false;
|
|
@@ -4200,8 +4308,8 @@ var AccessibilityEventFilter = class _AccessibilityEventFilter {
|
|
|
4200
4308
|
* @returns true表示应该处理,false表示应该过滤
|
|
4201
4309
|
*/
|
|
4202
4310
|
shouldProcessEventType(eventType) {
|
|
4203
|
-
var
|
|
4204
|
-
return this.eventTypes === null || ((_b = (
|
|
4311
|
+
var _a2, _b;
|
|
4312
|
+
return this.eventTypes === null || ((_b = (_a2 = this.eventTypes) == null ? void 0 : _a2.includes(eventType)) != null ? _b : false);
|
|
4205
4313
|
}
|
|
4206
4314
|
/**
|
|
4207
4315
|
* 创建默认的过滤配置
|
|
@@ -4329,14 +4437,14 @@ var Http = class {
|
|
|
4329
4437
|
* @returns Promise<HTTP响应>
|
|
4330
4438
|
*/
|
|
4331
4439
|
async httpGet(url, headers, timeout) {
|
|
4332
|
-
var
|
|
4440
|
+
var _a2;
|
|
4333
4441
|
const response = await this.asyncCall(
|
|
4334
4442
|
"httpGet",
|
|
4335
4443
|
{ url, headers },
|
|
4336
4444
|
timeout
|
|
4337
4445
|
);
|
|
4338
4446
|
if (!response.isSuccess()) {
|
|
4339
|
-
throw new Error(((
|
|
4447
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP GET request failed");
|
|
4340
4448
|
}
|
|
4341
4449
|
return response.data;
|
|
4342
4450
|
}
|
|
@@ -4349,14 +4457,14 @@ var Http = class {
|
|
|
4349
4457
|
* @returns Promise<HTTP响应>
|
|
4350
4458
|
*/
|
|
4351
4459
|
async httpPost(url, body, headers, timeout) {
|
|
4352
|
-
var
|
|
4460
|
+
var _a2;
|
|
4353
4461
|
const response = await this.asyncCall(
|
|
4354
4462
|
"httpPost",
|
|
4355
4463
|
{ url, body, headers },
|
|
4356
4464
|
timeout
|
|
4357
4465
|
);
|
|
4358
4466
|
if (!response.isSuccess()) {
|
|
4359
|
-
throw new Error(((
|
|
4467
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP POST request failed");
|
|
4360
4468
|
}
|
|
4361
4469
|
return response.data;
|
|
4362
4470
|
}
|
|
@@ -4389,7 +4497,7 @@ var Http = class {
|
|
|
4389
4497
|
* ], { description: "My files" });
|
|
4390
4498
|
*/
|
|
4391
4499
|
async httpPostFile(url, files, formData, headers, timeout) {
|
|
4392
|
-
var
|
|
4500
|
+
var _a2;
|
|
4393
4501
|
if (!files || files.length === 0) {
|
|
4394
4502
|
throw new Error("files\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF0C\u81F3\u5C11\u9700\u8981\u4E0A\u4F20\u4E00\u4E2A\u6587\u4EF6");
|
|
4395
4503
|
}
|
|
@@ -4404,7 +4512,7 @@ var Http = class {
|
|
|
4404
4512
|
timeout
|
|
4405
4513
|
);
|
|
4406
4514
|
if (!response.isSuccess()) {
|
|
4407
|
-
throw new Error(((
|
|
4515
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP POST file request failed");
|
|
4408
4516
|
}
|
|
4409
4517
|
return response.data;
|
|
4410
4518
|
}
|
|
@@ -4419,14 +4527,14 @@ var Http = class {
|
|
|
4419
4527
|
* @returns Promise<下载响应>
|
|
4420
4528
|
*/
|
|
4421
4529
|
async httpDownload(url, savePath, headers, saveToGallery, displayName, timeout) {
|
|
4422
|
-
var
|
|
4530
|
+
var _a2;
|
|
4423
4531
|
const response = await this.asyncCall(
|
|
4424
4532
|
"httpDownload",
|
|
4425
4533
|
{ url, savePath, headers, saveToGallery, displayName },
|
|
4426
4534
|
timeout
|
|
4427
4535
|
);
|
|
4428
4536
|
if (!response.isSuccess()) {
|
|
4429
|
-
throw new Error(((
|
|
4537
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP download failed");
|
|
4430
4538
|
}
|
|
4431
4539
|
return response.data;
|
|
4432
4540
|
}
|
|
@@ -4437,14 +4545,14 @@ var Http = class {
|
|
|
4437
4545
|
* @returns Promise<配置信息>
|
|
4438
4546
|
*/
|
|
4439
4547
|
async httpConfigure(config, timeout) {
|
|
4440
|
-
var
|
|
4548
|
+
var _a2;
|
|
4441
4549
|
const response = await this.asyncCall(
|
|
4442
4550
|
"httpConfigure",
|
|
4443
4551
|
config,
|
|
4444
4552
|
timeout
|
|
4445
4553
|
);
|
|
4446
4554
|
if (!response.isSuccess()) {
|
|
4447
|
-
throw new Error(((
|
|
4555
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP configure failed");
|
|
4448
4556
|
}
|
|
4449
4557
|
return response.data;
|
|
4450
4558
|
}
|
|
@@ -4454,10 +4562,10 @@ var Http = class {
|
|
|
4454
4562
|
* @returns Promise<配置信息>
|
|
4455
4563
|
*/
|
|
4456
4564
|
async httpReset(timeout) {
|
|
4457
|
-
var
|
|
4565
|
+
var _a2;
|
|
4458
4566
|
const response = await this.asyncCall("httpReset", void 0, timeout);
|
|
4459
4567
|
if (!response.isSuccess()) {
|
|
4460
|
-
throw new Error(((
|
|
4568
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP reset failed");
|
|
4461
4569
|
}
|
|
4462
4570
|
return response.data;
|
|
4463
4571
|
}
|
|
@@ -4467,10 +4575,10 @@ var Http = class {
|
|
|
4467
4575
|
* @returns Promise<配置信息>
|
|
4468
4576
|
*/
|
|
4469
4577
|
async httpGetConfig(timeout) {
|
|
4470
|
-
var
|
|
4578
|
+
var _a2;
|
|
4471
4579
|
const response = await this.asyncCall("httpGetConfig", void 0, timeout);
|
|
4472
4580
|
if (!response.isSuccess()) {
|
|
4473
|
-
throw new Error(((
|
|
4581
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get HTTP config failed");
|
|
4474
4582
|
}
|
|
4475
4583
|
return response.data;
|
|
4476
4584
|
}
|
|
@@ -4543,10 +4651,10 @@ var Path = class {
|
|
|
4543
4651
|
* @returns Promise<路径字符串>
|
|
4544
4652
|
*/
|
|
4545
4653
|
async getRootPath(timeout) {
|
|
4546
|
-
var
|
|
4654
|
+
var _a2;
|
|
4547
4655
|
const response = await this.asyncCall("getRootPath", void 0, timeout);
|
|
4548
4656
|
if (!response.isSuccess()) {
|
|
4549
|
-
throw new Error(((
|
|
4657
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get root path failed");
|
|
4550
4658
|
}
|
|
4551
4659
|
return response.data;
|
|
4552
4660
|
}
|
|
@@ -4556,10 +4664,10 @@ var Path = class {
|
|
|
4556
4664
|
* @returns Promise<路径字符串>
|
|
4557
4665
|
*/
|
|
4558
4666
|
async getDataPath(timeout) {
|
|
4559
|
-
var
|
|
4667
|
+
var _a2;
|
|
4560
4668
|
const response = await this.asyncCall("getDataPath", void 0, timeout);
|
|
4561
4669
|
if (!response.isSuccess()) {
|
|
4562
|
-
throw new Error(((
|
|
4670
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get data path failed");
|
|
4563
4671
|
}
|
|
4564
4672
|
return response.data;
|
|
4565
4673
|
}
|
|
@@ -4569,10 +4677,10 @@ var Path = class {
|
|
|
4569
4677
|
* @returns Promise<路径字符串>
|
|
4570
4678
|
*/
|
|
4571
4679
|
async getDownloadCachePath(timeout) {
|
|
4572
|
-
var
|
|
4680
|
+
var _a2;
|
|
4573
4681
|
const response = await this.asyncCall("getDownloadCachePath", void 0, timeout);
|
|
4574
4682
|
if (!response.isSuccess()) {
|
|
4575
|
-
throw new Error(((
|
|
4683
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get download cache path failed");
|
|
4576
4684
|
}
|
|
4577
4685
|
return response.data;
|
|
4578
4686
|
}
|
|
@@ -4582,10 +4690,10 @@ var Path = class {
|
|
|
4582
4690
|
* @returns Promise<路径字符串>
|
|
4583
4691
|
*/
|
|
4584
4692
|
async getInternalAppDataPath(timeout) {
|
|
4585
|
-
var
|
|
4693
|
+
var _a2;
|
|
4586
4694
|
const response = await this.asyncCall("getInternalAppDataPath", void 0, timeout);
|
|
4587
4695
|
if (!response.isSuccess()) {
|
|
4588
|
-
throw new Error(((
|
|
4696
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app data path failed");
|
|
4589
4697
|
}
|
|
4590
4698
|
return response.data;
|
|
4591
4699
|
}
|
|
@@ -4595,10 +4703,10 @@ var Path = class {
|
|
|
4595
4703
|
* @returns Promise<路径字符串>
|
|
4596
4704
|
*/
|
|
4597
4705
|
async getInternalAppCodeCacheDir(timeout) {
|
|
4598
|
-
var
|
|
4706
|
+
var _a2;
|
|
4599
4707
|
const response = await this.asyncCall("getInternalAppCodeCacheDir", void 0, timeout);
|
|
4600
4708
|
if (!response.isSuccess()) {
|
|
4601
|
-
throw new Error(((
|
|
4709
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app code cache dir failed");
|
|
4602
4710
|
}
|
|
4603
4711
|
return response.data;
|
|
4604
4712
|
}
|
|
@@ -4608,10 +4716,10 @@ var Path = class {
|
|
|
4608
4716
|
* @returns Promise<路径字符串>
|
|
4609
4717
|
*/
|
|
4610
4718
|
async getInternalAppCachePath(timeout) {
|
|
4611
|
-
var
|
|
4719
|
+
var _a2;
|
|
4612
4720
|
const response = await this.asyncCall("getInternalAppCachePath", void 0, timeout);
|
|
4613
4721
|
if (!response.isSuccess()) {
|
|
4614
|
-
throw new Error(((
|
|
4722
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app cache path failed");
|
|
4615
4723
|
}
|
|
4616
4724
|
return response.data;
|
|
4617
4725
|
}
|
|
@@ -4621,10 +4729,10 @@ var Path = class {
|
|
|
4621
4729
|
* @returns Promise<路径字符串>
|
|
4622
4730
|
*/
|
|
4623
4731
|
async getInternalAppDbsPath(timeout) {
|
|
4624
|
-
var
|
|
4732
|
+
var _a2;
|
|
4625
4733
|
const response = await this.asyncCall("getInternalAppDbsPath", void 0, timeout);
|
|
4626
4734
|
if (!response.isSuccess()) {
|
|
4627
|
-
throw new Error(((
|
|
4735
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app dbs path failed");
|
|
4628
4736
|
}
|
|
4629
4737
|
return response.data;
|
|
4630
4738
|
}
|
|
@@ -4635,10 +4743,10 @@ var Path = class {
|
|
|
4635
4743
|
* @returns Promise<路径字符串>
|
|
4636
4744
|
*/
|
|
4637
4745
|
async getInternalAppDbPath(dbName, timeout) {
|
|
4638
|
-
var
|
|
4746
|
+
var _a2;
|
|
4639
4747
|
const response = await this.asyncCall("getInternalAppDbPath", { dbName }, timeout);
|
|
4640
4748
|
if (!response.isSuccess()) {
|
|
4641
|
-
throw new Error(((
|
|
4749
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app db path failed");
|
|
4642
4750
|
}
|
|
4643
4751
|
return response.data;
|
|
4644
4752
|
}
|
|
@@ -4648,10 +4756,10 @@ var Path = class {
|
|
|
4648
4756
|
* @returns Promise<路径字符串>
|
|
4649
4757
|
*/
|
|
4650
4758
|
async getInternalAppFilesPath(timeout) {
|
|
4651
|
-
var
|
|
4759
|
+
var _a2;
|
|
4652
4760
|
const response = await this.asyncCall("getInternalAppFilesPath", void 0, timeout);
|
|
4653
4761
|
if (!response.isSuccess()) {
|
|
4654
|
-
throw new Error(((
|
|
4762
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app files path failed");
|
|
4655
4763
|
}
|
|
4656
4764
|
return response.data;
|
|
4657
4765
|
}
|
|
@@ -4661,10 +4769,10 @@ var Path = class {
|
|
|
4661
4769
|
* @returns Promise<路径字符串>
|
|
4662
4770
|
*/
|
|
4663
4771
|
async getInternalAppSpPath(timeout) {
|
|
4664
|
-
var
|
|
4772
|
+
var _a2;
|
|
4665
4773
|
const response = await this.asyncCall("getInternalAppSpPath", void 0, timeout);
|
|
4666
4774
|
if (!response.isSuccess()) {
|
|
4667
|
-
throw new Error(((
|
|
4775
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app sp path failed");
|
|
4668
4776
|
}
|
|
4669
4777
|
return response.data;
|
|
4670
4778
|
}
|
|
@@ -4674,10 +4782,10 @@ var Path = class {
|
|
|
4674
4782
|
* @returns Promise<路径字符串>
|
|
4675
4783
|
*/
|
|
4676
4784
|
async getInternalAppNoBackupFilesPath(timeout) {
|
|
4677
|
-
var
|
|
4785
|
+
var _a2;
|
|
4678
4786
|
const response = await this.asyncCall("getInternalAppNoBackupFilesPath", void 0, timeout);
|
|
4679
4787
|
if (!response.isSuccess()) {
|
|
4680
|
-
throw new Error(((
|
|
4788
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app no backup files path failed");
|
|
4681
4789
|
}
|
|
4682
4790
|
return response.data;
|
|
4683
4791
|
}
|
|
@@ -4687,10 +4795,10 @@ var Path = class {
|
|
|
4687
4795
|
* @returns Promise<路径字符串>
|
|
4688
4796
|
*/
|
|
4689
4797
|
async getExternalStoragePath(timeout) {
|
|
4690
|
-
var
|
|
4798
|
+
var _a2;
|
|
4691
4799
|
const response = await this.asyncCall("getExternalStoragePath", void 0, timeout);
|
|
4692
4800
|
if (!response.isSuccess()) {
|
|
4693
|
-
throw new Error(((
|
|
4801
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external storage path failed");
|
|
4694
4802
|
}
|
|
4695
4803
|
return response.data;
|
|
4696
4804
|
}
|
|
@@ -4700,10 +4808,10 @@ var Path = class {
|
|
|
4700
4808
|
* @returns Promise<路径字符串>
|
|
4701
4809
|
*/
|
|
4702
4810
|
async getExternalMusicPath(timeout) {
|
|
4703
|
-
var
|
|
4811
|
+
var _a2;
|
|
4704
4812
|
const response = await this.asyncCall("getExternalMusicPath", void 0, timeout);
|
|
4705
4813
|
if (!response.isSuccess()) {
|
|
4706
|
-
throw new Error(((
|
|
4814
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external music path failed");
|
|
4707
4815
|
}
|
|
4708
4816
|
return response.data;
|
|
4709
4817
|
}
|
|
@@ -4713,10 +4821,10 @@ var Path = class {
|
|
|
4713
4821
|
* @returns Promise<路径字符串>
|
|
4714
4822
|
*/
|
|
4715
4823
|
async getExternalPodcastsPath(timeout) {
|
|
4716
|
-
var
|
|
4824
|
+
var _a2;
|
|
4717
4825
|
const response = await this.asyncCall("getExternalPodcastsPath", void 0, timeout);
|
|
4718
4826
|
if (!response.isSuccess()) {
|
|
4719
|
-
throw new Error(((
|
|
4827
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external podcasts path failed");
|
|
4720
4828
|
}
|
|
4721
4829
|
return response.data;
|
|
4722
4830
|
}
|
|
@@ -4726,10 +4834,10 @@ var Path = class {
|
|
|
4726
4834
|
* @returns Promise<路径字符串>
|
|
4727
4835
|
*/
|
|
4728
4836
|
async getExternalRingtonesPath(timeout) {
|
|
4729
|
-
var
|
|
4837
|
+
var _a2;
|
|
4730
4838
|
const response = await this.asyncCall("getExternalRingtonesPath", void 0, timeout);
|
|
4731
4839
|
if (!response.isSuccess()) {
|
|
4732
|
-
throw new Error(((
|
|
4840
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external ringtones path failed");
|
|
4733
4841
|
}
|
|
4734
4842
|
return response.data;
|
|
4735
4843
|
}
|
|
@@ -4739,10 +4847,10 @@ var Path = class {
|
|
|
4739
4847
|
* @returns Promise<路径字符串>
|
|
4740
4848
|
*/
|
|
4741
4849
|
async getExternalAlarmsPath(timeout) {
|
|
4742
|
-
var
|
|
4850
|
+
var _a2;
|
|
4743
4851
|
const response = await this.asyncCall("getExternalAlarmsPath", void 0, timeout);
|
|
4744
4852
|
if (!response.isSuccess()) {
|
|
4745
|
-
throw new Error(((
|
|
4853
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external alarms path failed");
|
|
4746
4854
|
}
|
|
4747
4855
|
return response.data;
|
|
4748
4856
|
}
|
|
@@ -4752,10 +4860,10 @@ var Path = class {
|
|
|
4752
4860
|
* @returns Promise<路径字符串>
|
|
4753
4861
|
*/
|
|
4754
4862
|
async getExternalNotificationsPath(timeout) {
|
|
4755
|
-
var
|
|
4863
|
+
var _a2;
|
|
4756
4864
|
const response = await this.asyncCall("getExternalNotificationsPath", void 0, timeout);
|
|
4757
4865
|
if (!response.isSuccess()) {
|
|
4758
|
-
throw new Error(((
|
|
4866
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external notifications path failed");
|
|
4759
4867
|
}
|
|
4760
4868
|
return response.data;
|
|
4761
4869
|
}
|
|
@@ -4765,10 +4873,10 @@ var Path = class {
|
|
|
4765
4873
|
* @returns Promise<路径字符串>
|
|
4766
4874
|
*/
|
|
4767
4875
|
async getExternalPicturesPath(timeout) {
|
|
4768
|
-
var
|
|
4876
|
+
var _a2;
|
|
4769
4877
|
const response = await this.asyncCall("getExternalPicturesPath", void 0, timeout);
|
|
4770
4878
|
if (!response.isSuccess()) {
|
|
4771
|
-
throw new Error(((
|
|
4879
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external pictures path failed");
|
|
4772
4880
|
}
|
|
4773
4881
|
return response.data;
|
|
4774
4882
|
}
|
|
@@ -4778,10 +4886,10 @@ var Path = class {
|
|
|
4778
4886
|
* @returns Promise<路径字符串>
|
|
4779
4887
|
*/
|
|
4780
4888
|
async getExternalMoviesPath(timeout) {
|
|
4781
|
-
var
|
|
4889
|
+
var _a2;
|
|
4782
4890
|
const response = await this.asyncCall("getExternalMoviesPath", void 0, timeout);
|
|
4783
4891
|
if (!response.isSuccess()) {
|
|
4784
|
-
throw new Error(((
|
|
4892
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external movies path failed");
|
|
4785
4893
|
}
|
|
4786
4894
|
return response.data;
|
|
4787
4895
|
}
|
|
@@ -4791,10 +4899,10 @@ var Path = class {
|
|
|
4791
4899
|
* @returns Promise<路径字符串>
|
|
4792
4900
|
*/
|
|
4793
4901
|
async getExternalDownloadsPath(timeout) {
|
|
4794
|
-
var
|
|
4902
|
+
var _a2;
|
|
4795
4903
|
const response = await this.asyncCall("getExternalDownloadsPath", void 0, timeout);
|
|
4796
4904
|
if (!response.isSuccess()) {
|
|
4797
|
-
throw new Error(((
|
|
4905
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external downloads path failed");
|
|
4798
4906
|
}
|
|
4799
4907
|
return response.data;
|
|
4800
4908
|
}
|
|
@@ -4804,10 +4912,10 @@ var Path = class {
|
|
|
4804
4912
|
* @returns Promise<路径字符串>
|
|
4805
4913
|
*/
|
|
4806
4914
|
async getExternalDcimPath(timeout) {
|
|
4807
|
-
var
|
|
4915
|
+
var _a2;
|
|
4808
4916
|
const response = await this.asyncCall("getExternalDcimPath", void 0, timeout);
|
|
4809
4917
|
if (!response.isSuccess()) {
|
|
4810
|
-
throw new Error(((
|
|
4918
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external dcim path failed");
|
|
4811
4919
|
}
|
|
4812
4920
|
return response.data;
|
|
4813
4921
|
}
|
|
@@ -4817,10 +4925,10 @@ var Path = class {
|
|
|
4817
4925
|
* @returns Promise<路径字符串>
|
|
4818
4926
|
*/
|
|
4819
4927
|
async getExternalDocumentsPath(timeout) {
|
|
4820
|
-
var
|
|
4928
|
+
var _a2;
|
|
4821
4929
|
const response = await this.asyncCall("getExternalDocumentsPath", void 0, timeout);
|
|
4822
4930
|
if (!response.isSuccess()) {
|
|
4823
|
-
throw new Error(((
|
|
4931
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external documents path failed");
|
|
4824
4932
|
}
|
|
4825
4933
|
return response.data;
|
|
4826
4934
|
}
|
|
@@ -4830,10 +4938,10 @@ var Path = class {
|
|
|
4830
4938
|
* @returns Promise<路径字符串>
|
|
4831
4939
|
*/
|
|
4832
4940
|
async getExternalAppDataPath(timeout) {
|
|
4833
|
-
var
|
|
4941
|
+
var _a2;
|
|
4834
4942
|
const response = await this.asyncCall("getExternalAppDataPath", void 0, timeout);
|
|
4835
4943
|
if (!response.isSuccess()) {
|
|
4836
|
-
throw new Error(((
|
|
4944
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app data path failed");
|
|
4837
4945
|
}
|
|
4838
4946
|
return response.data;
|
|
4839
4947
|
}
|
|
@@ -4843,10 +4951,10 @@ var Path = class {
|
|
|
4843
4951
|
* @returns Promise<路径字符串>
|
|
4844
4952
|
*/
|
|
4845
4953
|
async getExternalAppCachePath(timeout) {
|
|
4846
|
-
var
|
|
4954
|
+
var _a2;
|
|
4847
4955
|
const response = await this.asyncCall("getExternalAppCachePath", void 0, timeout);
|
|
4848
4956
|
if (!response.isSuccess()) {
|
|
4849
|
-
throw new Error(((
|
|
4957
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app cache path failed");
|
|
4850
4958
|
}
|
|
4851
4959
|
return response.data;
|
|
4852
4960
|
}
|
|
@@ -4856,10 +4964,10 @@ var Path = class {
|
|
|
4856
4964
|
* @returns Promise<路径字符串>
|
|
4857
4965
|
*/
|
|
4858
4966
|
async getExternalAppFilesPath(timeout) {
|
|
4859
|
-
var
|
|
4967
|
+
var _a2;
|
|
4860
4968
|
const response = await this.asyncCall("getExternalAppFilesPath", void 0, timeout);
|
|
4861
4969
|
if (!response.isSuccess()) {
|
|
4862
|
-
throw new Error(((
|
|
4970
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app files path failed");
|
|
4863
4971
|
}
|
|
4864
4972
|
return response.data;
|
|
4865
4973
|
}
|
|
@@ -4869,10 +4977,10 @@ var Path = class {
|
|
|
4869
4977
|
* @returns Promise<路径字符串>
|
|
4870
4978
|
*/
|
|
4871
4979
|
async getExternalAppMusicPath(timeout) {
|
|
4872
|
-
var
|
|
4980
|
+
var _a2;
|
|
4873
4981
|
const response = await this.asyncCall("getExternalAppMusicPath", void 0, timeout);
|
|
4874
4982
|
if (!response.isSuccess()) {
|
|
4875
|
-
throw new Error(((
|
|
4983
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app music path failed");
|
|
4876
4984
|
}
|
|
4877
4985
|
return response.data;
|
|
4878
4986
|
}
|
|
@@ -4882,10 +4990,10 @@ var Path = class {
|
|
|
4882
4990
|
* @returns Promise<路径字符串>
|
|
4883
4991
|
*/
|
|
4884
4992
|
async getExternalAppPodcastsPath(timeout) {
|
|
4885
|
-
var
|
|
4993
|
+
var _a2;
|
|
4886
4994
|
const response = await this.asyncCall("getExternalAppPodcastsPath", void 0, timeout);
|
|
4887
4995
|
if (!response.isSuccess()) {
|
|
4888
|
-
throw new Error(((
|
|
4996
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app podcasts path failed");
|
|
4889
4997
|
}
|
|
4890
4998
|
return response.data;
|
|
4891
4999
|
}
|
|
@@ -4895,10 +5003,10 @@ var Path = class {
|
|
|
4895
5003
|
* @returns Promise<路径字符串>
|
|
4896
5004
|
*/
|
|
4897
5005
|
async getExternalAppRingtonesPath(timeout) {
|
|
4898
|
-
var
|
|
5006
|
+
var _a2;
|
|
4899
5007
|
const response = await this.asyncCall("getExternalAppRingtonesPath", void 0, timeout);
|
|
4900
5008
|
if (!response.isSuccess()) {
|
|
4901
|
-
throw new Error(((
|
|
5009
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app ringtones path failed");
|
|
4902
5010
|
}
|
|
4903
5011
|
return response.data;
|
|
4904
5012
|
}
|
|
@@ -4908,10 +5016,10 @@ var Path = class {
|
|
|
4908
5016
|
* @returns Promise<路径字符串>
|
|
4909
5017
|
*/
|
|
4910
5018
|
async getExternalAppAlarmsPath(timeout) {
|
|
4911
|
-
var
|
|
5019
|
+
var _a2;
|
|
4912
5020
|
const response = await this.asyncCall("getExternalAppAlarmsPath", void 0, timeout);
|
|
4913
5021
|
if (!response.isSuccess()) {
|
|
4914
|
-
throw new Error(((
|
|
5022
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app alarms path failed");
|
|
4915
5023
|
}
|
|
4916
5024
|
return response.data;
|
|
4917
5025
|
}
|
|
@@ -4921,10 +5029,10 @@ var Path = class {
|
|
|
4921
5029
|
* @returns Promise<路径字符串>
|
|
4922
5030
|
*/
|
|
4923
5031
|
async getExternalAppNotificationsPath(timeout) {
|
|
4924
|
-
var
|
|
5032
|
+
var _a2;
|
|
4925
5033
|
const response = await this.asyncCall("getExternalAppNotificationsPath", void 0, timeout);
|
|
4926
5034
|
if (!response.isSuccess()) {
|
|
4927
|
-
throw new Error(((
|
|
5035
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app notifications path failed");
|
|
4928
5036
|
}
|
|
4929
5037
|
return response.data;
|
|
4930
5038
|
}
|
|
@@ -4934,10 +5042,10 @@ var Path = class {
|
|
|
4934
5042
|
* @returns Promise<路径字符串>
|
|
4935
5043
|
*/
|
|
4936
5044
|
async getExternalAppPicturesPath(timeout) {
|
|
4937
|
-
var
|
|
5045
|
+
var _a2;
|
|
4938
5046
|
const response = await this.asyncCall("getExternalAppPicturesPath", void 0, timeout);
|
|
4939
5047
|
if (!response.isSuccess()) {
|
|
4940
|
-
throw new Error(((
|
|
5048
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app pictures path failed");
|
|
4941
5049
|
}
|
|
4942
5050
|
return response.data;
|
|
4943
5051
|
}
|
|
@@ -4947,10 +5055,10 @@ var Path = class {
|
|
|
4947
5055
|
* @returns Promise<路径字符串>
|
|
4948
5056
|
*/
|
|
4949
5057
|
async getExternalAppMoviesPath(timeout) {
|
|
4950
|
-
var
|
|
5058
|
+
var _a2;
|
|
4951
5059
|
const response = await this.asyncCall("getExternalAppMoviesPath", void 0, timeout);
|
|
4952
5060
|
if (!response.isSuccess()) {
|
|
4953
|
-
throw new Error(((
|
|
5061
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app movies path failed");
|
|
4954
5062
|
}
|
|
4955
5063
|
return response.data;
|
|
4956
5064
|
}
|
|
@@ -4960,10 +5068,10 @@ var Path = class {
|
|
|
4960
5068
|
* @returns Promise<路径字符串>
|
|
4961
5069
|
*/
|
|
4962
5070
|
async getExternalAppDownloadPath(timeout) {
|
|
4963
|
-
var
|
|
5071
|
+
var _a2;
|
|
4964
5072
|
const response = await this.asyncCall("getExternalAppDownloadPath", void 0, timeout);
|
|
4965
5073
|
if (!response.isSuccess()) {
|
|
4966
|
-
throw new Error(((
|
|
5074
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app download path failed");
|
|
4967
5075
|
}
|
|
4968
5076
|
return response.data;
|
|
4969
5077
|
}
|
|
@@ -4973,10 +5081,10 @@ var Path = class {
|
|
|
4973
5081
|
* @returns Promise<路径字符串>
|
|
4974
5082
|
*/
|
|
4975
5083
|
async getExternalAppDcimPath(timeout) {
|
|
4976
|
-
var
|
|
5084
|
+
var _a2;
|
|
4977
5085
|
const response = await this.asyncCall("getExternalAppDcimPath", void 0, timeout);
|
|
4978
5086
|
if (!response.isSuccess()) {
|
|
4979
|
-
throw new Error(((
|
|
5087
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app dcim path failed");
|
|
4980
5088
|
}
|
|
4981
5089
|
return response.data;
|
|
4982
5090
|
}
|
|
@@ -4986,10 +5094,10 @@ var Path = class {
|
|
|
4986
5094
|
* @returns Promise<路径字符串>
|
|
4987
5095
|
*/
|
|
4988
5096
|
async getExternalAppDocumentsPath(timeout) {
|
|
4989
|
-
var
|
|
5097
|
+
var _a2;
|
|
4990
5098
|
const response = await this.asyncCall("getExternalAppDocumentsPath", void 0, timeout);
|
|
4991
5099
|
if (!response.isSuccess()) {
|
|
4992
|
-
throw new Error(((
|
|
5100
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app documents path failed");
|
|
4993
5101
|
}
|
|
4994
5102
|
return response.data;
|
|
4995
5103
|
}
|
|
@@ -4999,10 +5107,10 @@ var Path = class {
|
|
|
4999
5107
|
* @returns Promise<路径字符串>
|
|
5000
5108
|
*/
|
|
5001
5109
|
async getExternalAppObbPath(timeout) {
|
|
5002
|
-
var
|
|
5110
|
+
var _a2;
|
|
5003
5111
|
const response = await this.asyncCall("getExternalAppObbPath", void 0, timeout);
|
|
5004
5112
|
if (!response.isSuccess()) {
|
|
5005
|
-
throw new Error(((
|
|
5113
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app obb path failed");
|
|
5006
5114
|
}
|
|
5007
5115
|
return response.data;
|
|
5008
5116
|
}
|
|
@@ -5012,10 +5120,10 @@ var Path = class {
|
|
|
5012
5120
|
* @returns Promise<路径字符串>
|
|
5013
5121
|
*/
|
|
5014
5122
|
async getRootPathExternalFirst(timeout) {
|
|
5015
|
-
var
|
|
5123
|
+
var _a2;
|
|
5016
5124
|
const response = await this.asyncCall("getRootPathExternalFirst", void 0, timeout);
|
|
5017
5125
|
if (!response.isSuccess()) {
|
|
5018
|
-
throw new Error(((
|
|
5126
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get root path external first failed");
|
|
5019
5127
|
}
|
|
5020
5128
|
return response.data;
|
|
5021
5129
|
}
|
|
@@ -5025,10 +5133,10 @@ var Path = class {
|
|
|
5025
5133
|
* @returns Promise<路径字符串>
|
|
5026
5134
|
*/
|
|
5027
5135
|
async getAppDataPathExternalFirst(timeout) {
|
|
5028
|
-
var
|
|
5136
|
+
var _a2;
|
|
5029
5137
|
const response = await this.asyncCall("getAppDataPathExternalFirst", void 0, timeout);
|
|
5030
5138
|
if (!response.isSuccess()) {
|
|
5031
|
-
throw new Error(((
|
|
5139
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get app data path external first failed");
|
|
5032
5140
|
}
|
|
5033
5141
|
return response.data;
|
|
5034
5142
|
}
|
|
@@ -5038,10 +5146,10 @@ var Path = class {
|
|
|
5038
5146
|
* @returns Promise<路径字符串>
|
|
5039
5147
|
*/
|
|
5040
5148
|
async getFilesPathExternalFirst(timeout) {
|
|
5041
|
-
var
|
|
5149
|
+
var _a2;
|
|
5042
5150
|
const response = await this.asyncCall("getFilesPathExternalFirst", void 0, timeout);
|
|
5043
5151
|
if (!response.isSuccess()) {
|
|
5044
|
-
throw new Error(((
|
|
5152
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get files path external first failed");
|
|
5045
5153
|
}
|
|
5046
5154
|
return response.data;
|
|
5047
5155
|
}
|
|
@@ -5051,10 +5159,10 @@ var Path = class {
|
|
|
5051
5159
|
* @returns Promise<路径字符串>
|
|
5052
5160
|
*/
|
|
5053
5161
|
async getCachePathExternalFirst(timeout) {
|
|
5054
|
-
var
|
|
5162
|
+
var _a2;
|
|
5055
5163
|
const response = await this.asyncCall("getCachePathExternalFirst", void 0, timeout);
|
|
5056
5164
|
if (!response.isSuccess()) {
|
|
5057
|
-
throw new Error(((
|
|
5165
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get cache path external first failed");
|
|
5058
5166
|
}
|
|
5059
5167
|
return response.data;
|
|
5060
5168
|
}
|
|
@@ -5130,14 +5238,14 @@ var FileIO = class {
|
|
|
5130
5238
|
* @returns Promise<是否成功>
|
|
5131
5239
|
*/
|
|
5132
5240
|
async writeFileFromIS(filePath, inputStreamBase64, append = false, timeout) {
|
|
5133
|
-
var
|
|
5241
|
+
var _a2;
|
|
5134
5242
|
const response = await this.asyncCall(
|
|
5135
5243
|
"writeFileFromIS",
|
|
5136
5244
|
{ filePath, inputStreamBase64, append },
|
|
5137
5245
|
timeout
|
|
5138
5246
|
);
|
|
5139
5247
|
if (!response.isSuccess()) {
|
|
5140
|
-
throw new Error(((
|
|
5248
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from input stream failed");
|
|
5141
5249
|
}
|
|
5142
5250
|
return response.data;
|
|
5143
5251
|
}
|
|
@@ -5150,14 +5258,14 @@ var FileIO = class {
|
|
|
5150
5258
|
* @returns Promise<是否成功>
|
|
5151
5259
|
*/
|
|
5152
5260
|
async writeFileFromBytesByStream(filePath, bytesBase64, append = false, timeout) {
|
|
5153
|
-
var
|
|
5261
|
+
var _a2;
|
|
5154
5262
|
const response = await this.asyncCall(
|
|
5155
5263
|
"writeFileFromBytesByStream",
|
|
5156
5264
|
{ filePath, bytesBase64, append },
|
|
5157
5265
|
timeout
|
|
5158
5266
|
);
|
|
5159
5267
|
if (!response.isSuccess()) {
|
|
5160
|
-
throw new Error(((
|
|
5268
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from bytes by stream failed");
|
|
5161
5269
|
}
|
|
5162
5270
|
return response.data;
|
|
5163
5271
|
}
|
|
@@ -5170,14 +5278,14 @@ var FileIO = class {
|
|
|
5170
5278
|
* @returns Promise<是否成功>
|
|
5171
5279
|
*/
|
|
5172
5280
|
async writeFileFromBytesByChannel(filePath, bytesBase64, append = false, timeout) {
|
|
5173
|
-
var
|
|
5281
|
+
var _a2;
|
|
5174
5282
|
const response = await this.asyncCall(
|
|
5175
5283
|
"writeFileFromBytesByChannel",
|
|
5176
5284
|
{ filePath, bytesBase64, append },
|
|
5177
5285
|
timeout
|
|
5178
5286
|
);
|
|
5179
5287
|
if (!response.isSuccess()) {
|
|
5180
|
-
throw new Error(((
|
|
5288
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from bytes by channel failed");
|
|
5181
5289
|
}
|
|
5182
5290
|
return response.data;
|
|
5183
5291
|
}
|
|
@@ -5190,14 +5298,14 @@ var FileIO = class {
|
|
|
5190
5298
|
* @returns Promise<是否成功>
|
|
5191
5299
|
*/
|
|
5192
5300
|
async writeFileFromBytesByMap(filePath, bytesBase64, append = false, timeout) {
|
|
5193
|
-
var
|
|
5301
|
+
var _a2;
|
|
5194
5302
|
const response = await this.asyncCall(
|
|
5195
5303
|
"writeFileFromBytesByMap",
|
|
5196
5304
|
{ filePath, bytesBase64, append },
|
|
5197
5305
|
timeout
|
|
5198
5306
|
);
|
|
5199
5307
|
if (!response.isSuccess()) {
|
|
5200
|
-
throw new Error(((
|
|
5308
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from bytes by map failed");
|
|
5201
5309
|
}
|
|
5202
5310
|
return response.data;
|
|
5203
5311
|
}
|
|
@@ -5211,14 +5319,14 @@ var FileIO = class {
|
|
|
5211
5319
|
* @returns Promise<是否成功>
|
|
5212
5320
|
*/
|
|
5213
5321
|
async writeFileFromString(filePath, content, append = false, threadSafe = false, timeout) {
|
|
5214
|
-
var
|
|
5322
|
+
var _a2;
|
|
5215
5323
|
const response = await this.asyncCall(
|
|
5216
5324
|
"writeFileFromString",
|
|
5217
5325
|
{ filePath, content, append, threadSafe },
|
|
5218
5326
|
timeout
|
|
5219
5327
|
);
|
|
5220
5328
|
if (!response.isSuccess()) {
|
|
5221
|
-
throw new Error(((
|
|
5329
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from string failed");
|
|
5222
5330
|
}
|
|
5223
5331
|
return response.data;
|
|
5224
5332
|
}
|
|
@@ -5230,14 +5338,14 @@ var FileIO = class {
|
|
|
5230
5338
|
* @returns Promise<字符串数组>
|
|
5231
5339
|
*/
|
|
5232
5340
|
async readFile2List(filePath, charsetName = "UTF-8", timeout) {
|
|
5233
|
-
var
|
|
5341
|
+
var _a2;
|
|
5234
5342
|
const response = await this.asyncCall(
|
|
5235
5343
|
"readFile2List",
|
|
5236
5344
|
{ filePath, charsetName },
|
|
5237
5345
|
timeout
|
|
5238
5346
|
);
|
|
5239
5347
|
if (!response.isSuccess()) {
|
|
5240
|
-
throw new Error(((
|
|
5348
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to list failed");
|
|
5241
5349
|
}
|
|
5242
5350
|
return response.data;
|
|
5243
5351
|
}
|
|
@@ -5249,14 +5357,14 @@ var FileIO = class {
|
|
|
5249
5357
|
* @returns Promise<文件内容字符串>
|
|
5250
5358
|
*/
|
|
5251
5359
|
async readFile2String(filePath, charsetName = "UTF-8", timeout) {
|
|
5252
|
-
var
|
|
5360
|
+
var _a2;
|
|
5253
5361
|
const response = await this.asyncCall(
|
|
5254
5362
|
"readFile2String",
|
|
5255
5363
|
{ filePath, charsetName },
|
|
5256
5364
|
timeout
|
|
5257
5365
|
);
|
|
5258
5366
|
if (!response.isSuccess()) {
|
|
5259
|
-
throw new Error(((
|
|
5367
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to string failed");
|
|
5260
5368
|
}
|
|
5261
5369
|
return response.data;
|
|
5262
5370
|
}
|
|
@@ -5267,14 +5375,14 @@ var FileIO = class {
|
|
|
5267
5375
|
* @returns Promise<Base64 编码的字节数组>
|
|
5268
5376
|
*/
|
|
5269
5377
|
async readFile2BytesByStream(filePath, timeout) {
|
|
5270
|
-
var
|
|
5378
|
+
var _a2;
|
|
5271
5379
|
const response = await this.asyncCall(
|
|
5272
5380
|
"readFile2BytesByStream",
|
|
5273
5381
|
{ filePath },
|
|
5274
5382
|
timeout
|
|
5275
5383
|
);
|
|
5276
5384
|
if (!response.isSuccess()) {
|
|
5277
|
-
throw new Error(((
|
|
5385
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to bytes by stream failed");
|
|
5278
5386
|
}
|
|
5279
5387
|
return response.data;
|
|
5280
5388
|
}
|
|
@@ -5285,14 +5393,14 @@ var FileIO = class {
|
|
|
5285
5393
|
* @returns Promise<Base64 编码的字节数组>
|
|
5286
5394
|
*/
|
|
5287
5395
|
async readFile2BytesByChannel(filePath, timeout) {
|
|
5288
|
-
var
|
|
5396
|
+
var _a2;
|
|
5289
5397
|
const response = await this.asyncCall(
|
|
5290
5398
|
"readFile2BytesByChannel",
|
|
5291
5399
|
{ filePath },
|
|
5292
5400
|
timeout
|
|
5293
5401
|
);
|
|
5294
5402
|
if (!response.isSuccess()) {
|
|
5295
|
-
throw new Error(((
|
|
5403
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to bytes by channel failed");
|
|
5296
5404
|
}
|
|
5297
5405
|
return response.data;
|
|
5298
5406
|
}
|
|
@@ -5303,14 +5411,14 @@ var FileIO = class {
|
|
|
5303
5411
|
* @returns Promise<Base64 编码的字节数组>
|
|
5304
5412
|
*/
|
|
5305
5413
|
async readFile2BytesByMap(filePath, timeout) {
|
|
5306
|
-
var
|
|
5414
|
+
var _a2;
|
|
5307
5415
|
const response = await this.asyncCall(
|
|
5308
5416
|
"readFile2BytesByMap",
|
|
5309
5417
|
{ filePath },
|
|
5310
5418
|
timeout
|
|
5311
5419
|
);
|
|
5312
5420
|
if (!response.isSuccess()) {
|
|
5313
|
-
throw new Error(((
|
|
5421
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to bytes by map failed");
|
|
5314
5422
|
}
|
|
5315
5423
|
return response.data;
|
|
5316
5424
|
}
|
|
@@ -5321,14 +5429,14 @@ var FileIO = class {
|
|
|
5321
5429
|
* @returns Promise<是否成功>
|
|
5322
5430
|
*/
|
|
5323
5431
|
async setBufferSize(bufferSize, timeout) {
|
|
5324
|
-
var
|
|
5432
|
+
var _a2;
|
|
5325
5433
|
const response = await this.asyncCall(
|
|
5326
5434
|
"setBufferSize",
|
|
5327
5435
|
{ bufferSize },
|
|
5328
5436
|
timeout
|
|
5329
5437
|
);
|
|
5330
5438
|
if (!response.isSuccess()) {
|
|
5331
|
-
throw new Error(((
|
|
5439
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Set buffer size failed");
|
|
5332
5440
|
}
|
|
5333
5441
|
return response.data;
|
|
5334
5442
|
}
|
|
@@ -5402,10 +5510,10 @@ var FileUtils = class {
|
|
|
5402
5510
|
* @returns Promise<文件信息>
|
|
5403
5511
|
*/
|
|
5404
5512
|
async getFileByPath(filePath, timeout) {
|
|
5405
|
-
var
|
|
5513
|
+
var _a2;
|
|
5406
5514
|
const response = await this.asyncCall("getFileByPath", { filePath }, timeout);
|
|
5407
5515
|
if (!response.isSuccess()) {
|
|
5408
|
-
throw new Error(((
|
|
5516
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file by path failed");
|
|
5409
5517
|
}
|
|
5410
5518
|
return response.data;
|
|
5411
5519
|
}
|
|
@@ -5416,10 +5524,10 @@ var FileUtils = class {
|
|
|
5416
5524
|
* @returns Promise<是否存在>
|
|
5417
5525
|
*/
|
|
5418
5526
|
async isFileExists(filePath, timeout) {
|
|
5419
|
-
var
|
|
5527
|
+
var _a2;
|
|
5420
5528
|
const response = await this.asyncCall("isFileExists", { filePath }, timeout);
|
|
5421
5529
|
if (!response.isSuccess()) {
|
|
5422
|
-
throw new Error(((
|
|
5530
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check file exists failed");
|
|
5423
5531
|
}
|
|
5424
5532
|
return response.data;
|
|
5425
5533
|
}
|
|
@@ -5431,10 +5539,10 @@ var FileUtils = class {
|
|
|
5431
5539
|
* @returns Promise<是否成功>
|
|
5432
5540
|
*/
|
|
5433
5541
|
async rename(filePath, newName, timeout) {
|
|
5434
|
-
var
|
|
5542
|
+
var _a2;
|
|
5435
5543
|
const response = await this.asyncCall("rename", { filePath, newName }, timeout);
|
|
5436
5544
|
if (!response.isSuccess()) {
|
|
5437
|
-
throw new Error(((
|
|
5545
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Rename file failed");
|
|
5438
5546
|
}
|
|
5439
5547
|
return response.data;
|
|
5440
5548
|
}
|
|
@@ -5445,10 +5553,10 @@ var FileUtils = class {
|
|
|
5445
5553
|
* @returns Promise<是否为目录>
|
|
5446
5554
|
*/
|
|
5447
5555
|
async isDir(filePath, timeout) {
|
|
5448
|
-
var
|
|
5556
|
+
var _a2;
|
|
5449
5557
|
const response = await this.asyncCall("isDir", { filePath }, timeout);
|
|
5450
5558
|
if (!response.isSuccess()) {
|
|
5451
|
-
throw new Error(((
|
|
5559
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check is directory failed");
|
|
5452
5560
|
}
|
|
5453
5561
|
return response.data;
|
|
5454
5562
|
}
|
|
@@ -5459,10 +5567,10 @@ var FileUtils = class {
|
|
|
5459
5567
|
* @returns Promise<是否为文件>
|
|
5460
5568
|
*/
|
|
5461
5569
|
async isFile(filePath, timeout) {
|
|
5462
|
-
var
|
|
5570
|
+
var _a2;
|
|
5463
5571
|
const response = await this.asyncCall("isFile", { filePath }, timeout);
|
|
5464
5572
|
if (!response.isSuccess()) {
|
|
5465
|
-
throw new Error(((
|
|
5573
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check is file failed");
|
|
5466
5574
|
}
|
|
5467
5575
|
return response.data;
|
|
5468
5576
|
}
|
|
@@ -5473,10 +5581,10 @@ var FileUtils = class {
|
|
|
5473
5581
|
* @returns Promise<是否成功>
|
|
5474
5582
|
*/
|
|
5475
5583
|
async createOrExistsDir(dirPath, timeout) {
|
|
5476
|
-
var
|
|
5584
|
+
var _a2;
|
|
5477
5585
|
const response = await this.asyncCall("createOrExistsDir", { dirPath }, timeout);
|
|
5478
5586
|
if (!response.isSuccess()) {
|
|
5479
|
-
throw new Error(((
|
|
5587
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Create or exists dir failed");
|
|
5480
5588
|
}
|
|
5481
5589
|
return response.data;
|
|
5482
5590
|
}
|
|
@@ -5487,10 +5595,10 @@ var FileUtils = class {
|
|
|
5487
5595
|
* @returns Promise<是否成功>
|
|
5488
5596
|
*/
|
|
5489
5597
|
async createOrExistsFile(filePath, timeout) {
|
|
5490
|
-
var
|
|
5598
|
+
var _a2;
|
|
5491
5599
|
const response = await this.asyncCall("createOrExistsFile", { filePath }, timeout);
|
|
5492
5600
|
if (!response.isSuccess()) {
|
|
5493
|
-
throw new Error(((
|
|
5601
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Create or exists file failed");
|
|
5494
5602
|
}
|
|
5495
5603
|
return response.data;
|
|
5496
5604
|
}
|
|
@@ -5501,10 +5609,10 @@ var FileUtils = class {
|
|
|
5501
5609
|
* @returns Promise<是否成功>
|
|
5502
5610
|
*/
|
|
5503
5611
|
async createFileByDeleteOldFile(filePath, timeout) {
|
|
5504
|
-
var
|
|
5612
|
+
var _a2;
|
|
5505
5613
|
const response = await this.asyncCall("createFileByDeleteOldFile", { filePath }, timeout);
|
|
5506
5614
|
if (!response.isSuccess()) {
|
|
5507
|
-
throw new Error(((
|
|
5615
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Create file by delete old file failed");
|
|
5508
5616
|
}
|
|
5509
5617
|
return response.data;
|
|
5510
5618
|
}
|
|
@@ -5516,10 +5624,10 @@ var FileUtils = class {
|
|
|
5516
5624
|
* @returns Promise<是否成功>
|
|
5517
5625
|
*/
|
|
5518
5626
|
async copy(srcFilePath, destFilePath, timeout) {
|
|
5519
|
-
var
|
|
5627
|
+
var _a2;
|
|
5520
5628
|
const response = await this.asyncCall("copy", { srcFilePath, destFilePath }, timeout);
|
|
5521
5629
|
if (!response.isSuccess()) {
|
|
5522
|
-
throw new Error(((
|
|
5630
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Copy file failed");
|
|
5523
5631
|
}
|
|
5524
5632
|
return response.data;
|
|
5525
5633
|
}
|
|
@@ -5531,10 +5639,10 @@ var FileUtils = class {
|
|
|
5531
5639
|
* @returns Promise<是否成功>
|
|
5532
5640
|
*/
|
|
5533
5641
|
async move(srcFilePath, destFilePath, timeout) {
|
|
5534
|
-
var
|
|
5642
|
+
var _a2;
|
|
5535
5643
|
const response = await this.asyncCall("move", { srcFilePath, destFilePath }, timeout);
|
|
5536
5644
|
if (!response.isSuccess()) {
|
|
5537
|
-
throw new Error(((
|
|
5645
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Move file failed");
|
|
5538
5646
|
}
|
|
5539
5647
|
return response.data;
|
|
5540
5648
|
}
|
|
@@ -5545,10 +5653,10 @@ var FileUtils = class {
|
|
|
5545
5653
|
* @returns Promise<是否成功>
|
|
5546
5654
|
*/
|
|
5547
5655
|
async delete(filePath, timeout) {
|
|
5548
|
-
var
|
|
5656
|
+
var _a2;
|
|
5549
5657
|
const response = await this.asyncCall("delete", { filePath }, timeout);
|
|
5550
5658
|
if (!response.isSuccess()) {
|
|
5551
|
-
throw new Error(((
|
|
5659
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Delete file failed");
|
|
5552
5660
|
}
|
|
5553
5661
|
return response.data;
|
|
5554
5662
|
}
|
|
@@ -5559,10 +5667,10 @@ var FileUtils = class {
|
|
|
5559
5667
|
* @returns Promise<是否成功>
|
|
5560
5668
|
*/
|
|
5561
5669
|
async deleteAllInDir(dirPath, timeout) {
|
|
5562
|
-
var
|
|
5670
|
+
var _a2;
|
|
5563
5671
|
const response = await this.asyncCall("deleteAllInDir", { dirPath }, timeout);
|
|
5564
5672
|
if (!response.isSuccess()) {
|
|
5565
|
-
throw new Error(((
|
|
5673
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Delete all in dir failed");
|
|
5566
5674
|
}
|
|
5567
5675
|
return response.data;
|
|
5568
5676
|
}
|
|
@@ -5573,10 +5681,10 @@ var FileUtils = class {
|
|
|
5573
5681
|
* @returns Promise<是否成功>
|
|
5574
5682
|
*/
|
|
5575
5683
|
async deleteFilesInDir(dirPath, timeout) {
|
|
5576
|
-
var
|
|
5684
|
+
var _a2;
|
|
5577
5685
|
const response = await this.asyncCall("deleteFilesInDir", { dirPath }, timeout);
|
|
5578
5686
|
if (!response.isSuccess()) {
|
|
5579
|
-
throw new Error(((
|
|
5687
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Delete files in dir failed");
|
|
5580
5688
|
}
|
|
5581
5689
|
return response.data;
|
|
5582
5690
|
}
|
|
@@ -5588,14 +5696,14 @@ var FileUtils = class {
|
|
|
5588
5696
|
* @returns Promise<是否成功>
|
|
5589
5697
|
*/
|
|
5590
5698
|
async deleteFilesInDirWithFilter(dirPath, filterPattern, timeout) {
|
|
5591
|
-
var
|
|
5699
|
+
var _a2;
|
|
5592
5700
|
const response = await this.asyncCall(
|
|
5593
5701
|
"deleteFilesInDirWithFilter",
|
|
5594
5702
|
{ dirPath, filterPattern },
|
|
5595
5703
|
timeout
|
|
5596
5704
|
);
|
|
5597
5705
|
if (!response.isSuccess()) {
|
|
5598
|
-
throw new Error(((
|
|
5706
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Delete files in dir with filter failed");
|
|
5599
5707
|
}
|
|
5600
5708
|
return response.data;
|
|
5601
5709
|
}
|
|
@@ -5606,10 +5714,10 @@ var FileUtils = class {
|
|
|
5606
5714
|
* @returns Promise<文件列表>
|
|
5607
5715
|
*/
|
|
5608
5716
|
async listFilesInDir(dirPath, timeout) {
|
|
5609
|
-
var
|
|
5717
|
+
var _a2;
|
|
5610
5718
|
const response = await this.asyncCall("listFilesInDir", { dirPath }, timeout);
|
|
5611
5719
|
if (!response.isSuccess()) {
|
|
5612
|
-
throw new Error(((
|
|
5720
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "List files in dir failed");
|
|
5613
5721
|
}
|
|
5614
5722
|
return response.data;
|
|
5615
5723
|
}
|
|
@@ -5621,14 +5729,14 @@ var FileUtils = class {
|
|
|
5621
5729
|
* @returns Promise<文件列表>
|
|
5622
5730
|
*/
|
|
5623
5731
|
async listFilesInDirWithFilter(dirPath, filterPattern, timeout) {
|
|
5624
|
-
var
|
|
5732
|
+
var _a2;
|
|
5625
5733
|
const response = await this.asyncCall(
|
|
5626
5734
|
"listFilesInDirWithFilter",
|
|
5627
5735
|
{ dirPath, filterPattern },
|
|
5628
5736
|
timeout
|
|
5629
5737
|
);
|
|
5630
5738
|
if (!response.isSuccess()) {
|
|
5631
|
-
throw new Error(((
|
|
5739
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "List files in dir with filter failed");
|
|
5632
5740
|
}
|
|
5633
5741
|
return response.data;
|
|
5634
5742
|
}
|
|
@@ -5639,10 +5747,10 @@ var FileUtils = class {
|
|
|
5639
5747
|
* @returns Promise<时间戳(毫秒)>
|
|
5640
5748
|
*/
|
|
5641
5749
|
async getFileLastModified(filePath, timeout) {
|
|
5642
|
-
var
|
|
5750
|
+
var _a2;
|
|
5643
5751
|
const response = await this.asyncCall("getFileLastModified", { filePath }, timeout);
|
|
5644
5752
|
if (!response.isSuccess()) {
|
|
5645
|
-
throw new Error(((
|
|
5753
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file last modified failed");
|
|
5646
5754
|
}
|
|
5647
5755
|
return response.data;
|
|
5648
5756
|
}
|
|
@@ -5653,10 +5761,10 @@ var FileUtils = class {
|
|
|
5653
5761
|
* @returns Promise<字符集名称>
|
|
5654
5762
|
*/
|
|
5655
5763
|
async getFileCharsetSimple(filePath, timeout) {
|
|
5656
|
-
var
|
|
5764
|
+
var _a2;
|
|
5657
5765
|
const response = await this.asyncCall("getFileCharsetSimple", { filePath }, timeout);
|
|
5658
5766
|
if (!response.isSuccess()) {
|
|
5659
|
-
throw new Error(((
|
|
5767
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file charset simple failed");
|
|
5660
5768
|
}
|
|
5661
5769
|
return response.data;
|
|
5662
5770
|
}
|
|
@@ -5667,10 +5775,10 @@ var FileUtils = class {
|
|
|
5667
5775
|
* @returns Promise<行数>
|
|
5668
5776
|
*/
|
|
5669
5777
|
async getFileLines(filePath, timeout) {
|
|
5670
|
-
var
|
|
5778
|
+
var _a2;
|
|
5671
5779
|
const response = await this.asyncCall("getFileLines", { filePath }, timeout);
|
|
5672
5780
|
if (!response.isSuccess()) {
|
|
5673
|
-
throw new Error(((
|
|
5781
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file lines failed");
|
|
5674
5782
|
}
|
|
5675
5783
|
return response.data;
|
|
5676
5784
|
}
|
|
@@ -5681,10 +5789,10 @@ var FileUtils = class {
|
|
|
5681
5789
|
* @returns Promise<大小(字节)>
|
|
5682
5790
|
*/
|
|
5683
5791
|
async getSize(filePath, timeout) {
|
|
5684
|
-
var
|
|
5792
|
+
var _a2;
|
|
5685
5793
|
const response = await this.asyncCall("getSize", { filePath }, timeout);
|
|
5686
5794
|
if (!response.isSuccess()) {
|
|
5687
|
-
throw new Error(((
|
|
5795
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get size failed");
|
|
5688
5796
|
}
|
|
5689
5797
|
return response.data;
|
|
5690
5798
|
}
|
|
@@ -5695,10 +5803,10 @@ var FileUtils = class {
|
|
|
5695
5803
|
* @returns Promise<长度(字节)>
|
|
5696
5804
|
*/
|
|
5697
5805
|
async getLength(filePath, timeout) {
|
|
5698
|
-
var
|
|
5806
|
+
var _a2;
|
|
5699
5807
|
const response = await this.asyncCall("getLength", { filePath }, timeout);
|
|
5700
5808
|
if (!response.isSuccess()) {
|
|
5701
|
-
throw new Error(((
|
|
5809
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get length failed");
|
|
5702
5810
|
}
|
|
5703
5811
|
return response.data;
|
|
5704
5812
|
}
|
|
@@ -5709,10 +5817,10 @@ var FileUtils = class {
|
|
|
5709
5817
|
* @returns Promise<Base64 编码的 MD5>
|
|
5710
5818
|
*/
|
|
5711
5819
|
async getFileMD5(filePath, timeout) {
|
|
5712
|
-
var
|
|
5820
|
+
var _a2;
|
|
5713
5821
|
const response = await this.asyncCall("getFileMD5", { filePath }, timeout);
|
|
5714
5822
|
if (!response.isSuccess()) {
|
|
5715
|
-
throw new Error(((
|
|
5823
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file MD5 failed");
|
|
5716
5824
|
}
|
|
5717
5825
|
return response.data;
|
|
5718
5826
|
}
|
|
@@ -5723,10 +5831,10 @@ var FileUtils = class {
|
|
|
5723
5831
|
* @returns Promise<MD5 字符串>
|
|
5724
5832
|
*/
|
|
5725
5833
|
async getFileMD5ToString(filePath, timeout) {
|
|
5726
|
-
var
|
|
5834
|
+
var _a2;
|
|
5727
5835
|
const response = await this.asyncCall("getFileMD5ToString", { filePath }, timeout);
|
|
5728
5836
|
if (!response.isSuccess()) {
|
|
5729
|
-
throw new Error(((
|
|
5837
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file MD5 to string failed");
|
|
5730
5838
|
}
|
|
5731
5839
|
return response.data;
|
|
5732
5840
|
}
|
|
@@ -5737,10 +5845,10 @@ var FileUtils = class {
|
|
|
5737
5845
|
* @returns Promise<目录名>
|
|
5738
5846
|
*/
|
|
5739
5847
|
async getDirName(filePath, timeout) {
|
|
5740
|
-
var
|
|
5848
|
+
var _a2;
|
|
5741
5849
|
const response = await this.asyncCall("getDirName", { filePath }, timeout);
|
|
5742
5850
|
if (!response.isSuccess()) {
|
|
5743
|
-
throw new Error(((
|
|
5851
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get dir name failed");
|
|
5744
5852
|
}
|
|
5745
5853
|
return response.data;
|
|
5746
5854
|
}
|
|
@@ -5751,10 +5859,10 @@ var FileUtils = class {
|
|
|
5751
5859
|
* @returns Promise<文件名>
|
|
5752
5860
|
*/
|
|
5753
5861
|
async getFileName(filePath, timeout) {
|
|
5754
|
-
var
|
|
5862
|
+
var _a2;
|
|
5755
5863
|
const response = await this.asyncCall("getFileName", { filePath }, timeout);
|
|
5756
5864
|
if (!response.isSuccess()) {
|
|
5757
|
-
throw new Error(((
|
|
5865
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file name failed");
|
|
5758
5866
|
}
|
|
5759
5867
|
return response.data;
|
|
5760
5868
|
}
|
|
@@ -5765,10 +5873,10 @@ var FileUtils = class {
|
|
|
5765
5873
|
* @returns Promise<文件名(不含扩展名)>
|
|
5766
5874
|
*/
|
|
5767
5875
|
async getFileNameNoExtension(filePath, timeout) {
|
|
5768
|
-
var
|
|
5876
|
+
var _a2;
|
|
5769
5877
|
const response = await this.asyncCall("getFileNameNoExtension", { filePath }, timeout);
|
|
5770
5878
|
if (!response.isSuccess()) {
|
|
5771
|
-
throw new Error(((
|
|
5879
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file name no extension failed");
|
|
5772
5880
|
}
|
|
5773
5881
|
return response.data;
|
|
5774
5882
|
}
|
|
@@ -5779,10 +5887,10 @@ var FileUtils = class {
|
|
|
5779
5887
|
* @returns Promise<扩展名>
|
|
5780
5888
|
*/
|
|
5781
5889
|
async getFileExtension(filePath, timeout) {
|
|
5782
|
-
var
|
|
5890
|
+
var _a2;
|
|
5783
5891
|
const response = await this.asyncCall("getFileExtension", { filePath }, timeout);
|
|
5784
5892
|
if (!response.isSuccess()) {
|
|
5785
|
-
throw new Error(((
|
|
5893
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file extension failed");
|
|
5786
5894
|
}
|
|
5787
5895
|
return response.data;
|
|
5788
5896
|
}
|
|
@@ -5793,10 +5901,10 @@ var FileUtils = class {
|
|
|
5793
5901
|
* @returns Promise<是否成功>
|
|
5794
5902
|
*/
|
|
5795
5903
|
async notifySystemToScan(filePath, timeout) {
|
|
5796
|
-
var
|
|
5904
|
+
var _a2;
|
|
5797
5905
|
const response = await this.asyncCall("notifySystemToScan", { filePath }, timeout);
|
|
5798
5906
|
if (!response.isSuccess()) {
|
|
5799
|
-
throw new Error(((
|
|
5907
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Notify system to scan failed");
|
|
5800
5908
|
}
|
|
5801
5909
|
return response.data;
|
|
5802
5910
|
}
|
|
@@ -5807,10 +5915,10 @@ var FileUtils = class {
|
|
|
5807
5915
|
* @returns Promise<总大小(字节)>
|
|
5808
5916
|
*/
|
|
5809
5917
|
async getFsTotalSize(filePath, timeout) {
|
|
5810
|
-
var
|
|
5918
|
+
var _a2;
|
|
5811
5919
|
const response = await this.asyncCall("getFsTotalSize", { filePath }, timeout);
|
|
5812
5920
|
if (!response.isSuccess()) {
|
|
5813
|
-
throw new Error(((
|
|
5921
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file system total size failed");
|
|
5814
5922
|
}
|
|
5815
5923
|
return response.data;
|
|
5816
5924
|
}
|
|
@@ -5821,10 +5929,10 @@ var FileUtils = class {
|
|
|
5821
5929
|
* @returns Promise<可用大小(字节)>
|
|
5822
5930
|
*/
|
|
5823
5931
|
async getFsAvailableSize(filePath, timeout) {
|
|
5824
|
-
var
|
|
5932
|
+
var _a2;
|
|
5825
5933
|
const response = await this.asyncCall("getFsAvailableSize", { filePath }, timeout);
|
|
5826
5934
|
if (!response.isSuccess()) {
|
|
5827
|
-
throw new Error(((
|
|
5935
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file system available size failed");
|
|
5828
5936
|
}
|
|
5829
5937
|
return response.data;
|
|
5830
5938
|
}
|
|
@@ -5908,14 +6016,14 @@ var Ime = class {
|
|
|
5908
6016
|
* @returns Promise<执行结果>
|
|
5909
6017
|
*/
|
|
5910
6018
|
async performEditorAction(actionId = 3 /* SEARCH */, timeout) {
|
|
5911
|
-
var
|
|
6019
|
+
var _a2;
|
|
5912
6020
|
const response = await this.asyncCall(
|
|
5913
6021
|
"performEditorAction",
|
|
5914
6022
|
{ actionId },
|
|
5915
6023
|
timeout
|
|
5916
6024
|
);
|
|
5917
6025
|
if (!response.isSuccess()) {
|
|
5918
|
-
throw new Error(((
|
|
6026
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Perform editor action failed");
|
|
5919
6027
|
}
|
|
5920
6028
|
return response.data;
|
|
5921
6029
|
}
|
|
@@ -5925,14 +6033,14 @@ var Ime = class {
|
|
|
5925
6033
|
* @returns Promise<执行结果>
|
|
5926
6034
|
*/
|
|
5927
6035
|
async openInputMethodSettings(timeout) {
|
|
5928
|
-
var
|
|
6036
|
+
var _a2;
|
|
5929
6037
|
const response = await this.asyncCall(
|
|
5930
6038
|
"openInputMethodSettings",
|
|
5931
6039
|
void 0,
|
|
5932
6040
|
timeout
|
|
5933
6041
|
);
|
|
5934
6042
|
if (!response.isSuccess()) {
|
|
5935
|
-
throw new Error(((
|
|
6043
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Open input method settings failed");
|
|
5936
6044
|
}
|
|
5937
6045
|
return response.data;
|
|
5938
6046
|
}
|
|
@@ -5942,14 +6050,14 @@ var Ime = class {
|
|
|
5942
6050
|
* @returns Promise<检查结果>
|
|
5943
6051
|
*/
|
|
5944
6052
|
async isInputMethodEnabled(timeout) {
|
|
5945
|
-
var
|
|
6053
|
+
var _a2;
|
|
5946
6054
|
const response = await this.asyncCall(
|
|
5947
6055
|
"isInputMethodEnabled",
|
|
5948
6056
|
void 0,
|
|
5949
6057
|
timeout
|
|
5950
6058
|
);
|
|
5951
6059
|
if (!response.isSuccess()) {
|
|
5952
|
-
throw new Error(((
|
|
6060
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check input method enabled failed");
|
|
5953
6061
|
}
|
|
5954
6062
|
return response.data;
|
|
5955
6063
|
}
|
|
@@ -5959,14 +6067,14 @@ var Ime = class {
|
|
|
5959
6067
|
* @returns Promise<检查结果>
|
|
5960
6068
|
*/
|
|
5961
6069
|
async isCurrentInputMethod(timeout) {
|
|
5962
|
-
var
|
|
6070
|
+
var _a2;
|
|
5963
6071
|
const response = await this.asyncCall(
|
|
5964
6072
|
"isCurrentInputMethod",
|
|
5965
6073
|
void 0,
|
|
5966
6074
|
timeout
|
|
5967
6075
|
);
|
|
5968
6076
|
if (!response.isSuccess()) {
|
|
5969
|
-
throw new Error(((
|
|
6077
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check current input method failed");
|
|
5970
6078
|
}
|
|
5971
6079
|
return response.data;
|
|
5972
6080
|
}
|
|
@@ -6041,10 +6149,10 @@ var ImageUtils = class {
|
|
|
6041
6149
|
* @returns Promise<图片尺寸信息>
|
|
6042
6150
|
*/
|
|
6043
6151
|
async getSize(imagePath, timeout) {
|
|
6044
|
-
var
|
|
6152
|
+
var _a2;
|
|
6045
6153
|
const response = await this.asyncCall("getSize", { imagePath }, timeout);
|
|
6046
6154
|
if (!response.isSuccess()) {
|
|
6047
|
-
throw new Error(((
|
|
6155
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u83B7\u53D6\u56FE\u7247\u5C3A\u5BF8\u5931\u8D25");
|
|
6048
6156
|
}
|
|
6049
6157
|
return response.data;
|
|
6050
6158
|
}
|
|
@@ -6055,10 +6163,10 @@ var ImageUtils = class {
|
|
|
6055
6163
|
* @returns Promise<图片类型信息>
|
|
6056
6164
|
*/
|
|
6057
6165
|
async getImageType(imagePath, timeout) {
|
|
6058
|
-
var
|
|
6166
|
+
var _a2;
|
|
6059
6167
|
const response = await this.asyncCall("getImageType", { imagePath }, timeout);
|
|
6060
6168
|
if (!response.isSuccess()) {
|
|
6061
|
-
throw new Error(((
|
|
6169
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u83B7\u53D6\u56FE\u7247\u7C7B\u578B\u5931\u8D25");
|
|
6062
6170
|
}
|
|
6063
6171
|
return response.data;
|
|
6064
6172
|
}
|
|
@@ -6069,10 +6177,10 @@ var ImageUtils = class {
|
|
|
6069
6177
|
* @returns Promise<是否为图片>
|
|
6070
6178
|
*/
|
|
6071
6179
|
async isImage(fileName, timeout) {
|
|
6072
|
-
var
|
|
6180
|
+
var _a2;
|
|
6073
6181
|
const response = await this.asyncCall("isImage", { fileName }, timeout);
|
|
6074
6182
|
if (!response.isSuccess()) {
|
|
6075
|
-
throw new Error(((
|
|
6183
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u5224\u65AD\u662F\u5426\u4E3A\u56FE\u7247\u5931\u8D25");
|
|
6076
6184
|
}
|
|
6077
6185
|
return response.data.isImage;
|
|
6078
6186
|
}
|
|
@@ -6083,10 +6191,10 @@ var ImageUtils = class {
|
|
|
6083
6191
|
* @returns Promise<图片旋转角度信息>
|
|
6084
6192
|
*/
|
|
6085
6193
|
async getRotateDegree(imagePath, timeout) {
|
|
6086
|
-
var
|
|
6194
|
+
var _a2;
|
|
6087
6195
|
const response = await this.asyncCall("getRotateDegree", { imagePath }, timeout);
|
|
6088
6196
|
if (!response.isSuccess()) {
|
|
6089
|
-
throw new Error(((
|
|
6197
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u83B7\u53D6\u56FE\u7247\u65CB\u8F6C\u89D2\u5EA6\u5931\u8D25");
|
|
6090
6198
|
}
|
|
6091
6199
|
return response.data;
|
|
6092
6200
|
}
|
|
@@ -6103,7 +6211,7 @@ var ImageUtils = class {
|
|
|
6103
6211
|
* @returns Promise<处理后的图片路径>
|
|
6104
6212
|
*/
|
|
6105
6213
|
async scale(imagePath, options = {}) {
|
|
6106
|
-
var
|
|
6214
|
+
var _a2;
|
|
6107
6215
|
const { scaleWidth, scaleHeight, savePath, format, timeout } = options;
|
|
6108
6216
|
const response = await this.asyncCall(
|
|
6109
6217
|
"scale",
|
|
@@ -6111,7 +6219,7 @@ var ImageUtils = class {
|
|
|
6111
6219
|
timeout
|
|
6112
6220
|
);
|
|
6113
6221
|
if (!response.isSuccess()) {
|
|
6114
|
-
throw new Error(((
|
|
6222
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u7F29\u653E\u56FE\u7247\u5931\u8D25");
|
|
6115
6223
|
}
|
|
6116
6224
|
return response.data.filePath;
|
|
6117
6225
|
}
|
|
@@ -6129,7 +6237,7 @@ var ImageUtils = class {
|
|
|
6129
6237
|
* @returns Promise<处理后的图片路径>
|
|
6130
6238
|
*/
|
|
6131
6239
|
async clip(imagePath, options = {}) {
|
|
6132
|
-
var
|
|
6240
|
+
var _a2;
|
|
6133
6241
|
const { x = 0, y = 0, width, height, savePath, format, timeout } = options;
|
|
6134
6242
|
const response = await this.asyncCall(
|
|
6135
6243
|
"clip",
|
|
@@ -6137,7 +6245,7 @@ var ImageUtils = class {
|
|
|
6137
6245
|
timeout
|
|
6138
6246
|
);
|
|
6139
6247
|
if (!response.isSuccess()) {
|
|
6140
|
-
throw new Error(((
|
|
6248
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u88C1\u526A\u56FE\u7247\u5931\u8D25");
|
|
6141
6249
|
}
|
|
6142
6250
|
return response.data.filePath;
|
|
6143
6251
|
}
|
|
@@ -6155,7 +6263,7 @@ var ImageUtils = class {
|
|
|
6155
6263
|
* @returns Promise<处理后的图片路径>
|
|
6156
6264
|
*/
|
|
6157
6265
|
async skew(imagePath, options = {}) {
|
|
6158
|
-
var
|
|
6266
|
+
var _a2;
|
|
6159
6267
|
const { kx = 0, ky = 0, px, py, savePath, format, timeout } = options;
|
|
6160
6268
|
const response = await this.asyncCall(
|
|
6161
6269
|
"skew",
|
|
@@ -6163,7 +6271,7 @@ var ImageUtils = class {
|
|
|
6163
6271
|
timeout
|
|
6164
6272
|
);
|
|
6165
6273
|
if (!response.isSuccess()) {
|
|
6166
|
-
throw new Error(((
|
|
6274
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u503E\u659C\u56FE\u7247\u5931\u8D25");
|
|
6167
6275
|
}
|
|
6168
6276
|
return response.data.filePath;
|
|
6169
6277
|
}
|
|
@@ -6180,7 +6288,7 @@ var ImageUtils = class {
|
|
|
6180
6288
|
* @returns Promise<处理后的图片路径>
|
|
6181
6289
|
*/
|
|
6182
6290
|
async rotate(imagePath, options = {}) {
|
|
6183
|
-
var
|
|
6291
|
+
var _a2;
|
|
6184
6292
|
const { degree = 0, px, py, savePath, format, timeout } = options;
|
|
6185
6293
|
const response = await this.asyncCall(
|
|
6186
6294
|
"rotate",
|
|
@@ -6188,7 +6296,7 @@ var ImageUtils = class {
|
|
|
6188
6296
|
timeout
|
|
6189
6297
|
);
|
|
6190
6298
|
if (!response.isSuccess()) {
|
|
6191
|
-
throw new Error(((
|
|
6299
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u65CB\u8F6C\u56FE\u7247\u5931\u8D25");
|
|
6192
6300
|
}
|
|
6193
6301
|
return response.data.filePath;
|
|
6194
6302
|
}
|
|
@@ -6202,7 +6310,7 @@ var ImageUtils = class {
|
|
|
6202
6310
|
* @returns Promise<处理后的图片路径>
|
|
6203
6311
|
*/
|
|
6204
6312
|
async toRound(imagePath, options = {}) {
|
|
6205
|
-
var
|
|
6313
|
+
var _a2;
|
|
6206
6314
|
const { savePath, format, timeout } = options;
|
|
6207
6315
|
const response = await this.asyncCall(
|
|
6208
6316
|
"toRound",
|
|
@@ -6210,7 +6318,7 @@ var ImageUtils = class {
|
|
|
6210
6318
|
timeout
|
|
6211
6319
|
);
|
|
6212
6320
|
if (!response.isSuccess()) {
|
|
6213
|
-
throw new Error(((
|
|
6321
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u8F6C\u4E3A\u5706\u5F62\u56FE\u7247\u5931\u8D25");
|
|
6214
6322
|
}
|
|
6215
6323
|
return response.data.filePath;
|
|
6216
6324
|
}
|
|
@@ -6225,7 +6333,7 @@ var ImageUtils = class {
|
|
|
6225
6333
|
* @returns Promise<处理后的图片路径>
|
|
6226
6334
|
*/
|
|
6227
6335
|
async toRoundCorner(imagePath, options = {}) {
|
|
6228
|
-
var
|
|
6336
|
+
var _a2;
|
|
6229
6337
|
const { radius = 0, savePath, format, timeout } = options;
|
|
6230
6338
|
const response = await this.asyncCall(
|
|
6231
6339
|
"toRoundCorner",
|
|
@@ -6233,7 +6341,7 @@ var ImageUtils = class {
|
|
|
6233
6341
|
timeout
|
|
6234
6342
|
);
|
|
6235
6343
|
if (!response.isSuccess()) {
|
|
6236
|
-
throw new Error(((
|
|
6344
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u8F6C\u4E3A\u5706\u89D2\u56FE\u7247\u5931\u8D25");
|
|
6237
6345
|
}
|
|
6238
6346
|
return response.data.filePath;
|
|
6239
6347
|
}
|
|
@@ -6250,7 +6358,7 @@ var ImageUtils = class {
|
|
|
6250
6358
|
* @returns Promise<处理后的图片路径>
|
|
6251
6359
|
*/
|
|
6252
6360
|
async addCornerBorder(imagePath, options = {}) {
|
|
6253
|
-
var
|
|
6361
|
+
var _a2;
|
|
6254
6362
|
const { borderSize = 0, color = "#000000", cornerRadius = 0, savePath, format, timeout } = options;
|
|
6255
6363
|
const response = await this.asyncCall(
|
|
6256
6364
|
"addCornerBorder",
|
|
@@ -6258,7 +6366,7 @@ var ImageUtils = class {
|
|
|
6258
6366
|
timeout
|
|
6259
6367
|
);
|
|
6260
6368
|
if (!response.isSuccess()) {
|
|
6261
|
-
throw new Error(((
|
|
6369
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u5706\u89D2\u8FB9\u6846\u5931\u8D25");
|
|
6262
6370
|
}
|
|
6263
6371
|
return response.data.filePath;
|
|
6264
6372
|
}
|
|
@@ -6274,7 +6382,7 @@ var ImageUtils = class {
|
|
|
6274
6382
|
* @returns Promise<处理后的图片路径>
|
|
6275
6383
|
*/
|
|
6276
6384
|
async addCircleBorder(imagePath, options = {}) {
|
|
6277
|
-
var
|
|
6385
|
+
var _a2;
|
|
6278
6386
|
const { borderSize = 0, color = "#000000", savePath, format, timeout } = options;
|
|
6279
6387
|
const response = await this.asyncCall(
|
|
6280
6388
|
"addCircleBorder",
|
|
@@ -6282,7 +6390,7 @@ var ImageUtils = class {
|
|
|
6282
6390
|
timeout
|
|
6283
6391
|
);
|
|
6284
6392
|
if (!response.isSuccess()) {
|
|
6285
|
-
throw new Error(((
|
|
6393
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u5706\u5F62\u8FB9\u6846\u5931\u8D25");
|
|
6286
6394
|
}
|
|
6287
6395
|
return response.data.filePath;
|
|
6288
6396
|
}
|
|
@@ -6297,7 +6405,7 @@ var ImageUtils = class {
|
|
|
6297
6405
|
* @returns Promise<处理后的图片路径>
|
|
6298
6406
|
*/
|
|
6299
6407
|
async addReflection(imagePath, options = {}) {
|
|
6300
|
-
var
|
|
6408
|
+
var _a2;
|
|
6301
6409
|
const { reflectionHeight = 0, savePath, format, timeout } = options;
|
|
6302
6410
|
const response = await this.asyncCall(
|
|
6303
6411
|
"addReflection",
|
|
@@ -6305,7 +6413,7 @@ var ImageUtils = class {
|
|
|
6305
6413
|
timeout
|
|
6306
6414
|
);
|
|
6307
6415
|
if (!response.isSuccess()) {
|
|
6308
|
-
throw new Error(((
|
|
6416
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u5012\u5F71\u5931\u8D25");
|
|
6309
6417
|
}
|
|
6310
6418
|
return response.data.filePath;
|
|
6311
6419
|
}
|
|
@@ -6324,7 +6432,7 @@ var ImageUtils = class {
|
|
|
6324
6432
|
* @returns Promise<处理后的图片路径>
|
|
6325
6433
|
*/
|
|
6326
6434
|
async addTextWatermark(imagePath, options = {}) {
|
|
6327
|
-
var
|
|
6435
|
+
var _a2;
|
|
6328
6436
|
const { text = "", x = 0, y = 0, color = "#000000", size = 16, savePath, format, timeout } = options;
|
|
6329
6437
|
const response = await this.asyncCall(
|
|
6330
6438
|
"addTextWatermark",
|
|
@@ -6332,7 +6440,7 @@ var ImageUtils = class {
|
|
|
6332
6440
|
timeout
|
|
6333
6441
|
);
|
|
6334
6442
|
if (!response.isSuccess()) {
|
|
6335
|
-
throw new Error(((
|
|
6443
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u6587\u5B57\u6C34\u5370\u5931\u8D25");
|
|
6336
6444
|
}
|
|
6337
6445
|
return response.data.filePath;
|
|
6338
6446
|
}
|
|
@@ -6350,7 +6458,7 @@ var ImageUtils = class {
|
|
|
6350
6458
|
* @returns Promise<处理后的图片路径>
|
|
6351
6459
|
*/
|
|
6352
6460
|
async addImageWatermark(imagePath, options) {
|
|
6353
|
-
var
|
|
6461
|
+
var _a2;
|
|
6354
6462
|
const { watermarkPath, x = 0, y = 0, alpha = 255, savePath, format, timeout } = options;
|
|
6355
6463
|
const response = await this.asyncCall(
|
|
6356
6464
|
"addImageWatermark",
|
|
@@ -6358,7 +6466,7 @@ var ImageUtils = class {
|
|
|
6358
6466
|
timeout
|
|
6359
6467
|
);
|
|
6360
6468
|
if (!response.isSuccess()) {
|
|
6361
|
-
throw new Error(((
|
|
6469
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u56FE\u7247\u6C34\u5370\u5931\u8D25");
|
|
6362
6470
|
}
|
|
6363
6471
|
return response.data.filePath;
|
|
6364
6472
|
}
|
|
@@ -6372,7 +6480,7 @@ var ImageUtils = class {
|
|
|
6372
6480
|
* @returns Promise<处理后的图片路径>
|
|
6373
6481
|
*/
|
|
6374
6482
|
async toAlpha(imagePath, options = {}) {
|
|
6375
|
-
var
|
|
6483
|
+
var _a2;
|
|
6376
6484
|
const { savePath, format, timeout } = options;
|
|
6377
6485
|
const response = await this.asyncCall(
|
|
6378
6486
|
"toAlpha",
|
|
@@ -6380,7 +6488,7 @@ var ImageUtils = class {
|
|
|
6380
6488
|
timeout
|
|
6381
6489
|
);
|
|
6382
6490
|
if (!response.isSuccess()) {
|
|
6383
|
-
throw new Error(((
|
|
6491
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u8F6C\u4E3A alpha \u4F4D\u56FE\u5931\u8D25");
|
|
6384
6492
|
}
|
|
6385
6493
|
return response.data.filePath;
|
|
6386
6494
|
}
|
|
@@ -6394,7 +6502,7 @@ var ImageUtils = class {
|
|
|
6394
6502
|
* @returns Promise<处理后的图片路径>
|
|
6395
6503
|
*/
|
|
6396
6504
|
async toGray(imagePath, options = {}) {
|
|
6397
|
-
var
|
|
6505
|
+
var _a2;
|
|
6398
6506
|
const { savePath, format, timeout } = options;
|
|
6399
6507
|
const response = await this.asyncCall(
|
|
6400
6508
|
"toGray",
|
|
@@ -6402,7 +6510,7 @@ var ImageUtils = class {
|
|
|
6402
6510
|
timeout
|
|
6403
6511
|
);
|
|
6404
6512
|
if (!response.isSuccess()) {
|
|
6405
|
-
throw new Error(((
|
|
6513
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u8F6C\u4E3A\u7070\u5EA6\u56FE\u7247\u5931\u8D25");
|
|
6406
6514
|
}
|
|
6407
6515
|
return response.data.filePath;
|
|
6408
6516
|
}
|
|
@@ -6418,7 +6526,7 @@ var ImageUtils = class {
|
|
|
6418
6526
|
* @returns Promise<处理后的图片路径>
|
|
6419
6527
|
*/
|
|
6420
6528
|
async fastBlur(imagePath, options = {}) {
|
|
6421
|
-
var
|
|
6529
|
+
var _a2;
|
|
6422
6530
|
const { radius = 0, scale = 1, savePath, format, timeout } = options;
|
|
6423
6531
|
const response = await this.asyncCall(
|
|
6424
6532
|
"fastBlur",
|
|
@@ -6426,7 +6534,7 @@ var ImageUtils = class {
|
|
|
6426
6534
|
timeout
|
|
6427
6535
|
);
|
|
6428
6536
|
if (!response.isSuccess()) {
|
|
6429
|
-
throw new Error(((
|
|
6537
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u5FEB\u901F\u6A21\u7CCA\u5931\u8D25");
|
|
6430
6538
|
}
|
|
6431
6539
|
return response.data.filePath;
|
|
6432
6540
|
}
|
|
@@ -6441,7 +6549,7 @@ var ImageUtils = class {
|
|
|
6441
6549
|
* @returns Promise<处理后的图片路径>
|
|
6442
6550
|
*/
|
|
6443
6551
|
async renderScriptBlur(imagePath, options = {}) {
|
|
6444
|
-
var
|
|
6552
|
+
var _a2;
|
|
6445
6553
|
const { radius = 0, savePath, format, timeout } = options;
|
|
6446
6554
|
const response = await this.asyncCall(
|
|
6447
6555
|
"renderScriptBlur",
|
|
@@ -6449,7 +6557,7 @@ var ImageUtils = class {
|
|
|
6449
6557
|
timeout
|
|
6450
6558
|
);
|
|
6451
6559
|
if (!response.isSuccess()) {
|
|
6452
|
-
throw new Error(((
|
|
6560
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "RenderScript \u6A21\u7CCA\u5931\u8D25");
|
|
6453
6561
|
}
|
|
6454
6562
|
return response.data.filePath;
|
|
6455
6563
|
}
|
|
@@ -6464,7 +6572,7 @@ var ImageUtils = class {
|
|
|
6464
6572
|
* @returns Promise<处理后的图片路径>
|
|
6465
6573
|
*/
|
|
6466
6574
|
async stackBlur(imagePath, options = {}) {
|
|
6467
|
-
var
|
|
6575
|
+
var _a2;
|
|
6468
6576
|
const { radius = 0, savePath, format, timeout } = options;
|
|
6469
6577
|
const response = await this.asyncCall(
|
|
6470
6578
|
"stackBlur",
|
|
@@ -6472,7 +6580,7 @@ var ImageUtils = class {
|
|
|
6472
6580
|
timeout
|
|
6473
6581
|
);
|
|
6474
6582
|
if (!response.isSuccess()) {
|
|
6475
|
-
throw new Error(((
|
|
6583
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Stack \u6A21\u7CCA\u5931\u8D25");
|
|
6476
6584
|
}
|
|
6477
6585
|
return response.data.filePath;
|
|
6478
6586
|
}
|
|
@@ -6489,7 +6597,7 @@ var ImageUtils = class {
|
|
|
6489
6597
|
* @returns Promise<压缩后的图片路径>
|
|
6490
6598
|
*/
|
|
6491
6599
|
async compressByScale(imagePath, options = {}) {
|
|
6492
|
-
var
|
|
6600
|
+
var _a2;
|
|
6493
6601
|
const { scaleWidth, scaleHeight, savePath, format, timeout } = options;
|
|
6494
6602
|
const response = await this.asyncCall(
|
|
6495
6603
|
"compressByScale",
|
|
@@ -6497,7 +6605,7 @@ var ImageUtils = class {
|
|
|
6497
6605
|
timeout
|
|
6498
6606
|
);
|
|
6499
6607
|
if (!response.isSuccess()) {
|
|
6500
|
-
throw new Error(((
|
|
6608
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6309\u7F29\u653E\u538B\u7F29\u5931\u8D25");
|
|
6501
6609
|
}
|
|
6502
6610
|
return response.data.filePath;
|
|
6503
6611
|
}
|
|
@@ -6512,7 +6620,7 @@ var ImageUtils = class {
|
|
|
6512
6620
|
* @returns Promise<压缩后的图片路径>
|
|
6513
6621
|
*/
|
|
6514
6622
|
async compressByQuality(imagePath, options = {}) {
|
|
6515
|
-
var
|
|
6623
|
+
var _a2;
|
|
6516
6624
|
const { quality = 100, format = "JPEG", savePath, timeout } = options;
|
|
6517
6625
|
const response = await this.asyncCall(
|
|
6518
6626
|
"compressByQuality",
|
|
@@ -6520,7 +6628,7 @@ var ImageUtils = class {
|
|
|
6520
6628
|
timeout
|
|
6521
6629
|
);
|
|
6522
6630
|
if (!response.isSuccess()) {
|
|
6523
|
-
throw new Error(((
|
|
6631
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6309\u8D28\u91CF\u538B\u7F29\u5931\u8D25");
|
|
6524
6632
|
}
|
|
6525
6633
|
return response.data.filePath;
|
|
6526
6634
|
}
|
|
@@ -6535,7 +6643,7 @@ var ImageUtils = class {
|
|
|
6535
6643
|
* @returns Promise<压缩后的图片路径>
|
|
6536
6644
|
*/
|
|
6537
6645
|
async compressBySampleSize(imagePath, options = {}) {
|
|
6538
|
-
var
|
|
6646
|
+
var _a2;
|
|
6539
6647
|
const { sampleSize = 1, savePath, format, timeout } = options;
|
|
6540
6648
|
const response = await this.asyncCall(
|
|
6541
6649
|
"compressBySampleSize",
|
|
@@ -6543,7 +6651,7 @@ var ImageUtils = class {
|
|
|
6543
6651
|
timeout
|
|
6544
6652
|
);
|
|
6545
6653
|
if (!response.isSuccess()) {
|
|
6546
|
-
throw new Error(((
|
|
6654
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6309\u91C7\u6837\u5927\u5C0F\u538B\u7F29\u5931\u8D25");
|
|
6547
6655
|
}
|
|
6548
6656
|
return response.data.filePath;
|
|
6549
6657
|
}
|
|
@@ -6558,7 +6666,7 @@ var ImageUtils = class {
|
|
|
6558
6666
|
* @returns Promise<保存结果>
|
|
6559
6667
|
*/
|
|
6560
6668
|
async save(imagePath, options = {}) {
|
|
6561
|
-
var
|
|
6669
|
+
var _a2;
|
|
6562
6670
|
const { savePath, format = "PNG", timeout } = options;
|
|
6563
6671
|
const response = await this.asyncCall(
|
|
6564
6672
|
"save",
|
|
@@ -6566,7 +6674,7 @@ var ImageUtils = class {
|
|
|
6566
6674
|
timeout
|
|
6567
6675
|
);
|
|
6568
6676
|
if (!response.isSuccess()) {
|
|
6569
|
-
throw new Error(((
|
|
6677
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u4FDD\u5B58\u56FE\u7247\u5931\u8D25");
|
|
6570
6678
|
}
|
|
6571
6679
|
return response.data;
|
|
6572
6680
|
}
|
|
@@ -6580,7 +6688,7 @@ var ImageUtils = class {
|
|
|
6580
6688
|
* @returns Promise<保存结果>
|
|
6581
6689
|
*/
|
|
6582
6690
|
async save2Album(imagePath, options = {}) {
|
|
6583
|
-
var
|
|
6691
|
+
var _a2;
|
|
6584
6692
|
const { fileName, format = "PNG", timeout } = options;
|
|
6585
6693
|
const response = await this.asyncCall(
|
|
6586
6694
|
"save2Album",
|
|
@@ -6588,7 +6696,7 @@ var ImageUtils = class {
|
|
|
6588
6696
|
timeout
|
|
6589
6697
|
);
|
|
6590
6698
|
if (!response.isSuccess()) {
|
|
6591
|
-
throw new Error(((
|
|
6699
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u4FDD\u5B58\u56FE\u7247\u5230\u76F8\u518C\u5931\u8D25");
|
|
6592
6700
|
}
|
|
6593
6701
|
return response.data;
|
|
6594
6702
|
}
|
|
@@ -6663,7 +6771,7 @@ var Gallery = class {
|
|
|
6663
6771
|
* @returns Promise<相册操作响应>
|
|
6664
6772
|
*/
|
|
6665
6773
|
async addImageToGallery(filePath, displayName, timeout) {
|
|
6666
|
-
var
|
|
6774
|
+
var _a2;
|
|
6667
6775
|
if (!filePath) {
|
|
6668
6776
|
throw new Error("filePath\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A");
|
|
6669
6777
|
}
|
|
@@ -6673,7 +6781,7 @@ var Gallery = class {
|
|
|
6673
6781
|
timeout
|
|
6674
6782
|
);
|
|
6675
6783
|
if (!response.isSuccess()) {
|
|
6676
|
-
throw new Error(((
|
|
6784
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u56FE\u7247\u5230\u76F8\u518C\u5931\u8D25");
|
|
6677
6785
|
}
|
|
6678
6786
|
return response.data;
|
|
6679
6787
|
}
|
|
@@ -6685,7 +6793,7 @@ var Gallery = class {
|
|
|
6685
6793
|
* @returns Promise<相册操作响应>
|
|
6686
6794
|
*/
|
|
6687
6795
|
async addVideoToGallery(filePath, displayName, timeout) {
|
|
6688
|
-
var
|
|
6796
|
+
var _a2;
|
|
6689
6797
|
if (!filePath) {
|
|
6690
6798
|
throw new Error("filePath\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A");
|
|
6691
6799
|
}
|
|
@@ -6695,7 +6803,7 @@ var Gallery = class {
|
|
|
6695
6803
|
timeout
|
|
6696
6804
|
);
|
|
6697
6805
|
if (!response.isSuccess()) {
|
|
6698
|
-
throw new Error(((
|
|
6806
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u89C6\u9891\u5230\u76F8\u518C\u5931\u8D25");
|
|
6699
6807
|
}
|
|
6700
6808
|
return response.data;
|
|
6701
6809
|
}
|
|
@@ -6706,7 +6814,7 @@ var Gallery = class {
|
|
|
6706
6814
|
* @returns Promise<删除响应>
|
|
6707
6815
|
*/
|
|
6708
6816
|
async deleteFromGalleryByUri(uri, timeout) {
|
|
6709
|
-
var
|
|
6817
|
+
var _a2;
|
|
6710
6818
|
if (!uri) {
|
|
6711
6819
|
throw new Error("uri\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A");
|
|
6712
6820
|
}
|
|
@@ -6716,7 +6824,7 @@ var Gallery = class {
|
|
|
6716
6824
|
timeout
|
|
6717
6825
|
);
|
|
6718
6826
|
if (!response.isSuccess()) {
|
|
6719
|
-
throw new Error(((
|
|
6827
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u4ECE\u76F8\u518C\u5220\u9664\u5931\u8D25");
|
|
6720
6828
|
}
|
|
6721
6829
|
return response.data;
|
|
6722
6830
|
}
|
|
@@ -6728,7 +6836,7 @@ var Gallery = class {
|
|
|
6728
6836
|
* @returns Promise<删除响应>
|
|
6729
6837
|
*/
|
|
6730
6838
|
async deleteFromGalleryById(id, type, timeout) {
|
|
6731
|
-
var
|
|
6839
|
+
var _a2;
|
|
6732
6840
|
if (id === void 0 || id === null) {
|
|
6733
6841
|
throw new Error("id\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A");
|
|
6734
6842
|
}
|
|
@@ -6741,7 +6849,7 @@ var Gallery = class {
|
|
|
6741
6849
|
timeout
|
|
6742
6850
|
);
|
|
6743
6851
|
if (!response.isSuccess()) {
|
|
6744
|
-
throw new Error(((
|
|
6852
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u4ECE\u76F8\u518C\u5220\u9664\u5931\u8D25");
|
|
6745
6853
|
}
|
|
6746
6854
|
return response.data;
|
|
6747
6855
|
}
|
|
@@ -6839,7 +6947,7 @@ var Mlkit = class {
|
|
|
6839
6947
|
* @returns Promise<识别结果>
|
|
6840
6948
|
*/
|
|
6841
6949
|
async findPhrasePositions(targetText, options = {}) {
|
|
6842
|
-
var
|
|
6950
|
+
var _a2;
|
|
6843
6951
|
if (!targetText || targetText.trim() === "") {
|
|
6844
6952
|
throw new Error("targetText cannot be empty");
|
|
6845
6953
|
}
|
|
@@ -6863,7 +6971,7 @@ var Mlkit = class {
|
|
|
6863
6971
|
timeout
|
|
6864
6972
|
);
|
|
6865
6973
|
if (!response.isSuccess()) {
|
|
6866
|
-
throw new Error(((
|
|
6974
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Recognition failed");
|
|
6867
6975
|
}
|
|
6868
6976
|
return response.data;
|
|
6869
6977
|
}
|
|
@@ -6873,7 +6981,7 @@ var Mlkit = class {
|
|
|
6873
6981
|
* @returns Promise<识别结果>
|
|
6874
6982
|
*/
|
|
6875
6983
|
async getScreenTextPositions(options = {}) {
|
|
6876
|
-
var
|
|
6984
|
+
var _a2;
|
|
6877
6985
|
const {
|
|
6878
6986
|
region,
|
|
6879
6987
|
rotationDegrees = 0,
|
|
@@ -6893,7 +7001,7 @@ var Mlkit = class {
|
|
|
6893
7001
|
timeout
|
|
6894
7002
|
);
|
|
6895
7003
|
if (!response.isSuccess()) {
|
|
6896
|
-
throw new Error(((
|
|
7004
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Recognition failed");
|
|
6897
7005
|
}
|
|
6898
7006
|
return response.data;
|
|
6899
7007
|
}
|
|
@@ -6904,7 +7012,7 @@ var Mlkit = class {
|
|
|
6904
7012
|
* @returns Promise<JSON 字符串结果>
|
|
6905
7013
|
*/
|
|
6906
7014
|
async findPhrasePositionsOnScreenAsJson(targetText, options = {}) {
|
|
6907
|
-
var
|
|
7015
|
+
var _a2;
|
|
6908
7016
|
if (!targetText || targetText.trim() === "") {
|
|
6909
7017
|
throw new Error("targetText cannot be empty");
|
|
6910
7018
|
}
|
|
@@ -6928,7 +7036,7 @@ var Mlkit = class {
|
|
|
6928
7036
|
timeout
|
|
6929
7037
|
);
|
|
6930
7038
|
if (!response.isSuccess()) {
|
|
6931
|
-
throw new Error(((
|
|
7039
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Recognition failed");
|
|
6932
7040
|
}
|
|
6933
7041
|
const data = response.data;
|
|
6934
7042
|
return data.jsonResult;
|
|
@@ -6939,7 +7047,7 @@ var Mlkit = class {
|
|
|
6939
7047
|
* @returns Promise<JSON 字符串结果>
|
|
6940
7048
|
*/
|
|
6941
7049
|
async getScreenTextPositionsAsJson(options = {}) {
|
|
6942
|
-
var
|
|
7050
|
+
var _a2;
|
|
6943
7051
|
const {
|
|
6944
7052
|
region,
|
|
6945
7053
|
rotationDegrees = 0,
|
|
@@ -6959,7 +7067,7 @@ var Mlkit = class {
|
|
|
6959
7067
|
timeout
|
|
6960
7068
|
);
|
|
6961
7069
|
if (!response.isSuccess()) {
|
|
6962
|
-
throw new Error(((
|
|
7070
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Recognition failed");
|
|
6963
7071
|
}
|
|
6964
7072
|
const data = response.data;
|
|
6965
7073
|
return data.jsonResult;
|
|
@@ -7126,10 +7234,10 @@ var BarUtils = class {
|
|
|
7126
7234
|
}
|
|
7127
7235
|
/** Set status bar color. color: Android color int (e.g. 0xff0000). isDecor: whether to apply to decor. */
|
|
7128
7236
|
async setStatusBarColor(color, options, timeout) {
|
|
7129
|
-
var
|
|
7237
|
+
var _a2;
|
|
7130
7238
|
const res = await this.asyncCall(
|
|
7131
7239
|
BarUtilsCallMethod.setStatusBarColor,
|
|
7132
|
-
{ color, isDecor: (
|
|
7240
|
+
{ color, isDecor: (_a2 = options == null ? void 0 : options.isDecor) != null ? _a2 : false },
|
|
7133
7241
|
timeout
|
|
7134
7242
|
);
|
|
7135
7243
|
if (!res.isSuccess()) {
|
|
@@ -7594,28 +7702,28 @@ var Log = class {
|
|
|
7594
7702
|
}
|
|
7595
7703
|
/** 读取当前日志全文 */
|
|
7596
7704
|
async readAllText(timeout) {
|
|
7597
|
-
var
|
|
7705
|
+
var _a2;
|
|
7598
7706
|
const res = await this.asyncCall(
|
|
7599
7707
|
LogCallMethod.readAllText,
|
|
7600
7708
|
void 0,
|
|
7601
7709
|
timeout
|
|
7602
7710
|
);
|
|
7603
7711
|
const d = res.getDataOrNull();
|
|
7604
|
-
return (
|
|
7712
|
+
return (_a2 = d == null ? void 0 : d.text) != null ? _a2 : "";
|
|
7605
7713
|
}
|
|
7606
7714
|
/**
|
|
7607
7715
|
* 获取日志服务当前域名(origin,无路径;与上传、管理后台同源)。
|
|
7608
7716
|
* 与 Kotlin getLogServiceBaseUrl / adminWebBaseUrl 对齐。
|
|
7609
7717
|
*/
|
|
7610
7718
|
async getLogServiceBaseUrl(timeout) {
|
|
7611
|
-
var
|
|
7719
|
+
var _a2;
|
|
7612
7720
|
const res = await this.asyncCall(
|
|
7613
7721
|
LogCallMethod.getLogServiceBaseUrl,
|
|
7614
7722
|
void 0,
|
|
7615
7723
|
timeout
|
|
7616
7724
|
);
|
|
7617
7725
|
const d = res.getDataOrNull();
|
|
7618
|
-
return (
|
|
7726
|
+
return (_a2 = d == null ? void 0 : d.baseUrl) != null ? _a2 : "";
|
|
7619
7727
|
}
|
|
7620
7728
|
/** 清空日志 */
|
|
7621
7729
|
async clear(timeout) {
|
|
@@ -7657,6 +7765,17 @@ var Log = class {
|
|
|
7657
7765
|
);
|
|
7658
7766
|
return res.isSuccess();
|
|
7659
7767
|
}
|
|
7768
|
+
/**
|
|
7769
|
+
* 追加日志(appendTimestampedEntry / appendLine 简写)。
|
|
7770
|
+
* 默认带时间戳;`timestamped: false` 时走 appendLine。
|
|
7771
|
+
*/
|
|
7772
|
+
async append(text, options) {
|
|
7773
|
+
const { timestamped = true, maxLength, timeout } = options != null ? options : {};
|
|
7774
|
+
if (timestamped) {
|
|
7775
|
+
return this.appendTimestampedEntry(text, timeout);
|
|
7776
|
+
}
|
|
7777
|
+
return this.appendLine(text, maxLength, timeout);
|
|
7778
|
+
}
|
|
7660
7779
|
/** 替换全部内容 */
|
|
7661
7780
|
async replaceAll(content, timeout) {
|
|
7662
7781
|
const res = await this.asyncCall(
|
|
@@ -7671,10 +7790,10 @@ var Log = class {
|
|
|
7671
7790
|
* resolve 后请保留 dispose 或调用 unsubscribe(subscriptionId) 以释放原生协程与 JS 回调。
|
|
7672
7791
|
*/
|
|
7673
7792
|
async subscribe(stream, onUpdate, options) {
|
|
7674
|
-
var
|
|
7793
|
+
var _a2;
|
|
7675
7794
|
const self = this;
|
|
7676
7795
|
const callbackId = generateUUID();
|
|
7677
|
-
const timeoutSec = (
|
|
7796
|
+
const timeoutSec = (_a2 = options == null ? void 0 : options.timeout) != null ? _a2 : 30;
|
|
7678
7797
|
return new Promise((resolve, reject) => {
|
|
7679
7798
|
let settled = false;
|
|
7680
7799
|
const timer = setTimeout(() => {
|
|
@@ -7685,7 +7804,7 @@ var Log = class {
|
|
|
7685
7804
|
}
|
|
7686
7805
|
}, timeoutSec * 1e3);
|
|
7687
7806
|
streamHandlers.set(callbackId, (raw) => {
|
|
7688
|
-
var
|
|
7807
|
+
var _a3, _b, _c;
|
|
7689
7808
|
let response;
|
|
7690
7809
|
try {
|
|
7691
7810
|
response = JSON.parse(raw);
|
|
@@ -7701,7 +7820,7 @@ var Log = class {
|
|
|
7701
7820
|
streamHandlers.delete(callbackId);
|
|
7702
7821
|
reject(
|
|
7703
7822
|
new Error(
|
|
7704
|
-
(
|
|
7823
|
+
(_a3 = response.message) != null ? _a3 : "Log subscribe failed"
|
|
7705
7824
|
)
|
|
7706
7825
|
);
|
|
7707
7826
|
}
|
|
@@ -7847,6 +7966,8 @@ export {
|
|
|
7847
7966
|
LogStream,
|
|
7848
7967
|
Mlkit,
|
|
7849
7968
|
MlkitCallMethod,
|
|
7969
|
+
NODE_LOOKUP_SCOPE_ACTIVE_WINDOW,
|
|
7970
|
+
NODE_LOOKUP_SCOPE_ALL_WINDOWS,
|
|
7850
7971
|
Node,
|
|
7851
7972
|
NodeAsync,
|
|
7852
7973
|
NodeClassValue,
|
|
@@ -7860,6 +7981,7 @@ export {
|
|
|
7860
7981
|
barUtils,
|
|
7861
7982
|
callbacks,
|
|
7862
7983
|
decodeBase64UTF8,
|
|
7984
|
+
ensureAssistsXPinia,
|
|
7863
7985
|
fileIO,
|
|
7864
7986
|
fileUtils,
|
|
7865
7987
|
float,
|