assistsx-js 0.2.0 → 0.2.2
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 +8 -6
- package/dist/index.cjs +439 -356
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +103 -32
- package/dist/index.d.ts +103 -32
- package/dist/index.global.js +9 -13
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +437 -356
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/assistsx-async.ts +83 -8
- package/src/assistsx.ts +54 -11
- package/src/index.ts +1 -0
- package/src/node-lookup-scope.ts +10 -0
- package/src/step-async.ts +71 -9
- package/src/step.ts +45 -13
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
|
});
|
|
@@ -1445,14 +1477,16 @@ var StepAsync = class {
|
|
|
1445
1477
|
filterClass,
|
|
1446
1478
|
filterViewId,
|
|
1447
1479
|
filterDes,
|
|
1448
|
-
filterText
|
|
1480
|
+
filterText,
|
|
1481
|
+
scope
|
|
1449
1482
|
} = {}) {
|
|
1450
1483
|
Step.assert(this.step.stepId);
|
|
1451
1484
|
const nodes = await AssistsXAsync.getAllNodes({
|
|
1452
1485
|
filterClass,
|
|
1453
1486
|
filterViewId,
|
|
1454
1487
|
filterDes,
|
|
1455
|
-
filterText
|
|
1488
|
+
filterText,
|
|
1489
|
+
scope
|
|
1456
1490
|
});
|
|
1457
1491
|
Step.assert(this.step.stepId);
|
|
1458
1492
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
@@ -1469,13 +1503,9 @@ var StepAsync = class {
|
|
|
1469
1503
|
Step.assert(this.step.stepId);
|
|
1470
1504
|
return result;
|
|
1471
1505
|
}
|
|
1472
|
-
|
|
1473
|
-
* 获取当前应用包名
|
|
1474
|
-
* @returns 包名
|
|
1475
|
-
*/
|
|
1476
|
-
async getPackageName() {
|
|
1506
|
+
async getPackageName(timeoutOrOptions) {
|
|
1477
1507
|
Step.assert(this.step.stepId);
|
|
1478
|
-
const result = await AssistsXAsync.getPackageName();
|
|
1508
|
+
const result = typeof timeoutOrOptions === "number" ? await AssistsXAsync.getPackageName(timeoutOrOptions) : await AssistsXAsync.getPackageName(timeoutOrOptions != null ? timeoutOrOptions : {});
|
|
1479
1509
|
Step.assert(this.step.stepId);
|
|
1480
1510
|
return result;
|
|
1481
1511
|
}
|
|
@@ -1490,13 +1520,15 @@ var StepAsync = class {
|
|
|
1490
1520
|
async findById(id, {
|
|
1491
1521
|
filterClass,
|
|
1492
1522
|
filterText,
|
|
1493
|
-
filterDes
|
|
1523
|
+
filterDes,
|
|
1524
|
+
scope
|
|
1494
1525
|
} = {}) {
|
|
1495
1526
|
Step.assert(this.step.stepId);
|
|
1496
1527
|
const nodes = await AssistsXAsync.findById(id, {
|
|
1497
1528
|
filterClass,
|
|
1498
1529
|
filterText,
|
|
1499
|
-
filterDes
|
|
1530
|
+
filterDes,
|
|
1531
|
+
scope
|
|
1500
1532
|
});
|
|
1501
1533
|
Step.assert(this.step.stepId);
|
|
1502
1534
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
@@ -1513,13 +1545,15 @@ var StepAsync = class {
|
|
|
1513
1545
|
async findByText(text, {
|
|
1514
1546
|
filterClass,
|
|
1515
1547
|
filterViewId,
|
|
1516
|
-
filterDes
|
|
1548
|
+
filterDes,
|
|
1549
|
+
scope
|
|
1517
1550
|
} = {}) {
|
|
1518
1551
|
Step.assert(this.step.stepId);
|
|
1519
1552
|
const nodes = await AssistsXAsync.findByText(text, {
|
|
1520
1553
|
filterClass,
|
|
1521
1554
|
filterViewId,
|
|
1522
|
-
filterDes
|
|
1555
|
+
filterDes,
|
|
1556
|
+
scope
|
|
1523
1557
|
});
|
|
1524
1558
|
Step.assert(this.step.stepId);
|
|
1525
1559
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
@@ -1536,26 +1570,23 @@ var StepAsync = class {
|
|
|
1536
1570
|
async findByTags(className, {
|
|
1537
1571
|
filterText,
|
|
1538
1572
|
filterViewId,
|
|
1539
|
-
filterDes
|
|
1573
|
+
filterDes,
|
|
1574
|
+
scope
|
|
1540
1575
|
} = {}) {
|
|
1541
1576
|
Step.assert(this.step.stepId);
|
|
1542
1577
|
const nodes = await AssistsXAsync.findByTags(className, {
|
|
1543
1578
|
filterText,
|
|
1544
1579
|
filterViewId,
|
|
1545
|
-
filterDes
|
|
1580
|
+
filterDes,
|
|
1581
|
+
scope
|
|
1546
1582
|
});
|
|
1547
1583
|
Step.assert(this.step.stepId);
|
|
1548
1584
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
1549
1585
|
return nodes;
|
|
1550
1586
|
}
|
|
1551
|
-
|
|
1552
|
-
* 查找所有匹配文本的节点
|
|
1553
|
-
* @param text 要查找的文本
|
|
1554
|
-
* @returns 节点数组
|
|
1555
|
-
*/
|
|
1556
|
-
async findByTextAllMatch(text) {
|
|
1587
|
+
async findByTextAllMatch(text, timeoutOrOptions) {
|
|
1557
1588
|
Step.assert(this.step.stepId);
|
|
1558
|
-
const nodes = await AssistsXAsync.findByTextAllMatch(text);
|
|
1589
|
+
const nodes = typeof timeoutOrOptions === "number" ? await AssistsXAsync.findByTextAllMatch(text, timeoutOrOptions) : timeoutOrOptions !== void 0 ? await AssistsXAsync.findByTextAllMatch(text, timeoutOrOptions) : await AssistsXAsync.findByTextAllMatch(text);
|
|
1559
1590
|
Step.assert(this.step.stepId);
|
|
1560
1591
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
1561
1592
|
return nodes;
|
|
@@ -1719,7 +1750,7 @@ var _Step = class _Step {
|
|
|
1719
1750
|
*/
|
|
1720
1751
|
this.repeatCount = 0;
|
|
1721
1752
|
/**
|
|
1722
|
-
*
|
|
1753
|
+
* 步骤重复执行最大次数,默认15次
|
|
1723
1754
|
*/
|
|
1724
1755
|
this.repeatCountMax = _Step.repeatCountMaxDefault;
|
|
1725
1756
|
/**
|
|
@@ -1758,7 +1789,7 @@ var _Step = class _Step {
|
|
|
1758
1789
|
delayMs = _Step.delayMsDefault,
|
|
1759
1790
|
exceptionRetryCountMax = _Step.exceptionRetryCountMaxDefault
|
|
1760
1791
|
} = {}) {
|
|
1761
|
-
var
|
|
1792
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
1762
1793
|
this.exception = void 0;
|
|
1763
1794
|
const stepStore = useStepStore();
|
|
1764
1795
|
let implnName = impl.name;
|
|
@@ -1796,7 +1827,7 @@ var _Step = class _Step {
|
|
|
1796
1827
|
await currentStep.delay(currentStep.delayMs);
|
|
1797
1828
|
_Step.assert(currentStep.stepId);
|
|
1798
1829
|
}
|
|
1799
|
-
implnName = (_b = (
|
|
1830
|
+
implnName = (_b = (_a2 = currentStep.impl) == null ? void 0 : _a2.name) != null ? _b : "undefined";
|
|
1800
1831
|
if (_Step.showLog) {
|
|
1801
1832
|
console.log(
|
|
1802
1833
|
`\u6267\u884C\u6B65\u9AA4${implnName}\uFF0C\u91CD\u590D\u6B21\u6570${currentStep.repeatCount}`
|
|
@@ -1839,7 +1870,7 @@ var _Step = class _Step {
|
|
|
1839
1870
|
} else {
|
|
1840
1871
|
nextStep = await ((_e = currentStep.impl) == null ? void 0 : _e.call(currentStep, currentStep));
|
|
1841
1872
|
}
|
|
1842
|
-
if (currentStep.repeatCountMax
|
|
1873
|
+
if (currentStep.repeatCountMax > _Step.repeatCountInfinite && currentStep.repeatCount >= currentStep.repeatCountMax) {
|
|
1843
1874
|
if (_Step.showLog) {
|
|
1844
1875
|
console.log(
|
|
1845
1876
|
`\u91CD\u590D\u6B21\u6570${currentStep.repeatCount}\u8D85\u8FC7\u6700\u5927\u6B21\u6570${currentStep.repeatCountMax}\uFF0C\u505C\u6B62\u6267\u884C`
|
|
@@ -2033,13 +2064,13 @@ var _Step = class _Step {
|
|
|
2033
2064
|
repeatCountMax = _Step.repeatCountMaxDefault,
|
|
2034
2065
|
exceptionRetryCountMax = _Step.exceptionRetryCountMaxDefault
|
|
2035
2066
|
} = {}) {
|
|
2036
|
-
var
|
|
2067
|
+
var _a2;
|
|
2037
2068
|
_Step.assert(this.stepId);
|
|
2038
2069
|
return new _Step({
|
|
2039
2070
|
stepId: this.stepId,
|
|
2040
2071
|
impl,
|
|
2041
2072
|
tag,
|
|
2042
|
-
data: (
|
|
2073
|
+
data: (_a2 = data != null ? data : this.data) != null ? _a2 : {},
|
|
2043
2074
|
delayMs,
|
|
2044
2075
|
repeatCountMax,
|
|
2045
2076
|
exceptionRetryCountMax
|
|
@@ -2052,13 +2083,13 @@ var _Step = class _Step {
|
|
|
2052
2083
|
repeatCountMax = _Step.repeatCountMaxDefault,
|
|
2053
2084
|
exceptionRetryCountMax = _Step.exceptionRetryCountMaxDefault
|
|
2054
2085
|
} = {}) {
|
|
2055
|
-
var
|
|
2086
|
+
var _a2;
|
|
2056
2087
|
_Step.assert(this.stepId);
|
|
2057
2088
|
return new _Step({
|
|
2058
2089
|
stepId: this.stepId,
|
|
2059
2090
|
impl: void 0,
|
|
2060
2091
|
tag,
|
|
2061
|
-
data: (
|
|
2092
|
+
data: (_a2 = data != null ? data : this.data) != null ? _a2 : {},
|
|
2062
2093
|
delayMs,
|
|
2063
2094
|
repeatCountMax,
|
|
2064
2095
|
exceptionRetryCountMax,
|
|
@@ -2076,7 +2107,7 @@ var _Step = class _Step {
|
|
|
2076
2107
|
repeat({
|
|
2077
2108
|
stepId = this.stepId,
|
|
2078
2109
|
tag = this.tag,
|
|
2079
|
-
data = ((
|
|
2110
|
+
data = ((_a2) => (_a2 = this.data) != null ? _a2 : {})(),
|
|
2080
2111
|
delayMs = this.delayMs,
|
|
2081
2112
|
repeatCountMax = this.repeatCountMax,
|
|
2082
2113
|
exceptionRetryCountMax = this.exceptionRetryCountMax
|
|
@@ -2160,14 +2191,16 @@ var _Step = class _Step {
|
|
|
2160
2191
|
filterClass,
|
|
2161
2192
|
filterViewId,
|
|
2162
2193
|
filterDes,
|
|
2163
|
-
filterText
|
|
2194
|
+
filterText,
|
|
2195
|
+
scope
|
|
2164
2196
|
} = {}) {
|
|
2165
2197
|
_Step.assert(this.stepId);
|
|
2166
2198
|
const nodes = AssistsX2.getAllNodes({
|
|
2167
2199
|
filterClass,
|
|
2168
2200
|
filterViewId,
|
|
2169
2201
|
filterDes,
|
|
2170
|
-
filterText
|
|
2202
|
+
filterText,
|
|
2203
|
+
scope
|
|
2171
2204
|
});
|
|
2172
2205
|
_Step.assert(this.stepId);
|
|
2173
2206
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
@@ -2186,11 +2219,11 @@ var _Step = class _Step {
|
|
|
2186
2219
|
}
|
|
2187
2220
|
/**
|
|
2188
2221
|
* 获取当前应用包名
|
|
2189
|
-
* @
|
|
2222
|
+
* @param options.scope 节点查找范围(可选)
|
|
2190
2223
|
*/
|
|
2191
|
-
getPackageName() {
|
|
2224
|
+
getPackageName(options = {}) {
|
|
2192
2225
|
_Step.assert(this.stepId);
|
|
2193
|
-
const result = AssistsX2.getPackageName();
|
|
2226
|
+
const result = AssistsX2.getPackageName(options);
|
|
2194
2227
|
_Step.assert(this.stepId);
|
|
2195
2228
|
return result;
|
|
2196
2229
|
}
|
|
@@ -2205,10 +2238,16 @@ var _Step = class _Step {
|
|
|
2205
2238
|
findById(id, {
|
|
2206
2239
|
filterClass,
|
|
2207
2240
|
filterText,
|
|
2208
|
-
filterDes
|
|
2241
|
+
filterDes,
|
|
2242
|
+
scope
|
|
2209
2243
|
} = {}) {
|
|
2210
2244
|
_Step.assert(this.stepId);
|
|
2211
|
-
const nodes = AssistsX2.findById(id, {
|
|
2245
|
+
const nodes = AssistsX2.findById(id, {
|
|
2246
|
+
filterClass,
|
|
2247
|
+
filterText,
|
|
2248
|
+
filterDes,
|
|
2249
|
+
scope
|
|
2250
|
+
});
|
|
2212
2251
|
_Step.assert(this.stepId);
|
|
2213
2252
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
2214
2253
|
return nodes;
|
|
@@ -2224,13 +2263,15 @@ var _Step = class _Step {
|
|
|
2224
2263
|
findByText(text, {
|
|
2225
2264
|
filterClass,
|
|
2226
2265
|
filterViewId,
|
|
2227
|
-
filterDes
|
|
2266
|
+
filterDes,
|
|
2267
|
+
scope
|
|
2228
2268
|
} = {}) {
|
|
2229
2269
|
_Step.assert(this.stepId);
|
|
2230
2270
|
const nodes = AssistsX2.findByText(text, {
|
|
2231
2271
|
filterClass,
|
|
2232
2272
|
filterViewId,
|
|
2233
|
-
filterDes
|
|
2273
|
+
filterDes,
|
|
2274
|
+
scope
|
|
2234
2275
|
});
|
|
2235
2276
|
_Step.assert(this.stepId);
|
|
2236
2277
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
@@ -2247,13 +2288,15 @@ var _Step = class _Step {
|
|
|
2247
2288
|
findByTags(className, {
|
|
2248
2289
|
filterText,
|
|
2249
2290
|
filterViewId,
|
|
2250
|
-
filterDes
|
|
2291
|
+
filterDes,
|
|
2292
|
+
scope
|
|
2251
2293
|
} = {}) {
|
|
2252
2294
|
_Step.assert(this.stepId);
|
|
2253
2295
|
const nodes = AssistsX2.findByTags(className, {
|
|
2254
2296
|
filterText,
|
|
2255
2297
|
filterViewId,
|
|
2256
|
-
filterDes
|
|
2298
|
+
filterDes,
|
|
2299
|
+
scope
|
|
2257
2300
|
});
|
|
2258
2301
|
_Step.assert(this.stepId);
|
|
2259
2302
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
@@ -2262,11 +2305,11 @@ var _Step = class _Step {
|
|
|
2262
2305
|
/**
|
|
2263
2306
|
* 查找所有匹配文本的节点
|
|
2264
2307
|
* @param text 要查找的文本
|
|
2265
|
-
* @
|
|
2308
|
+
* @param options.scope 节点查找范围(可选)
|
|
2266
2309
|
*/
|
|
2267
|
-
findByTextAllMatch(text) {
|
|
2310
|
+
findByTextAllMatch(text, { scope } = {}) {
|
|
2268
2311
|
_Step.assert(this.stepId);
|
|
2269
|
-
const nodes = AssistsX2.findByTextAllMatch(text);
|
|
2312
|
+
const nodes = AssistsX2.findByTextAllMatch(text, { scope });
|
|
2270
2313
|
_Step.assert(this.stepId);
|
|
2271
2314
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
2272
2315
|
return nodes;
|
|
@@ -2398,7 +2441,7 @@ var _Step = class _Step {
|
|
|
2398
2441
|
};
|
|
2399
2442
|
_Step.delayMsDefault = 1e3;
|
|
2400
2443
|
_Step.repeatCountInfinite = -1;
|
|
2401
|
-
_Step.repeatCountMaxDefault =
|
|
2444
|
+
_Step.repeatCountMaxDefault = 15;
|
|
2402
2445
|
_Step.showLog = false;
|
|
2403
2446
|
_Step.exceptionRetryCountMaxDefault = 3;
|
|
2404
2447
|
/**
|
|
@@ -2782,7 +2825,7 @@ var Node = class _Node {
|
|
|
2782
2825
|
* @param params 节点参数对象
|
|
2783
2826
|
*/
|
|
2784
2827
|
constructor(params) {
|
|
2785
|
-
var
|
|
2828
|
+
var _a2;
|
|
2786
2829
|
this.nodeId = params.nodeId;
|
|
2787
2830
|
this.text = params.text;
|
|
2788
2831
|
this.des = params.des;
|
|
@@ -2802,7 +2845,7 @@ var Node = class _Node {
|
|
|
2802
2845
|
this.isSelected = params.isSelected;
|
|
2803
2846
|
this.isVisibleToUser = params.isVisibleToUser;
|
|
2804
2847
|
this.drawingOrder = params.drawingOrder;
|
|
2805
|
-
const rawBounds = (
|
|
2848
|
+
const rawBounds = (_a2 = params.bounds) != null ? _a2 : params.boundsInScreen;
|
|
2806
2849
|
this.bounds = rawBounds instanceof Bounds ? rawBounds : Bounds.fromData(rawBounds);
|
|
2807
2850
|
}
|
|
2808
2851
|
get async() {
|
|
@@ -3165,7 +3208,7 @@ var Node = class _Node {
|
|
|
3165
3208
|
// src/assistsx.ts
|
|
3166
3209
|
var callbacks = /* @__PURE__ */ new Map();
|
|
3167
3210
|
var accessibilityEventListeners = [];
|
|
3168
|
-
var screen
|
|
3211
|
+
var screen;
|
|
3169
3212
|
if (typeof window !== "undefined" && !window.assistsxCallback) {
|
|
3170
3213
|
window.assistsxCallback = (data) => {
|
|
3171
3214
|
let callbackId;
|
|
@@ -3316,10 +3359,17 @@ var AssistsX2 = class {
|
|
|
3316
3359
|
filterClass,
|
|
3317
3360
|
filterViewId,
|
|
3318
3361
|
filterDes,
|
|
3319
|
-
filterText
|
|
3362
|
+
filterText,
|
|
3363
|
+
scope
|
|
3320
3364
|
} = {}) {
|
|
3321
3365
|
const response = this.call(CallMethod.getAllNodes, {
|
|
3322
|
-
args: {
|
|
3366
|
+
args: {
|
|
3367
|
+
filterClass,
|
|
3368
|
+
filterViewId,
|
|
3369
|
+
filterDes,
|
|
3370
|
+
filterText,
|
|
3371
|
+
...scope !== void 0 ? { scope } : {}
|
|
3372
|
+
}
|
|
3323
3373
|
});
|
|
3324
3374
|
const data = response.getDataOrDefault([]);
|
|
3325
3375
|
if (!Array.isArray(data)) {
|
|
@@ -3483,8 +3533,12 @@ var AssistsX2 = class {
|
|
|
3483
3533
|
* 获取当前应用包名
|
|
3484
3534
|
* @returns 包名
|
|
3485
3535
|
*/
|
|
3486
|
-
static getPackageName() {
|
|
3487
|
-
const
|
|
3536
|
+
static getPackageName(options = {}) {
|
|
3537
|
+
const { scope } = options;
|
|
3538
|
+
const response = this.call(
|
|
3539
|
+
CallMethod.getPackageName,
|
|
3540
|
+
scope !== void 0 ? { args: { scope } } : {}
|
|
3541
|
+
);
|
|
3488
3542
|
return response.getDataOrDefault("");
|
|
3489
3543
|
}
|
|
3490
3544
|
/**
|
|
@@ -3512,10 +3566,17 @@ var AssistsX2 = class {
|
|
|
3512
3566
|
filterClass,
|
|
3513
3567
|
filterText,
|
|
3514
3568
|
filterDes,
|
|
3515
|
-
node
|
|
3569
|
+
node,
|
|
3570
|
+
scope
|
|
3516
3571
|
} = {}) {
|
|
3517
3572
|
const response = this.call(CallMethod.findById, {
|
|
3518
|
-
args: {
|
|
3573
|
+
args: {
|
|
3574
|
+
id,
|
|
3575
|
+
filterClass,
|
|
3576
|
+
filterText,
|
|
3577
|
+
filterDes,
|
|
3578
|
+
...scope !== void 0 ? { scope } : {}
|
|
3579
|
+
},
|
|
3519
3580
|
node
|
|
3520
3581
|
});
|
|
3521
3582
|
const data = response.getDataOrDefault([]);
|
|
@@ -3539,10 +3600,17 @@ var AssistsX2 = class {
|
|
|
3539
3600
|
filterClass,
|
|
3540
3601
|
filterViewId,
|
|
3541
3602
|
filterDes,
|
|
3542
|
-
node
|
|
3603
|
+
node,
|
|
3604
|
+
scope
|
|
3543
3605
|
} = {}) {
|
|
3544
3606
|
const response = this.call(CallMethod.findByText, {
|
|
3545
|
-
args: {
|
|
3607
|
+
args: {
|
|
3608
|
+
text,
|
|
3609
|
+
filterClass,
|
|
3610
|
+
filterViewId,
|
|
3611
|
+
filterDes,
|
|
3612
|
+
...scope !== void 0 ? { scope } : {}
|
|
3613
|
+
},
|
|
3546
3614
|
node
|
|
3547
3615
|
});
|
|
3548
3616
|
const data = response.getDataOrDefault([]);
|
|
@@ -3566,10 +3634,17 @@ var AssistsX2 = class {
|
|
|
3566
3634
|
filterText,
|
|
3567
3635
|
filterViewId,
|
|
3568
3636
|
filterDes,
|
|
3569
|
-
node
|
|
3637
|
+
node,
|
|
3638
|
+
scope
|
|
3570
3639
|
} = {}) {
|
|
3571
3640
|
const response = this.call(CallMethod.findByTags, {
|
|
3572
|
-
args: {
|
|
3641
|
+
args: {
|
|
3642
|
+
className,
|
|
3643
|
+
filterText,
|
|
3644
|
+
filterViewId,
|
|
3645
|
+
filterDes,
|
|
3646
|
+
...scope !== void 0 ? { scope } : {}
|
|
3647
|
+
},
|
|
3573
3648
|
node
|
|
3574
3649
|
});
|
|
3575
3650
|
const data = response.getDataOrDefault([]);
|
|
@@ -3583,11 +3658,14 @@ var AssistsX2 = class {
|
|
|
3583
3658
|
/**
|
|
3584
3659
|
* 查找所有匹配文本的节点
|
|
3585
3660
|
* @param text 要查找的文本
|
|
3586
|
-
* @
|
|
3661
|
+
* @param options.scope 节点查找范围(可选)
|
|
3587
3662
|
*/
|
|
3588
|
-
static findByTextAllMatch(text) {
|
|
3663
|
+
static findByTextAllMatch(text, { scope } = {}) {
|
|
3589
3664
|
const response = this.call(CallMethod.findByTextAllMatch, {
|
|
3590
|
-
args: {
|
|
3665
|
+
args: {
|
|
3666
|
+
text,
|
|
3667
|
+
...scope !== void 0 ? { scope } : {}
|
|
3668
|
+
}
|
|
3591
3669
|
});
|
|
3592
3670
|
const data = response.getDataOrDefault([]);
|
|
3593
3671
|
if (!Array.isArray(data)) {
|
|
@@ -4040,10 +4118,11 @@ function normalizeScreen(data) {
|
|
|
4040
4118
|
if (typeof w !== "number" || typeof h !== "number") return null;
|
|
4041
4119
|
return { width: Math.floor(w), height: Math.floor(h) };
|
|
4042
4120
|
}
|
|
4121
|
+
var _a;
|
|
4043
4122
|
if (typeof window !== "undefined") {
|
|
4044
4123
|
try {
|
|
4045
4124
|
if (window.assistsx && typeof window.assistsx.call === "function") {
|
|
4046
|
-
screen = AssistsX2.getScreenSize();
|
|
4125
|
+
screen = (_a = AssistsX2.getScreenSize()) != null ? _a : { width: 0, height: 0 };
|
|
4047
4126
|
}
|
|
4048
4127
|
} catch (e) {
|
|
4049
4128
|
console.log("Failed to initialize screen size:", e);
|
|
@@ -4178,8 +4257,8 @@ WindowFlags.FLAG_HARDWARE_ACCELERATED = 16777216;
|
|
|
4178
4257
|
// src/accessibility-event-filter.ts
|
|
4179
4258
|
var AccessibilityEventFilter = class _AccessibilityEventFilter {
|
|
4180
4259
|
constructor(config = {}) {
|
|
4181
|
-
var
|
|
4182
|
-
this.packageName = (
|
|
4260
|
+
var _a2, _b, _c, _d, _e;
|
|
4261
|
+
this.packageName = (_a2 = config.packageName) != null ? _a2 : null;
|
|
4183
4262
|
this.processInBackground = (_b = config.processInBackground) != null ? _b : true;
|
|
4184
4263
|
this.fetchNodeInfo = (_c = config.fetchNodeInfo) != null ? _c : true;
|
|
4185
4264
|
this.enableLogging = (_d = config.enableLogging) != null ? _d : false;
|
|
@@ -4200,8 +4279,8 @@ var AccessibilityEventFilter = class _AccessibilityEventFilter {
|
|
|
4200
4279
|
* @returns true表示应该处理,false表示应该过滤
|
|
4201
4280
|
*/
|
|
4202
4281
|
shouldProcessEventType(eventType) {
|
|
4203
|
-
var
|
|
4204
|
-
return this.eventTypes === null || ((_b = (
|
|
4282
|
+
var _a2, _b;
|
|
4283
|
+
return this.eventTypes === null || ((_b = (_a2 = this.eventTypes) == null ? void 0 : _a2.includes(eventType)) != null ? _b : false);
|
|
4205
4284
|
}
|
|
4206
4285
|
/**
|
|
4207
4286
|
* 创建默认的过滤配置
|
|
@@ -4329,14 +4408,14 @@ var Http = class {
|
|
|
4329
4408
|
* @returns Promise<HTTP响应>
|
|
4330
4409
|
*/
|
|
4331
4410
|
async httpGet(url, headers, timeout) {
|
|
4332
|
-
var
|
|
4411
|
+
var _a2;
|
|
4333
4412
|
const response = await this.asyncCall(
|
|
4334
4413
|
"httpGet",
|
|
4335
4414
|
{ url, headers },
|
|
4336
4415
|
timeout
|
|
4337
4416
|
);
|
|
4338
4417
|
if (!response.isSuccess()) {
|
|
4339
|
-
throw new Error(((
|
|
4418
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP GET request failed");
|
|
4340
4419
|
}
|
|
4341
4420
|
return response.data;
|
|
4342
4421
|
}
|
|
@@ -4349,14 +4428,14 @@ var Http = class {
|
|
|
4349
4428
|
* @returns Promise<HTTP响应>
|
|
4350
4429
|
*/
|
|
4351
4430
|
async httpPost(url, body, headers, timeout) {
|
|
4352
|
-
var
|
|
4431
|
+
var _a2;
|
|
4353
4432
|
const response = await this.asyncCall(
|
|
4354
4433
|
"httpPost",
|
|
4355
4434
|
{ url, body, headers },
|
|
4356
4435
|
timeout
|
|
4357
4436
|
);
|
|
4358
4437
|
if (!response.isSuccess()) {
|
|
4359
|
-
throw new Error(((
|
|
4438
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP POST request failed");
|
|
4360
4439
|
}
|
|
4361
4440
|
return response.data;
|
|
4362
4441
|
}
|
|
@@ -4389,7 +4468,7 @@ var Http = class {
|
|
|
4389
4468
|
* ], { description: "My files" });
|
|
4390
4469
|
*/
|
|
4391
4470
|
async httpPostFile(url, files, formData, headers, timeout) {
|
|
4392
|
-
var
|
|
4471
|
+
var _a2;
|
|
4393
4472
|
if (!files || files.length === 0) {
|
|
4394
4473
|
throw new Error("files\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF0C\u81F3\u5C11\u9700\u8981\u4E0A\u4F20\u4E00\u4E2A\u6587\u4EF6");
|
|
4395
4474
|
}
|
|
@@ -4404,7 +4483,7 @@ var Http = class {
|
|
|
4404
4483
|
timeout
|
|
4405
4484
|
);
|
|
4406
4485
|
if (!response.isSuccess()) {
|
|
4407
|
-
throw new Error(((
|
|
4486
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP POST file request failed");
|
|
4408
4487
|
}
|
|
4409
4488
|
return response.data;
|
|
4410
4489
|
}
|
|
@@ -4419,14 +4498,14 @@ var Http = class {
|
|
|
4419
4498
|
* @returns Promise<下载响应>
|
|
4420
4499
|
*/
|
|
4421
4500
|
async httpDownload(url, savePath, headers, saveToGallery, displayName, timeout) {
|
|
4422
|
-
var
|
|
4501
|
+
var _a2;
|
|
4423
4502
|
const response = await this.asyncCall(
|
|
4424
4503
|
"httpDownload",
|
|
4425
4504
|
{ url, savePath, headers, saveToGallery, displayName },
|
|
4426
4505
|
timeout
|
|
4427
4506
|
);
|
|
4428
4507
|
if (!response.isSuccess()) {
|
|
4429
|
-
throw new Error(((
|
|
4508
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP download failed");
|
|
4430
4509
|
}
|
|
4431
4510
|
return response.data;
|
|
4432
4511
|
}
|
|
@@ -4437,14 +4516,14 @@ var Http = class {
|
|
|
4437
4516
|
* @returns Promise<配置信息>
|
|
4438
4517
|
*/
|
|
4439
4518
|
async httpConfigure(config, timeout) {
|
|
4440
|
-
var
|
|
4519
|
+
var _a2;
|
|
4441
4520
|
const response = await this.asyncCall(
|
|
4442
4521
|
"httpConfigure",
|
|
4443
4522
|
config,
|
|
4444
4523
|
timeout
|
|
4445
4524
|
);
|
|
4446
4525
|
if (!response.isSuccess()) {
|
|
4447
|
-
throw new Error(((
|
|
4526
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP configure failed");
|
|
4448
4527
|
}
|
|
4449
4528
|
return response.data;
|
|
4450
4529
|
}
|
|
@@ -4454,10 +4533,10 @@ var Http = class {
|
|
|
4454
4533
|
* @returns Promise<配置信息>
|
|
4455
4534
|
*/
|
|
4456
4535
|
async httpReset(timeout) {
|
|
4457
|
-
var
|
|
4536
|
+
var _a2;
|
|
4458
4537
|
const response = await this.asyncCall("httpReset", void 0, timeout);
|
|
4459
4538
|
if (!response.isSuccess()) {
|
|
4460
|
-
throw new Error(((
|
|
4539
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP reset failed");
|
|
4461
4540
|
}
|
|
4462
4541
|
return response.data;
|
|
4463
4542
|
}
|
|
@@ -4467,10 +4546,10 @@ var Http = class {
|
|
|
4467
4546
|
* @returns Promise<配置信息>
|
|
4468
4547
|
*/
|
|
4469
4548
|
async httpGetConfig(timeout) {
|
|
4470
|
-
var
|
|
4549
|
+
var _a2;
|
|
4471
4550
|
const response = await this.asyncCall("httpGetConfig", void 0, timeout);
|
|
4472
4551
|
if (!response.isSuccess()) {
|
|
4473
|
-
throw new Error(((
|
|
4552
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get HTTP config failed");
|
|
4474
4553
|
}
|
|
4475
4554
|
return response.data;
|
|
4476
4555
|
}
|
|
@@ -4543,10 +4622,10 @@ var Path = class {
|
|
|
4543
4622
|
* @returns Promise<路径字符串>
|
|
4544
4623
|
*/
|
|
4545
4624
|
async getRootPath(timeout) {
|
|
4546
|
-
var
|
|
4625
|
+
var _a2;
|
|
4547
4626
|
const response = await this.asyncCall("getRootPath", void 0, timeout);
|
|
4548
4627
|
if (!response.isSuccess()) {
|
|
4549
|
-
throw new Error(((
|
|
4628
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get root path failed");
|
|
4550
4629
|
}
|
|
4551
4630
|
return response.data;
|
|
4552
4631
|
}
|
|
@@ -4556,10 +4635,10 @@ var Path = class {
|
|
|
4556
4635
|
* @returns Promise<路径字符串>
|
|
4557
4636
|
*/
|
|
4558
4637
|
async getDataPath(timeout) {
|
|
4559
|
-
var
|
|
4638
|
+
var _a2;
|
|
4560
4639
|
const response = await this.asyncCall("getDataPath", void 0, timeout);
|
|
4561
4640
|
if (!response.isSuccess()) {
|
|
4562
|
-
throw new Error(((
|
|
4641
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get data path failed");
|
|
4563
4642
|
}
|
|
4564
4643
|
return response.data;
|
|
4565
4644
|
}
|
|
@@ -4569,10 +4648,10 @@ var Path = class {
|
|
|
4569
4648
|
* @returns Promise<路径字符串>
|
|
4570
4649
|
*/
|
|
4571
4650
|
async getDownloadCachePath(timeout) {
|
|
4572
|
-
var
|
|
4651
|
+
var _a2;
|
|
4573
4652
|
const response = await this.asyncCall("getDownloadCachePath", void 0, timeout);
|
|
4574
4653
|
if (!response.isSuccess()) {
|
|
4575
|
-
throw new Error(((
|
|
4654
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get download cache path failed");
|
|
4576
4655
|
}
|
|
4577
4656
|
return response.data;
|
|
4578
4657
|
}
|
|
@@ -4582,10 +4661,10 @@ var Path = class {
|
|
|
4582
4661
|
* @returns Promise<路径字符串>
|
|
4583
4662
|
*/
|
|
4584
4663
|
async getInternalAppDataPath(timeout) {
|
|
4585
|
-
var
|
|
4664
|
+
var _a2;
|
|
4586
4665
|
const response = await this.asyncCall("getInternalAppDataPath", void 0, timeout);
|
|
4587
4666
|
if (!response.isSuccess()) {
|
|
4588
|
-
throw new Error(((
|
|
4667
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app data path failed");
|
|
4589
4668
|
}
|
|
4590
4669
|
return response.data;
|
|
4591
4670
|
}
|
|
@@ -4595,10 +4674,10 @@ var Path = class {
|
|
|
4595
4674
|
* @returns Promise<路径字符串>
|
|
4596
4675
|
*/
|
|
4597
4676
|
async getInternalAppCodeCacheDir(timeout) {
|
|
4598
|
-
var
|
|
4677
|
+
var _a2;
|
|
4599
4678
|
const response = await this.asyncCall("getInternalAppCodeCacheDir", void 0, timeout);
|
|
4600
4679
|
if (!response.isSuccess()) {
|
|
4601
|
-
throw new Error(((
|
|
4680
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app code cache dir failed");
|
|
4602
4681
|
}
|
|
4603
4682
|
return response.data;
|
|
4604
4683
|
}
|
|
@@ -4608,10 +4687,10 @@ var Path = class {
|
|
|
4608
4687
|
* @returns Promise<路径字符串>
|
|
4609
4688
|
*/
|
|
4610
4689
|
async getInternalAppCachePath(timeout) {
|
|
4611
|
-
var
|
|
4690
|
+
var _a2;
|
|
4612
4691
|
const response = await this.asyncCall("getInternalAppCachePath", void 0, timeout);
|
|
4613
4692
|
if (!response.isSuccess()) {
|
|
4614
|
-
throw new Error(((
|
|
4693
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app cache path failed");
|
|
4615
4694
|
}
|
|
4616
4695
|
return response.data;
|
|
4617
4696
|
}
|
|
@@ -4621,10 +4700,10 @@ var Path = class {
|
|
|
4621
4700
|
* @returns Promise<路径字符串>
|
|
4622
4701
|
*/
|
|
4623
4702
|
async getInternalAppDbsPath(timeout) {
|
|
4624
|
-
var
|
|
4703
|
+
var _a2;
|
|
4625
4704
|
const response = await this.asyncCall("getInternalAppDbsPath", void 0, timeout);
|
|
4626
4705
|
if (!response.isSuccess()) {
|
|
4627
|
-
throw new Error(((
|
|
4706
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app dbs path failed");
|
|
4628
4707
|
}
|
|
4629
4708
|
return response.data;
|
|
4630
4709
|
}
|
|
@@ -4635,10 +4714,10 @@ var Path = class {
|
|
|
4635
4714
|
* @returns Promise<路径字符串>
|
|
4636
4715
|
*/
|
|
4637
4716
|
async getInternalAppDbPath(dbName, timeout) {
|
|
4638
|
-
var
|
|
4717
|
+
var _a2;
|
|
4639
4718
|
const response = await this.asyncCall("getInternalAppDbPath", { dbName }, timeout);
|
|
4640
4719
|
if (!response.isSuccess()) {
|
|
4641
|
-
throw new Error(((
|
|
4720
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app db path failed");
|
|
4642
4721
|
}
|
|
4643
4722
|
return response.data;
|
|
4644
4723
|
}
|
|
@@ -4648,10 +4727,10 @@ var Path = class {
|
|
|
4648
4727
|
* @returns Promise<路径字符串>
|
|
4649
4728
|
*/
|
|
4650
4729
|
async getInternalAppFilesPath(timeout) {
|
|
4651
|
-
var
|
|
4730
|
+
var _a2;
|
|
4652
4731
|
const response = await this.asyncCall("getInternalAppFilesPath", void 0, timeout);
|
|
4653
4732
|
if (!response.isSuccess()) {
|
|
4654
|
-
throw new Error(((
|
|
4733
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app files path failed");
|
|
4655
4734
|
}
|
|
4656
4735
|
return response.data;
|
|
4657
4736
|
}
|
|
@@ -4661,10 +4740,10 @@ var Path = class {
|
|
|
4661
4740
|
* @returns Promise<路径字符串>
|
|
4662
4741
|
*/
|
|
4663
4742
|
async getInternalAppSpPath(timeout) {
|
|
4664
|
-
var
|
|
4743
|
+
var _a2;
|
|
4665
4744
|
const response = await this.asyncCall("getInternalAppSpPath", void 0, timeout);
|
|
4666
4745
|
if (!response.isSuccess()) {
|
|
4667
|
-
throw new Error(((
|
|
4746
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app sp path failed");
|
|
4668
4747
|
}
|
|
4669
4748
|
return response.data;
|
|
4670
4749
|
}
|
|
@@ -4674,10 +4753,10 @@ var Path = class {
|
|
|
4674
4753
|
* @returns Promise<路径字符串>
|
|
4675
4754
|
*/
|
|
4676
4755
|
async getInternalAppNoBackupFilesPath(timeout) {
|
|
4677
|
-
var
|
|
4756
|
+
var _a2;
|
|
4678
4757
|
const response = await this.asyncCall("getInternalAppNoBackupFilesPath", void 0, timeout);
|
|
4679
4758
|
if (!response.isSuccess()) {
|
|
4680
|
-
throw new Error(((
|
|
4759
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app no backup files path failed");
|
|
4681
4760
|
}
|
|
4682
4761
|
return response.data;
|
|
4683
4762
|
}
|
|
@@ -4687,10 +4766,10 @@ var Path = class {
|
|
|
4687
4766
|
* @returns Promise<路径字符串>
|
|
4688
4767
|
*/
|
|
4689
4768
|
async getExternalStoragePath(timeout) {
|
|
4690
|
-
var
|
|
4769
|
+
var _a2;
|
|
4691
4770
|
const response = await this.asyncCall("getExternalStoragePath", void 0, timeout);
|
|
4692
4771
|
if (!response.isSuccess()) {
|
|
4693
|
-
throw new Error(((
|
|
4772
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external storage path failed");
|
|
4694
4773
|
}
|
|
4695
4774
|
return response.data;
|
|
4696
4775
|
}
|
|
@@ -4700,10 +4779,10 @@ var Path = class {
|
|
|
4700
4779
|
* @returns Promise<路径字符串>
|
|
4701
4780
|
*/
|
|
4702
4781
|
async getExternalMusicPath(timeout) {
|
|
4703
|
-
var
|
|
4782
|
+
var _a2;
|
|
4704
4783
|
const response = await this.asyncCall("getExternalMusicPath", void 0, timeout);
|
|
4705
4784
|
if (!response.isSuccess()) {
|
|
4706
|
-
throw new Error(((
|
|
4785
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external music path failed");
|
|
4707
4786
|
}
|
|
4708
4787
|
return response.data;
|
|
4709
4788
|
}
|
|
@@ -4713,10 +4792,10 @@ var Path = class {
|
|
|
4713
4792
|
* @returns Promise<路径字符串>
|
|
4714
4793
|
*/
|
|
4715
4794
|
async getExternalPodcastsPath(timeout) {
|
|
4716
|
-
var
|
|
4795
|
+
var _a2;
|
|
4717
4796
|
const response = await this.asyncCall("getExternalPodcastsPath", void 0, timeout);
|
|
4718
4797
|
if (!response.isSuccess()) {
|
|
4719
|
-
throw new Error(((
|
|
4798
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external podcasts path failed");
|
|
4720
4799
|
}
|
|
4721
4800
|
return response.data;
|
|
4722
4801
|
}
|
|
@@ -4726,10 +4805,10 @@ var Path = class {
|
|
|
4726
4805
|
* @returns Promise<路径字符串>
|
|
4727
4806
|
*/
|
|
4728
4807
|
async getExternalRingtonesPath(timeout) {
|
|
4729
|
-
var
|
|
4808
|
+
var _a2;
|
|
4730
4809
|
const response = await this.asyncCall("getExternalRingtonesPath", void 0, timeout);
|
|
4731
4810
|
if (!response.isSuccess()) {
|
|
4732
|
-
throw new Error(((
|
|
4811
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external ringtones path failed");
|
|
4733
4812
|
}
|
|
4734
4813
|
return response.data;
|
|
4735
4814
|
}
|
|
@@ -4739,10 +4818,10 @@ var Path = class {
|
|
|
4739
4818
|
* @returns Promise<路径字符串>
|
|
4740
4819
|
*/
|
|
4741
4820
|
async getExternalAlarmsPath(timeout) {
|
|
4742
|
-
var
|
|
4821
|
+
var _a2;
|
|
4743
4822
|
const response = await this.asyncCall("getExternalAlarmsPath", void 0, timeout);
|
|
4744
4823
|
if (!response.isSuccess()) {
|
|
4745
|
-
throw new Error(((
|
|
4824
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external alarms path failed");
|
|
4746
4825
|
}
|
|
4747
4826
|
return response.data;
|
|
4748
4827
|
}
|
|
@@ -4752,10 +4831,10 @@ var Path = class {
|
|
|
4752
4831
|
* @returns Promise<路径字符串>
|
|
4753
4832
|
*/
|
|
4754
4833
|
async getExternalNotificationsPath(timeout) {
|
|
4755
|
-
var
|
|
4834
|
+
var _a2;
|
|
4756
4835
|
const response = await this.asyncCall("getExternalNotificationsPath", void 0, timeout);
|
|
4757
4836
|
if (!response.isSuccess()) {
|
|
4758
|
-
throw new Error(((
|
|
4837
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external notifications path failed");
|
|
4759
4838
|
}
|
|
4760
4839
|
return response.data;
|
|
4761
4840
|
}
|
|
@@ -4765,10 +4844,10 @@ var Path = class {
|
|
|
4765
4844
|
* @returns Promise<路径字符串>
|
|
4766
4845
|
*/
|
|
4767
4846
|
async getExternalPicturesPath(timeout) {
|
|
4768
|
-
var
|
|
4847
|
+
var _a2;
|
|
4769
4848
|
const response = await this.asyncCall("getExternalPicturesPath", void 0, timeout);
|
|
4770
4849
|
if (!response.isSuccess()) {
|
|
4771
|
-
throw new Error(((
|
|
4850
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external pictures path failed");
|
|
4772
4851
|
}
|
|
4773
4852
|
return response.data;
|
|
4774
4853
|
}
|
|
@@ -4778,10 +4857,10 @@ var Path = class {
|
|
|
4778
4857
|
* @returns Promise<路径字符串>
|
|
4779
4858
|
*/
|
|
4780
4859
|
async getExternalMoviesPath(timeout) {
|
|
4781
|
-
var
|
|
4860
|
+
var _a2;
|
|
4782
4861
|
const response = await this.asyncCall("getExternalMoviesPath", void 0, timeout);
|
|
4783
4862
|
if (!response.isSuccess()) {
|
|
4784
|
-
throw new Error(((
|
|
4863
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external movies path failed");
|
|
4785
4864
|
}
|
|
4786
4865
|
return response.data;
|
|
4787
4866
|
}
|
|
@@ -4791,10 +4870,10 @@ var Path = class {
|
|
|
4791
4870
|
* @returns Promise<路径字符串>
|
|
4792
4871
|
*/
|
|
4793
4872
|
async getExternalDownloadsPath(timeout) {
|
|
4794
|
-
var
|
|
4873
|
+
var _a2;
|
|
4795
4874
|
const response = await this.asyncCall("getExternalDownloadsPath", void 0, timeout);
|
|
4796
4875
|
if (!response.isSuccess()) {
|
|
4797
|
-
throw new Error(((
|
|
4876
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external downloads path failed");
|
|
4798
4877
|
}
|
|
4799
4878
|
return response.data;
|
|
4800
4879
|
}
|
|
@@ -4804,10 +4883,10 @@ var Path = class {
|
|
|
4804
4883
|
* @returns Promise<路径字符串>
|
|
4805
4884
|
*/
|
|
4806
4885
|
async getExternalDcimPath(timeout) {
|
|
4807
|
-
var
|
|
4886
|
+
var _a2;
|
|
4808
4887
|
const response = await this.asyncCall("getExternalDcimPath", void 0, timeout);
|
|
4809
4888
|
if (!response.isSuccess()) {
|
|
4810
|
-
throw new Error(((
|
|
4889
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external dcim path failed");
|
|
4811
4890
|
}
|
|
4812
4891
|
return response.data;
|
|
4813
4892
|
}
|
|
@@ -4817,10 +4896,10 @@ var Path = class {
|
|
|
4817
4896
|
* @returns Promise<路径字符串>
|
|
4818
4897
|
*/
|
|
4819
4898
|
async getExternalDocumentsPath(timeout) {
|
|
4820
|
-
var
|
|
4899
|
+
var _a2;
|
|
4821
4900
|
const response = await this.asyncCall("getExternalDocumentsPath", void 0, timeout);
|
|
4822
4901
|
if (!response.isSuccess()) {
|
|
4823
|
-
throw new Error(((
|
|
4902
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external documents path failed");
|
|
4824
4903
|
}
|
|
4825
4904
|
return response.data;
|
|
4826
4905
|
}
|
|
@@ -4830,10 +4909,10 @@ var Path = class {
|
|
|
4830
4909
|
* @returns Promise<路径字符串>
|
|
4831
4910
|
*/
|
|
4832
4911
|
async getExternalAppDataPath(timeout) {
|
|
4833
|
-
var
|
|
4912
|
+
var _a2;
|
|
4834
4913
|
const response = await this.asyncCall("getExternalAppDataPath", void 0, timeout);
|
|
4835
4914
|
if (!response.isSuccess()) {
|
|
4836
|
-
throw new Error(((
|
|
4915
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app data path failed");
|
|
4837
4916
|
}
|
|
4838
4917
|
return response.data;
|
|
4839
4918
|
}
|
|
@@ -4843,10 +4922,10 @@ var Path = class {
|
|
|
4843
4922
|
* @returns Promise<路径字符串>
|
|
4844
4923
|
*/
|
|
4845
4924
|
async getExternalAppCachePath(timeout) {
|
|
4846
|
-
var
|
|
4925
|
+
var _a2;
|
|
4847
4926
|
const response = await this.asyncCall("getExternalAppCachePath", void 0, timeout);
|
|
4848
4927
|
if (!response.isSuccess()) {
|
|
4849
|
-
throw new Error(((
|
|
4928
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app cache path failed");
|
|
4850
4929
|
}
|
|
4851
4930
|
return response.data;
|
|
4852
4931
|
}
|
|
@@ -4856,10 +4935,10 @@ var Path = class {
|
|
|
4856
4935
|
* @returns Promise<路径字符串>
|
|
4857
4936
|
*/
|
|
4858
4937
|
async getExternalAppFilesPath(timeout) {
|
|
4859
|
-
var
|
|
4938
|
+
var _a2;
|
|
4860
4939
|
const response = await this.asyncCall("getExternalAppFilesPath", void 0, timeout);
|
|
4861
4940
|
if (!response.isSuccess()) {
|
|
4862
|
-
throw new Error(((
|
|
4941
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app files path failed");
|
|
4863
4942
|
}
|
|
4864
4943
|
return response.data;
|
|
4865
4944
|
}
|
|
@@ -4869,10 +4948,10 @@ var Path = class {
|
|
|
4869
4948
|
* @returns Promise<路径字符串>
|
|
4870
4949
|
*/
|
|
4871
4950
|
async getExternalAppMusicPath(timeout) {
|
|
4872
|
-
var
|
|
4951
|
+
var _a2;
|
|
4873
4952
|
const response = await this.asyncCall("getExternalAppMusicPath", void 0, timeout);
|
|
4874
4953
|
if (!response.isSuccess()) {
|
|
4875
|
-
throw new Error(((
|
|
4954
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app music path failed");
|
|
4876
4955
|
}
|
|
4877
4956
|
return response.data;
|
|
4878
4957
|
}
|
|
@@ -4882,10 +4961,10 @@ var Path = class {
|
|
|
4882
4961
|
* @returns Promise<路径字符串>
|
|
4883
4962
|
*/
|
|
4884
4963
|
async getExternalAppPodcastsPath(timeout) {
|
|
4885
|
-
var
|
|
4964
|
+
var _a2;
|
|
4886
4965
|
const response = await this.asyncCall("getExternalAppPodcastsPath", void 0, timeout);
|
|
4887
4966
|
if (!response.isSuccess()) {
|
|
4888
|
-
throw new Error(((
|
|
4967
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app podcasts path failed");
|
|
4889
4968
|
}
|
|
4890
4969
|
return response.data;
|
|
4891
4970
|
}
|
|
@@ -4895,10 +4974,10 @@ var Path = class {
|
|
|
4895
4974
|
* @returns Promise<路径字符串>
|
|
4896
4975
|
*/
|
|
4897
4976
|
async getExternalAppRingtonesPath(timeout) {
|
|
4898
|
-
var
|
|
4977
|
+
var _a2;
|
|
4899
4978
|
const response = await this.asyncCall("getExternalAppRingtonesPath", void 0, timeout);
|
|
4900
4979
|
if (!response.isSuccess()) {
|
|
4901
|
-
throw new Error(((
|
|
4980
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app ringtones path failed");
|
|
4902
4981
|
}
|
|
4903
4982
|
return response.data;
|
|
4904
4983
|
}
|
|
@@ -4908,10 +4987,10 @@ var Path = class {
|
|
|
4908
4987
|
* @returns Promise<路径字符串>
|
|
4909
4988
|
*/
|
|
4910
4989
|
async getExternalAppAlarmsPath(timeout) {
|
|
4911
|
-
var
|
|
4990
|
+
var _a2;
|
|
4912
4991
|
const response = await this.asyncCall("getExternalAppAlarmsPath", void 0, timeout);
|
|
4913
4992
|
if (!response.isSuccess()) {
|
|
4914
|
-
throw new Error(((
|
|
4993
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app alarms path failed");
|
|
4915
4994
|
}
|
|
4916
4995
|
return response.data;
|
|
4917
4996
|
}
|
|
@@ -4921,10 +5000,10 @@ var Path = class {
|
|
|
4921
5000
|
* @returns Promise<路径字符串>
|
|
4922
5001
|
*/
|
|
4923
5002
|
async getExternalAppNotificationsPath(timeout) {
|
|
4924
|
-
var
|
|
5003
|
+
var _a2;
|
|
4925
5004
|
const response = await this.asyncCall("getExternalAppNotificationsPath", void 0, timeout);
|
|
4926
5005
|
if (!response.isSuccess()) {
|
|
4927
|
-
throw new Error(((
|
|
5006
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app notifications path failed");
|
|
4928
5007
|
}
|
|
4929
5008
|
return response.data;
|
|
4930
5009
|
}
|
|
@@ -4934,10 +5013,10 @@ var Path = class {
|
|
|
4934
5013
|
* @returns Promise<路径字符串>
|
|
4935
5014
|
*/
|
|
4936
5015
|
async getExternalAppPicturesPath(timeout) {
|
|
4937
|
-
var
|
|
5016
|
+
var _a2;
|
|
4938
5017
|
const response = await this.asyncCall("getExternalAppPicturesPath", void 0, timeout);
|
|
4939
5018
|
if (!response.isSuccess()) {
|
|
4940
|
-
throw new Error(((
|
|
5019
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app pictures path failed");
|
|
4941
5020
|
}
|
|
4942
5021
|
return response.data;
|
|
4943
5022
|
}
|
|
@@ -4947,10 +5026,10 @@ var Path = class {
|
|
|
4947
5026
|
* @returns Promise<路径字符串>
|
|
4948
5027
|
*/
|
|
4949
5028
|
async getExternalAppMoviesPath(timeout) {
|
|
4950
|
-
var
|
|
5029
|
+
var _a2;
|
|
4951
5030
|
const response = await this.asyncCall("getExternalAppMoviesPath", void 0, timeout);
|
|
4952
5031
|
if (!response.isSuccess()) {
|
|
4953
|
-
throw new Error(((
|
|
5032
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app movies path failed");
|
|
4954
5033
|
}
|
|
4955
5034
|
return response.data;
|
|
4956
5035
|
}
|
|
@@ -4960,10 +5039,10 @@ var Path = class {
|
|
|
4960
5039
|
* @returns Promise<路径字符串>
|
|
4961
5040
|
*/
|
|
4962
5041
|
async getExternalAppDownloadPath(timeout) {
|
|
4963
|
-
var
|
|
5042
|
+
var _a2;
|
|
4964
5043
|
const response = await this.asyncCall("getExternalAppDownloadPath", void 0, timeout);
|
|
4965
5044
|
if (!response.isSuccess()) {
|
|
4966
|
-
throw new Error(((
|
|
5045
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app download path failed");
|
|
4967
5046
|
}
|
|
4968
5047
|
return response.data;
|
|
4969
5048
|
}
|
|
@@ -4973,10 +5052,10 @@ var Path = class {
|
|
|
4973
5052
|
* @returns Promise<路径字符串>
|
|
4974
5053
|
*/
|
|
4975
5054
|
async getExternalAppDcimPath(timeout) {
|
|
4976
|
-
var
|
|
5055
|
+
var _a2;
|
|
4977
5056
|
const response = await this.asyncCall("getExternalAppDcimPath", void 0, timeout);
|
|
4978
5057
|
if (!response.isSuccess()) {
|
|
4979
|
-
throw new Error(((
|
|
5058
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app dcim path failed");
|
|
4980
5059
|
}
|
|
4981
5060
|
return response.data;
|
|
4982
5061
|
}
|
|
@@ -4986,10 +5065,10 @@ var Path = class {
|
|
|
4986
5065
|
* @returns Promise<路径字符串>
|
|
4987
5066
|
*/
|
|
4988
5067
|
async getExternalAppDocumentsPath(timeout) {
|
|
4989
|
-
var
|
|
5068
|
+
var _a2;
|
|
4990
5069
|
const response = await this.asyncCall("getExternalAppDocumentsPath", void 0, timeout);
|
|
4991
5070
|
if (!response.isSuccess()) {
|
|
4992
|
-
throw new Error(((
|
|
5071
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app documents path failed");
|
|
4993
5072
|
}
|
|
4994
5073
|
return response.data;
|
|
4995
5074
|
}
|
|
@@ -4999,10 +5078,10 @@ var Path = class {
|
|
|
4999
5078
|
* @returns Promise<路径字符串>
|
|
5000
5079
|
*/
|
|
5001
5080
|
async getExternalAppObbPath(timeout) {
|
|
5002
|
-
var
|
|
5081
|
+
var _a2;
|
|
5003
5082
|
const response = await this.asyncCall("getExternalAppObbPath", void 0, timeout);
|
|
5004
5083
|
if (!response.isSuccess()) {
|
|
5005
|
-
throw new Error(((
|
|
5084
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app obb path failed");
|
|
5006
5085
|
}
|
|
5007
5086
|
return response.data;
|
|
5008
5087
|
}
|
|
@@ -5012,10 +5091,10 @@ var Path = class {
|
|
|
5012
5091
|
* @returns Promise<路径字符串>
|
|
5013
5092
|
*/
|
|
5014
5093
|
async getRootPathExternalFirst(timeout) {
|
|
5015
|
-
var
|
|
5094
|
+
var _a2;
|
|
5016
5095
|
const response = await this.asyncCall("getRootPathExternalFirst", void 0, timeout);
|
|
5017
5096
|
if (!response.isSuccess()) {
|
|
5018
|
-
throw new Error(((
|
|
5097
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get root path external first failed");
|
|
5019
5098
|
}
|
|
5020
5099
|
return response.data;
|
|
5021
5100
|
}
|
|
@@ -5025,10 +5104,10 @@ var Path = class {
|
|
|
5025
5104
|
* @returns Promise<路径字符串>
|
|
5026
5105
|
*/
|
|
5027
5106
|
async getAppDataPathExternalFirst(timeout) {
|
|
5028
|
-
var
|
|
5107
|
+
var _a2;
|
|
5029
5108
|
const response = await this.asyncCall("getAppDataPathExternalFirst", void 0, timeout);
|
|
5030
5109
|
if (!response.isSuccess()) {
|
|
5031
|
-
throw new Error(((
|
|
5110
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get app data path external first failed");
|
|
5032
5111
|
}
|
|
5033
5112
|
return response.data;
|
|
5034
5113
|
}
|
|
@@ -5038,10 +5117,10 @@ var Path = class {
|
|
|
5038
5117
|
* @returns Promise<路径字符串>
|
|
5039
5118
|
*/
|
|
5040
5119
|
async getFilesPathExternalFirst(timeout) {
|
|
5041
|
-
var
|
|
5120
|
+
var _a2;
|
|
5042
5121
|
const response = await this.asyncCall("getFilesPathExternalFirst", void 0, timeout);
|
|
5043
5122
|
if (!response.isSuccess()) {
|
|
5044
|
-
throw new Error(((
|
|
5123
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get files path external first failed");
|
|
5045
5124
|
}
|
|
5046
5125
|
return response.data;
|
|
5047
5126
|
}
|
|
@@ -5051,10 +5130,10 @@ var Path = class {
|
|
|
5051
5130
|
* @returns Promise<路径字符串>
|
|
5052
5131
|
*/
|
|
5053
5132
|
async getCachePathExternalFirst(timeout) {
|
|
5054
|
-
var
|
|
5133
|
+
var _a2;
|
|
5055
5134
|
const response = await this.asyncCall("getCachePathExternalFirst", void 0, timeout);
|
|
5056
5135
|
if (!response.isSuccess()) {
|
|
5057
|
-
throw new Error(((
|
|
5136
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get cache path external first failed");
|
|
5058
5137
|
}
|
|
5059
5138
|
return response.data;
|
|
5060
5139
|
}
|
|
@@ -5130,14 +5209,14 @@ var FileIO = class {
|
|
|
5130
5209
|
* @returns Promise<是否成功>
|
|
5131
5210
|
*/
|
|
5132
5211
|
async writeFileFromIS(filePath, inputStreamBase64, append = false, timeout) {
|
|
5133
|
-
var
|
|
5212
|
+
var _a2;
|
|
5134
5213
|
const response = await this.asyncCall(
|
|
5135
5214
|
"writeFileFromIS",
|
|
5136
5215
|
{ filePath, inputStreamBase64, append },
|
|
5137
5216
|
timeout
|
|
5138
5217
|
);
|
|
5139
5218
|
if (!response.isSuccess()) {
|
|
5140
|
-
throw new Error(((
|
|
5219
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from input stream failed");
|
|
5141
5220
|
}
|
|
5142
5221
|
return response.data;
|
|
5143
5222
|
}
|
|
@@ -5150,14 +5229,14 @@ var FileIO = class {
|
|
|
5150
5229
|
* @returns Promise<是否成功>
|
|
5151
5230
|
*/
|
|
5152
5231
|
async writeFileFromBytesByStream(filePath, bytesBase64, append = false, timeout) {
|
|
5153
|
-
var
|
|
5232
|
+
var _a2;
|
|
5154
5233
|
const response = await this.asyncCall(
|
|
5155
5234
|
"writeFileFromBytesByStream",
|
|
5156
5235
|
{ filePath, bytesBase64, append },
|
|
5157
5236
|
timeout
|
|
5158
5237
|
);
|
|
5159
5238
|
if (!response.isSuccess()) {
|
|
5160
|
-
throw new Error(((
|
|
5239
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from bytes by stream failed");
|
|
5161
5240
|
}
|
|
5162
5241
|
return response.data;
|
|
5163
5242
|
}
|
|
@@ -5170,14 +5249,14 @@ var FileIO = class {
|
|
|
5170
5249
|
* @returns Promise<是否成功>
|
|
5171
5250
|
*/
|
|
5172
5251
|
async writeFileFromBytesByChannel(filePath, bytesBase64, append = false, timeout) {
|
|
5173
|
-
var
|
|
5252
|
+
var _a2;
|
|
5174
5253
|
const response = await this.asyncCall(
|
|
5175
5254
|
"writeFileFromBytesByChannel",
|
|
5176
5255
|
{ filePath, bytesBase64, append },
|
|
5177
5256
|
timeout
|
|
5178
5257
|
);
|
|
5179
5258
|
if (!response.isSuccess()) {
|
|
5180
|
-
throw new Error(((
|
|
5259
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from bytes by channel failed");
|
|
5181
5260
|
}
|
|
5182
5261
|
return response.data;
|
|
5183
5262
|
}
|
|
@@ -5190,14 +5269,14 @@ var FileIO = class {
|
|
|
5190
5269
|
* @returns Promise<是否成功>
|
|
5191
5270
|
*/
|
|
5192
5271
|
async writeFileFromBytesByMap(filePath, bytesBase64, append = false, timeout) {
|
|
5193
|
-
var
|
|
5272
|
+
var _a2;
|
|
5194
5273
|
const response = await this.asyncCall(
|
|
5195
5274
|
"writeFileFromBytesByMap",
|
|
5196
5275
|
{ filePath, bytesBase64, append },
|
|
5197
5276
|
timeout
|
|
5198
5277
|
);
|
|
5199
5278
|
if (!response.isSuccess()) {
|
|
5200
|
-
throw new Error(((
|
|
5279
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from bytes by map failed");
|
|
5201
5280
|
}
|
|
5202
5281
|
return response.data;
|
|
5203
5282
|
}
|
|
@@ -5211,14 +5290,14 @@ var FileIO = class {
|
|
|
5211
5290
|
* @returns Promise<是否成功>
|
|
5212
5291
|
*/
|
|
5213
5292
|
async writeFileFromString(filePath, content, append = false, threadSafe = false, timeout) {
|
|
5214
|
-
var
|
|
5293
|
+
var _a2;
|
|
5215
5294
|
const response = await this.asyncCall(
|
|
5216
5295
|
"writeFileFromString",
|
|
5217
5296
|
{ filePath, content, append, threadSafe },
|
|
5218
5297
|
timeout
|
|
5219
5298
|
);
|
|
5220
5299
|
if (!response.isSuccess()) {
|
|
5221
|
-
throw new Error(((
|
|
5300
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from string failed");
|
|
5222
5301
|
}
|
|
5223
5302
|
return response.data;
|
|
5224
5303
|
}
|
|
@@ -5230,14 +5309,14 @@ var FileIO = class {
|
|
|
5230
5309
|
* @returns Promise<字符串数组>
|
|
5231
5310
|
*/
|
|
5232
5311
|
async readFile2List(filePath, charsetName = "UTF-8", timeout) {
|
|
5233
|
-
var
|
|
5312
|
+
var _a2;
|
|
5234
5313
|
const response = await this.asyncCall(
|
|
5235
5314
|
"readFile2List",
|
|
5236
5315
|
{ filePath, charsetName },
|
|
5237
5316
|
timeout
|
|
5238
5317
|
);
|
|
5239
5318
|
if (!response.isSuccess()) {
|
|
5240
|
-
throw new Error(((
|
|
5319
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to list failed");
|
|
5241
5320
|
}
|
|
5242
5321
|
return response.data;
|
|
5243
5322
|
}
|
|
@@ -5249,14 +5328,14 @@ var FileIO = class {
|
|
|
5249
5328
|
* @returns Promise<文件内容字符串>
|
|
5250
5329
|
*/
|
|
5251
5330
|
async readFile2String(filePath, charsetName = "UTF-8", timeout) {
|
|
5252
|
-
var
|
|
5331
|
+
var _a2;
|
|
5253
5332
|
const response = await this.asyncCall(
|
|
5254
5333
|
"readFile2String",
|
|
5255
5334
|
{ filePath, charsetName },
|
|
5256
5335
|
timeout
|
|
5257
5336
|
);
|
|
5258
5337
|
if (!response.isSuccess()) {
|
|
5259
|
-
throw new Error(((
|
|
5338
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to string failed");
|
|
5260
5339
|
}
|
|
5261
5340
|
return response.data;
|
|
5262
5341
|
}
|
|
@@ -5267,14 +5346,14 @@ var FileIO = class {
|
|
|
5267
5346
|
* @returns Promise<Base64 编码的字节数组>
|
|
5268
5347
|
*/
|
|
5269
5348
|
async readFile2BytesByStream(filePath, timeout) {
|
|
5270
|
-
var
|
|
5349
|
+
var _a2;
|
|
5271
5350
|
const response = await this.asyncCall(
|
|
5272
5351
|
"readFile2BytesByStream",
|
|
5273
5352
|
{ filePath },
|
|
5274
5353
|
timeout
|
|
5275
5354
|
);
|
|
5276
5355
|
if (!response.isSuccess()) {
|
|
5277
|
-
throw new Error(((
|
|
5356
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to bytes by stream failed");
|
|
5278
5357
|
}
|
|
5279
5358
|
return response.data;
|
|
5280
5359
|
}
|
|
@@ -5285,14 +5364,14 @@ var FileIO = class {
|
|
|
5285
5364
|
* @returns Promise<Base64 编码的字节数组>
|
|
5286
5365
|
*/
|
|
5287
5366
|
async readFile2BytesByChannel(filePath, timeout) {
|
|
5288
|
-
var
|
|
5367
|
+
var _a2;
|
|
5289
5368
|
const response = await this.asyncCall(
|
|
5290
5369
|
"readFile2BytesByChannel",
|
|
5291
5370
|
{ filePath },
|
|
5292
5371
|
timeout
|
|
5293
5372
|
);
|
|
5294
5373
|
if (!response.isSuccess()) {
|
|
5295
|
-
throw new Error(((
|
|
5374
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to bytes by channel failed");
|
|
5296
5375
|
}
|
|
5297
5376
|
return response.data;
|
|
5298
5377
|
}
|
|
@@ -5303,14 +5382,14 @@ var FileIO = class {
|
|
|
5303
5382
|
* @returns Promise<Base64 编码的字节数组>
|
|
5304
5383
|
*/
|
|
5305
5384
|
async readFile2BytesByMap(filePath, timeout) {
|
|
5306
|
-
var
|
|
5385
|
+
var _a2;
|
|
5307
5386
|
const response = await this.asyncCall(
|
|
5308
5387
|
"readFile2BytesByMap",
|
|
5309
5388
|
{ filePath },
|
|
5310
5389
|
timeout
|
|
5311
5390
|
);
|
|
5312
5391
|
if (!response.isSuccess()) {
|
|
5313
|
-
throw new Error(((
|
|
5392
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to bytes by map failed");
|
|
5314
5393
|
}
|
|
5315
5394
|
return response.data;
|
|
5316
5395
|
}
|
|
@@ -5321,14 +5400,14 @@ var FileIO = class {
|
|
|
5321
5400
|
* @returns Promise<是否成功>
|
|
5322
5401
|
*/
|
|
5323
5402
|
async setBufferSize(bufferSize, timeout) {
|
|
5324
|
-
var
|
|
5403
|
+
var _a2;
|
|
5325
5404
|
const response = await this.asyncCall(
|
|
5326
5405
|
"setBufferSize",
|
|
5327
5406
|
{ bufferSize },
|
|
5328
5407
|
timeout
|
|
5329
5408
|
);
|
|
5330
5409
|
if (!response.isSuccess()) {
|
|
5331
|
-
throw new Error(((
|
|
5410
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Set buffer size failed");
|
|
5332
5411
|
}
|
|
5333
5412
|
return response.data;
|
|
5334
5413
|
}
|
|
@@ -5402,10 +5481,10 @@ var FileUtils = class {
|
|
|
5402
5481
|
* @returns Promise<文件信息>
|
|
5403
5482
|
*/
|
|
5404
5483
|
async getFileByPath(filePath, timeout) {
|
|
5405
|
-
var
|
|
5484
|
+
var _a2;
|
|
5406
5485
|
const response = await this.asyncCall("getFileByPath", { filePath }, timeout);
|
|
5407
5486
|
if (!response.isSuccess()) {
|
|
5408
|
-
throw new Error(((
|
|
5487
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file by path failed");
|
|
5409
5488
|
}
|
|
5410
5489
|
return response.data;
|
|
5411
5490
|
}
|
|
@@ -5416,10 +5495,10 @@ var FileUtils = class {
|
|
|
5416
5495
|
* @returns Promise<是否存在>
|
|
5417
5496
|
*/
|
|
5418
5497
|
async isFileExists(filePath, timeout) {
|
|
5419
|
-
var
|
|
5498
|
+
var _a2;
|
|
5420
5499
|
const response = await this.asyncCall("isFileExists", { filePath }, timeout);
|
|
5421
5500
|
if (!response.isSuccess()) {
|
|
5422
|
-
throw new Error(((
|
|
5501
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check file exists failed");
|
|
5423
5502
|
}
|
|
5424
5503
|
return response.data;
|
|
5425
5504
|
}
|
|
@@ -5431,10 +5510,10 @@ var FileUtils = class {
|
|
|
5431
5510
|
* @returns Promise<是否成功>
|
|
5432
5511
|
*/
|
|
5433
5512
|
async rename(filePath, newName, timeout) {
|
|
5434
|
-
var
|
|
5513
|
+
var _a2;
|
|
5435
5514
|
const response = await this.asyncCall("rename", { filePath, newName }, timeout);
|
|
5436
5515
|
if (!response.isSuccess()) {
|
|
5437
|
-
throw new Error(((
|
|
5516
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Rename file failed");
|
|
5438
5517
|
}
|
|
5439
5518
|
return response.data;
|
|
5440
5519
|
}
|
|
@@ -5445,10 +5524,10 @@ var FileUtils = class {
|
|
|
5445
5524
|
* @returns Promise<是否为目录>
|
|
5446
5525
|
*/
|
|
5447
5526
|
async isDir(filePath, timeout) {
|
|
5448
|
-
var
|
|
5527
|
+
var _a2;
|
|
5449
5528
|
const response = await this.asyncCall("isDir", { filePath }, timeout);
|
|
5450
5529
|
if (!response.isSuccess()) {
|
|
5451
|
-
throw new Error(((
|
|
5530
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check is directory failed");
|
|
5452
5531
|
}
|
|
5453
5532
|
return response.data;
|
|
5454
5533
|
}
|
|
@@ -5459,10 +5538,10 @@ var FileUtils = class {
|
|
|
5459
5538
|
* @returns Promise<是否为文件>
|
|
5460
5539
|
*/
|
|
5461
5540
|
async isFile(filePath, timeout) {
|
|
5462
|
-
var
|
|
5541
|
+
var _a2;
|
|
5463
5542
|
const response = await this.asyncCall("isFile", { filePath }, timeout);
|
|
5464
5543
|
if (!response.isSuccess()) {
|
|
5465
|
-
throw new Error(((
|
|
5544
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check is file failed");
|
|
5466
5545
|
}
|
|
5467
5546
|
return response.data;
|
|
5468
5547
|
}
|
|
@@ -5473,10 +5552,10 @@ var FileUtils = class {
|
|
|
5473
5552
|
* @returns Promise<是否成功>
|
|
5474
5553
|
*/
|
|
5475
5554
|
async createOrExistsDir(dirPath, timeout) {
|
|
5476
|
-
var
|
|
5555
|
+
var _a2;
|
|
5477
5556
|
const response = await this.asyncCall("createOrExistsDir", { dirPath }, timeout);
|
|
5478
5557
|
if (!response.isSuccess()) {
|
|
5479
|
-
throw new Error(((
|
|
5558
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Create or exists dir failed");
|
|
5480
5559
|
}
|
|
5481
5560
|
return response.data;
|
|
5482
5561
|
}
|
|
@@ -5487,10 +5566,10 @@ var FileUtils = class {
|
|
|
5487
5566
|
* @returns Promise<是否成功>
|
|
5488
5567
|
*/
|
|
5489
5568
|
async createOrExistsFile(filePath, timeout) {
|
|
5490
|
-
var
|
|
5569
|
+
var _a2;
|
|
5491
5570
|
const response = await this.asyncCall("createOrExistsFile", { filePath }, timeout);
|
|
5492
5571
|
if (!response.isSuccess()) {
|
|
5493
|
-
throw new Error(((
|
|
5572
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Create or exists file failed");
|
|
5494
5573
|
}
|
|
5495
5574
|
return response.data;
|
|
5496
5575
|
}
|
|
@@ -5501,10 +5580,10 @@ var FileUtils = class {
|
|
|
5501
5580
|
* @returns Promise<是否成功>
|
|
5502
5581
|
*/
|
|
5503
5582
|
async createFileByDeleteOldFile(filePath, timeout) {
|
|
5504
|
-
var
|
|
5583
|
+
var _a2;
|
|
5505
5584
|
const response = await this.asyncCall("createFileByDeleteOldFile", { filePath }, timeout);
|
|
5506
5585
|
if (!response.isSuccess()) {
|
|
5507
|
-
throw new Error(((
|
|
5586
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Create file by delete old file failed");
|
|
5508
5587
|
}
|
|
5509
5588
|
return response.data;
|
|
5510
5589
|
}
|
|
@@ -5516,10 +5595,10 @@ var FileUtils = class {
|
|
|
5516
5595
|
* @returns Promise<是否成功>
|
|
5517
5596
|
*/
|
|
5518
5597
|
async copy(srcFilePath, destFilePath, timeout) {
|
|
5519
|
-
var
|
|
5598
|
+
var _a2;
|
|
5520
5599
|
const response = await this.asyncCall("copy", { srcFilePath, destFilePath }, timeout);
|
|
5521
5600
|
if (!response.isSuccess()) {
|
|
5522
|
-
throw new Error(((
|
|
5601
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Copy file failed");
|
|
5523
5602
|
}
|
|
5524
5603
|
return response.data;
|
|
5525
5604
|
}
|
|
@@ -5531,10 +5610,10 @@ var FileUtils = class {
|
|
|
5531
5610
|
* @returns Promise<是否成功>
|
|
5532
5611
|
*/
|
|
5533
5612
|
async move(srcFilePath, destFilePath, timeout) {
|
|
5534
|
-
var
|
|
5613
|
+
var _a2;
|
|
5535
5614
|
const response = await this.asyncCall("move", { srcFilePath, destFilePath }, timeout);
|
|
5536
5615
|
if (!response.isSuccess()) {
|
|
5537
|
-
throw new Error(((
|
|
5616
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Move file failed");
|
|
5538
5617
|
}
|
|
5539
5618
|
return response.data;
|
|
5540
5619
|
}
|
|
@@ -5545,10 +5624,10 @@ var FileUtils = class {
|
|
|
5545
5624
|
* @returns Promise<是否成功>
|
|
5546
5625
|
*/
|
|
5547
5626
|
async delete(filePath, timeout) {
|
|
5548
|
-
var
|
|
5627
|
+
var _a2;
|
|
5549
5628
|
const response = await this.asyncCall("delete", { filePath }, timeout);
|
|
5550
5629
|
if (!response.isSuccess()) {
|
|
5551
|
-
throw new Error(((
|
|
5630
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Delete file failed");
|
|
5552
5631
|
}
|
|
5553
5632
|
return response.data;
|
|
5554
5633
|
}
|
|
@@ -5559,10 +5638,10 @@ var FileUtils = class {
|
|
|
5559
5638
|
* @returns Promise<是否成功>
|
|
5560
5639
|
*/
|
|
5561
5640
|
async deleteAllInDir(dirPath, timeout) {
|
|
5562
|
-
var
|
|
5641
|
+
var _a2;
|
|
5563
5642
|
const response = await this.asyncCall("deleteAllInDir", { dirPath }, timeout);
|
|
5564
5643
|
if (!response.isSuccess()) {
|
|
5565
|
-
throw new Error(((
|
|
5644
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Delete all in dir failed");
|
|
5566
5645
|
}
|
|
5567
5646
|
return response.data;
|
|
5568
5647
|
}
|
|
@@ -5573,10 +5652,10 @@ var FileUtils = class {
|
|
|
5573
5652
|
* @returns Promise<是否成功>
|
|
5574
5653
|
*/
|
|
5575
5654
|
async deleteFilesInDir(dirPath, timeout) {
|
|
5576
|
-
var
|
|
5655
|
+
var _a2;
|
|
5577
5656
|
const response = await this.asyncCall("deleteFilesInDir", { dirPath }, timeout);
|
|
5578
5657
|
if (!response.isSuccess()) {
|
|
5579
|
-
throw new Error(((
|
|
5658
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Delete files in dir failed");
|
|
5580
5659
|
}
|
|
5581
5660
|
return response.data;
|
|
5582
5661
|
}
|
|
@@ -5588,14 +5667,14 @@ var FileUtils = class {
|
|
|
5588
5667
|
* @returns Promise<是否成功>
|
|
5589
5668
|
*/
|
|
5590
5669
|
async deleteFilesInDirWithFilter(dirPath, filterPattern, timeout) {
|
|
5591
|
-
var
|
|
5670
|
+
var _a2;
|
|
5592
5671
|
const response = await this.asyncCall(
|
|
5593
5672
|
"deleteFilesInDirWithFilter",
|
|
5594
5673
|
{ dirPath, filterPattern },
|
|
5595
5674
|
timeout
|
|
5596
5675
|
);
|
|
5597
5676
|
if (!response.isSuccess()) {
|
|
5598
|
-
throw new Error(((
|
|
5677
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Delete files in dir with filter failed");
|
|
5599
5678
|
}
|
|
5600
5679
|
return response.data;
|
|
5601
5680
|
}
|
|
@@ -5606,10 +5685,10 @@ var FileUtils = class {
|
|
|
5606
5685
|
* @returns Promise<文件列表>
|
|
5607
5686
|
*/
|
|
5608
5687
|
async listFilesInDir(dirPath, timeout) {
|
|
5609
|
-
var
|
|
5688
|
+
var _a2;
|
|
5610
5689
|
const response = await this.asyncCall("listFilesInDir", { dirPath }, timeout);
|
|
5611
5690
|
if (!response.isSuccess()) {
|
|
5612
|
-
throw new Error(((
|
|
5691
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "List files in dir failed");
|
|
5613
5692
|
}
|
|
5614
5693
|
return response.data;
|
|
5615
5694
|
}
|
|
@@ -5621,14 +5700,14 @@ var FileUtils = class {
|
|
|
5621
5700
|
* @returns Promise<文件列表>
|
|
5622
5701
|
*/
|
|
5623
5702
|
async listFilesInDirWithFilter(dirPath, filterPattern, timeout) {
|
|
5624
|
-
var
|
|
5703
|
+
var _a2;
|
|
5625
5704
|
const response = await this.asyncCall(
|
|
5626
5705
|
"listFilesInDirWithFilter",
|
|
5627
5706
|
{ dirPath, filterPattern },
|
|
5628
5707
|
timeout
|
|
5629
5708
|
);
|
|
5630
5709
|
if (!response.isSuccess()) {
|
|
5631
|
-
throw new Error(((
|
|
5710
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "List files in dir with filter failed");
|
|
5632
5711
|
}
|
|
5633
5712
|
return response.data;
|
|
5634
5713
|
}
|
|
@@ -5639,10 +5718,10 @@ var FileUtils = class {
|
|
|
5639
5718
|
* @returns Promise<时间戳(毫秒)>
|
|
5640
5719
|
*/
|
|
5641
5720
|
async getFileLastModified(filePath, timeout) {
|
|
5642
|
-
var
|
|
5721
|
+
var _a2;
|
|
5643
5722
|
const response = await this.asyncCall("getFileLastModified", { filePath }, timeout);
|
|
5644
5723
|
if (!response.isSuccess()) {
|
|
5645
|
-
throw new Error(((
|
|
5724
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file last modified failed");
|
|
5646
5725
|
}
|
|
5647
5726
|
return response.data;
|
|
5648
5727
|
}
|
|
@@ -5653,10 +5732,10 @@ var FileUtils = class {
|
|
|
5653
5732
|
* @returns Promise<字符集名称>
|
|
5654
5733
|
*/
|
|
5655
5734
|
async getFileCharsetSimple(filePath, timeout) {
|
|
5656
|
-
var
|
|
5735
|
+
var _a2;
|
|
5657
5736
|
const response = await this.asyncCall("getFileCharsetSimple", { filePath }, timeout);
|
|
5658
5737
|
if (!response.isSuccess()) {
|
|
5659
|
-
throw new Error(((
|
|
5738
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file charset simple failed");
|
|
5660
5739
|
}
|
|
5661
5740
|
return response.data;
|
|
5662
5741
|
}
|
|
@@ -5667,10 +5746,10 @@ var FileUtils = class {
|
|
|
5667
5746
|
* @returns Promise<行数>
|
|
5668
5747
|
*/
|
|
5669
5748
|
async getFileLines(filePath, timeout) {
|
|
5670
|
-
var
|
|
5749
|
+
var _a2;
|
|
5671
5750
|
const response = await this.asyncCall("getFileLines", { filePath }, timeout);
|
|
5672
5751
|
if (!response.isSuccess()) {
|
|
5673
|
-
throw new Error(((
|
|
5752
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file lines failed");
|
|
5674
5753
|
}
|
|
5675
5754
|
return response.data;
|
|
5676
5755
|
}
|
|
@@ -5681,10 +5760,10 @@ var FileUtils = class {
|
|
|
5681
5760
|
* @returns Promise<大小(字节)>
|
|
5682
5761
|
*/
|
|
5683
5762
|
async getSize(filePath, timeout) {
|
|
5684
|
-
var
|
|
5763
|
+
var _a2;
|
|
5685
5764
|
const response = await this.asyncCall("getSize", { filePath }, timeout);
|
|
5686
5765
|
if (!response.isSuccess()) {
|
|
5687
|
-
throw new Error(((
|
|
5766
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get size failed");
|
|
5688
5767
|
}
|
|
5689
5768
|
return response.data;
|
|
5690
5769
|
}
|
|
@@ -5695,10 +5774,10 @@ var FileUtils = class {
|
|
|
5695
5774
|
* @returns Promise<长度(字节)>
|
|
5696
5775
|
*/
|
|
5697
5776
|
async getLength(filePath, timeout) {
|
|
5698
|
-
var
|
|
5777
|
+
var _a2;
|
|
5699
5778
|
const response = await this.asyncCall("getLength", { filePath }, timeout);
|
|
5700
5779
|
if (!response.isSuccess()) {
|
|
5701
|
-
throw new Error(((
|
|
5780
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get length failed");
|
|
5702
5781
|
}
|
|
5703
5782
|
return response.data;
|
|
5704
5783
|
}
|
|
@@ -5709,10 +5788,10 @@ var FileUtils = class {
|
|
|
5709
5788
|
* @returns Promise<Base64 编码的 MD5>
|
|
5710
5789
|
*/
|
|
5711
5790
|
async getFileMD5(filePath, timeout) {
|
|
5712
|
-
var
|
|
5791
|
+
var _a2;
|
|
5713
5792
|
const response = await this.asyncCall("getFileMD5", { filePath }, timeout);
|
|
5714
5793
|
if (!response.isSuccess()) {
|
|
5715
|
-
throw new Error(((
|
|
5794
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file MD5 failed");
|
|
5716
5795
|
}
|
|
5717
5796
|
return response.data;
|
|
5718
5797
|
}
|
|
@@ -5723,10 +5802,10 @@ var FileUtils = class {
|
|
|
5723
5802
|
* @returns Promise<MD5 字符串>
|
|
5724
5803
|
*/
|
|
5725
5804
|
async getFileMD5ToString(filePath, timeout) {
|
|
5726
|
-
var
|
|
5805
|
+
var _a2;
|
|
5727
5806
|
const response = await this.asyncCall("getFileMD5ToString", { filePath }, timeout);
|
|
5728
5807
|
if (!response.isSuccess()) {
|
|
5729
|
-
throw new Error(((
|
|
5808
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file MD5 to string failed");
|
|
5730
5809
|
}
|
|
5731
5810
|
return response.data;
|
|
5732
5811
|
}
|
|
@@ -5737,10 +5816,10 @@ var FileUtils = class {
|
|
|
5737
5816
|
* @returns Promise<目录名>
|
|
5738
5817
|
*/
|
|
5739
5818
|
async getDirName(filePath, timeout) {
|
|
5740
|
-
var
|
|
5819
|
+
var _a2;
|
|
5741
5820
|
const response = await this.asyncCall("getDirName", { filePath }, timeout);
|
|
5742
5821
|
if (!response.isSuccess()) {
|
|
5743
|
-
throw new Error(((
|
|
5822
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get dir name failed");
|
|
5744
5823
|
}
|
|
5745
5824
|
return response.data;
|
|
5746
5825
|
}
|
|
@@ -5751,10 +5830,10 @@ var FileUtils = class {
|
|
|
5751
5830
|
* @returns Promise<文件名>
|
|
5752
5831
|
*/
|
|
5753
5832
|
async getFileName(filePath, timeout) {
|
|
5754
|
-
var
|
|
5833
|
+
var _a2;
|
|
5755
5834
|
const response = await this.asyncCall("getFileName", { filePath }, timeout);
|
|
5756
5835
|
if (!response.isSuccess()) {
|
|
5757
|
-
throw new Error(((
|
|
5836
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file name failed");
|
|
5758
5837
|
}
|
|
5759
5838
|
return response.data;
|
|
5760
5839
|
}
|
|
@@ -5765,10 +5844,10 @@ var FileUtils = class {
|
|
|
5765
5844
|
* @returns Promise<文件名(不含扩展名)>
|
|
5766
5845
|
*/
|
|
5767
5846
|
async getFileNameNoExtension(filePath, timeout) {
|
|
5768
|
-
var
|
|
5847
|
+
var _a2;
|
|
5769
5848
|
const response = await this.asyncCall("getFileNameNoExtension", { filePath }, timeout);
|
|
5770
5849
|
if (!response.isSuccess()) {
|
|
5771
|
-
throw new Error(((
|
|
5850
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file name no extension failed");
|
|
5772
5851
|
}
|
|
5773
5852
|
return response.data;
|
|
5774
5853
|
}
|
|
@@ -5779,10 +5858,10 @@ var FileUtils = class {
|
|
|
5779
5858
|
* @returns Promise<扩展名>
|
|
5780
5859
|
*/
|
|
5781
5860
|
async getFileExtension(filePath, timeout) {
|
|
5782
|
-
var
|
|
5861
|
+
var _a2;
|
|
5783
5862
|
const response = await this.asyncCall("getFileExtension", { filePath }, timeout);
|
|
5784
5863
|
if (!response.isSuccess()) {
|
|
5785
|
-
throw new Error(((
|
|
5864
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file extension failed");
|
|
5786
5865
|
}
|
|
5787
5866
|
return response.data;
|
|
5788
5867
|
}
|
|
@@ -5793,10 +5872,10 @@ var FileUtils = class {
|
|
|
5793
5872
|
* @returns Promise<是否成功>
|
|
5794
5873
|
*/
|
|
5795
5874
|
async notifySystemToScan(filePath, timeout) {
|
|
5796
|
-
var
|
|
5875
|
+
var _a2;
|
|
5797
5876
|
const response = await this.asyncCall("notifySystemToScan", { filePath }, timeout);
|
|
5798
5877
|
if (!response.isSuccess()) {
|
|
5799
|
-
throw new Error(((
|
|
5878
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Notify system to scan failed");
|
|
5800
5879
|
}
|
|
5801
5880
|
return response.data;
|
|
5802
5881
|
}
|
|
@@ -5807,10 +5886,10 @@ var FileUtils = class {
|
|
|
5807
5886
|
* @returns Promise<总大小(字节)>
|
|
5808
5887
|
*/
|
|
5809
5888
|
async getFsTotalSize(filePath, timeout) {
|
|
5810
|
-
var
|
|
5889
|
+
var _a2;
|
|
5811
5890
|
const response = await this.asyncCall("getFsTotalSize", { filePath }, timeout);
|
|
5812
5891
|
if (!response.isSuccess()) {
|
|
5813
|
-
throw new Error(((
|
|
5892
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file system total size failed");
|
|
5814
5893
|
}
|
|
5815
5894
|
return response.data;
|
|
5816
5895
|
}
|
|
@@ -5821,10 +5900,10 @@ var FileUtils = class {
|
|
|
5821
5900
|
* @returns Promise<可用大小(字节)>
|
|
5822
5901
|
*/
|
|
5823
5902
|
async getFsAvailableSize(filePath, timeout) {
|
|
5824
|
-
var
|
|
5903
|
+
var _a2;
|
|
5825
5904
|
const response = await this.asyncCall("getFsAvailableSize", { filePath }, timeout);
|
|
5826
5905
|
if (!response.isSuccess()) {
|
|
5827
|
-
throw new Error(((
|
|
5906
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file system available size failed");
|
|
5828
5907
|
}
|
|
5829
5908
|
return response.data;
|
|
5830
5909
|
}
|
|
@@ -5908,14 +5987,14 @@ var Ime = class {
|
|
|
5908
5987
|
* @returns Promise<执行结果>
|
|
5909
5988
|
*/
|
|
5910
5989
|
async performEditorAction(actionId = 3 /* SEARCH */, timeout) {
|
|
5911
|
-
var
|
|
5990
|
+
var _a2;
|
|
5912
5991
|
const response = await this.asyncCall(
|
|
5913
5992
|
"performEditorAction",
|
|
5914
5993
|
{ actionId },
|
|
5915
5994
|
timeout
|
|
5916
5995
|
);
|
|
5917
5996
|
if (!response.isSuccess()) {
|
|
5918
|
-
throw new Error(((
|
|
5997
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Perform editor action failed");
|
|
5919
5998
|
}
|
|
5920
5999
|
return response.data;
|
|
5921
6000
|
}
|
|
@@ -5925,14 +6004,14 @@ var Ime = class {
|
|
|
5925
6004
|
* @returns Promise<执行结果>
|
|
5926
6005
|
*/
|
|
5927
6006
|
async openInputMethodSettings(timeout) {
|
|
5928
|
-
var
|
|
6007
|
+
var _a2;
|
|
5929
6008
|
const response = await this.asyncCall(
|
|
5930
6009
|
"openInputMethodSettings",
|
|
5931
6010
|
void 0,
|
|
5932
6011
|
timeout
|
|
5933
6012
|
);
|
|
5934
6013
|
if (!response.isSuccess()) {
|
|
5935
|
-
throw new Error(((
|
|
6014
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Open input method settings failed");
|
|
5936
6015
|
}
|
|
5937
6016
|
return response.data;
|
|
5938
6017
|
}
|
|
@@ -5942,14 +6021,14 @@ var Ime = class {
|
|
|
5942
6021
|
* @returns Promise<检查结果>
|
|
5943
6022
|
*/
|
|
5944
6023
|
async isInputMethodEnabled(timeout) {
|
|
5945
|
-
var
|
|
6024
|
+
var _a2;
|
|
5946
6025
|
const response = await this.asyncCall(
|
|
5947
6026
|
"isInputMethodEnabled",
|
|
5948
6027
|
void 0,
|
|
5949
6028
|
timeout
|
|
5950
6029
|
);
|
|
5951
6030
|
if (!response.isSuccess()) {
|
|
5952
|
-
throw new Error(((
|
|
6031
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check input method enabled failed");
|
|
5953
6032
|
}
|
|
5954
6033
|
return response.data;
|
|
5955
6034
|
}
|
|
@@ -5959,14 +6038,14 @@ var Ime = class {
|
|
|
5959
6038
|
* @returns Promise<检查结果>
|
|
5960
6039
|
*/
|
|
5961
6040
|
async isCurrentInputMethod(timeout) {
|
|
5962
|
-
var
|
|
6041
|
+
var _a2;
|
|
5963
6042
|
const response = await this.asyncCall(
|
|
5964
6043
|
"isCurrentInputMethod",
|
|
5965
6044
|
void 0,
|
|
5966
6045
|
timeout
|
|
5967
6046
|
);
|
|
5968
6047
|
if (!response.isSuccess()) {
|
|
5969
|
-
throw new Error(((
|
|
6048
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check current input method failed");
|
|
5970
6049
|
}
|
|
5971
6050
|
return response.data;
|
|
5972
6051
|
}
|
|
@@ -6041,10 +6120,10 @@ var ImageUtils = class {
|
|
|
6041
6120
|
* @returns Promise<图片尺寸信息>
|
|
6042
6121
|
*/
|
|
6043
6122
|
async getSize(imagePath, timeout) {
|
|
6044
|
-
var
|
|
6123
|
+
var _a2;
|
|
6045
6124
|
const response = await this.asyncCall("getSize", { imagePath }, timeout);
|
|
6046
6125
|
if (!response.isSuccess()) {
|
|
6047
|
-
throw new Error(((
|
|
6126
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u83B7\u53D6\u56FE\u7247\u5C3A\u5BF8\u5931\u8D25");
|
|
6048
6127
|
}
|
|
6049
6128
|
return response.data;
|
|
6050
6129
|
}
|
|
@@ -6055,10 +6134,10 @@ var ImageUtils = class {
|
|
|
6055
6134
|
* @returns Promise<图片类型信息>
|
|
6056
6135
|
*/
|
|
6057
6136
|
async getImageType(imagePath, timeout) {
|
|
6058
|
-
var
|
|
6137
|
+
var _a2;
|
|
6059
6138
|
const response = await this.asyncCall("getImageType", { imagePath }, timeout);
|
|
6060
6139
|
if (!response.isSuccess()) {
|
|
6061
|
-
throw new Error(((
|
|
6140
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u83B7\u53D6\u56FE\u7247\u7C7B\u578B\u5931\u8D25");
|
|
6062
6141
|
}
|
|
6063
6142
|
return response.data;
|
|
6064
6143
|
}
|
|
@@ -6069,10 +6148,10 @@ var ImageUtils = class {
|
|
|
6069
6148
|
* @returns Promise<是否为图片>
|
|
6070
6149
|
*/
|
|
6071
6150
|
async isImage(fileName, timeout) {
|
|
6072
|
-
var
|
|
6151
|
+
var _a2;
|
|
6073
6152
|
const response = await this.asyncCall("isImage", { fileName }, timeout);
|
|
6074
6153
|
if (!response.isSuccess()) {
|
|
6075
|
-
throw new Error(((
|
|
6154
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u5224\u65AD\u662F\u5426\u4E3A\u56FE\u7247\u5931\u8D25");
|
|
6076
6155
|
}
|
|
6077
6156
|
return response.data.isImage;
|
|
6078
6157
|
}
|
|
@@ -6083,10 +6162,10 @@ var ImageUtils = class {
|
|
|
6083
6162
|
* @returns Promise<图片旋转角度信息>
|
|
6084
6163
|
*/
|
|
6085
6164
|
async getRotateDegree(imagePath, timeout) {
|
|
6086
|
-
var
|
|
6165
|
+
var _a2;
|
|
6087
6166
|
const response = await this.asyncCall("getRotateDegree", { imagePath }, timeout);
|
|
6088
6167
|
if (!response.isSuccess()) {
|
|
6089
|
-
throw new Error(((
|
|
6168
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u83B7\u53D6\u56FE\u7247\u65CB\u8F6C\u89D2\u5EA6\u5931\u8D25");
|
|
6090
6169
|
}
|
|
6091
6170
|
return response.data;
|
|
6092
6171
|
}
|
|
@@ -6103,7 +6182,7 @@ var ImageUtils = class {
|
|
|
6103
6182
|
* @returns Promise<处理后的图片路径>
|
|
6104
6183
|
*/
|
|
6105
6184
|
async scale(imagePath, options = {}) {
|
|
6106
|
-
var
|
|
6185
|
+
var _a2;
|
|
6107
6186
|
const { scaleWidth, scaleHeight, savePath, format, timeout } = options;
|
|
6108
6187
|
const response = await this.asyncCall(
|
|
6109
6188
|
"scale",
|
|
@@ -6111,7 +6190,7 @@ var ImageUtils = class {
|
|
|
6111
6190
|
timeout
|
|
6112
6191
|
);
|
|
6113
6192
|
if (!response.isSuccess()) {
|
|
6114
|
-
throw new Error(((
|
|
6193
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u7F29\u653E\u56FE\u7247\u5931\u8D25");
|
|
6115
6194
|
}
|
|
6116
6195
|
return response.data.filePath;
|
|
6117
6196
|
}
|
|
@@ -6129,7 +6208,7 @@ var ImageUtils = class {
|
|
|
6129
6208
|
* @returns Promise<处理后的图片路径>
|
|
6130
6209
|
*/
|
|
6131
6210
|
async clip(imagePath, options = {}) {
|
|
6132
|
-
var
|
|
6211
|
+
var _a2;
|
|
6133
6212
|
const { x = 0, y = 0, width, height, savePath, format, timeout } = options;
|
|
6134
6213
|
const response = await this.asyncCall(
|
|
6135
6214
|
"clip",
|
|
@@ -6137,7 +6216,7 @@ var ImageUtils = class {
|
|
|
6137
6216
|
timeout
|
|
6138
6217
|
);
|
|
6139
6218
|
if (!response.isSuccess()) {
|
|
6140
|
-
throw new Error(((
|
|
6219
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u88C1\u526A\u56FE\u7247\u5931\u8D25");
|
|
6141
6220
|
}
|
|
6142
6221
|
return response.data.filePath;
|
|
6143
6222
|
}
|
|
@@ -6155,7 +6234,7 @@ var ImageUtils = class {
|
|
|
6155
6234
|
* @returns Promise<处理后的图片路径>
|
|
6156
6235
|
*/
|
|
6157
6236
|
async skew(imagePath, options = {}) {
|
|
6158
|
-
var
|
|
6237
|
+
var _a2;
|
|
6159
6238
|
const { kx = 0, ky = 0, px, py, savePath, format, timeout } = options;
|
|
6160
6239
|
const response = await this.asyncCall(
|
|
6161
6240
|
"skew",
|
|
@@ -6163,7 +6242,7 @@ var ImageUtils = class {
|
|
|
6163
6242
|
timeout
|
|
6164
6243
|
);
|
|
6165
6244
|
if (!response.isSuccess()) {
|
|
6166
|
-
throw new Error(((
|
|
6245
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u503E\u659C\u56FE\u7247\u5931\u8D25");
|
|
6167
6246
|
}
|
|
6168
6247
|
return response.data.filePath;
|
|
6169
6248
|
}
|
|
@@ -6180,7 +6259,7 @@ var ImageUtils = class {
|
|
|
6180
6259
|
* @returns Promise<处理后的图片路径>
|
|
6181
6260
|
*/
|
|
6182
6261
|
async rotate(imagePath, options = {}) {
|
|
6183
|
-
var
|
|
6262
|
+
var _a2;
|
|
6184
6263
|
const { degree = 0, px, py, savePath, format, timeout } = options;
|
|
6185
6264
|
const response = await this.asyncCall(
|
|
6186
6265
|
"rotate",
|
|
@@ -6188,7 +6267,7 @@ var ImageUtils = class {
|
|
|
6188
6267
|
timeout
|
|
6189
6268
|
);
|
|
6190
6269
|
if (!response.isSuccess()) {
|
|
6191
|
-
throw new Error(((
|
|
6270
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u65CB\u8F6C\u56FE\u7247\u5931\u8D25");
|
|
6192
6271
|
}
|
|
6193
6272
|
return response.data.filePath;
|
|
6194
6273
|
}
|
|
@@ -6202,7 +6281,7 @@ var ImageUtils = class {
|
|
|
6202
6281
|
* @returns Promise<处理后的图片路径>
|
|
6203
6282
|
*/
|
|
6204
6283
|
async toRound(imagePath, options = {}) {
|
|
6205
|
-
var
|
|
6284
|
+
var _a2;
|
|
6206
6285
|
const { savePath, format, timeout } = options;
|
|
6207
6286
|
const response = await this.asyncCall(
|
|
6208
6287
|
"toRound",
|
|
@@ -6210,7 +6289,7 @@ var ImageUtils = class {
|
|
|
6210
6289
|
timeout
|
|
6211
6290
|
);
|
|
6212
6291
|
if (!response.isSuccess()) {
|
|
6213
|
-
throw new Error(((
|
|
6292
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u8F6C\u4E3A\u5706\u5F62\u56FE\u7247\u5931\u8D25");
|
|
6214
6293
|
}
|
|
6215
6294
|
return response.data.filePath;
|
|
6216
6295
|
}
|
|
@@ -6225,7 +6304,7 @@ var ImageUtils = class {
|
|
|
6225
6304
|
* @returns Promise<处理后的图片路径>
|
|
6226
6305
|
*/
|
|
6227
6306
|
async toRoundCorner(imagePath, options = {}) {
|
|
6228
|
-
var
|
|
6307
|
+
var _a2;
|
|
6229
6308
|
const { radius = 0, savePath, format, timeout } = options;
|
|
6230
6309
|
const response = await this.asyncCall(
|
|
6231
6310
|
"toRoundCorner",
|
|
@@ -6233,7 +6312,7 @@ var ImageUtils = class {
|
|
|
6233
6312
|
timeout
|
|
6234
6313
|
);
|
|
6235
6314
|
if (!response.isSuccess()) {
|
|
6236
|
-
throw new Error(((
|
|
6315
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u8F6C\u4E3A\u5706\u89D2\u56FE\u7247\u5931\u8D25");
|
|
6237
6316
|
}
|
|
6238
6317
|
return response.data.filePath;
|
|
6239
6318
|
}
|
|
@@ -6250,7 +6329,7 @@ var ImageUtils = class {
|
|
|
6250
6329
|
* @returns Promise<处理后的图片路径>
|
|
6251
6330
|
*/
|
|
6252
6331
|
async addCornerBorder(imagePath, options = {}) {
|
|
6253
|
-
var
|
|
6332
|
+
var _a2;
|
|
6254
6333
|
const { borderSize = 0, color = "#000000", cornerRadius = 0, savePath, format, timeout } = options;
|
|
6255
6334
|
const response = await this.asyncCall(
|
|
6256
6335
|
"addCornerBorder",
|
|
@@ -6258,7 +6337,7 @@ var ImageUtils = class {
|
|
|
6258
6337
|
timeout
|
|
6259
6338
|
);
|
|
6260
6339
|
if (!response.isSuccess()) {
|
|
6261
|
-
throw new Error(((
|
|
6340
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u5706\u89D2\u8FB9\u6846\u5931\u8D25");
|
|
6262
6341
|
}
|
|
6263
6342
|
return response.data.filePath;
|
|
6264
6343
|
}
|
|
@@ -6274,7 +6353,7 @@ var ImageUtils = class {
|
|
|
6274
6353
|
* @returns Promise<处理后的图片路径>
|
|
6275
6354
|
*/
|
|
6276
6355
|
async addCircleBorder(imagePath, options = {}) {
|
|
6277
|
-
var
|
|
6356
|
+
var _a2;
|
|
6278
6357
|
const { borderSize = 0, color = "#000000", savePath, format, timeout } = options;
|
|
6279
6358
|
const response = await this.asyncCall(
|
|
6280
6359
|
"addCircleBorder",
|
|
@@ -6282,7 +6361,7 @@ var ImageUtils = class {
|
|
|
6282
6361
|
timeout
|
|
6283
6362
|
);
|
|
6284
6363
|
if (!response.isSuccess()) {
|
|
6285
|
-
throw new Error(((
|
|
6364
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u5706\u5F62\u8FB9\u6846\u5931\u8D25");
|
|
6286
6365
|
}
|
|
6287
6366
|
return response.data.filePath;
|
|
6288
6367
|
}
|
|
@@ -6297,7 +6376,7 @@ var ImageUtils = class {
|
|
|
6297
6376
|
* @returns Promise<处理后的图片路径>
|
|
6298
6377
|
*/
|
|
6299
6378
|
async addReflection(imagePath, options = {}) {
|
|
6300
|
-
var
|
|
6379
|
+
var _a2;
|
|
6301
6380
|
const { reflectionHeight = 0, savePath, format, timeout } = options;
|
|
6302
6381
|
const response = await this.asyncCall(
|
|
6303
6382
|
"addReflection",
|
|
@@ -6305,7 +6384,7 @@ var ImageUtils = class {
|
|
|
6305
6384
|
timeout
|
|
6306
6385
|
);
|
|
6307
6386
|
if (!response.isSuccess()) {
|
|
6308
|
-
throw new Error(((
|
|
6387
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u5012\u5F71\u5931\u8D25");
|
|
6309
6388
|
}
|
|
6310
6389
|
return response.data.filePath;
|
|
6311
6390
|
}
|
|
@@ -6324,7 +6403,7 @@ var ImageUtils = class {
|
|
|
6324
6403
|
* @returns Promise<处理后的图片路径>
|
|
6325
6404
|
*/
|
|
6326
6405
|
async addTextWatermark(imagePath, options = {}) {
|
|
6327
|
-
var
|
|
6406
|
+
var _a2;
|
|
6328
6407
|
const { text = "", x = 0, y = 0, color = "#000000", size = 16, savePath, format, timeout } = options;
|
|
6329
6408
|
const response = await this.asyncCall(
|
|
6330
6409
|
"addTextWatermark",
|
|
@@ -6332,7 +6411,7 @@ var ImageUtils = class {
|
|
|
6332
6411
|
timeout
|
|
6333
6412
|
);
|
|
6334
6413
|
if (!response.isSuccess()) {
|
|
6335
|
-
throw new Error(((
|
|
6414
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u6587\u5B57\u6C34\u5370\u5931\u8D25");
|
|
6336
6415
|
}
|
|
6337
6416
|
return response.data.filePath;
|
|
6338
6417
|
}
|
|
@@ -6350,7 +6429,7 @@ var ImageUtils = class {
|
|
|
6350
6429
|
* @returns Promise<处理后的图片路径>
|
|
6351
6430
|
*/
|
|
6352
6431
|
async addImageWatermark(imagePath, options) {
|
|
6353
|
-
var
|
|
6432
|
+
var _a2;
|
|
6354
6433
|
const { watermarkPath, x = 0, y = 0, alpha = 255, savePath, format, timeout } = options;
|
|
6355
6434
|
const response = await this.asyncCall(
|
|
6356
6435
|
"addImageWatermark",
|
|
@@ -6358,7 +6437,7 @@ var ImageUtils = class {
|
|
|
6358
6437
|
timeout
|
|
6359
6438
|
);
|
|
6360
6439
|
if (!response.isSuccess()) {
|
|
6361
|
-
throw new Error(((
|
|
6440
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u56FE\u7247\u6C34\u5370\u5931\u8D25");
|
|
6362
6441
|
}
|
|
6363
6442
|
return response.data.filePath;
|
|
6364
6443
|
}
|
|
@@ -6372,7 +6451,7 @@ var ImageUtils = class {
|
|
|
6372
6451
|
* @returns Promise<处理后的图片路径>
|
|
6373
6452
|
*/
|
|
6374
6453
|
async toAlpha(imagePath, options = {}) {
|
|
6375
|
-
var
|
|
6454
|
+
var _a2;
|
|
6376
6455
|
const { savePath, format, timeout } = options;
|
|
6377
6456
|
const response = await this.asyncCall(
|
|
6378
6457
|
"toAlpha",
|
|
@@ -6380,7 +6459,7 @@ var ImageUtils = class {
|
|
|
6380
6459
|
timeout
|
|
6381
6460
|
);
|
|
6382
6461
|
if (!response.isSuccess()) {
|
|
6383
|
-
throw new Error(((
|
|
6462
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u8F6C\u4E3A alpha \u4F4D\u56FE\u5931\u8D25");
|
|
6384
6463
|
}
|
|
6385
6464
|
return response.data.filePath;
|
|
6386
6465
|
}
|
|
@@ -6394,7 +6473,7 @@ var ImageUtils = class {
|
|
|
6394
6473
|
* @returns Promise<处理后的图片路径>
|
|
6395
6474
|
*/
|
|
6396
6475
|
async toGray(imagePath, options = {}) {
|
|
6397
|
-
var
|
|
6476
|
+
var _a2;
|
|
6398
6477
|
const { savePath, format, timeout } = options;
|
|
6399
6478
|
const response = await this.asyncCall(
|
|
6400
6479
|
"toGray",
|
|
@@ -6402,7 +6481,7 @@ var ImageUtils = class {
|
|
|
6402
6481
|
timeout
|
|
6403
6482
|
);
|
|
6404
6483
|
if (!response.isSuccess()) {
|
|
6405
|
-
throw new Error(((
|
|
6484
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u8F6C\u4E3A\u7070\u5EA6\u56FE\u7247\u5931\u8D25");
|
|
6406
6485
|
}
|
|
6407
6486
|
return response.data.filePath;
|
|
6408
6487
|
}
|
|
@@ -6418,7 +6497,7 @@ var ImageUtils = class {
|
|
|
6418
6497
|
* @returns Promise<处理后的图片路径>
|
|
6419
6498
|
*/
|
|
6420
6499
|
async fastBlur(imagePath, options = {}) {
|
|
6421
|
-
var
|
|
6500
|
+
var _a2;
|
|
6422
6501
|
const { radius = 0, scale = 1, savePath, format, timeout } = options;
|
|
6423
6502
|
const response = await this.asyncCall(
|
|
6424
6503
|
"fastBlur",
|
|
@@ -6426,7 +6505,7 @@ var ImageUtils = class {
|
|
|
6426
6505
|
timeout
|
|
6427
6506
|
);
|
|
6428
6507
|
if (!response.isSuccess()) {
|
|
6429
|
-
throw new Error(((
|
|
6508
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u5FEB\u901F\u6A21\u7CCA\u5931\u8D25");
|
|
6430
6509
|
}
|
|
6431
6510
|
return response.data.filePath;
|
|
6432
6511
|
}
|
|
@@ -6441,7 +6520,7 @@ var ImageUtils = class {
|
|
|
6441
6520
|
* @returns Promise<处理后的图片路径>
|
|
6442
6521
|
*/
|
|
6443
6522
|
async renderScriptBlur(imagePath, options = {}) {
|
|
6444
|
-
var
|
|
6523
|
+
var _a2;
|
|
6445
6524
|
const { radius = 0, savePath, format, timeout } = options;
|
|
6446
6525
|
const response = await this.asyncCall(
|
|
6447
6526
|
"renderScriptBlur",
|
|
@@ -6449,7 +6528,7 @@ var ImageUtils = class {
|
|
|
6449
6528
|
timeout
|
|
6450
6529
|
);
|
|
6451
6530
|
if (!response.isSuccess()) {
|
|
6452
|
-
throw new Error(((
|
|
6531
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "RenderScript \u6A21\u7CCA\u5931\u8D25");
|
|
6453
6532
|
}
|
|
6454
6533
|
return response.data.filePath;
|
|
6455
6534
|
}
|
|
@@ -6464,7 +6543,7 @@ var ImageUtils = class {
|
|
|
6464
6543
|
* @returns Promise<处理后的图片路径>
|
|
6465
6544
|
*/
|
|
6466
6545
|
async stackBlur(imagePath, options = {}) {
|
|
6467
|
-
var
|
|
6546
|
+
var _a2;
|
|
6468
6547
|
const { radius = 0, savePath, format, timeout } = options;
|
|
6469
6548
|
const response = await this.asyncCall(
|
|
6470
6549
|
"stackBlur",
|
|
@@ -6472,7 +6551,7 @@ var ImageUtils = class {
|
|
|
6472
6551
|
timeout
|
|
6473
6552
|
);
|
|
6474
6553
|
if (!response.isSuccess()) {
|
|
6475
|
-
throw new Error(((
|
|
6554
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Stack \u6A21\u7CCA\u5931\u8D25");
|
|
6476
6555
|
}
|
|
6477
6556
|
return response.data.filePath;
|
|
6478
6557
|
}
|
|
@@ -6489,7 +6568,7 @@ var ImageUtils = class {
|
|
|
6489
6568
|
* @returns Promise<压缩后的图片路径>
|
|
6490
6569
|
*/
|
|
6491
6570
|
async compressByScale(imagePath, options = {}) {
|
|
6492
|
-
var
|
|
6571
|
+
var _a2;
|
|
6493
6572
|
const { scaleWidth, scaleHeight, savePath, format, timeout } = options;
|
|
6494
6573
|
const response = await this.asyncCall(
|
|
6495
6574
|
"compressByScale",
|
|
@@ -6497,7 +6576,7 @@ var ImageUtils = class {
|
|
|
6497
6576
|
timeout
|
|
6498
6577
|
);
|
|
6499
6578
|
if (!response.isSuccess()) {
|
|
6500
|
-
throw new Error(((
|
|
6579
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6309\u7F29\u653E\u538B\u7F29\u5931\u8D25");
|
|
6501
6580
|
}
|
|
6502
6581
|
return response.data.filePath;
|
|
6503
6582
|
}
|
|
@@ -6512,7 +6591,7 @@ var ImageUtils = class {
|
|
|
6512
6591
|
* @returns Promise<压缩后的图片路径>
|
|
6513
6592
|
*/
|
|
6514
6593
|
async compressByQuality(imagePath, options = {}) {
|
|
6515
|
-
var
|
|
6594
|
+
var _a2;
|
|
6516
6595
|
const { quality = 100, format = "JPEG", savePath, timeout } = options;
|
|
6517
6596
|
const response = await this.asyncCall(
|
|
6518
6597
|
"compressByQuality",
|
|
@@ -6520,7 +6599,7 @@ var ImageUtils = class {
|
|
|
6520
6599
|
timeout
|
|
6521
6600
|
);
|
|
6522
6601
|
if (!response.isSuccess()) {
|
|
6523
|
-
throw new Error(((
|
|
6602
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6309\u8D28\u91CF\u538B\u7F29\u5931\u8D25");
|
|
6524
6603
|
}
|
|
6525
6604
|
return response.data.filePath;
|
|
6526
6605
|
}
|
|
@@ -6535,7 +6614,7 @@ var ImageUtils = class {
|
|
|
6535
6614
|
* @returns Promise<压缩后的图片路径>
|
|
6536
6615
|
*/
|
|
6537
6616
|
async compressBySampleSize(imagePath, options = {}) {
|
|
6538
|
-
var
|
|
6617
|
+
var _a2;
|
|
6539
6618
|
const { sampleSize = 1, savePath, format, timeout } = options;
|
|
6540
6619
|
const response = await this.asyncCall(
|
|
6541
6620
|
"compressBySampleSize",
|
|
@@ -6543,7 +6622,7 @@ var ImageUtils = class {
|
|
|
6543
6622
|
timeout
|
|
6544
6623
|
);
|
|
6545
6624
|
if (!response.isSuccess()) {
|
|
6546
|
-
throw new Error(((
|
|
6625
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6309\u91C7\u6837\u5927\u5C0F\u538B\u7F29\u5931\u8D25");
|
|
6547
6626
|
}
|
|
6548
6627
|
return response.data.filePath;
|
|
6549
6628
|
}
|
|
@@ -6558,7 +6637,7 @@ var ImageUtils = class {
|
|
|
6558
6637
|
* @returns Promise<保存结果>
|
|
6559
6638
|
*/
|
|
6560
6639
|
async save(imagePath, options = {}) {
|
|
6561
|
-
var
|
|
6640
|
+
var _a2;
|
|
6562
6641
|
const { savePath, format = "PNG", timeout } = options;
|
|
6563
6642
|
const response = await this.asyncCall(
|
|
6564
6643
|
"save",
|
|
@@ -6566,7 +6645,7 @@ var ImageUtils = class {
|
|
|
6566
6645
|
timeout
|
|
6567
6646
|
);
|
|
6568
6647
|
if (!response.isSuccess()) {
|
|
6569
|
-
throw new Error(((
|
|
6648
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u4FDD\u5B58\u56FE\u7247\u5931\u8D25");
|
|
6570
6649
|
}
|
|
6571
6650
|
return response.data;
|
|
6572
6651
|
}
|
|
@@ -6580,7 +6659,7 @@ var ImageUtils = class {
|
|
|
6580
6659
|
* @returns Promise<保存结果>
|
|
6581
6660
|
*/
|
|
6582
6661
|
async save2Album(imagePath, options = {}) {
|
|
6583
|
-
var
|
|
6662
|
+
var _a2;
|
|
6584
6663
|
const { fileName, format = "PNG", timeout } = options;
|
|
6585
6664
|
const response = await this.asyncCall(
|
|
6586
6665
|
"save2Album",
|
|
@@ -6588,7 +6667,7 @@ var ImageUtils = class {
|
|
|
6588
6667
|
timeout
|
|
6589
6668
|
);
|
|
6590
6669
|
if (!response.isSuccess()) {
|
|
6591
|
-
throw new Error(((
|
|
6670
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u4FDD\u5B58\u56FE\u7247\u5230\u76F8\u518C\u5931\u8D25");
|
|
6592
6671
|
}
|
|
6593
6672
|
return response.data;
|
|
6594
6673
|
}
|
|
@@ -6663,7 +6742,7 @@ var Gallery = class {
|
|
|
6663
6742
|
* @returns Promise<相册操作响应>
|
|
6664
6743
|
*/
|
|
6665
6744
|
async addImageToGallery(filePath, displayName, timeout) {
|
|
6666
|
-
var
|
|
6745
|
+
var _a2;
|
|
6667
6746
|
if (!filePath) {
|
|
6668
6747
|
throw new Error("filePath\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A");
|
|
6669
6748
|
}
|
|
@@ -6673,7 +6752,7 @@ var Gallery = class {
|
|
|
6673
6752
|
timeout
|
|
6674
6753
|
);
|
|
6675
6754
|
if (!response.isSuccess()) {
|
|
6676
|
-
throw new Error(((
|
|
6755
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u56FE\u7247\u5230\u76F8\u518C\u5931\u8D25");
|
|
6677
6756
|
}
|
|
6678
6757
|
return response.data;
|
|
6679
6758
|
}
|
|
@@ -6685,7 +6764,7 @@ var Gallery = class {
|
|
|
6685
6764
|
* @returns Promise<相册操作响应>
|
|
6686
6765
|
*/
|
|
6687
6766
|
async addVideoToGallery(filePath, displayName, timeout) {
|
|
6688
|
-
var
|
|
6767
|
+
var _a2;
|
|
6689
6768
|
if (!filePath) {
|
|
6690
6769
|
throw new Error("filePath\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A");
|
|
6691
6770
|
}
|
|
@@ -6695,7 +6774,7 @@ var Gallery = class {
|
|
|
6695
6774
|
timeout
|
|
6696
6775
|
);
|
|
6697
6776
|
if (!response.isSuccess()) {
|
|
6698
|
-
throw new Error(((
|
|
6777
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u89C6\u9891\u5230\u76F8\u518C\u5931\u8D25");
|
|
6699
6778
|
}
|
|
6700
6779
|
return response.data;
|
|
6701
6780
|
}
|
|
@@ -6706,7 +6785,7 @@ var Gallery = class {
|
|
|
6706
6785
|
* @returns Promise<删除响应>
|
|
6707
6786
|
*/
|
|
6708
6787
|
async deleteFromGalleryByUri(uri, timeout) {
|
|
6709
|
-
var
|
|
6788
|
+
var _a2;
|
|
6710
6789
|
if (!uri) {
|
|
6711
6790
|
throw new Error("uri\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A");
|
|
6712
6791
|
}
|
|
@@ -6716,7 +6795,7 @@ var Gallery = class {
|
|
|
6716
6795
|
timeout
|
|
6717
6796
|
);
|
|
6718
6797
|
if (!response.isSuccess()) {
|
|
6719
|
-
throw new Error(((
|
|
6798
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u4ECE\u76F8\u518C\u5220\u9664\u5931\u8D25");
|
|
6720
6799
|
}
|
|
6721
6800
|
return response.data;
|
|
6722
6801
|
}
|
|
@@ -6728,7 +6807,7 @@ var Gallery = class {
|
|
|
6728
6807
|
* @returns Promise<删除响应>
|
|
6729
6808
|
*/
|
|
6730
6809
|
async deleteFromGalleryById(id, type, timeout) {
|
|
6731
|
-
var
|
|
6810
|
+
var _a2;
|
|
6732
6811
|
if (id === void 0 || id === null) {
|
|
6733
6812
|
throw new Error("id\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A");
|
|
6734
6813
|
}
|
|
@@ -6741,7 +6820,7 @@ var Gallery = class {
|
|
|
6741
6820
|
timeout
|
|
6742
6821
|
);
|
|
6743
6822
|
if (!response.isSuccess()) {
|
|
6744
|
-
throw new Error(((
|
|
6823
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u4ECE\u76F8\u518C\u5220\u9664\u5931\u8D25");
|
|
6745
6824
|
}
|
|
6746
6825
|
return response.data;
|
|
6747
6826
|
}
|
|
@@ -6839,7 +6918,7 @@ var Mlkit = class {
|
|
|
6839
6918
|
* @returns Promise<识别结果>
|
|
6840
6919
|
*/
|
|
6841
6920
|
async findPhrasePositions(targetText, options = {}) {
|
|
6842
|
-
var
|
|
6921
|
+
var _a2;
|
|
6843
6922
|
if (!targetText || targetText.trim() === "") {
|
|
6844
6923
|
throw new Error("targetText cannot be empty");
|
|
6845
6924
|
}
|
|
@@ -6863,7 +6942,7 @@ var Mlkit = class {
|
|
|
6863
6942
|
timeout
|
|
6864
6943
|
);
|
|
6865
6944
|
if (!response.isSuccess()) {
|
|
6866
|
-
throw new Error(((
|
|
6945
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Recognition failed");
|
|
6867
6946
|
}
|
|
6868
6947
|
return response.data;
|
|
6869
6948
|
}
|
|
@@ -6873,7 +6952,7 @@ var Mlkit = class {
|
|
|
6873
6952
|
* @returns Promise<识别结果>
|
|
6874
6953
|
*/
|
|
6875
6954
|
async getScreenTextPositions(options = {}) {
|
|
6876
|
-
var
|
|
6955
|
+
var _a2;
|
|
6877
6956
|
const {
|
|
6878
6957
|
region,
|
|
6879
6958
|
rotationDegrees = 0,
|
|
@@ -6893,7 +6972,7 @@ var Mlkit = class {
|
|
|
6893
6972
|
timeout
|
|
6894
6973
|
);
|
|
6895
6974
|
if (!response.isSuccess()) {
|
|
6896
|
-
throw new Error(((
|
|
6975
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Recognition failed");
|
|
6897
6976
|
}
|
|
6898
6977
|
return response.data;
|
|
6899
6978
|
}
|
|
@@ -6904,7 +6983,7 @@ var Mlkit = class {
|
|
|
6904
6983
|
* @returns Promise<JSON 字符串结果>
|
|
6905
6984
|
*/
|
|
6906
6985
|
async findPhrasePositionsOnScreenAsJson(targetText, options = {}) {
|
|
6907
|
-
var
|
|
6986
|
+
var _a2;
|
|
6908
6987
|
if (!targetText || targetText.trim() === "") {
|
|
6909
6988
|
throw new Error("targetText cannot be empty");
|
|
6910
6989
|
}
|
|
@@ -6928,7 +7007,7 @@ var Mlkit = class {
|
|
|
6928
7007
|
timeout
|
|
6929
7008
|
);
|
|
6930
7009
|
if (!response.isSuccess()) {
|
|
6931
|
-
throw new Error(((
|
|
7010
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Recognition failed");
|
|
6932
7011
|
}
|
|
6933
7012
|
const data = response.data;
|
|
6934
7013
|
return data.jsonResult;
|
|
@@ -6939,7 +7018,7 @@ var Mlkit = class {
|
|
|
6939
7018
|
* @returns Promise<JSON 字符串结果>
|
|
6940
7019
|
*/
|
|
6941
7020
|
async getScreenTextPositionsAsJson(options = {}) {
|
|
6942
|
-
var
|
|
7021
|
+
var _a2;
|
|
6943
7022
|
const {
|
|
6944
7023
|
region,
|
|
6945
7024
|
rotationDegrees = 0,
|
|
@@ -6959,7 +7038,7 @@ var Mlkit = class {
|
|
|
6959
7038
|
timeout
|
|
6960
7039
|
);
|
|
6961
7040
|
if (!response.isSuccess()) {
|
|
6962
|
-
throw new Error(((
|
|
7041
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Recognition failed");
|
|
6963
7042
|
}
|
|
6964
7043
|
const data = response.data;
|
|
6965
7044
|
return data.jsonResult;
|
|
@@ -7126,10 +7205,10 @@ var BarUtils = class {
|
|
|
7126
7205
|
}
|
|
7127
7206
|
/** Set status bar color. color: Android color int (e.g. 0xff0000). isDecor: whether to apply to decor. */
|
|
7128
7207
|
async setStatusBarColor(color, options, timeout) {
|
|
7129
|
-
var
|
|
7208
|
+
var _a2;
|
|
7130
7209
|
const res = await this.asyncCall(
|
|
7131
7210
|
BarUtilsCallMethod.setStatusBarColor,
|
|
7132
|
-
{ color, isDecor: (
|
|
7211
|
+
{ color, isDecor: (_a2 = options == null ? void 0 : options.isDecor) != null ? _a2 : false },
|
|
7133
7212
|
timeout
|
|
7134
7213
|
);
|
|
7135
7214
|
if (!res.isSuccess()) {
|
|
@@ -7594,28 +7673,28 @@ var Log = class {
|
|
|
7594
7673
|
}
|
|
7595
7674
|
/** 读取当前日志全文 */
|
|
7596
7675
|
async readAllText(timeout) {
|
|
7597
|
-
var
|
|
7676
|
+
var _a2;
|
|
7598
7677
|
const res = await this.asyncCall(
|
|
7599
7678
|
LogCallMethod.readAllText,
|
|
7600
7679
|
void 0,
|
|
7601
7680
|
timeout
|
|
7602
7681
|
);
|
|
7603
7682
|
const d = res.getDataOrNull();
|
|
7604
|
-
return (
|
|
7683
|
+
return (_a2 = d == null ? void 0 : d.text) != null ? _a2 : "";
|
|
7605
7684
|
}
|
|
7606
7685
|
/**
|
|
7607
7686
|
* 获取日志服务当前域名(origin,无路径;与上传、管理后台同源)。
|
|
7608
7687
|
* 与 Kotlin getLogServiceBaseUrl / adminWebBaseUrl 对齐。
|
|
7609
7688
|
*/
|
|
7610
7689
|
async getLogServiceBaseUrl(timeout) {
|
|
7611
|
-
var
|
|
7690
|
+
var _a2;
|
|
7612
7691
|
const res = await this.asyncCall(
|
|
7613
7692
|
LogCallMethod.getLogServiceBaseUrl,
|
|
7614
7693
|
void 0,
|
|
7615
7694
|
timeout
|
|
7616
7695
|
);
|
|
7617
7696
|
const d = res.getDataOrNull();
|
|
7618
|
-
return (
|
|
7697
|
+
return (_a2 = d == null ? void 0 : d.baseUrl) != null ? _a2 : "";
|
|
7619
7698
|
}
|
|
7620
7699
|
/** 清空日志 */
|
|
7621
7700
|
async clear(timeout) {
|
|
@@ -7671,10 +7750,10 @@ var Log = class {
|
|
|
7671
7750
|
* resolve 后请保留 dispose 或调用 unsubscribe(subscriptionId) 以释放原生协程与 JS 回调。
|
|
7672
7751
|
*/
|
|
7673
7752
|
async subscribe(stream, onUpdate, options) {
|
|
7674
|
-
var
|
|
7753
|
+
var _a2;
|
|
7675
7754
|
const self = this;
|
|
7676
7755
|
const callbackId = generateUUID();
|
|
7677
|
-
const timeoutSec = (
|
|
7756
|
+
const timeoutSec = (_a2 = options == null ? void 0 : options.timeout) != null ? _a2 : 30;
|
|
7678
7757
|
return new Promise((resolve, reject) => {
|
|
7679
7758
|
let settled = false;
|
|
7680
7759
|
const timer = setTimeout(() => {
|
|
@@ -7685,7 +7764,7 @@ var Log = class {
|
|
|
7685
7764
|
}
|
|
7686
7765
|
}, timeoutSec * 1e3);
|
|
7687
7766
|
streamHandlers.set(callbackId, (raw) => {
|
|
7688
|
-
var
|
|
7767
|
+
var _a3, _b, _c;
|
|
7689
7768
|
let response;
|
|
7690
7769
|
try {
|
|
7691
7770
|
response = JSON.parse(raw);
|
|
@@ -7701,7 +7780,7 @@ var Log = class {
|
|
|
7701
7780
|
streamHandlers.delete(callbackId);
|
|
7702
7781
|
reject(
|
|
7703
7782
|
new Error(
|
|
7704
|
-
(
|
|
7783
|
+
(_a3 = response.message) != null ? _a3 : "Log subscribe failed"
|
|
7705
7784
|
)
|
|
7706
7785
|
);
|
|
7707
7786
|
}
|
|
@@ -7847,6 +7926,8 @@ export {
|
|
|
7847
7926
|
LogStream,
|
|
7848
7927
|
Mlkit,
|
|
7849
7928
|
MlkitCallMethod,
|
|
7929
|
+
NODE_LOOKUP_SCOPE_ACTIVE_WINDOW,
|
|
7930
|
+
NODE_LOOKUP_SCOPE_ALL_WINDOWS,
|
|
7850
7931
|
Node,
|
|
7851
7932
|
NodeAsync,
|
|
7852
7933
|
NodeClassValue,
|