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.cjs
CHANGED
|
@@ -44,6 +44,8 @@ __export(index_exports, {
|
|
|
44
44
|
LogStream: () => LogStream,
|
|
45
45
|
Mlkit: () => Mlkit,
|
|
46
46
|
MlkitCallMethod: () => MlkitCallMethod,
|
|
47
|
+
NODE_LOOKUP_SCOPE_ACTIVE_WINDOW: () => NODE_LOOKUP_SCOPE_ACTIVE_WINDOW,
|
|
48
|
+
NODE_LOOKUP_SCOPE_ALL_WINDOWS: () => NODE_LOOKUP_SCOPE_ALL_WINDOWS,
|
|
47
49
|
Node: () => Node,
|
|
48
50
|
NodeAsync: () => NodeAsync,
|
|
49
51
|
NodeClassValue: () => NodeClassValue,
|
|
@@ -75,6 +77,10 @@ __export(index_exports, {
|
|
|
75
77
|
});
|
|
76
78
|
module.exports = __toCommonJS(index_exports);
|
|
77
79
|
|
|
80
|
+
// src/node-lookup-scope.ts
|
|
81
|
+
var NODE_LOOKUP_SCOPE_ACTIVE_WINDOW = "active_window";
|
|
82
|
+
var NODE_LOOKUP_SCOPE_ALL_WINDOWS = "all_windows";
|
|
83
|
+
|
|
78
84
|
// src/bounds.ts
|
|
79
85
|
var Bounds = class _Bounds {
|
|
80
86
|
// 构造函数
|
|
@@ -272,8 +278,8 @@ var CallResponse = class {
|
|
|
272
278
|
}
|
|
273
279
|
// 获取数据,如果数据为空则返回默认值
|
|
274
280
|
getDataOrDefault(defaultValue) {
|
|
275
|
-
var
|
|
276
|
-
return (
|
|
281
|
+
var _a2;
|
|
282
|
+
return (_a2 = this.data) != null ? _a2 : defaultValue;
|
|
277
283
|
}
|
|
278
284
|
};
|
|
279
285
|
|
|
@@ -314,9 +320,9 @@ var AppInfo = class _AppInfo {
|
|
|
314
320
|
* @returns AppInfo实例
|
|
315
321
|
*/
|
|
316
322
|
static fromJSON(data) {
|
|
317
|
-
var
|
|
323
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
|
318
324
|
return new _AppInfo(
|
|
319
|
-
(
|
|
325
|
+
(_a2 = data.isSystem) != null ? _a2 : false,
|
|
320
326
|
(_b = data.minSdkVersion) != null ? _b : 0,
|
|
321
327
|
(_c = data.name) != null ? _c : "",
|
|
322
328
|
(_d = data.packageName) != null ? _d : "",
|
|
@@ -365,9 +371,9 @@ var DeviceInfo = class _DeviceInfo {
|
|
|
365
371
|
* @returns DeviceInfo实例
|
|
366
372
|
*/
|
|
367
373
|
static fromJSON(data) {
|
|
368
|
-
var
|
|
374
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
369
375
|
return new _DeviceInfo(
|
|
370
|
-
(
|
|
376
|
+
(_a2 = data.uniqueDeviceId) != null ? _a2 : "",
|
|
371
377
|
(_b = data.androidID) != null ? _b : "",
|
|
372
378
|
(_c = data.macAddress) != null ? _c : "",
|
|
373
379
|
(_d = data.isDeviceRooted) != null ? _d : false,
|
|
@@ -490,10 +496,17 @@ var AssistsXAsync = class {
|
|
|
490
496
|
filterViewId,
|
|
491
497
|
filterDes,
|
|
492
498
|
filterText,
|
|
493
|
-
timeout
|
|
499
|
+
timeout,
|
|
500
|
+
scope
|
|
494
501
|
} = {}) {
|
|
495
502
|
const response = await this.asyncCall(CallMethod.getAllNodes, {
|
|
496
|
-
args: {
|
|
503
|
+
args: {
|
|
504
|
+
filterClass,
|
|
505
|
+
filterViewId,
|
|
506
|
+
filterDes,
|
|
507
|
+
filterText,
|
|
508
|
+
...scope !== void 0 ? { scope } : {}
|
|
509
|
+
},
|
|
497
510
|
timeout
|
|
498
511
|
});
|
|
499
512
|
const data = response.getDataOrDefault([]);
|
|
@@ -718,13 +731,11 @@ var AssistsXAsync = class {
|
|
|
718
731
|
});
|
|
719
732
|
return response.getDataOrDefault(false);
|
|
720
733
|
}
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
* @returns 包名
|
|
725
|
-
*/
|
|
726
|
-
static async getPackageName(timeout) {
|
|
734
|
+
static async getPackageName(timeoutOrOptions) {
|
|
735
|
+
const normalized = typeof timeoutOrOptions === "number" ? { timeout: timeoutOrOptions } : timeoutOrOptions != null ? timeoutOrOptions : {};
|
|
736
|
+
const { timeout, scope } = normalized;
|
|
727
737
|
const response = await this.asyncCall(CallMethod.getPackageName, {
|
|
738
|
+
args: scope !== void 0 ? { scope } : void 0,
|
|
728
739
|
timeout
|
|
729
740
|
});
|
|
730
741
|
return response.getDataOrDefault("");
|
|
@@ -758,10 +769,17 @@ var AssistsXAsync = class {
|
|
|
758
769
|
filterText,
|
|
759
770
|
filterDes,
|
|
760
771
|
node,
|
|
761
|
-
timeout
|
|
772
|
+
timeout,
|
|
773
|
+
scope
|
|
762
774
|
} = {}) {
|
|
763
775
|
const response = await this.asyncCall(CallMethod.findById, {
|
|
764
|
-
args: {
|
|
776
|
+
args: {
|
|
777
|
+
id,
|
|
778
|
+
filterClass,
|
|
779
|
+
filterText,
|
|
780
|
+
filterDes,
|
|
781
|
+
...scope !== void 0 ? { scope } : {}
|
|
782
|
+
},
|
|
765
783
|
node,
|
|
766
784
|
timeout
|
|
767
785
|
});
|
|
@@ -788,10 +806,17 @@ var AssistsXAsync = class {
|
|
|
788
806
|
filterViewId,
|
|
789
807
|
filterDes,
|
|
790
808
|
node,
|
|
791
|
-
timeout
|
|
809
|
+
timeout,
|
|
810
|
+
scope
|
|
792
811
|
} = {}) {
|
|
793
812
|
const response = await this.asyncCall(CallMethod.findByText, {
|
|
794
|
-
args: {
|
|
813
|
+
args: {
|
|
814
|
+
text,
|
|
815
|
+
filterClass,
|
|
816
|
+
filterViewId,
|
|
817
|
+
filterDes,
|
|
818
|
+
...scope !== void 0 ? { scope } : {}
|
|
819
|
+
},
|
|
795
820
|
node,
|
|
796
821
|
timeout
|
|
797
822
|
});
|
|
@@ -818,10 +843,17 @@ var AssistsXAsync = class {
|
|
|
818
843
|
filterViewId,
|
|
819
844
|
filterDes,
|
|
820
845
|
node,
|
|
821
|
-
timeout
|
|
846
|
+
timeout,
|
|
847
|
+
scope
|
|
822
848
|
} = {}) {
|
|
823
849
|
const response = await this.asyncCall(CallMethod.findByTags, {
|
|
824
|
-
args: {
|
|
850
|
+
args: {
|
|
851
|
+
className,
|
|
852
|
+
filterText,
|
|
853
|
+
filterViewId,
|
|
854
|
+
filterDes,
|
|
855
|
+
...scope !== void 0 ? { scope } : {}
|
|
856
|
+
},
|
|
825
857
|
node,
|
|
826
858
|
timeout
|
|
827
859
|
});
|
|
@@ -833,15 +865,14 @@ var AssistsXAsync = class {
|
|
|
833
865
|
}
|
|
834
866
|
return Node.fromJSONArray(data);
|
|
835
867
|
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
840
|
-
* @returns 节点数组
|
|
841
|
-
*/
|
|
842
|
-
static async findByTextAllMatch(text, timeout) {
|
|
868
|
+
static async findByTextAllMatch(text, timeoutOrOptions) {
|
|
869
|
+
const normalized = typeof timeoutOrOptions === "number" ? { timeout: timeoutOrOptions } : timeoutOrOptions != null ? timeoutOrOptions : {};
|
|
870
|
+
const { timeout, scope } = normalized;
|
|
843
871
|
const response = await this.asyncCall(CallMethod.findByTextAllMatch, {
|
|
844
|
-
args: {
|
|
872
|
+
args: {
|
|
873
|
+
text,
|
|
874
|
+
...scope !== void 0 ? { scope } : {}
|
|
875
|
+
},
|
|
845
876
|
timeout
|
|
846
877
|
});
|
|
847
878
|
const data = response.getDataOrDefault([]);
|
|
@@ -1362,18 +1393,21 @@ var AssistsXAsync = class {
|
|
|
1362
1393
|
* @param options.filePath 文件路径(可选,不提供则自动生成)
|
|
1363
1394
|
* @param options.prettyPrint 是否格式化输出,默认为 true
|
|
1364
1395
|
* @param options.timeout 超时时间(秒),默认30秒
|
|
1396
|
+
* @param options.scope 节点查找范围(可选)
|
|
1365
1397
|
* @returns 保存的文件路径
|
|
1366
1398
|
*/
|
|
1367
1399
|
static async saveRootNodeTreeJson(options = {}) {
|
|
1368
1400
|
const {
|
|
1369
1401
|
filePath,
|
|
1370
1402
|
prettyPrint = true,
|
|
1371
|
-
timeout
|
|
1403
|
+
timeout,
|
|
1404
|
+
scope
|
|
1372
1405
|
} = options;
|
|
1373
1406
|
const response = await this.asyncCall(CallMethod.saveRootNodeTreeJson, {
|
|
1374
1407
|
args: {
|
|
1375
1408
|
filePath,
|
|
1376
|
-
prettyPrint
|
|
1409
|
+
prettyPrint,
|
|
1410
|
+
...scope !== void 0 ? { scope } : {}
|
|
1377
1411
|
},
|
|
1378
1412
|
timeout
|
|
1379
1413
|
});
|
|
@@ -1522,14 +1556,16 @@ var StepAsync = class {
|
|
|
1522
1556
|
filterClass,
|
|
1523
1557
|
filterViewId,
|
|
1524
1558
|
filterDes,
|
|
1525
|
-
filterText
|
|
1559
|
+
filterText,
|
|
1560
|
+
scope
|
|
1526
1561
|
} = {}) {
|
|
1527
1562
|
Step.assert(this.step.stepId);
|
|
1528
1563
|
const nodes = await AssistsXAsync.getAllNodes({
|
|
1529
1564
|
filterClass,
|
|
1530
1565
|
filterViewId,
|
|
1531
1566
|
filterDes,
|
|
1532
|
-
filterText
|
|
1567
|
+
filterText,
|
|
1568
|
+
scope
|
|
1533
1569
|
});
|
|
1534
1570
|
Step.assert(this.step.stepId);
|
|
1535
1571
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
@@ -1546,13 +1582,9 @@ var StepAsync = class {
|
|
|
1546
1582
|
Step.assert(this.step.stepId);
|
|
1547
1583
|
return result;
|
|
1548
1584
|
}
|
|
1549
|
-
|
|
1550
|
-
* 获取当前应用包名
|
|
1551
|
-
* @returns 包名
|
|
1552
|
-
*/
|
|
1553
|
-
async getPackageName() {
|
|
1585
|
+
async getPackageName(timeoutOrOptions) {
|
|
1554
1586
|
Step.assert(this.step.stepId);
|
|
1555
|
-
const result = await AssistsXAsync.getPackageName();
|
|
1587
|
+
const result = typeof timeoutOrOptions === "number" ? await AssistsXAsync.getPackageName(timeoutOrOptions) : await AssistsXAsync.getPackageName(timeoutOrOptions != null ? timeoutOrOptions : {});
|
|
1556
1588
|
Step.assert(this.step.stepId);
|
|
1557
1589
|
return result;
|
|
1558
1590
|
}
|
|
@@ -1567,13 +1599,15 @@ var StepAsync = class {
|
|
|
1567
1599
|
async findById(id, {
|
|
1568
1600
|
filterClass,
|
|
1569
1601
|
filterText,
|
|
1570
|
-
filterDes
|
|
1602
|
+
filterDes,
|
|
1603
|
+
scope
|
|
1571
1604
|
} = {}) {
|
|
1572
1605
|
Step.assert(this.step.stepId);
|
|
1573
1606
|
const nodes = await AssistsXAsync.findById(id, {
|
|
1574
1607
|
filterClass,
|
|
1575
1608
|
filterText,
|
|
1576
|
-
filterDes
|
|
1609
|
+
filterDes,
|
|
1610
|
+
scope
|
|
1577
1611
|
});
|
|
1578
1612
|
Step.assert(this.step.stepId);
|
|
1579
1613
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
@@ -1590,13 +1624,15 @@ var StepAsync = class {
|
|
|
1590
1624
|
async findByText(text, {
|
|
1591
1625
|
filterClass,
|
|
1592
1626
|
filterViewId,
|
|
1593
|
-
filterDes
|
|
1627
|
+
filterDes,
|
|
1628
|
+
scope
|
|
1594
1629
|
} = {}) {
|
|
1595
1630
|
Step.assert(this.step.stepId);
|
|
1596
1631
|
const nodes = await AssistsXAsync.findByText(text, {
|
|
1597
1632
|
filterClass,
|
|
1598
1633
|
filterViewId,
|
|
1599
|
-
filterDes
|
|
1634
|
+
filterDes,
|
|
1635
|
+
scope
|
|
1600
1636
|
});
|
|
1601
1637
|
Step.assert(this.step.stepId);
|
|
1602
1638
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
@@ -1613,26 +1649,23 @@ var StepAsync = class {
|
|
|
1613
1649
|
async findByTags(className, {
|
|
1614
1650
|
filterText,
|
|
1615
1651
|
filterViewId,
|
|
1616
|
-
filterDes
|
|
1652
|
+
filterDes,
|
|
1653
|
+
scope
|
|
1617
1654
|
} = {}) {
|
|
1618
1655
|
Step.assert(this.step.stepId);
|
|
1619
1656
|
const nodes = await AssistsXAsync.findByTags(className, {
|
|
1620
1657
|
filterText,
|
|
1621
1658
|
filterViewId,
|
|
1622
|
-
filterDes
|
|
1659
|
+
filterDes,
|
|
1660
|
+
scope
|
|
1623
1661
|
});
|
|
1624
1662
|
Step.assert(this.step.stepId);
|
|
1625
1663
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
1626
1664
|
return nodes;
|
|
1627
1665
|
}
|
|
1628
|
-
|
|
1629
|
-
* 查找所有匹配文本的节点
|
|
1630
|
-
* @param text 要查找的文本
|
|
1631
|
-
* @returns 节点数组
|
|
1632
|
-
*/
|
|
1633
|
-
async findByTextAllMatch(text) {
|
|
1666
|
+
async findByTextAllMatch(text, timeoutOrOptions) {
|
|
1634
1667
|
Step.assert(this.step.stepId);
|
|
1635
|
-
const nodes = await AssistsXAsync.findByTextAllMatch(text);
|
|
1668
|
+
const nodes = typeof timeoutOrOptions === "number" ? await AssistsXAsync.findByTextAllMatch(text, timeoutOrOptions) : timeoutOrOptions !== void 0 ? await AssistsXAsync.findByTextAllMatch(text, timeoutOrOptions) : await AssistsXAsync.findByTextAllMatch(text);
|
|
1636
1669
|
Step.assert(this.step.stepId);
|
|
1637
1670
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
1638
1671
|
return nodes;
|
|
@@ -1796,7 +1829,7 @@ var _Step = class _Step {
|
|
|
1796
1829
|
*/
|
|
1797
1830
|
this.repeatCount = 0;
|
|
1798
1831
|
/**
|
|
1799
|
-
*
|
|
1832
|
+
* 步骤重复执行最大次数,默认15次
|
|
1800
1833
|
*/
|
|
1801
1834
|
this.repeatCountMax = _Step.repeatCountMaxDefault;
|
|
1802
1835
|
/**
|
|
@@ -1835,7 +1868,7 @@ var _Step = class _Step {
|
|
|
1835
1868
|
delayMs = _Step.delayMsDefault,
|
|
1836
1869
|
exceptionRetryCountMax = _Step.exceptionRetryCountMaxDefault
|
|
1837
1870
|
} = {}) {
|
|
1838
|
-
var
|
|
1871
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
1839
1872
|
this.exception = void 0;
|
|
1840
1873
|
const stepStore = useStepStore();
|
|
1841
1874
|
let implnName = impl.name;
|
|
@@ -1873,7 +1906,7 @@ var _Step = class _Step {
|
|
|
1873
1906
|
await currentStep.delay(currentStep.delayMs);
|
|
1874
1907
|
_Step.assert(currentStep.stepId);
|
|
1875
1908
|
}
|
|
1876
|
-
implnName = (_b = (
|
|
1909
|
+
implnName = (_b = (_a2 = currentStep.impl) == null ? void 0 : _a2.name) != null ? _b : "undefined";
|
|
1877
1910
|
if (_Step.showLog) {
|
|
1878
1911
|
console.log(
|
|
1879
1912
|
`\u6267\u884C\u6B65\u9AA4${implnName}\uFF0C\u91CD\u590D\u6B21\u6570${currentStep.repeatCount}`
|
|
@@ -1916,7 +1949,7 @@ var _Step = class _Step {
|
|
|
1916
1949
|
} else {
|
|
1917
1950
|
nextStep = await ((_e = currentStep.impl) == null ? void 0 : _e.call(currentStep, currentStep));
|
|
1918
1951
|
}
|
|
1919
|
-
if (currentStep.repeatCountMax
|
|
1952
|
+
if (currentStep.repeatCountMax > _Step.repeatCountInfinite && currentStep.repeatCount >= currentStep.repeatCountMax) {
|
|
1920
1953
|
if (_Step.showLog) {
|
|
1921
1954
|
console.log(
|
|
1922
1955
|
`\u91CD\u590D\u6B21\u6570${currentStep.repeatCount}\u8D85\u8FC7\u6700\u5927\u6B21\u6570${currentStep.repeatCountMax}\uFF0C\u505C\u6B62\u6267\u884C`
|
|
@@ -2110,13 +2143,13 @@ var _Step = class _Step {
|
|
|
2110
2143
|
repeatCountMax = _Step.repeatCountMaxDefault,
|
|
2111
2144
|
exceptionRetryCountMax = _Step.exceptionRetryCountMaxDefault
|
|
2112
2145
|
} = {}) {
|
|
2113
|
-
var
|
|
2146
|
+
var _a2;
|
|
2114
2147
|
_Step.assert(this.stepId);
|
|
2115
2148
|
return new _Step({
|
|
2116
2149
|
stepId: this.stepId,
|
|
2117
2150
|
impl,
|
|
2118
2151
|
tag,
|
|
2119
|
-
data: (
|
|
2152
|
+
data: (_a2 = data != null ? data : this.data) != null ? _a2 : {},
|
|
2120
2153
|
delayMs,
|
|
2121
2154
|
repeatCountMax,
|
|
2122
2155
|
exceptionRetryCountMax
|
|
@@ -2129,13 +2162,13 @@ var _Step = class _Step {
|
|
|
2129
2162
|
repeatCountMax = _Step.repeatCountMaxDefault,
|
|
2130
2163
|
exceptionRetryCountMax = _Step.exceptionRetryCountMaxDefault
|
|
2131
2164
|
} = {}) {
|
|
2132
|
-
var
|
|
2165
|
+
var _a2;
|
|
2133
2166
|
_Step.assert(this.stepId);
|
|
2134
2167
|
return new _Step({
|
|
2135
2168
|
stepId: this.stepId,
|
|
2136
2169
|
impl: void 0,
|
|
2137
2170
|
tag,
|
|
2138
|
-
data: (
|
|
2171
|
+
data: (_a2 = data != null ? data : this.data) != null ? _a2 : {},
|
|
2139
2172
|
delayMs,
|
|
2140
2173
|
repeatCountMax,
|
|
2141
2174
|
exceptionRetryCountMax,
|
|
@@ -2153,7 +2186,7 @@ var _Step = class _Step {
|
|
|
2153
2186
|
repeat({
|
|
2154
2187
|
stepId = this.stepId,
|
|
2155
2188
|
tag = this.tag,
|
|
2156
|
-
data = ((
|
|
2189
|
+
data = ((_a2) => (_a2 = this.data) != null ? _a2 : {})(),
|
|
2157
2190
|
delayMs = this.delayMs,
|
|
2158
2191
|
repeatCountMax = this.repeatCountMax,
|
|
2159
2192
|
exceptionRetryCountMax = this.exceptionRetryCountMax
|
|
@@ -2237,14 +2270,16 @@ var _Step = class _Step {
|
|
|
2237
2270
|
filterClass,
|
|
2238
2271
|
filterViewId,
|
|
2239
2272
|
filterDes,
|
|
2240
|
-
filterText
|
|
2273
|
+
filterText,
|
|
2274
|
+
scope
|
|
2241
2275
|
} = {}) {
|
|
2242
2276
|
_Step.assert(this.stepId);
|
|
2243
2277
|
const nodes = AssistsX2.getAllNodes({
|
|
2244
2278
|
filterClass,
|
|
2245
2279
|
filterViewId,
|
|
2246
2280
|
filterDes,
|
|
2247
|
-
filterText
|
|
2281
|
+
filterText,
|
|
2282
|
+
scope
|
|
2248
2283
|
});
|
|
2249
2284
|
_Step.assert(this.stepId);
|
|
2250
2285
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
@@ -2263,11 +2298,11 @@ var _Step = class _Step {
|
|
|
2263
2298
|
}
|
|
2264
2299
|
/**
|
|
2265
2300
|
* 获取当前应用包名
|
|
2266
|
-
* @
|
|
2301
|
+
* @param options.scope 节点查找范围(可选)
|
|
2267
2302
|
*/
|
|
2268
|
-
getPackageName() {
|
|
2303
|
+
getPackageName(options = {}) {
|
|
2269
2304
|
_Step.assert(this.stepId);
|
|
2270
|
-
const result = AssistsX2.getPackageName();
|
|
2305
|
+
const result = AssistsX2.getPackageName(options);
|
|
2271
2306
|
_Step.assert(this.stepId);
|
|
2272
2307
|
return result;
|
|
2273
2308
|
}
|
|
@@ -2282,10 +2317,16 @@ var _Step = class _Step {
|
|
|
2282
2317
|
findById(id, {
|
|
2283
2318
|
filterClass,
|
|
2284
2319
|
filterText,
|
|
2285
|
-
filterDes
|
|
2320
|
+
filterDes,
|
|
2321
|
+
scope
|
|
2286
2322
|
} = {}) {
|
|
2287
2323
|
_Step.assert(this.stepId);
|
|
2288
|
-
const nodes = AssistsX2.findById(id, {
|
|
2324
|
+
const nodes = AssistsX2.findById(id, {
|
|
2325
|
+
filterClass,
|
|
2326
|
+
filterText,
|
|
2327
|
+
filterDes,
|
|
2328
|
+
scope
|
|
2329
|
+
});
|
|
2289
2330
|
_Step.assert(this.stepId);
|
|
2290
2331
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
2291
2332
|
return nodes;
|
|
@@ -2301,13 +2342,15 @@ var _Step = class _Step {
|
|
|
2301
2342
|
findByText(text, {
|
|
2302
2343
|
filterClass,
|
|
2303
2344
|
filterViewId,
|
|
2304
|
-
filterDes
|
|
2345
|
+
filterDes,
|
|
2346
|
+
scope
|
|
2305
2347
|
} = {}) {
|
|
2306
2348
|
_Step.assert(this.stepId);
|
|
2307
2349
|
const nodes = AssistsX2.findByText(text, {
|
|
2308
2350
|
filterClass,
|
|
2309
2351
|
filterViewId,
|
|
2310
|
-
filterDes
|
|
2352
|
+
filterDes,
|
|
2353
|
+
scope
|
|
2311
2354
|
});
|
|
2312
2355
|
_Step.assert(this.stepId);
|
|
2313
2356
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
@@ -2324,13 +2367,15 @@ var _Step = class _Step {
|
|
|
2324
2367
|
findByTags(className, {
|
|
2325
2368
|
filterText,
|
|
2326
2369
|
filterViewId,
|
|
2327
|
-
filterDes
|
|
2370
|
+
filterDes,
|
|
2371
|
+
scope
|
|
2328
2372
|
} = {}) {
|
|
2329
2373
|
_Step.assert(this.stepId);
|
|
2330
2374
|
const nodes = AssistsX2.findByTags(className, {
|
|
2331
2375
|
filterText,
|
|
2332
2376
|
filterViewId,
|
|
2333
|
-
filterDes
|
|
2377
|
+
filterDes,
|
|
2378
|
+
scope
|
|
2334
2379
|
});
|
|
2335
2380
|
_Step.assert(this.stepId);
|
|
2336
2381
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
@@ -2339,11 +2384,11 @@ var _Step = class _Step {
|
|
|
2339
2384
|
/**
|
|
2340
2385
|
* 查找所有匹配文本的节点
|
|
2341
2386
|
* @param text 要查找的文本
|
|
2342
|
-
* @
|
|
2387
|
+
* @param options.scope 节点查找范围(可选)
|
|
2343
2388
|
*/
|
|
2344
|
-
findByTextAllMatch(text) {
|
|
2389
|
+
findByTextAllMatch(text, { scope } = {}) {
|
|
2345
2390
|
_Step.assert(this.stepId);
|
|
2346
|
-
const nodes = AssistsX2.findByTextAllMatch(text);
|
|
2391
|
+
const nodes = AssistsX2.findByTextAllMatch(text, { scope });
|
|
2347
2392
|
_Step.assert(this.stepId);
|
|
2348
2393
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
2349
2394
|
return nodes;
|
|
@@ -2475,7 +2520,7 @@ var _Step = class _Step {
|
|
|
2475
2520
|
};
|
|
2476
2521
|
_Step.delayMsDefault = 1e3;
|
|
2477
2522
|
_Step.repeatCountInfinite = -1;
|
|
2478
|
-
_Step.repeatCountMaxDefault =
|
|
2523
|
+
_Step.repeatCountMaxDefault = 15;
|
|
2479
2524
|
_Step.showLog = false;
|
|
2480
2525
|
_Step.exceptionRetryCountMaxDefault = 3;
|
|
2481
2526
|
/**
|
|
@@ -2859,7 +2904,7 @@ var Node = class _Node {
|
|
|
2859
2904
|
* @param params 节点参数对象
|
|
2860
2905
|
*/
|
|
2861
2906
|
constructor(params) {
|
|
2862
|
-
var
|
|
2907
|
+
var _a2;
|
|
2863
2908
|
this.nodeId = params.nodeId;
|
|
2864
2909
|
this.text = params.text;
|
|
2865
2910
|
this.des = params.des;
|
|
@@ -2879,7 +2924,7 @@ var Node = class _Node {
|
|
|
2879
2924
|
this.isSelected = params.isSelected;
|
|
2880
2925
|
this.isVisibleToUser = params.isVisibleToUser;
|
|
2881
2926
|
this.drawingOrder = params.drawingOrder;
|
|
2882
|
-
const rawBounds = (
|
|
2927
|
+
const rawBounds = (_a2 = params.bounds) != null ? _a2 : params.boundsInScreen;
|
|
2883
2928
|
this.bounds = rawBounds instanceof Bounds ? rawBounds : Bounds.fromData(rawBounds);
|
|
2884
2929
|
}
|
|
2885
2930
|
get async() {
|
|
@@ -3242,7 +3287,7 @@ var Node = class _Node {
|
|
|
3242
3287
|
// src/assistsx.ts
|
|
3243
3288
|
var callbacks = /* @__PURE__ */ new Map();
|
|
3244
3289
|
var accessibilityEventListeners = [];
|
|
3245
|
-
var screen
|
|
3290
|
+
var screen;
|
|
3246
3291
|
if (typeof window !== "undefined" && !window.assistsxCallback) {
|
|
3247
3292
|
window.assistsxCallback = (data) => {
|
|
3248
3293
|
let callbackId;
|
|
@@ -3393,10 +3438,17 @@ var AssistsX2 = class {
|
|
|
3393
3438
|
filterClass,
|
|
3394
3439
|
filterViewId,
|
|
3395
3440
|
filterDes,
|
|
3396
|
-
filterText
|
|
3441
|
+
filterText,
|
|
3442
|
+
scope
|
|
3397
3443
|
} = {}) {
|
|
3398
3444
|
const response = this.call(CallMethod.getAllNodes, {
|
|
3399
|
-
args: {
|
|
3445
|
+
args: {
|
|
3446
|
+
filterClass,
|
|
3447
|
+
filterViewId,
|
|
3448
|
+
filterDes,
|
|
3449
|
+
filterText,
|
|
3450
|
+
...scope !== void 0 ? { scope } : {}
|
|
3451
|
+
}
|
|
3400
3452
|
});
|
|
3401
3453
|
const data = response.getDataOrDefault([]);
|
|
3402
3454
|
if (!Array.isArray(data)) {
|
|
@@ -3560,8 +3612,12 @@ var AssistsX2 = class {
|
|
|
3560
3612
|
* 获取当前应用包名
|
|
3561
3613
|
* @returns 包名
|
|
3562
3614
|
*/
|
|
3563
|
-
static getPackageName() {
|
|
3564
|
-
const
|
|
3615
|
+
static getPackageName(options = {}) {
|
|
3616
|
+
const { scope } = options;
|
|
3617
|
+
const response = this.call(
|
|
3618
|
+
CallMethod.getPackageName,
|
|
3619
|
+
scope !== void 0 ? { args: { scope } } : {}
|
|
3620
|
+
);
|
|
3565
3621
|
return response.getDataOrDefault("");
|
|
3566
3622
|
}
|
|
3567
3623
|
/**
|
|
@@ -3589,10 +3645,17 @@ var AssistsX2 = class {
|
|
|
3589
3645
|
filterClass,
|
|
3590
3646
|
filterText,
|
|
3591
3647
|
filterDes,
|
|
3592
|
-
node
|
|
3648
|
+
node,
|
|
3649
|
+
scope
|
|
3593
3650
|
} = {}) {
|
|
3594
3651
|
const response = this.call(CallMethod.findById, {
|
|
3595
|
-
args: {
|
|
3652
|
+
args: {
|
|
3653
|
+
id,
|
|
3654
|
+
filterClass,
|
|
3655
|
+
filterText,
|
|
3656
|
+
filterDes,
|
|
3657
|
+
...scope !== void 0 ? { scope } : {}
|
|
3658
|
+
},
|
|
3596
3659
|
node
|
|
3597
3660
|
});
|
|
3598
3661
|
const data = response.getDataOrDefault([]);
|
|
@@ -3616,10 +3679,17 @@ var AssistsX2 = class {
|
|
|
3616
3679
|
filterClass,
|
|
3617
3680
|
filterViewId,
|
|
3618
3681
|
filterDes,
|
|
3619
|
-
node
|
|
3682
|
+
node,
|
|
3683
|
+
scope
|
|
3620
3684
|
} = {}) {
|
|
3621
3685
|
const response = this.call(CallMethod.findByText, {
|
|
3622
|
-
args: {
|
|
3686
|
+
args: {
|
|
3687
|
+
text,
|
|
3688
|
+
filterClass,
|
|
3689
|
+
filterViewId,
|
|
3690
|
+
filterDes,
|
|
3691
|
+
...scope !== void 0 ? { scope } : {}
|
|
3692
|
+
},
|
|
3623
3693
|
node
|
|
3624
3694
|
});
|
|
3625
3695
|
const data = response.getDataOrDefault([]);
|
|
@@ -3643,10 +3713,17 @@ var AssistsX2 = class {
|
|
|
3643
3713
|
filterText,
|
|
3644
3714
|
filterViewId,
|
|
3645
3715
|
filterDes,
|
|
3646
|
-
node
|
|
3716
|
+
node,
|
|
3717
|
+
scope
|
|
3647
3718
|
} = {}) {
|
|
3648
3719
|
const response = this.call(CallMethod.findByTags, {
|
|
3649
|
-
args: {
|
|
3720
|
+
args: {
|
|
3721
|
+
className,
|
|
3722
|
+
filterText,
|
|
3723
|
+
filterViewId,
|
|
3724
|
+
filterDes,
|
|
3725
|
+
...scope !== void 0 ? { scope } : {}
|
|
3726
|
+
},
|
|
3650
3727
|
node
|
|
3651
3728
|
});
|
|
3652
3729
|
const data = response.getDataOrDefault([]);
|
|
@@ -3660,11 +3737,14 @@ var AssistsX2 = class {
|
|
|
3660
3737
|
/**
|
|
3661
3738
|
* 查找所有匹配文本的节点
|
|
3662
3739
|
* @param text 要查找的文本
|
|
3663
|
-
* @
|
|
3740
|
+
* @param options.scope 节点查找范围(可选)
|
|
3664
3741
|
*/
|
|
3665
|
-
static findByTextAllMatch(text) {
|
|
3742
|
+
static findByTextAllMatch(text, { scope } = {}) {
|
|
3666
3743
|
const response = this.call(CallMethod.findByTextAllMatch, {
|
|
3667
|
-
args: {
|
|
3744
|
+
args: {
|
|
3745
|
+
text,
|
|
3746
|
+
...scope !== void 0 ? { scope } : {}
|
|
3747
|
+
}
|
|
3668
3748
|
});
|
|
3669
3749
|
const data = response.getDataOrDefault([]);
|
|
3670
3750
|
if (!Array.isArray(data)) {
|
|
@@ -4117,10 +4197,11 @@ function normalizeScreen(data) {
|
|
|
4117
4197
|
if (typeof w !== "number" || typeof h !== "number") return null;
|
|
4118
4198
|
return { width: Math.floor(w), height: Math.floor(h) };
|
|
4119
4199
|
}
|
|
4200
|
+
var _a;
|
|
4120
4201
|
if (typeof window !== "undefined") {
|
|
4121
4202
|
try {
|
|
4122
4203
|
if (window.assistsx && typeof window.assistsx.call === "function") {
|
|
4123
|
-
screen = AssistsX2.getScreenSize();
|
|
4204
|
+
screen = (_a = AssistsX2.getScreenSize()) != null ? _a : { width: 0, height: 0 };
|
|
4124
4205
|
}
|
|
4125
4206
|
} catch (e) {
|
|
4126
4207
|
console.log("Failed to initialize screen size:", e);
|
|
@@ -4255,8 +4336,8 @@ WindowFlags.FLAG_HARDWARE_ACCELERATED = 16777216;
|
|
|
4255
4336
|
// src/accessibility-event-filter.ts
|
|
4256
4337
|
var AccessibilityEventFilter = class _AccessibilityEventFilter {
|
|
4257
4338
|
constructor(config = {}) {
|
|
4258
|
-
var
|
|
4259
|
-
this.packageName = (
|
|
4339
|
+
var _a2, _b, _c, _d, _e;
|
|
4340
|
+
this.packageName = (_a2 = config.packageName) != null ? _a2 : null;
|
|
4260
4341
|
this.processInBackground = (_b = config.processInBackground) != null ? _b : true;
|
|
4261
4342
|
this.fetchNodeInfo = (_c = config.fetchNodeInfo) != null ? _c : true;
|
|
4262
4343
|
this.enableLogging = (_d = config.enableLogging) != null ? _d : false;
|
|
@@ -4277,8 +4358,8 @@ var AccessibilityEventFilter = class _AccessibilityEventFilter {
|
|
|
4277
4358
|
* @returns true表示应该处理,false表示应该过滤
|
|
4278
4359
|
*/
|
|
4279
4360
|
shouldProcessEventType(eventType) {
|
|
4280
|
-
var
|
|
4281
|
-
return this.eventTypes === null || ((_b = (
|
|
4361
|
+
var _a2, _b;
|
|
4362
|
+
return this.eventTypes === null || ((_b = (_a2 = this.eventTypes) == null ? void 0 : _a2.includes(eventType)) != null ? _b : false);
|
|
4282
4363
|
}
|
|
4283
4364
|
/**
|
|
4284
4365
|
* 创建默认的过滤配置
|
|
@@ -4406,14 +4487,14 @@ var Http = class {
|
|
|
4406
4487
|
* @returns Promise<HTTP响应>
|
|
4407
4488
|
*/
|
|
4408
4489
|
async httpGet(url, headers, timeout) {
|
|
4409
|
-
var
|
|
4490
|
+
var _a2;
|
|
4410
4491
|
const response = await this.asyncCall(
|
|
4411
4492
|
"httpGet",
|
|
4412
4493
|
{ url, headers },
|
|
4413
4494
|
timeout
|
|
4414
4495
|
);
|
|
4415
4496
|
if (!response.isSuccess()) {
|
|
4416
|
-
throw new Error(((
|
|
4497
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP GET request failed");
|
|
4417
4498
|
}
|
|
4418
4499
|
return response.data;
|
|
4419
4500
|
}
|
|
@@ -4426,14 +4507,14 @@ var Http = class {
|
|
|
4426
4507
|
* @returns Promise<HTTP响应>
|
|
4427
4508
|
*/
|
|
4428
4509
|
async httpPost(url, body, headers, timeout) {
|
|
4429
|
-
var
|
|
4510
|
+
var _a2;
|
|
4430
4511
|
const response = await this.asyncCall(
|
|
4431
4512
|
"httpPost",
|
|
4432
4513
|
{ url, body, headers },
|
|
4433
4514
|
timeout
|
|
4434
4515
|
);
|
|
4435
4516
|
if (!response.isSuccess()) {
|
|
4436
|
-
throw new Error(((
|
|
4517
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP POST request failed");
|
|
4437
4518
|
}
|
|
4438
4519
|
return response.data;
|
|
4439
4520
|
}
|
|
@@ -4466,7 +4547,7 @@ var Http = class {
|
|
|
4466
4547
|
* ], { description: "My files" });
|
|
4467
4548
|
*/
|
|
4468
4549
|
async httpPostFile(url, files, formData, headers, timeout) {
|
|
4469
|
-
var
|
|
4550
|
+
var _a2;
|
|
4470
4551
|
if (!files || files.length === 0) {
|
|
4471
4552
|
throw new Error("files\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF0C\u81F3\u5C11\u9700\u8981\u4E0A\u4F20\u4E00\u4E2A\u6587\u4EF6");
|
|
4472
4553
|
}
|
|
@@ -4481,7 +4562,7 @@ var Http = class {
|
|
|
4481
4562
|
timeout
|
|
4482
4563
|
);
|
|
4483
4564
|
if (!response.isSuccess()) {
|
|
4484
|
-
throw new Error(((
|
|
4565
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP POST file request failed");
|
|
4485
4566
|
}
|
|
4486
4567
|
return response.data;
|
|
4487
4568
|
}
|
|
@@ -4496,14 +4577,14 @@ var Http = class {
|
|
|
4496
4577
|
* @returns Promise<下载响应>
|
|
4497
4578
|
*/
|
|
4498
4579
|
async httpDownload(url, savePath, headers, saveToGallery, displayName, timeout) {
|
|
4499
|
-
var
|
|
4580
|
+
var _a2;
|
|
4500
4581
|
const response = await this.asyncCall(
|
|
4501
4582
|
"httpDownload",
|
|
4502
4583
|
{ url, savePath, headers, saveToGallery, displayName },
|
|
4503
4584
|
timeout
|
|
4504
4585
|
);
|
|
4505
4586
|
if (!response.isSuccess()) {
|
|
4506
|
-
throw new Error(((
|
|
4587
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP download failed");
|
|
4507
4588
|
}
|
|
4508
4589
|
return response.data;
|
|
4509
4590
|
}
|
|
@@ -4514,14 +4595,14 @@ var Http = class {
|
|
|
4514
4595
|
* @returns Promise<配置信息>
|
|
4515
4596
|
*/
|
|
4516
4597
|
async httpConfigure(config, timeout) {
|
|
4517
|
-
var
|
|
4598
|
+
var _a2;
|
|
4518
4599
|
const response = await this.asyncCall(
|
|
4519
4600
|
"httpConfigure",
|
|
4520
4601
|
config,
|
|
4521
4602
|
timeout
|
|
4522
4603
|
);
|
|
4523
4604
|
if (!response.isSuccess()) {
|
|
4524
|
-
throw new Error(((
|
|
4605
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP configure failed");
|
|
4525
4606
|
}
|
|
4526
4607
|
return response.data;
|
|
4527
4608
|
}
|
|
@@ -4531,10 +4612,10 @@ var Http = class {
|
|
|
4531
4612
|
* @returns Promise<配置信息>
|
|
4532
4613
|
*/
|
|
4533
4614
|
async httpReset(timeout) {
|
|
4534
|
-
var
|
|
4615
|
+
var _a2;
|
|
4535
4616
|
const response = await this.asyncCall("httpReset", void 0, timeout);
|
|
4536
4617
|
if (!response.isSuccess()) {
|
|
4537
|
-
throw new Error(((
|
|
4618
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP reset failed");
|
|
4538
4619
|
}
|
|
4539
4620
|
return response.data;
|
|
4540
4621
|
}
|
|
@@ -4544,10 +4625,10 @@ var Http = class {
|
|
|
4544
4625
|
* @returns Promise<配置信息>
|
|
4545
4626
|
*/
|
|
4546
4627
|
async httpGetConfig(timeout) {
|
|
4547
|
-
var
|
|
4628
|
+
var _a2;
|
|
4548
4629
|
const response = await this.asyncCall("httpGetConfig", void 0, timeout);
|
|
4549
4630
|
if (!response.isSuccess()) {
|
|
4550
|
-
throw new Error(((
|
|
4631
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get HTTP config failed");
|
|
4551
4632
|
}
|
|
4552
4633
|
return response.data;
|
|
4553
4634
|
}
|
|
@@ -4620,10 +4701,10 @@ var Path = class {
|
|
|
4620
4701
|
* @returns Promise<路径字符串>
|
|
4621
4702
|
*/
|
|
4622
4703
|
async getRootPath(timeout) {
|
|
4623
|
-
var
|
|
4704
|
+
var _a2;
|
|
4624
4705
|
const response = await this.asyncCall("getRootPath", void 0, timeout);
|
|
4625
4706
|
if (!response.isSuccess()) {
|
|
4626
|
-
throw new Error(((
|
|
4707
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get root path failed");
|
|
4627
4708
|
}
|
|
4628
4709
|
return response.data;
|
|
4629
4710
|
}
|
|
@@ -4633,10 +4714,10 @@ var Path = class {
|
|
|
4633
4714
|
* @returns Promise<路径字符串>
|
|
4634
4715
|
*/
|
|
4635
4716
|
async getDataPath(timeout) {
|
|
4636
|
-
var
|
|
4717
|
+
var _a2;
|
|
4637
4718
|
const response = await this.asyncCall("getDataPath", void 0, timeout);
|
|
4638
4719
|
if (!response.isSuccess()) {
|
|
4639
|
-
throw new Error(((
|
|
4720
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get data path failed");
|
|
4640
4721
|
}
|
|
4641
4722
|
return response.data;
|
|
4642
4723
|
}
|
|
@@ -4646,10 +4727,10 @@ var Path = class {
|
|
|
4646
4727
|
* @returns Promise<路径字符串>
|
|
4647
4728
|
*/
|
|
4648
4729
|
async getDownloadCachePath(timeout) {
|
|
4649
|
-
var
|
|
4730
|
+
var _a2;
|
|
4650
4731
|
const response = await this.asyncCall("getDownloadCachePath", void 0, timeout);
|
|
4651
4732
|
if (!response.isSuccess()) {
|
|
4652
|
-
throw new Error(((
|
|
4733
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get download cache path failed");
|
|
4653
4734
|
}
|
|
4654
4735
|
return response.data;
|
|
4655
4736
|
}
|
|
@@ -4659,10 +4740,10 @@ var Path = class {
|
|
|
4659
4740
|
* @returns Promise<路径字符串>
|
|
4660
4741
|
*/
|
|
4661
4742
|
async getInternalAppDataPath(timeout) {
|
|
4662
|
-
var
|
|
4743
|
+
var _a2;
|
|
4663
4744
|
const response = await this.asyncCall("getInternalAppDataPath", void 0, timeout);
|
|
4664
4745
|
if (!response.isSuccess()) {
|
|
4665
|
-
throw new Error(((
|
|
4746
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app data path failed");
|
|
4666
4747
|
}
|
|
4667
4748
|
return response.data;
|
|
4668
4749
|
}
|
|
@@ -4672,10 +4753,10 @@ var Path = class {
|
|
|
4672
4753
|
* @returns Promise<路径字符串>
|
|
4673
4754
|
*/
|
|
4674
4755
|
async getInternalAppCodeCacheDir(timeout) {
|
|
4675
|
-
var
|
|
4756
|
+
var _a2;
|
|
4676
4757
|
const response = await this.asyncCall("getInternalAppCodeCacheDir", void 0, timeout);
|
|
4677
4758
|
if (!response.isSuccess()) {
|
|
4678
|
-
throw new Error(((
|
|
4759
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app code cache dir failed");
|
|
4679
4760
|
}
|
|
4680
4761
|
return response.data;
|
|
4681
4762
|
}
|
|
@@ -4685,10 +4766,10 @@ var Path = class {
|
|
|
4685
4766
|
* @returns Promise<路径字符串>
|
|
4686
4767
|
*/
|
|
4687
4768
|
async getInternalAppCachePath(timeout) {
|
|
4688
|
-
var
|
|
4769
|
+
var _a2;
|
|
4689
4770
|
const response = await this.asyncCall("getInternalAppCachePath", void 0, timeout);
|
|
4690
4771
|
if (!response.isSuccess()) {
|
|
4691
|
-
throw new Error(((
|
|
4772
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app cache path failed");
|
|
4692
4773
|
}
|
|
4693
4774
|
return response.data;
|
|
4694
4775
|
}
|
|
@@ -4698,10 +4779,10 @@ var Path = class {
|
|
|
4698
4779
|
* @returns Promise<路径字符串>
|
|
4699
4780
|
*/
|
|
4700
4781
|
async getInternalAppDbsPath(timeout) {
|
|
4701
|
-
var
|
|
4782
|
+
var _a2;
|
|
4702
4783
|
const response = await this.asyncCall("getInternalAppDbsPath", void 0, timeout);
|
|
4703
4784
|
if (!response.isSuccess()) {
|
|
4704
|
-
throw new Error(((
|
|
4785
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app dbs path failed");
|
|
4705
4786
|
}
|
|
4706
4787
|
return response.data;
|
|
4707
4788
|
}
|
|
@@ -4712,10 +4793,10 @@ var Path = class {
|
|
|
4712
4793
|
* @returns Promise<路径字符串>
|
|
4713
4794
|
*/
|
|
4714
4795
|
async getInternalAppDbPath(dbName, timeout) {
|
|
4715
|
-
var
|
|
4796
|
+
var _a2;
|
|
4716
4797
|
const response = await this.asyncCall("getInternalAppDbPath", { dbName }, timeout);
|
|
4717
4798
|
if (!response.isSuccess()) {
|
|
4718
|
-
throw new Error(((
|
|
4799
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app db path failed");
|
|
4719
4800
|
}
|
|
4720
4801
|
return response.data;
|
|
4721
4802
|
}
|
|
@@ -4725,10 +4806,10 @@ var Path = class {
|
|
|
4725
4806
|
* @returns Promise<路径字符串>
|
|
4726
4807
|
*/
|
|
4727
4808
|
async getInternalAppFilesPath(timeout) {
|
|
4728
|
-
var
|
|
4809
|
+
var _a2;
|
|
4729
4810
|
const response = await this.asyncCall("getInternalAppFilesPath", void 0, timeout);
|
|
4730
4811
|
if (!response.isSuccess()) {
|
|
4731
|
-
throw new Error(((
|
|
4812
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app files path failed");
|
|
4732
4813
|
}
|
|
4733
4814
|
return response.data;
|
|
4734
4815
|
}
|
|
@@ -4738,10 +4819,10 @@ var Path = class {
|
|
|
4738
4819
|
* @returns Promise<路径字符串>
|
|
4739
4820
|
*/
|
|
4740
4821
|
async getInternalAppSpPath(timeout) {
|
|
4741
|
-
var
|
|
4822
|
+
var _a2;
|
|
4742
4823
|
const response = await this.asyncCall("getInternalAppSpPath", void 0, timeout);
|
|
4743
4824
|
if (!response.isSuccess()) {
|
|
4744
|
-
throw new Error(((
|
|
4825
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app sp path failed");
|
|
4745
4826
|
}
|
|
4746
4827
|
return response.data;
|
|
4747
4828
|
}
|
|
@@ -4751,10 +4832,10 @@ var Path = class {
|
|
|
4751
4832
|
* @returns Promise<路径字符串>
|
|
4752
4833
|
*/
|
|
4753
4834
|
async getInternalAppNoBackupFilesPath(timeout) {
|
|
4754
|
-
var
|
|
4835
|
+
var _a2;
|
|
4755
4836
|
const response = await this.asyncCall("getInternalAppNoBackupFilesPath", void 0, timeout);
|
|
4756
4837
|
if (!response.isSuccess()) {
|
|
4757
|
-
throw new Error(((
|
|
4838
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app no backup files path failed");
|
|
4758
4839
|
}
|
|
4759
4840
|
return response.data;
|
|
4760
4841
|
}
|
|
@@ -4764,10 +4845,10 @@ var Path = class {
|
|
|
4764
4845
|
* @returns Promise<路径字符串>
|
|
4765
4846
|
*/
|
|
4766
4847
|
async getExternalStoragePath(timeout) {
|
|
4767
|
-
var
|
|
4848
|
+
var _a2;
|
|
4768
4849
|
const response = await this.asyncCall("getExternalStoragePath", void 0, timeout);
|
|
4769
4850
|
if (!response.isSuccess()) {
|
|
4770
|
-
throw new Error(((
|
|
4851
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external storage path failed");
|
|
4771
4852
|
}
|
|
4772
4853
|
return response.data;
|
|
4773
4854
|
}
|
|
@@ -4777,10 +4858,10 @@ var Path = class {
|
|
|
4777
4858
|
* @returns Promise<路径字符串>
|
|
4778
4859
|
*/
|
|
4779
4860
|
async getExternalMusicPath(timeout) {
|
|
4780
|
-
var
|
|
4861
|
+
var _a2;
|
|
4781
4862
|
const response = await this.asyncCall("getExternalMusicPath", void 0, timeout);
|
|
4782
4863
|
if (!response.isSuccess()) {
|
|
4783
|
-
throw new Error(((
|
|
4864
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external music path failed");
|
|
4784
4865
|
}
|
|
4785
4866
|
return response.data;
|
|
4786
4867
|
}
|
|
@@ -4790,10 +4871,10 @@ var Path = class {
|
|
|
4790
4871
|
* @returns Promise<路径字符串>
|
|
4791
4872
|
*/
|
|
4792
4873
|
async getExternalPodcastsPath(timeout) {
|
|
4793
|
-
var
|
|
4874
|
+
var _a2;
|
|
4794
4875
|
const response = await this.asyncCall("getExternalPodcastsPath", void 0, timeout);
|
|
4795
4876
|
if (!response.isSuccess()) {
|
|
4796
|
-
throw new Error(((
|
|
4877
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external podcasts path failed");
|
|
4797
4878
|
}
|
|
4798
4879
|
return response.data;
|
|
4799
4880
|
}
|
|
@@ -4803,10 +4884,10 @@ var Path = class {
|
|
|
4803
4884
|
* @returns Promise<路径字符串>
|
|
4804
4885
|
*/
|
|
4805
4886
|
async getExternalRingtonesPath(timeout) {
|
|
4806
|
-
var
|
|
4887
|
+
var _a2;
|
|
4807
4888
|
const response = await this.asyncCall("getExternalRingtonesPath", void 0, timeout);
|
|
4808
4889
|
if (!response.isSuccess()) {
|
|
4809
|
-
throw new Error(((
|
|
4890
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external ringtones path failed");
|
|
4810
4891
|
}
|
|
4811
4892
|
return response.data;
|
|
4812
4893
|
}
|
|
@@ -4816,10 +4897,10 @@ var Path = class {
|
|
|
4816
4897
|
* @returns Promise<路径字符串>
|
|
4817
4898
|
*/
|
|
4818
4899
|
async getExternalAlarmsPath(timeout) {
|
|
4819
|
-
var
|
|
4900
|
+
var _a2;
|
|
4820
4901
|
const response = await this.asyncCall("getExternalAlarmsPath", void 0, timeout);
|
|
4821
4902
|
if (!response.isSuccess()) {
|
|
4822
|
-
throw new Error(((
|
|
4903
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external alarms path failed");
|
|
4823
4904
|
}
|
|
4824
4905
|
return response.data;
|
|
4825
4906
|
}
|
|
@@ -4829,10 +4910,10 @@ var Path = class {
|
|
|
4829
4910
|
* @returns Promise<路径字符串>
|
|
4830
4911
|
*/
|
|
4831
4912
|
async getExternalNotificationsPath(timeout) {
|
|
4832
|
-
var
|
|
4913
|
+
var _a2;
|
|
4833
4914
|
const response = await this.asyncCall("getExternalNotificationsPath", void 0, timeout);
|
|
4834
4915
|
if (!response.isSuccess()) {
|
|
4835
|
-
throw new Error(((
|
|
4916
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external notifications path failed");
|
|
4836
4917
|
}
|
|
4837
4918
|
return response.data;
|
|
4838
4919
|
}
|
|
@@ -4842,10 +4923,10 @@ var Path = class {
|
|
|
4842
4923
|
* @returns Promise<路径字符串>
|
|
4843
4924
|
*/
|
|
4844
4925
|
async getExternalPicturesPath(timeout) {
|
|
4845
|
-
var
|
|
4926
|
+
var _a2;
|
|
4846
4927
|
const response = await this.asyncCall("getExternalPicturesPath", void 0, timeout);
|
|
4847
4928
|
if (!response.isSuccess()) {
|
|
4848
|
-
throw new Error(((
|
|
4929
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external pictures path failed");
|
|
4849
4930
|
}
|
|
4850
4931
|
return response.data;
|
|
4851
4932
|
}
|
|
@@ -4855,10 +4936,10 @@ var Path = class {
|
|
|
4855
4936
|
* @returns Promise<路径字符串>
|
|
4856
4937
|
*/
|
|
4857
4938
|
async getExternalMoviesPath(timeout) {
|
|
4858
|
-
var
|
|
4939
|
+
var _a2;
|
|
4859
4940
|
const response = await this.asyncCall("getExternalMoviesPath", void 0, timeout);
|
|
4860
4941
|
if (!response.isSuccess()) {
|
|
4861
|
-
throw new Error(((
|
|
4942
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external movies path failed");
|
|
4862
4943
|
}
|
|
4863
4944
|
return response.data;
|
|
4864
4945
|
}
|
|
@@ -4868,10 +4949,10 @@ var Path = class {
|
|
|
4868
4949
|
* @returns Promise<路径字符串>
|
|
4869
4950
|
*/
|
|
4870
4951
|
async getExternalDownloadsPath(timeout) {
|
|
4871
|
-
var
|
|
4952
|
+
var _a2;
|
|
4872
4953
|
const response = await this.asyncCall("getExternalDownloadsPath", void 0, timeout);
|
|
4873
4954
|
if (!response.isSuccess()) {
|
|
4874
|
-
throw new Error(((
|
|
4955
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external downloads path failed");
|
|
4875
4956
|
}
|
|
4876
4957
|
return response.data;
|
|
4877
4958
|
}
|
|
@@ -4881,10 +4962,10 @@ var Path = class {
|
|
|
4881
4962
|
* @returns Promise<路径字符串>
|
|
4882
4963
|
*/
|
|
4883
4964
|
async getExternalDcimPath(timeout) {
|
|
4884
|
-
var
|
|
4965
|
+
var _a2;
|
|
4885
4966
|
const response = await this.asyncCall("getExternalDcimPath", void 0, timeout);
|
|
4886
4967
|
if (!response.isSuccess()) {
|
|
4887
|
-
throw new Error(((
|
|
4968
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external dcim path failed");
|
|
4888
4969
|
}
|
|
4889
4970
|
return response.data;
|
|
4890
4971
|
}
|
|
@@ -4894,10 +4975,10 @@ var Path = class {
|
|
|
4894
4975
|
* @returns Promise<路径字符串>
|
|
4895
4976
|
*/
|
|
4896
4977
|
async getExternalDocumentsPath(timeout) {
|
|
4897
|
-
var
|
|
4978
|
+
var _a2;
|
|
4898
4979
|
const response = await this.asyncCall("getExternalDocumentsPath", void 0, timeout);
|
|
4899
4980
|
if (!response.isSuccess()) {
|
|
4900
|
-
throw new Error(((
|
|
4981
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external documents path failed");
|
|
4901
4982
|
}
|
|
4902
4983
|
return response.data;
|
|
4903
4984
|
}
|
|
@@ -4907,10 +4988,10 @@ var Path = class {
|
|
|
4907
4988
|
* @returns Promise<路径字符串>
|
|
4908
4989
|
*/
|
|
4909
4990
|
async getExternalAppDataPath(timeout) {
|
|
4910
|
-
var
|
|
4991
|
+
var _a2;
|
|
4911
4992
|
const response = await this.asyncCall("getExternalAppDataPath", void 0, timeout);
|
|
4912
4993
|
if (!response.isSuccess()) {
|
|
4913
|
-
throw new Error(((
|
|
4994
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app data path failed");
|
|
4914
4995
|
}
|
|
4915
4996
|
return response.data;
|
|
4916
4997
|
}
|
|
@@ -4920,10 +5001,10 @@ var Path = class {
|
|
|
4920
5001
|
* @returns Promise<路径字符串>
|
|
4921
5002
|
*/
|
|
4922
5003
|
async getExternalAppCachePath(timeout) {
|
|
4923
|
-
var
|
|
5004
|
+
var _a2;
|
|
4924
5005
|
const response = await this.asyncCall("getExternalAppCachePath", void 0, timeout);
|
|
4925
5006
|
if (!response.isSuccess()) {
|
|
4926
|
-
throw new Error(((
|
|
5007
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app cache path failed");
|
|
4927
5008
|
}
|
|
4928
5009
|
return response.data;
|
|
4929
5010
|
}
|
|
@@ -4933,10 +5014,10 @@ var Path = class {
|
|
|
4933
5014
|
* @returns Promise<路径字符串>
|
|
4934
5015
|
*/
|
|
4935
5016
|
async getExternalAppFilesPath(timeout) {
|
|
4936
|
-
var
|
|
5017
|
+
var _a2;
|
|
4937
5018
|
const response = await this.asyncCall("getExternalAppFilesPath", void 0, timeout);
|
|
4938
5019
|
if (!response.isSuccess()) {
|
|
4939
|
-
throw new Error(((
|
|
5020
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app files path failed");
|
|
4940
5021
|
}
|
|
4941
5022
|
return response.data;
|
|
4942
5023
|
}
|
|
@@ -4946,10 +5027,10 @@ var Path = class {
|
|
|
4946
5027
|
* @returns Promise<路径字符串>
|
|
4947
5028
|
*/
|
|
4948
5029
|
async getExternalAppMusicPath(timeout) {
|
|
4949
|
-
var
|
|
5030
|
+
var _a2;
|
|
4950
5031
|
const response = await this.asyncCall("getExternalAppMusicPath", void 0, timeout);
|
|
4951
5032
|
if (!response.isSuccess()) {
|
|
4952
|
-
throw new Error(((
|
|
5033
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app music path failed");
|
|
4953
5034
|
}
|
|
4954
5035
|
return response.data;
|
|
4955
5036
|
}
|
|
@@ -4959,10 +5040,10 @@ var Path = class {
|
|
|
4959
5040
|
* @returns Promise<路径字符串>
|
|
4960
5041
|
*/
|
|
4961
5042
|
async getExternalAppPodcastsPath(timeout) {
|
|
4962
|
-
var
|
|
5043
|
+
var _a2;
|
|
4963
5044
|
const response = await this.asyncCall("getExternalAppPodcastsPath", void 0, timeout);
|
|
4964
5045
|
if (!response.isSuccess()) {
|
|
4965
|
-
throw new Error(((
|
|
5046
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app podcasts path failed");
|
|
4966
5047
|
}
|
|
4967
5048
|
return response.data;
|
|
4968
5049
|
}
|
|
@@ -4972,10 +5053,10 @@ var Path = class {
|
|
|
4972
5053
|
* @returns Promise<路径字符串>
|
|
4973
5054
|
*/
|
|
4974
5055
|
async getExternalAppRingtonesPath(timeout) {
|
|
4975
|
-
var
|
|
5056
|
+
var _a2;
|
|
4976
5057
|
const response = await this.asyncCall("getExternalAppRingtonesPath", void 0, timeout);
|
|
4977
5058
|
if (!response.isSuccess()) {
|
|
4978
|
-
throw new Error(((
|
|
5059
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app ringtones path failed");
|
|
4979
5060
|
}
|
|
4980
5061
|
return response.data;
|
|
4981
5062
|
}
|
|
@@ -4985,10 +5066,10 @@ var Path = class {
|
|
|
4985
5066
|
* @returns Promise<路径字符串>
|
|
4986
5067
|
*/
|
|
4987
5068
|
async getExternalAppAlarmsPath(timeout) {
|
|
4988
|
-
var
|
|
5069
|
+
var _a2;
|
|
4989
5070
|
const response = await this.asyncCall("getExternalAppAlarmsPath", void 0, timeout);
|
|
4990
5071
|
if (!response.isSuccess()) {
|
|
4991
|
-
throw new Error(((
|
|
5072
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app alarms path failed");
|
|
4992
5073
|
}
|
|
4993
5074
|
return response.data;
|
|
4994
5075
|
}
|
|
@@ -4998,10 +5079,10 @@ var Path = class {
|
|
|
4998
5079
|
* @returns Promise<路径字符串>
|
|
4999
5080
|
*/
|
|
5000
5081
|
async getExternalAppNotificationsPath(timeout) {
|
|
5001
|
-
var
|
|
5082
|
+
var _a2;
|
|
5002
5083
|
const response = await this.asyncCall("getExternalAppNotificationsPath", void 0, timeout);
|
|
5003
5084
|
if (!response.isSuccess()) {
|
|
5004
|
-
throw new Error(((
|
|
5085
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app notifications path failed");
|
|
5005
5086
|
}
|
|
5006
5087
|
return response.data;
|
|
5007
5088
|
}
|
|
@@ -5011,10 +5092,10 @@ var Path = class {
|
|
|
5011
5092
|
* @returns Promise<路径字符串>
|
|
5012
5093
|
*/
|
|
5013
5094
|
async getExternalAppPicturesPath(timeout) {
|
|
5014
|
-
var
|
|
5095
|
+
var _a2;
|
|
5015
5096
|
const response = await this.asyncCall("getExternalAppPicturesPath", void 0, timeout);
|
|
5016
5097
|
if (!response.isSuccess()) {
|
|
5017
|
-
throw new Error(((
|
|
5098
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app pictures path failed");
|
|
5018
5099
|
}
|
|
5019
5100
|
return response.data;
|
|
5020
5101
|
}
|
|
@@ -5024,10 +5105,10 @@ var Path = class {
|
|
|
5024
5105
|
* @returns Promise<路径字符串>
|
|
5025
5106
|
*/
|
|
5026
5107
|
async getExternalAppMoviesPath(timeout) {
|
|
5027
|
-
var
|
|
5108
|
+
var _a2;
|
|
5028
5109
|
const response = await this.asyncCall("getExternalAppMoviesPath", void 0, timeout);
|
|
5029
5110
|
if (!response.isSuccess()) {
|
|
5030
|
-
throw new Error(((
|
|
5111
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app movies path failed");
|
|
5031
5112
|
}
|
|
5032
5113
|
return response.data;
|
|
5033
5114
|
}
|
|
@@ -5037,10 +5118,10 @@ var Path = class {
|
|
|
5037
5118
|
* @returns Promise<路径字符串>
|
|
5038
5119
|
*/
|
|
5039
5120
|
async getExternalAppDownloadPath(timeout) {
|
|
5040
|
-
var
|
|
5121
|
+
var _a2;
|
|
5041
5122
|
const response = await this.asyncCall("getExternalAppDownloadPath", void 0, timeout);
|
|
5042
5123
|
if (!response.isSuccess()) {
|
|
5043
|
-
throw new Error(((
|
|
5124
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app download path failed");
|
|
5044
5125
|
}
|
|
5045
5126
|
return response.data;
|
|
5046
5127
|
}
|
|
@@ -5050,10 +5131,10 @@ var Path = class {
|
|
|
5050
5131
|
* @returns Promise<路径字符串>
|
|
5051
5132
|
*/
|
|
5052
5133
|
async getExternalAppDcimPath(timeout) {
|
|
5053
|
-
var
|
|
5134
|
+
var _a2;
|
|
5054
5135
|
const response = await this.asyncCall("getExternalAppDcimPath", void 0, timeout);
|
|
5055
5136
|
if (!response.isSuccess()) {
|
|
5056
|
-
throw new Error(((
|
|
5137
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app dcim path failed");
|
|
5057
5138
|
}
|
|
5058
5139
|
return response.data;
|
|
5059
5140
|
}
|
|
@@ -5063,10 +5144,10 @@ var Path = class {
|
|
|
5063
5144
|
* @returns Promise<路径字符串>
|
|
5064
5145
|
*/
|
|
5065
5146
|
async getExternalAppDocumentsPath(timeout) {
|
|
5066
|
-
var
|
|
5147
|
+
var _a2;
|
|
5067
5148
|
const response = await this.asyncCall("getExternalAppDocumentsPath", void 0, timeout);
|
|
5068
5149
|
if (!response.isSuccess()) {
|
|
5069
|
-
throw new Error(((
|
|
5150
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app documents path failed");
|
|
5070
5151
|
}
|
|
5071
5152
|
return response.data;
|
|
5072
5153
|
}
|
|
@@ -5076,10 +5157,10 @@ var Path = class {
|
|
|
5076
5157
|
* @returns Promise<路径字符串>
|
|
5077
5158
|
*/
|
|
5078
5159
|
async getExternalAppObbPath(timeout) {
|
|
5079
|
-
var
|
|
5160
|
+
var _a2;
|
|
5080
5161
|
const response = await this.asyncCall("getExternalAppObbPath", void 0, timeout);
|
|
5081
5162
|
if (!response.isSuccess()) {
|
|
5082
|
-
throw new Error(((
|
|
5163
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app obb path failed");
|
|
5083
5164
|
}
|
|
5084
5165
|
return response.data;
|
|
5085
5166
|
}
|
|
@@ -5089,10 +5170,10 @@ var Path = class {
|
|
|
5089
5170
|
* @returns Promise<路径字符串>
|
|
5090
5171
|
*/
|
|
5091
5172
|
async getRootPathExternalFirst(timeout) {
|
|
5092
|
-
var
|
|
5173
|
+
var _a2;
|
|
5093
5174
|
const response = await this.asyncCall("getRootPathExternalFirst", void 0, timeout);
|
|
5094
5175
|
if (!response.isSuccess()) {
|
|
5095
|
-
throw new Error(((
|
|
5176
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get root path external first failed");
|
|
5096
5177
|
}
|
|
5097
5178
|
return response.data;
|
|
5098
5179
|
}
|
|
@@ -5102,10 +5183,10 @@ var Path = class {
|
|
|
5102
5183
|
* @returns Promise<路径字符串>
|
|
5103
5184
|
*/
|
|
5104
5185
|
async getAppDataPathExternalFirst(timeout) {
|
|
5105
|
-
var
|
|
5186
|
+
var _a2;
|
|
5106
5187
|
const response = await this.asyncCall("getAppDataPathExternalFirst", void 0, timeout);
|
|
5107
5188
|
if (!response.isSuccess()) {
|
|
5108
|
-
throw new Error(((
|
|
5189
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get app data path external first failed");
|
|
5109
5190
|
}
|
|
5110
5191
|
return response.data;
|
|
5111
5192
|
}
|
|
@@ -5115,10 +5196,10 @@ var Path = class {
|
|
|
5115
5196
|
* @returns Promise<路径字符串>
|
|
5116
5197
|
*/
|
|
5117
5198
|
async getFilesPathExternalFirst(timeout) {
|
|
5118
|
-
var
|
|
5199
|
+
var _a2;
|
|
5119
5200
|
const response = await this.asyncCall("getFilesPathExternalFirst", void 0, timeout);
|
|
5120
5201
|
if (!response.isSuccess()) {
|
|
5121
|
-
throw new Error(((
|
|
5202
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get files path external first failed");
|
|
5122
5203
|
}
|
|
5123
5204
|
return response.data;
|
|
5124
5205
|
}
|
|
@@ -5128,10 +5209,10 @@ var Path = class {
|
|
|
5128
5209
|
* @returns Promise<路径字符串>
|
|
5129
5210
|
*/
|
|
5130
5211
|
async getCachePathExternalFirst(timeout) {
|
|
5131
|
-
var
|
|
5212
|
+
var _a2;
|
|
5132
5213
|
const response = await this.asyncCall("getCachePathExternalFirst", void 0, timeout);
|
|
5133
5214
|
if (!response.isSuccess()) {
|
|
5134
|
-
throw new Error(((
|
|
5215
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get cache path external first failed");
|
|
5135
5216
|
}
|
|
5136
5217
|
return response.data;
|
|
5137
5218
|
}
|
|
@@ -5207,14 +5288,14 @@ var FileIO = class {
|
|
|
5207
5288
|
* @returns Promise<是否成功>
|
|
5208
5289
|
*/
|
|
5209
5290
|
async writeFileFromIS(filePath, inputStreamBase64, append = false, timeout) {
|
|
5210
|
-
var
|
|
5291
|
+
var _a2;
|
|
5211
5292
|
const response = await this.asyncCall(
|
|
5212
5293
|
"writeFileFromIS",
|
|
5213
5294
|
{ filePath, inputStreamBase64, append },
|
|
5214
5295
|
timeout
|
|
5215
5296
|
);
|
|
5216
5297
|
if (!response.isSuccess()) {
|
|
5217
|
-
throw new Error(((
|
|
5298
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from input stream failed");
|
|
5218
5299
|
}
|
|
5219
5300
|
return response.data;
|
|
5220
5301
|
}
|
|
@@ -5227,14 +5308,14 @@ var FileIO = class {
|
|
|
5227
5308
|
* @returns Promise<是否成功>
|
|
5228
5309
|
*/
|
|
5229
5310
|
async writeFileFromBytesByStream(filePath, bytesBase64, append = false, timeout) {
|
|
5230
|
-
var
|
|
5311
|
+
var _a2;
|
|
5231
5312
|
const response = await this.asyncCall(
|
|
5232
5313
|
"writeFileFromBytesByStream",
|
|
5233
5314
|
{ filePath, bytesBase64, append },
|
|
5234
5315
|
timeout
|
|
5235
5316
|
);
|
|
5236
5317
|
if (!response.isSuccess()) {
|
|
5237
|
-
throw new Error(((
|
|
5318
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from bytes by stream failed");
|
|
5238
5319
|
}
|
|
5239
5320
|
return response.data;
|
|
5240
5321
|
}
|
|
@@ -5247,14 +5328,14 @@ var FileIO = class {
|
|
|
5247
5328
|
* @returns Promise<是否成功>
|
|
5248
5329
|
*/
|
|
5249
5330
|
async writeFileFromBytesByChannel(filePath, bytesBase64, append = false, timeout) {
|
|
5250
|
-
var
|
|
5331
|
+
var _a2;
|
|
5251
5332
|
const response = await this.asyncCall(
|
|
5252
5333
|
"writeFileFromBytesByChannel",
|
|
5253
5334
|
{ filePath, bytesBase64, append },
|
|
5254
5335
|
timeout
|
|
5255
5336
|
);
|
|
5256
5337
|
if (!response.isSuccess()) {
|
|
5257
|
-
throw new Error(((
|
|
5338
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from bytes by channel failed");
|
|
5258
5339
|
}
|
|
5259
5340
|
return response.data;
|
|
5260
5341
|
}
|
|
@@ -5267,14 +5348,14 @@ var FileIO = class {
|
|
|
5267
5348
|
* @returns Promise<是否成功>
|
|
5268
5349
|
*/
|
|
5269
5350
|
async writeFileFromBytesByMap(filePath, bytesBase64, append = false, timeout) {
|
|
5270
|
-
var
|
|
5351
|
+
var _a2;
|
|
5271
5352
|
const response = await this.asyncCall(
|
|
5272
5353
|
"writeFileFromBytesByMap",
|
|
5273
5354
|
{ filePath, bytesBase64, append },
|
|
5274
5355
|
timeout
|
|
5275
5356
|
);
|
|
5276
5357
|
if (!response.isSuccess()) {
|
|
5277
|
-
throw new Error(((
|
|
5358
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from bytes by map failed");
|
|
5278
5359
|
}
|
|
5279
5360
|
return response.data;
|
|
5280
5361
|
}
|
|
@@ -5288,14 +5369,14 @@ var FileIO = class {
|
|
|
5288
5369
|
* @returns Promise<是否成功>
|
|
5289
5370
|
*/
|
|
5290
5371
|
async writeFileFromString(filePath, content, append = false, threadSafe = false, timeout) {
|
|
5291
|
-
var
|
|
5372
|
+
var _a2;
|
|
5292
5373
|
const response = await this.asyncCall(
|
|
5293
5374
|
"writeFileFromString",
|
|
5294
5375
|
{ filePath, content, append, threadSafe },
|
|
5295
5376
|
timeout
|
|
5296
5377
|
);
|
|
5297
5378
|
if (!response.isSuccess()) {
|
|
5298
|
-
throw new Error(((
|
|
5379
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from string failed");
|
|
5299
5380
|
}
|
|
5300
5381
|
return response.data;
|
|
5301
5382
|
}
|
|
@@ -5307,14 +5388,14 @@ var FileIO = class {
|
|
|
5307
5388
|
* @returns Promise<字符串数组>
|
|
5308
5389
|
*/
|
|
5309
5390
|
async readFile2List(filePath, charsetName = "UTF-8", timeout) {
|
|
5310
|
-
var
|
|
5391
|
+
var _a2;
|
|
5311
5392
|
const response = await this.asyncCall(
|
|
5312
5393
|
"readFile2List",
|
|
5313
5394
|
{ filePath, charsetName },
|
|
5314
5395
|
timeout
|
|
5315
5396
|
);
|
|
5316
5397
|
if (!response.isSuccess()) {
|
|
5317
|
-
throw new Error(((
|
|
5398
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to list failed");
|
|
5318
5399
|
}
|
|
5319
5400
|
return response.data;
|
|
5320
5401
|
}
|
|
@@ -5326,14 +5407,14 @@ var FileIO = class {
|
|
|
5326
5407
|
* @returns Promise<文件内容字符串>
|
|
5327
5408
|
*/
|
|
5328
5409
|
async readFile2String(filePath, charsetName = "UTF-8", timeout) {
|
|
5329
|
-
var
|
|
5410
|
+
var _a2;
|
|
5330
5411
|
const response = await this.asyncCall(
|
|
5331
5412
|
"readFile2String",
|
|
5332
5413
|
{ filePath, charsetName },
|
|
5333
5414
|
timeout
|
|
5334
5415
|
);
|
|
5335
5416
|
if (!response.isSuccess()) {
|
|
5336
|
-
throw new Error(((
|
|
5417
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to string failed");
|
|
5337
5418
|
}
|
|
5338
5419
|
return response.data;
|
|
5339
5420
|
}
|
|
@@ -5344,14 +5425,14 @@ var FileIO = class {
|
|
|
5344
5425
|
* @returns Promise<Base64 编码的字节数组>
|
|
5345
5426
|
*/
|
|
5346
5427
|
async readFile2BytesByStream(filePath, timeout) {
|
|
5347
|
-
var
|
|
5428
|
+
var _a2;
|
|
5348
5429
|
const response = await this.asyncCall(
|
|
5349
5430
|
"readFile2BytesByStream",
|
|
5350
5431
|
{ filePath },
|
|
5351
5432
|
timeout
|
|
5352
5433
|
);
|
|
5353
5434
|
if (!response.isSuccess()) {
|
|
5354
|
-
throw new Error(((
|
|
5435
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to bytes by stream failed");
|
|
5355
5436
|
}
|
|
5356
5437
|
return response.data;
|
|
5357
5438
|
}
|
|
@@ -5362,14 +5443,14 @@ var FileIO = class {
|
|
|
5362
5443
|
* @returns Promise<Base64 编码的字节数组>
|
|
5363
5444
|
*/
|
|
5364
5445
|
async readFile2BytesByChannel(filePath, timeout) {
|
|
5365
|
-
var
|
|
5446
|
+
var _a2;
|
|
5366
5447
|
const response = await this.asyncCall(
|
|
5367
5448
|
"readFile2BytesByChannel",
|
|
5368
5449
|
{ filePath },
|
|
5369
5450
|
timeout
|
|
5370
5451
|
);
|
|
5371
5452
|
if (!response.isSuccess()) {
|
|
5372
|
-
throw new Error(((
|
|
5453
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to bytes by channel failed");
|
|
5373
5454
|
}
|
|
5374
5455
|
return response.data;
|
|
5375
5456
|
}
|
|
@@ -5380,14 +5461,14 @@ var FileIO = class {
|
|
|
5380
5461
|
* @returns Promise<Base64 编码的字节数组>
|
|
5381
5462
|
*/
|
|
5382
5463
|
async readFile2BytesByMap(filePath, timeout) {
|
|
5383
|
-
var
|
|
5464
|
+
var _a2;
|
|
5384
5465
|
const response = await this.asyncCall(
|
|
5385
5466
|
"readFile2BytesByMap",
|
|
5386
5467
|
{ filePath },
|
|
5387
5468
|
timeout
|
|
5388
5469
|
);
|
|
5389
5470
|
if (!response.isSuccess()) {
|
|
5390
|
-
throw new Error(((
|
|
5471
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to bytes by map failed");
|
|
5391
5472
|
}
|
|
5392
5473
|
return response.data;
|
|
5393
5474
|
}
|
|
@@ -5398,14 +5479,14 @@ var FileIO = class {
|
|
|
5398
5479
|
* @returns Promise<是否成功>
|
|
5399
5480
|
*/
|
|
5400
5481
|
async setBufferSize(bufferSize, timeout) {
|
|
5401
|
-
var
|
|
5482
|
+
var _a2;
|
|
5402
5483
|
const response = await this.asyncCall(
|
|
5403
5484
|
"setBufferSize",
|
|
5404
5485
|
{ bufferSize },
|
|
5405
5486
|
timeout
|
|
5406
5487
|
);
|
|
5407
5488
|
if (!response.isSuccess()) {
|
|
5408
|
-
throw new Error(((
|
|
5489
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Set buffer size failed");
|
|
5409
5490
|
}
|
|
5410
5491
|
return response.data;
|
|
5411
5492
|
}
|
|
@@ -5479,10 +5560,10 @@ var FileUtils = class {
|
|
|
5479
5560
|
* @returns Promise<文件信息>
|
|
5480
5561
|
*/
|
|
5481
5562
|
async getFileByPath(filePath, timeout) {
|
|
5482
|
-
var
|
|
5563
|
+
var _a2;
|
|
5483
5564
|
const response = await this.asyncCall("getFileByPath", { filePath }, timeout);
|
|
5484
5565
|
if (!response.isSuccess()) {
|
|
5485
|
-
throw new Error(((
|
|
5566
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file by path failed");
|
|
5486
5567
|
}
|
|
5487
5568
|
return response.data;
|
|
5488
5569
|
}
|
|
@@ -5493,10 +5574,10 @@ var FileUtils = class {
|
|
|
5493
5574
|
* @returns Promise<是否存在>
|
|
5494
5575
|
*/
|
|
5495
5576
|
async isFileExists(filePath, timeout) {
|
|
5496
|
-
var
|
|
5577
|
+
var _a2;
|
|
5497
5578
|
const response = await this.asyncCall("isFileExists", { filePath }, timeout);
|
|
5498
5579
|
if (!response.isSuccess()) {
|
|
5499
|
-
throw new Error(((
|
|
5580
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check file exists failed");
|
|
5500
5581
|
}
|
|
5501
5582
|
return response.data;
|
|
5502
5583
|
}
|
|
@@ -5508,10 +5589,10 @@ var FileUtils = class {
|
|
|
5508
5589
|
* @returns Promise<是否成功>
|
|
5509
5590
|
*/
|
|
5510
5591
|
async rename(filePath, newName, timeout) {
|
|
5511
|
-
var
|
|
5592
|
+
var _a2;
|
|
5512
5593
|
const response = await this.asyncCall("rename", { filePath, newName }, timeout);
|
|
5513
5594
|
if (!response.isSuccess()) {
|
|
5514
|
-
throw new Error(((
|
|
5595
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Rename file failed");
|
|
5515
5596
|
}
|
|
5516
5597
|
return response.data;
|
|
5517
5598
|
}
|
|
@@ -5522,10 +5603,10 @@ var FileUtils = class {
|
|
|
5522
5603
|
* @returns Promise<是否为目录>
|
|
5523
5604
|
*/
|
|
5524
5605
|
async isDir(filePath, timeout) {
|
|
5525
|
-
var
|
|
5606
|
+
var _a2;
|
|
5526
5607
|
const response = await this.asyncCall("isDir", { filePath }, timeout);
|
|
5527
5608
|
if (!response.isSuccess()) {
|
|
5528
|
-
throw new Error(((
|
|
5609
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check is directory failed");
|
|
5529
5610
|
}
|
|
5530
5611
|
return response.data;
|
|
5531
5612
|
}
|
|
@@ -5536,10 +5617,10 @@ var FileUtils = class {
|
|
|
5536
5617
|
* @returns Promise<是否为文件>
|
|
5537
5618
|
*/
|
|
5538
5619
|
async isFile(filePath, timeout) {
|
|
5539
|
-
var
|
|
5620
|
+
var _a2;
|
|
5540
5621
|
const response = await this.asyncCall("isFile", { filePath }, timeout);
|
|
5541
5622
|
if (!response.isSuccess()) {
|
|
5542
|
-
throw new Error(((
|
|
5623
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check is file failed");
|
|
5543
5624
|
}
|
|
5544
5625
|
return response.data;
|
|
5545
5626
|
}
|
|
@@ -5550,10 +5631,10 @@ var FileUtils = class {
|
|
|
5550
5631
|
* @returns Promise<是否成功>
|
|
5551
5632
|
*/
|
|
5552
5633
|
async createOrExistsDir(dirPath, timeout) {
|
|
5553
|
-
var
|
|
5634
|
+
var _a2;
|
|
5554
5635
|
const response = await this.asyncCall("createOrExistsDir", { dirPath }, timeout);
|
|
5555
5636
|
if (!response.isSuccess()) {
|
|
5556
|
-
throw new Error(((
|
|
5637
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Create or exists dir failed");
|
|
5557
5638
|
}
|
|
5558
5639
|
return response.data;
|
|
5559
5640
|
}
|
|
@@ -5564,10 +5645,10 @@ var FileUtils = class {
|
|
|
5564
5645
|
* @returns Promise<是否成功>
|
|
5565
5646
|
*/
|
|
5566
5647
|
async createOrExistsFile(filePath, timeout) {
|
|
5567
|
-
var
|
|
5648
|
+
var _a2;
|
|
5568
5649
|
const response = await this.asyncCall("createOrExistsFile", { filePath }, timeout);
|
|
5569
5650
|
if (!response.isSuccess()) {
|
|
5570
|
-
throw new Error(((
|
|
5651
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Create or exists file failed");
|
|
5571
5652
|
}
|
|
5572
5653
|
return response.data;
|
|
5573
5654
|
}
|
|
@@ -5578,10 +5659,10 @@ var FileUtils = class {
|
|
|
5578
5659
|
* @returns Promise<是否成功>
|
|
5579
5660
|
*/
|
|
5580
5661
|
async createFileByDeleteOldFile(filePath, timeout) {
|
|
5581
|
-
var
|
|
5662
|
+
var _a2;
|
|
5582
5663
|
const response = await this.asyncCall("createFileByDeleteOldFile", { filePath }, timeout);
|
|
5583
5664
|
if (!response.isSuccess()) {
|
|
5584
|
-
throw new Error(((
|
|
5665
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Create file by delete old file failed");
|
|
5585
5666
|
}
|
|
5586
5667
|
return response.data;
|
|
5587
5668
|
}
|
|
@@ -5593,10 +5674,10 @@ var FileUtils = class {
|
|
|
5593
5674
|
* @returns Promise<是否成功>
|
|
5594
5675
|
*/
|
|
5595
5676
|
async copy(srcFilePath, destFilePath, timeout) {
|
|
5596
|
-
var
|
|
5677
|
+
var _a2;
|
|
5597
5678
|
const response = await this.asyncCall("copy", { srcFilePath, destFilePath }, timeout);
|
|
5598
5679
|
if (!response.isSuccess()) {
|
|
5599
|
-
throw new Error(((
|
|
5680
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Copy file failed");
|
|
5600
5681
|
}
|
|
5601
5682
|
return response.data;
|
|
5602
5683
|
}
|
|
@@ -5608,10 +5689,10 @@ var FileUtils = class {
|
|
|
5608
5689
|
* @returns Promise<是否成功>
|
|
5609
5690
|
*/
|
|
5610
5691
|
async move(srcFilePath, destFilePath, timeout) {
|
|
5611
|
-
var
|
|
5692
|
+
var _a2;
|
|
5612
5693
|
const response = await this.asyncCall("move", { srcFilePath, destFilePath }, timeout);
|
|
5613
5694
|
if (!response.isSuccess()) {
|
|
5614
|
-
throw new Error(((
|
|
5695
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Move file failed");
|
|
5615
5696
|
}
|
|
5616
5697
|
return response.data;
|
|
5617
5698
|
}
|
|
@@ -5622,10 +5703,10 @@ var FileUtils = class {
|
|
|
5622
5703
|
* @returns Promise<是否成功>
|
|
5623
5704
|
*/
|
|
5624
5705
|
async delete(filePath, timeout) {
|
|
5625
|
-
var
|
|
5706
|
+
var _a2;
|
|
5626
5707
|
const response = await this.asyncCall("delete", { filePath }, timeout);
|
|
5627
5708
|
if (!response.isSuccess()) {
|
|
5628
|
-
throw new Error(((
|
|
5709
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Delete file failed");
|
|
5629
5710
|
}
|
|
5630
5711
|
return response.data;
|
|
5631
5712
|
}
|
|
@@ -5636,10 +5717,10 @@ var FileUtils = class {
|
|
|
5636
5717
|
* @returns Promise<是否成功>
|
|
5637
5718
|
*/
|
|
5638
5719
|
async deleteAllInDir(dirPath, timeout) {
|
|
5639
|
-
var
|
|
5720
|
+
var _a2;
|
|
5640
5721
|
const response = await this.asyncCall("deleteAllInDir", { dirPath }, timeout);
|
|
5641
5722
|
if (!response.isSuccess()) {
|
|
5642
|
-
throw new Error(((
|
|
5723
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Delete all in dir failed");
|
|
5643
5724
|
}
|
|
5644
5725
|
return response.data;
|
|
5645
5726
|
}
|
|
@@ -5650,10 +5731,10 @@ var FileUtils = class {
|
|
|
5650
5731
|
* @returns Promise<是否成功>
|
|
5651
5732
|
*/
|
|
5652
5733
|
async deleteFilesInDir(dirPath, timeout) {
|
|
5653
|
-
var
|
|
5734
|
+
var _a2;
|
|
5654
5735
|
const response = await this.asyncCall("deleteFilesInDir", { dirPath }, timeout);
|
|
5655
5736
|
if (!response.isSuccess()) {
|
|
5656
|
-
throw new Error(((
|
|
5737
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Delete files in dir failed");
|
|
5657
5738
|
}
|
|
5658
5739
|
return response.data;
|
|
5659
5740
|
}
|
|
@@ -5665,14 +5746,14 @@ var FileUtils = class {
|
|
|
5665
5746
|
* @returns Promise<是否成功>
|
|
5666
5747
|
*/
|
|
5667
5748
|
async deleteFilesInDirWithFilter(dirPath, filterPattern, timeout) {
|
|
5668
|
-
var
|
|
5749
|
+
var _a2;
|
|
5669
5750
|
const response = await this.asyncCall(
|
|
5670
5751
|
"deleteFilesInDirWithFilter",
|
|
5671
5752
|
{ dirPath, filterPattern },
|
|
5672
5753
|
timeout
|
|
5673
5754
|
);
|
|
5674
5755
|
if (!response.isSuccess()) {
|
|
5675
|
-
throw new Error(((
|
|
5756
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Delete files in dir with filter failed");
|
|
5676
5757
|
}
|
|
5677
5758
|
return response.data;
|
|
5678
5759
|
}
|
|
@@ -5683,10 +5764,10 @@ var FileUtils = class {
|
|
|
5683
5764
|
* @returns Promise<文件列表>
|
|
5684
5765
|
*/
|
|
5685
5766
|
async listFilesInDir(dirPath, timeout) {
|
|
5686
|
-
var
|
|
5767
|
+
var _a2;
|
|
5687
5768
|
const response = await this.asyncCall("listFilesInDir", { dirPath }, timeout);
|
|
5688
5769
|
if (!response.isSuccess()) {
|
|
5689
|
-
throw new Error(((
|
|
5770
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "List files in dir failed");
|
|
5690
5771
|
}
|
|
5691
5772
|
return response.data;
|
|
5692
5773
|
}
|
|
@@ -5698,14 +5779,14 @@ var FileUtils = class {
|
|
|
5698
5779
|
* @returns Promise<文件列表>
|
|
5699
5780
|
*/
|
|
5700
5781
|
async listFilesInDirWithFilter(dirPath, filterPattern, timeout) {
|
|
5701
|
-
var
|
|
5782
|
+
var _a2;
|
|
5702
5783
|
const response = await this.asyncCall(
|
|
5703
5784
|
"listFilesInDirWithFilter",
|
|
5704
5785
|
{ dirPath, filterPattern },
|
|
5705
5786
|
timeout
|
|
5706
5787
|
);
|
|
5707
5788
|
if (!response.isSuccess()) {
|
|
5708
|
-
throw new Error(((
|
|
5789
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "List files in dir with filter failed");
|
|
5709
5790
|
}
|
|
5710
5791
|
return response.data;
|
|
5711
5792
|
}
|
|
@@ -5716,10 +5797,10 @@ var FileUtils = class {
|
|
|
5716
5797
|
* @returns Promise<时间戳(毫秒)>
|
|
5717
5798
|
*/
|
|
5718
5799
|
async getFileLastModified(filePath, timeout) {
|
|
5719
|
-
var
|
|
5800
|
+
var _a2;
|
|
5720
5801
|
const response = await this.asyncCall("getFileLastModified", { filePath }, timeout);
|
|
5721
5802
|
if (!response.isSuccess()) {
|
|
5722
|
-
throw new Error(((
|
|
5803
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file last modified failed");
|
|
5723
5804
|
}
|
|
5724
5805
|
return response.data;
|
|
5725
5806
|
}
|
|
@@ -5730,10 +5811,10 @@ var FileUtils = class {
|
|
|
5730
5811
|
* @returns Promise<字符集名称>
|
|
5731
5812
|
*/
|
|
5732
5813
|
async getFileCharsetSimple(filePath, timeout) {
|
|
5733
|
-
var
|
|
5814
|
+
var _a2;
|
|
5734
5815
|
const response = await this.asyncCall("getFileCharsetSimple", { filePath }, timeout);
|
|
5735
5816
|
if (!response.isSuccess()) {
|
|
5736
|
-
throw new Error(((
|
|
5817
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file charset simple failed");
|
|
5737
5818
|
}
|
|
5738
5819
|
return response.data;
|
|
5739
5820
|
}
|
|
@@ -5744,10 +5825,10 @@ var FileUtils = class {
|
|
|
5744
5825
|
* @returns Promise<行数>
|
|
5745
5826
|
*/
|
|
5746
5827
|
async getFileLines(filePath, timeout) {
|
|
5747
|
-
var
|
|
5828
|
+
var _a2;
|
|
5748
5829
|
const response = await this.asyncCall("getFileLines", { filePath }, timeout);
|
|
5749
5830
|
if (!response.isSuccess()) {
|
|
5750
|
-
throw new Error(((
|
|
5831
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file lines failed");
|
|
5751
5832
|
}
|
|
5752
5833
|
return response.data;
|
|
5753
5834
|
}
|
|
@@ -5758,10 +5839,10 @@ var FileUtils = class {
|
|
|
5758
5839
|
* @returns Promise<大小(字节)>
|
|
5759
5840
|
*/
|
|
5760
5841
|
async getSize(filePath, timeout) {
|
|
5761
|
-
var
|
|
5842
|
+
var _a2;
|
|
5762
5843
|
const response = await this.asyncCall("getSize", { filePath }, timeout);
|
|
5763
5844
|
if (!response.isSuccess()) {
|
|
5764
|
-
throw new Error(((
|
|
5845
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get size failed");
|
|
5765
5846
|
}
|
|
5766
5847
|
return response.data;
|
|
5767
5848
|
}
|
|
@@ -5772,10 +5853,10 @@ var FileUtils = class {
|
|
|
5772
5853
|
* @returns Promise<长度(字节)>
|
|
5773
5854
|
*/
|
|
5774
5855
|
async getLength(filePath, timeout) {
|
|
5775
|
-
var
|
|
5856
|
+
var _a2;
|
|
5776
5857
|
const response = await this.asyncCall("getLength", { filePath }, timeout);
|
|
5777
5858
|
if (!response.isSuccess()) {
|
|
5778
|
-
throw new Error(((
|
|
5859
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get length failed");
|
|
5779
5860
|
}
|
|
5780
5861
|
return response.data;
|
|
5781
5862
|
}
|
|
@@ -5786,10 +5867,10 @@ var FileUtils = class {
|
|
|
5786
5867
|
* @returns Promise<Base64 编码的 MD5>
|
|
5787
5868
|
*/
|
|
5788
5869
|
async getFileMD5(filePath, timeout) {
|
|
5789
|
-
var
|
|
5870
|
+
var _a2;
|
|
5790
5871
|
const response = await this.asyncCall("getFileMD5", { filePath }, timeout);
|
|
5791
5872
|
if (!response.isSuccess()) {
|
|
5792
|
-
throw new Error(((
|
|
5873
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file MD5 failed");
|
|
5793
5874
|
}
|
|
5794
5875
|
return response.data;
|
|
5795
5876
|
}
|
|
@@ -5800,10 +5881,10 @@ var FileUtils = class {
|
|
|
5800
5881
|
* @returns Promise<MD5 字符串>
|
|
5801
5882
|
*/
|
|
5802
5883
|
async getFileMD5ToString(filePath, timeout) {
|
|
5803
|
-
var
|
|
5884
|
+
var _a2;
|
|
5804
5885
|
const response = await this.asyncCall("getFileMD5ToString", { filePath }, timeout);
|
|
5805
5886
|
if (!response.isSuccess()) {
|
|
5806
|
-
throw new Error(((
|
|
5887
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file MD5 to string failed");
|
|
5807
5888
|
}
|
|
5808
5889
|
return response.data;
|
|
5809
5890
|
}
|
|
@@ -5814,10 +5895,10 @@ var FileUtils = class {
|
|
|
5814
5895
|
* @returns Promise<目录名>
|
|
5815
5896
|
*/
|
|
5816
5897
|
async getDirName(filePath, timeout) {
|
|
5817
|
-
var
|
|
5898
|
+
var _a2;
|
|
5818
5899
|
const response = await this.asyncCall("getDirName", { filePath }, timeout);
|
|
5819
5900
|
if (!response.isSuccess()) {
|
|
5820
|
-
throw new Error(((
|
|
5901
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get dir name failed");
|
|
5821
5902
|
}
|
|
5822
5903
|
return response.data;
|
|
5823
5904
|
}
|
|
@@ -5828,10 +5909,10 @@ var FileUtils = class {
|
|
|
5828
5909
|
* @returns Promise<文件名>
|
|
5829
5910
|
*/
|
|
5830
5911
|
async getFileName(filePath, timeout) {
|
|
5831
|
-
var
|
|
5912
|
+
var _a2;
|
|
5832
5913
|
const response = await this.asyncCall("getFileName", { filePath }, timeout);
|
|
5833
5914
|
if (!response.isSuccess()) {
|
|
5834
|
-
throw new Error(((
|
|
5915
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file name failed");
|
|
5835
5916
|
}
|
|
5836
5917
|
return response.data;
|
|
5837
5918
|
}
|
|
@@ -5842,10 +5923,10 @@ var FileUtils = class {
|
|
|
5842
5923
|
* @returns Promise<文件名(不含扩展名)>
|
|
5843
5924
|
*/
|
|
5844
5925
|
async getFileNameNoExtension(filePath, timeout) {
|
|
5845
|
-
var
|
|
5926
|
+
var _a2;
|
|
5846
5927
|
const response = await this.asyncCall("getFileNameNoExtension", { filePath }, timeout);
|
|
5847
5928
|
if (!response.isSuccess()) {
|
|
5848
|
-
throw new Error(((
|
|
5929
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file name no extension failed");
|
|
5849
5930
|
}
|
|
5850
5931
|
return response.data;
|
|
5851
5932
|
}
|
|
@@ -5856,10 +5937,10 @@ var FileUtils = class {
|
|
|
5856
5937
|
* @returns Promise<扩展名>
|
|
5857
5938
|
*/
|
|
5858
5939
|
async getFileExtension(filePath, timeout) {
|
|
5859
|
-
var
|
|
5940
|
+
var _a2;
|
|
5860
5941
|
const response = await this.asyncCall("getFileExtension", { filePath }, timeout);
|
|
5861
5942
|
if (!response.isSuccess()) {
|
|
5862
|
-
throw new Error(((
|
|
5943
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file extension failed");
|
|
5863
5944
|
}
|
|
5864
5945
|
return response.data;
|
|
5865
5946
|
}
|
|
@@ -5870,10 +5951,10 @@ var FileUtils = class {
|
|
|
5870
5951
|
* @returns Promise<是否成功>
|
|
5871
5952
|
*/
|
|
5872
5953
|
async notifySystemToScan(filePath, timeout) {
|
|
5873
|
-
var
|
|
5954
|
+
var _a2;
|
|
5874
5955
|
const response = await this.asyncCall("notifySystemToScan", { filePath }, timeout);
|
|
5875
5956
|
if (!response.isSuccess()) {
|
|
5876
|
-
throw new Error(((
|
|
5957
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Notify system to scan failed");
|
|
5877
5958
|
}
|
|
5878
5959
|
return response.data;
|
|
5879
5960
|
}
|
|
@@ -5884,10 +5965,10 @@ var FileUtils = class {
|
|
|
5884
5965
|
* @returns Promise<总大小(字节)>
|
|
5885
5966
|
*/
|
|
5886
5967
|
async getFsTotalSize(filePath, timeout) {
|
|
5887
|
-
var
|
|
5968
|
+
var _a2;
|
|
5888
5969
|
const response = await this.asyncCall("getFsTotalSize", { filePath }, timeout);
|
|
5889
5970
|
if (!response.isSuccess()) {
|
|
5890
|
-
throw new Error(((
|
|
5971
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file system total size failed");
|
|
5891
5972
|
}
|
|
5892
5973
|
return response.data;
|
|
5893
5974
|
}
|
|
@@ -5898,10 +5979,10 @@ var FileUtils = class {
|
|
|
5898
5979
|
* @returns Promise<可用大小(字节)>
|
|
5899
5980
|
*/
|
|
5900
5981
|
async getFsAvailableSize(filePath, timeout) {
|
|
5901
|
-
var
|
|
5982
|
+
var _a2;
|
|
5902
5983
|
const response = await this.asyncCall("getFsAvailableSize", { filePath }, timeout);
|
|
5903
5984
|
if (!response.isSuccess()) {
|
|
5904
|
-
throw new Error(((
|
|
5985
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file system available size failed");
|
|
5905
5986
|
}
|
|
5906
5987
|
return response.data;
|
|
5907
5988
|
}
|
|
@@ -5985,14 +6066,14 @@ var Ime = class {
|
|
|
5985
6066
|
* @returns Promise<执行结果>
|
|
5986
6067
|
*/
|
|
5987
6068
|
async performEditorAction(actionId = 3 /* SEARCH */, timeout) {
|
|
5988
|
-
var
|
|
6069
|
+
var _a2;
|
|
5989
6070
|
const response = await this.asyncCall(
|
|
5990
6071
|
"performEditorAction",
|
|
5991
6072
|
{ actionId },
|
|
5992
6073
|
timeout
|
|
5993
6074
|
);
|
|
5994
6075
|
if (!response.isSuccess()) {
|
|
5995
|
-
throw new Error(((
|
|
6076
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Perform editor action failed");
|
|
5996
6077
|
}
|
|
5997
6078
|
return response.data;
|
|
5998
6079
|
}
|
|
@@ -6002,14 +6083,14 @@ var Ime = class {
|
|
|
6002
6083
|
* @returns Promise<执行结果>
|
|
6003
6084
|
*/
|
|
6004
6085
|
async openInputMethodSettings(timeout) {
|
|
6005
|
-
var
|
|
6086
|
+
var _a2;
|
|
6006
6087
|
const response = await this.asyncCall(
|
|
6007
6088
|
"openInputMethodSettings",
|
|
6008
6089
|
void 0,
|
|
6009
6090
|
timeout
|
|
6010
6091
|
);
|
|
6011
6092
|
if (!response.isSuccess()) {
|
|
6012
|
-
throw new Error(((
|
|
6093
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Open input method settings failed");
|
|
6013
6094
|
}
|
|
6014
6095
|
return response.data;
|
|
6015
6096
|
}
|
|
@@ -6019,14 +6100,14 @@ var Ime = class {
|
|
|
6019
6100
|
* @returns Promise<检查结果>
|
|
6020
6101
|
*/
|
|
6021
6102
|
async isInputMethodEnabled(timeout) {
|
|
6022
|
-
var
|
|
6103
|
+
var _a2;
|
|
6023
6104
|
const response = await this.asyncCall(
|
|
6024
6105
|
"isInputMethodEnabled",
|
|
6025
6106
|
void 0,
|
|
6026
6107
|
timeout
|
|
6027
6108
|
);
|
|
6028
6109
|
if (!response.isSuccess()) {
|
|
6029
|
-
throw new Error(((
|
|
6110
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check input method enabled failed");
|
|
6030
6111
|
}
|
|
6031
6112
|
return response.data;
|
|
6032
6113
|
}
|
|
@@ -6036,14 +6117,14 @@ var Ime = class {
|
|
|
6036
6117
|
* @returns Promise<检查结果>
|
|
6037
6118
|
*/
|
|
6038
6119
|
async isCurrentInputMethod(timeout) {
|
|
6039
|
-
var
|
|
6120
|
+
var _a2;
|
|
6040
6121
|
const response = await this.asyncCall(
|
|
6041
6122
|
"isCurrentInputMethod",
|
|
6042
6123
|
void 0,
|
|
6043
6124
|
timeout
|
|
6044
6125
|
);
|
|
6045
6126
|
if (!response.isSuccess()) {
|
|
6046
|
-
throw new Error(((
|
|
6127
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check current input method failed");
|
|
6047
6128
|
}
|
|
6048
6129
|
return response.data;
|
|
6049
6130
|
}
|
|
@@ -6118,10 +6199,10 @@ var ImageUtils = class {
|
|
|
6118
6199
|
* @returns Promise<图片尺寸信息>
|
|
6119
6200
|
*/
|
|
6120
6201
|
async getSize(imagePath, timeout) {
|
|
6121
|
-
var
|
|
6202
|
+
var _a2;
|
|
6122
6203
|
const response = await this.asyncCall("getSize", { imagePath }, timeout);
|
|
6123
6204
|
if (!response.isSuccess()) {
|
|
6124
|
-
throw new Error(((
|
|
6205
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u83B7\u53D6\u56FE\u7247\u5C3A\u5BF8\u5931\u8D25");
|
|
6125
6206
|
}
|
|
6126
6207
|
return response.data;
|
|
6127
6208
|
}
|
|
@@ -6132,10 +6213,10 @@ var ImageUtils = class {
|
|
|
6132
6213
|
* @returns Promise<图片类型信息>
|
|
6133
6214
|
*/
|
|
6134
6215
|
async getImageType(imagePath, timeout) {
|
|
6135
|
-
var
|
|
6216
|
+
var _a2;
|
|
6136
6217
|
const response = await this.asyncCall("getImageType", { imagePath }, timeout);
|
|
6137
6218
|
if (!response.isSuccess()) {
|
|
6138
|
-
throw new Error(((
|
|
6219
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u83B7\u53D6\u56FE\u7247\u7C7B\u578B\u5931\u8D25");
|
|
6139
6220
|
}
|
|
6140
6221
|
return response.data;
|
|
6141
6222
|
}
|
|
@@ -6146,10 +6227,10 @@ var ImageUtils = class {
|
|
|
6146
6227
|
* @returns Promise<是否为图片>
|
|
6147
6228
|
*/
|
|
6148
6229
|
async isImage(fileName, timeout) {
|
|
6149
|
-
var
|
|
6230
|
+
var _a2;
|
|
6150
6231
|
const response = await this.asyncCall("isImage", { fileName }, timeout);
|
|
6151
6232
|
if (!response.isSuccess()) {
|
|
6152
|
-
throw new Error(((
|
|
6233
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u5224\u65AD\u662F\u5426\u4E3A\u56FE\u7247\u5931\u8D25");
|
|
6153
6234
|
}
|
|
6154
6235
|
return response.data.isImage;
|
|
6155
6236
|
}
|
|
@@ -6160,10 +6241,10 @@ var ImageUtils = class {
|
|
|
6160
6241
|
* @returns Promise<图片旋转角度信息>
|
|
6161
6242
|
*/
|
|
6162
6243
|
async getRotateDegree(imagePath, timeout) {
|
|
6163
|
-
var
|
|
6244
|
+
var _a2;
|
|
6164
6245
|
const response = await this.asyncCall("getRotateDegree", { imagePath }, timeout);
|
|
6165
6246
|
if (!response.isSuccess()) {
|
|
6166
|
-
throw new Error(((
|
|
6247
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u83B7\u53D6\u56FE\u7247\u65CB\u8F6C\u89D2\u5EA6\u5931\u8D25");
|
|
6167
6248
|
}
|
|
6168
6249
|
return response.data;
|
|
6169
6250
|
}
|
|
@@ -6180,7 +6261,7 @@ var ImageUtils = class {
|
|
|
6180
6261
|
* @returns Promise<处理后的图片路径>
|
|
6181
6262
|
*/
|
|
6182
6263
|
async scale(imagePath, options = {}) {
|
|
6183
|
-
var
|
|
6264
|
+
var _a2;
|
|
6184
6265
|
const { scaleWidth, scaleHeight, savePath, format, timeout } = options;
|
|
6185
6266
|
const response = await this.asyncCall(
|
|
6186
6267
|
"scale",
|
|
@@ -6188,7 +6269,7 @@ var ImageUtils = class {
|
|
|
6188
6269
|
timeout
|
|
6189
6270
|
);
|
|
6190
6271
|
if (!response.isSuccess()) {
|
|
6191
|
-
throw new Error(((
|
|
6272
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u7F29\u653E\u56FE\u7247\u5931\u8D25");
|
|
6192
6273
|
}
|
|
6193
6274
|
return response.data.filePath;
|
|
6194
6275
|
}
|
|
@@ -6206,7 +6287,7 @@ var ImageUtils = class {
|
|
|
6206
6287
|
* @returns Promise<处理后的图片路径>
|
|
6207
6288
|
*/
|
|
6208
6289
|
async clip(imagePath, options = {}) {
|
|
6209
|
-
var
|
|
6290
|
+
var _a2;
|
|
6210
6291
|
const { x = 0, y = 0, width, height, savePath, format, timeout } = options;
|
|
6211
6292
|
const response = await this.asyncCall(
|
|
6212
6293
|
"clip",
|
|
@@ -6214,7 +6295,7 @@ var ImageUtils = class {
|
|
|
6214
6295
|
timeout
|
|
6215
6296
|
);
|
|
6216
6297
|
if (!response.isSuccess()) {
|
|
6217
|
-
throw new Error(((
|
|
6298
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u88C1\u526A\u56FE\u7247\u5931\u8D25");
|
|
6218
6299
|
}
|
|
6219
6300
|
return response.data.filePath;
|
|
6220
6301
|
}
|
|
@@ -6232,7 +6313,7 @@ var ImageUtils = class {
|
|
|
6232
6313
|
* @returns Promise<处理后的图片路径>
|
|
6233
6314
|
*/
|
|
6234
6315
|
async skew(imagePath, options = {}) {
|
|
6235
|
-
var
|
|
6316
|
+
var _a2;
|
|
6236
6317
|
const { kx = 0, ky = 0, px, py, savePath, format, timeout } = options;
|
|
6237
6318
|
const response = await this.asyncCall(
|
|
6238
6319
|
"skew",
|
|
@@ -6240,7 +6321,7 @@ var ImageUtils = class {
|
|
|
6240
6321
|
timeout
|
|
6241
6322
|
);
|
|
6242
6323
|
if (!response.isSuccess()) {
|
|
6243
|
-
throw new Error(((
|
|
6324
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u503E\u659C\u56FE\u7247\u5931\u8D25");
|
|
6244
6325
|
}
|
|
6245
6326
|
return response.data.filePath;
|
|
6246
6327
|
}
|
|
@@ -6257,7 +6338,7 @@ var ImageUtils = class {
|
|
|
6257
6338
|
* @returns Promise<处理后的图片路径>
|
|
6258
6339
|
*/
|
|
6259
6340
|
async rotate(imagePath, options = {}) {
|
|
6260
|
-
var
|
|
6341
|
+
var _a2;
|
|
6261
6342
|
const { degree = 0, px, py, savePath, format, timeout } = options;
|
|
6262
6343
|
const response = await this.asyncCall(
|
|
6263
6344
|
"rotate",
|
|
@@ -6265,7 +6346,7 @@ var ImageUtils = class {
|
|
|
6265
6346
|
timeout
|
|
6266
6347
|
);
|
|
6267
6348
|
if (!response.isSuccess()) {
|
|
6268
|
-
throw new Error(((
|
|
6349
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u65CB\u8F6C\u56FE\u7247\u5931\u8D25");
|
|
6269
6350
|
}
|
|
6270
6351
|
return response.data.filePath;
|
|
6271
6352
|
}
|
|
@@ -6279,7 +6360,7 @@ var ImageUtils = class {
|
|
|
6279
6360
|
* @returns Promise<处理后的图片路径>
|
|
6280
6361
|
*/
|
|
6281
6362
|
async toRound(imagePath, options = {}) {
|
|
6282
|
-
var
|
|
6363
|
+
var _a2;
|
|
6283
6364
|
const { savePath, format, timeout } = options;
|
|
6284
6365
|
const response = await this.asyncCall(
|
|
6285
6366
|
"toRound",
|
|
@@ -6287,7 +6368,7 @@ var ImageUtils = class {
|
|
|
6287
6368
|
timeout
|
|
6288
6369
|
);
|
|
6289
6370
|
if (!response.isSuccess()) {
|
|
6290
|
-
throw new Error(((
|
|
6371
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u8F6C\u4E3A\u5706\u5F62\u56FE\u7247\u5931\u8D25");
|
|
6291
6372
|
}
|
|
6292
6373
|
return response.data.filePath;
|
|
6293
6374
|
}
|
|
@@ -6302,7 +6383,7 @@ var ImageUtils = class {
|
|
|
6302
6383
|
* @returns Promise<处理后的图片路径>
|
|
6303
6384
|
*/
|
|
6304
6385
|
async toRoundCorner(imagePath, options = {}) {
|
|
6305
|
-
var
|
|
6386
|
+
var _a2;
|
|
6306
6387
|
const { radius = 0, savePath, format, timeout } = options;
|
|
6307
6388
|
const response = await this.asyncCall(
|
|
6308
6389
|
"toRoundCorner",
|
|
@@ -6310,7 +6391,7 @@ var ImageUtils = class {
|
|
|
6310
6391
|
timeout
|
|
6311
6392
|
);
|
|
6312
6393
|
if (!response.isSuccess()) {
|
|
6313
|
-
throw new Error(((
|
|
6394
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u8F6C\u4E3A\u5706\u89D2\u56FE\u7247\u5931\u8D25");
|
|
6314
6395
|
}
|
|
6315
6396
|
return response.data.filePath;
|
|
6316
6397
|
}
|
|
@@ -6327,7 +6408,7 @@ var ImageUtils = class {
|
|
|
6327
6408
|
* @returns Promise<处理后的图片路径>
|
|
6328
6409
|
*/
|
|
6329
6410
|
async addCornerBorder(imagePath, options = {}) {
|
|
6330
|
-
var
|
|
6411
|
+
var _a2;
|
|
6331
6412
|
const { borderSize = 0, color = "#000000", cornerRadius = 0, savePath, format, timeout } = options;
|
|
6332
6413
|
const response = await this.asyncCall(
|
|
6333
6414
|
"addCornerBorder",
|
|
@@ -6335,7 +6416,7 @@ var ImageUtils = class {
|
|
|
6335
6416
|
timeout
|
|
6336
6417
|
);
|
|
6337
6418
|
if (!response.isSuccess()) {
|
|
6338
|
-
throw new Error(((
|
|
6419
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u5706\u89D2\u8FB9\u6846\u5931\u8D25");
|
|
6339
6420
|
}
|
|
6340
6421
|
return response.data.filePath;
|
|
6341
6422
|
}
|
|
@@ -6351,7 +6432,7 @@ var ImageUtils = class {
|
|
|
6351
6432
|
* @returns Promise<处理后的图片路径>
|
|
6352
6433
|
*/
|
|
6353
6434
|
async addCircleBorder(imagePath, options = {}) {
|
|
6354
|
-
var
|
|
6435
|
+
var _a2;
|
|
6355
6436
|
const { borderSize = 0, color = "#000000", savePath, format, timeout } = options;
|
|
6356
6437
|
const response = await this.asyncCall(
|
|
6357
6438
|
"addCircleBorder",
|
|
@@ -6359,7 +6440,7 @@ var ImageUtils = class {
|
|
|
6359
6440
|
timeout
|
|
6360
6441
|
);
|
|
6361
6442
|
if (!response.isSuccess()) {
|
|
6362
|
-
throw new Error(((
|
|
6443
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u5706\u5F62\u8FB9\u6846\u5931\u8D25");
|
|
6363
6444
|
}
|
|
6364
6445
|
return response.data.filePath;
|
|
6365
6446
|
}
|
|
@@ -6374,7 +6455,7 @@ var ImageUtils = class {
|
|
|
6374
6455
|
* @returns Promise<处理后的图片路径>
|
|
6375
6456
|
*/
|
|
6376
6457
|
async addReflection(imagePath, options = {}) {
|
|
6377
|
-
var
|
|
6458
|
+
var _a2;
|
|
6378
6459
|
const { reflectionHeight = 0, savePath, format, timeout } = options;
|
|
6379
6460
|
const response = await this.asyncCall(
|
|
6380
6461
|
"addReflection",
|
|
@@ -6382,7 +6463,7 @@ var ImageUtils = class {
|
|
|
6382
6463
|
timeout
|
|
6383
6464
|
);
|
|
6384
6465
|
if (!response.isSuccess()) {
|
|
6385
|
-
throw new Error(((
|
|
6466
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u5012\u5F71\u5931\u8D25");
|
|
6386
6467
|
}
|
|
6387
6468
|
return response.data.filePath;
|
|
6388
6469
|
}
|
|
@@ -6401,7 +6482,7 @@ var ImageUtils = class {
|
|
|
6401
6482
|
* @returns Promise<处理后的图片路径>
|
|
6402
6483
|
*/
|
|
6403
6484
|
async addTextWatermark(imagePath, options = {}) {
|
|
6404
|
-
var
|
|
6485
|
+
var _a2;
|
|
6405
6486
|
const { text = "", x = 0, y = 0, color = "#000000", size = 16, savePath, format, timeout } = options;
|
|
6406
6487
|
const response = await this.asyncCall(
|
|
6407
6488
|
"addTextWatermark",
|
|
@@ -6409,7 +6490,7 @@ var ImageUtils = class {
|
|
|
6409
6490
|
timeout
|
|
6410
6491
|
);
|
|
6411
6492
|
if (!response.isSuccess()) {
|
|
6412
|
-
throw new Error(((
|
|
6493
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u6587\u5B57\u6C34\u5370\u5931\u8D25");
|
|
6413
6494
|
}
|
|
6414
6495
|
return response.data.filePath;
|
|
6415
6496
|
}
|
|
@@ -6427,7 +6508,7 @@ var ImageUtils = class {
|
|
|
6427
6508
|
* @returns Promise<处理后的图片路径>
|
|
6428
6509
|
*/
|
|
6429
6510
|
async addImageWatermark(imagePath, options) {
|
|
6430
|
-
var
|
|
6511
|
+
var _a2;
|
|
6431
6512
|
const { watermarkPath, x = 0, y = 0, alpha = 255, savePath, format, timeout } = options;
|
|
6432
6513
|
const response = await this.asyncCall(
|
|
6433
6514
|
"addImageWatermark",
|
|
@@ -6435,7 +6516,7 @@ var ImageUtils = class {
|
|
|
6435
6516
|
timeout
|
|
6436
6517
|
);
|
|
6437
6518
|
if (!response.isSuccess()) {
|
|
6438
|
-
throw new Error(((
|
|
6519
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u56FE\u7247\u6C34\u5370\u5931\u8D25");
|
|
6439
6520
|
}
|
|
6440
6521
|
return response.data.filePath;
|
|
6441
6522
|
}
|
|
@@ -6449,7 +6530,7 @@ var ImageUtils = class {
|
|
|
6449
6530
|
* @returns Promise<处理后的图片路径>
|
|
6450
6531
|
*/
|
|
6451
6532
|
async toAlpha(imagePath, options = {}) {
|
|
6452
|
-
var
|
|
6533
|
+
var _a2;
|
|
6453
6534
|
const { savePath, format, timeout } = options;
|
|
6454
6535
|
const response = await this.asyncCall(
|
|
6455
6536
|
"toAlpha",
|
|
@@ -6457,7 +6538,7 @@ var ImageUtils = class {
|
|
|
6457
6538
|
timeout
|
|
6458
6539
|
);
|
|
6459
6540
|
if (!response.isSuccess()) {
|
|
6460
|
-
throw new Error(((
|
|
6541
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u8F6C\u4E3A alpha \u4F4D\u56FE\u5931\u8D25");
|
|
6461
6542
|
}
|
|
6462
6543
|
return response.data.filePath;
|
|
6463
6544
|
}
|
|
@@ -6471,7 +6552,7 @@ var ImageUtils = class {
|
|
|
6471
6552
|
* @returns Promise<处理后的图片路径>
|
|
6472
6553
|
*/
|
|
6473
6554
|
async toGray(imagePath, options = {}) {
|
|
6474
|
-
var
|
|
6555
|
+
var _a2;
|
|
6475
6556
|
const { savePath, format, timeout } = options;
|
|
6476
6557
|
const response = await this.asyncCall(
|
|
6477
6558
|
"toGray",
|
|
@@ -6479,7 +6560,7 @@ var ImageUtils = class {
|
|
|
6479
6560
|
timeout
|
|
6480
6561
|
);
|
|
6481
6562
|
if (!response.isSuccess()) {
|
|
6482
|
-
throw new Error(((
|
|
6563
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u8F6C\u4E3A\u7070\u5EA6\u56FE\u7247\u5931\u8D25");
|
|
6483
6564
|
}
|
|
6484
6565
|
return response.data.filePath;
|
|
6485
6566
|
}
|
|
@@ -6495,7 +6576,7 @@ var ImageUtils = class {
|
|
|
6495
6576
|
* @returns Promise<处理后的图片路径>
|
|
6496
6577
|
*/
|
|
6497
6578
|
async fastBlur(imagePath, options = {}) {
|
|
6498
|
-
var
|
|
6579
|
+
var _a2;
|
|
6499
6580
|
const { radius = 0, scale = 1, savePath, format, timeout } = options;
|
|
6500
6581
|
const response = await this.asyncCall(
|
|
6501
6582
|
"fastBlur",
|
|
@@ -6503,7 +6584,7 @@ var ImageUtils = class {
|
|
|
6503
6584
|
timeout
|
|
6504
6585
|
);
|
|
6505
6586
|
if (!response.isSuccess()) {
|
|
6506
|
-
throw new Error(((
|
|
6587
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u5FEB\u901F\u6A21\u7CCA\u5931\u8D25");
|
|
6507
6588
|
}
|
|
6508
6589
|
return response.data.filePath;
|
|
6509
6590
|
}
|
|
@@ -6518,7 +6599,7 @@ var ImageUtils = class {
|
|
|
6518
6599
|
* @returns Promise<处理后的图片路径>
|
|
6519
6600
|
*/
|
|
6520
6601
|
async renderScriptBlur(imagePath, options = {}) {
|
|
6521
|
-
var
|
|
6602
|
+
var _a2;
|
|
6522
6603
|
const { radius = 0, savePath, format, timeout } = options;
|
|
6523
6604
|
const response = await this.asyncCall(
|
|
6524
6605
|
"renderScriptBlur",
|
|
@@ -6526,7 +6607,7 @@ var ImageUtils = class {
|
|
|
6526
6607
|
timeout
|
|
6527
6608
|
);
|
|
6528
6609
|
if (!response.isSuccess()) {
|
|
6529
|
-
throw new Error(((
|
|
6610
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "RenderScript \u6A21\u7CCA\u5931\u8D25");
|
|
6530
6611
|
}
|
|
6531
6612
|
return response.data.filePath;
|
|
6532
6613
|
}
|
|
@@ -6541,7 +6622,7 @@ var ImageUtils = class {
|
|
|
6541
6622
|
* @returns Promise<处理后的图片路径>
|
|
6542
6623
|
*/
|
|
6543
6624
|
async stackBlur(imagePath, options = {}) {
|
|
6544
|
-
var
|
|
6625
|
+
var _a2;
|
|
6545
6626
|
const { radius = 0, savePath, format, timeout } = options;
|
|
6546
6627
|
const response = await this.asyncCall(
|
|
6547
6628
|
"stackBlur",
|
|
@@ -6549,7 +6630,7 @@ var ImageUtils = class {
|
|
|
6549
6630
|
timeout
|
|
6550
6631
|
);
|
|
6551
6632
|
if (!response.isSuccess()) {
|
|
6552
|
-
throw new Error(((
|
|
6633
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Stack \u6A21\u7CCA\u5931\u8D25");
|
|
6553
6634
|
}
|
|
6554
6635
|
return response.data.filePath;
|
|
6555
6636
|
}
|
|
@@ -6566,7 +6647,7 @@ var ImageUtils = class {
|
|
|
6566
6647
|
* @returns Promise<压缩后的图片路径>
|
|
6567
6648
|
*/
|
|
6568
6649
|
async compressByScale(imagePath, options = {}) {
|
|
6569
|
-
var
|
|
6650
|
+
var _a2;
|
|
6570
6651
|
const { scaleWidth, scaleHeight, savePath, format, timeout } = options;
|
|
6571
6652
|
const response = await this.asyncCall(
|
|
6572
6653
|
"compressByScale",
|
|
@@ -6574,7 +6655,7 @@ var ImageUtils = class {
|
|
|
6574
6655
|
timeout
|
|
6575
6656
|
);
|
|
6576
6657
|
if (!response.isSuccess()) {
|
|
6577
|
-
throw new Error(((
|
|
6658
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6309\u7F29\u653E\u538B\u7F29\u5931\u8D25");
|
|
6578
6659
|
}
|
|
6579
6660
|
return response.data.filePath;
|
|
6580
6661
|
}
|
|
@@ -6589,7 +6670,7 @@ var ImageUtils = class {
|
|
|
6589
6670
|
* @returns Promise<压缩后的图片路径>
|
|
6590
6671
|
*/
|
|
6591
6672
|
async compressByQuality(imagePath, options = {}) {
|
|
6592
|
-
var
|
|
6673
|
+
var _a2;
|
|
6593
6674
|
const { quality = 100, format = "JPEG", savePath, timeout } = options;
|
|
6594
6675
|
const response = await this.asyncCall(
|
|
6595
6676
|
"compressByQuality",
|
|
@@ -6597,7 +6678,7 @@ var ImageUtils = class {
|
|
|
6597
6678
|
timeout
|
|
6598
6679
|
);
|
|
6599
6680
|
if (!response.isSuccess()) {
|
|
6600
|
-
throw new Error(((
|
|
6681
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6309\u8D28\u91CF\u538B\u7F29\u5931\u8D25");
|
|
6601
6682
|
}
|
|
6602
6683
|
return response.data.filePath;
|
|
6603
6684
|
}
|
|
@@ -6612,7 +6693,7 @@ var ImageUtils = class {
|
|
|
6612
6693
|
* @returns Promise<压缩后的图片路径>
|
|
6613
6694
|
*/
|
|
6614
6695
|
async compressBySampleSize(imagePath, options = {}) {
|
|
6615
|
-
var
|
|
6696
|
+
var _a2;
|
|
6616
6697
|
const { sampleSize = 1, savePath, format, timeout } = options;
|
|
6617
6698
|
const response = await this.asyncCall(
|
|
6618
6699
|
"compressBySampleSize",
|
|
@@ -6620,7 +6701,7 @@ var ImageUtils = class {
|
|
|
6620
6701
|
timeout
|
|
6621
6702
|
);
|
|
6622
6703
|
if (!response.isSuccess()) {
|
|
6623
|
-
throw new Error(((
|
|
6704
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6309\u91C7\u6837\u5927\u5C0F\u538B\u7F29\u5931\u8D25");
|
|
6624
6705
|
}
|
|
6625
6706
|
return response.data.filePath;
|
|
6626
6707
|
}
|
|
@@ -6635,7 +6716,7 @@ var ImageUtils = class {
|
|
|
6635
6716
|
* @returns Promise<保存结果>
|
|
6636
6717
|
*/
|
|
6637
6718
|
async save(imagePath, options = {}) {
|
|
6638
|
-
var
|
|
6719
|
+
var _a2;
|
|
6639
6720
|
const { savePath, format = "PNG", timeout } = options;
|
|
6640
6721
|
const response = await this.asyncCall(
|
|
6641
6722
|
"save",
|
|
@@ -6643,7 +6724,7 @@ var ImageUtils = class {
|
|
|
6643
6724
|
timeout
|
|
6644
6725
|
);
|
|
6645
6726
|
if (!response.isSuccess()) {
|
|
6646
|
-
throw new Error(((
|
|
6727
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u4FDD\u5B58\u56FE\u7247\u5931\u8D25");
|
|
6647
6728
|
}
|
|
6648
6729
|
return response.data;
|
|
6649
6730
|
}
|
|
@@ -6657,7 +6738,7 @@ var ImageUtils = class {
|
|
|
6657
6738
|
* @returns Promise<保存结果>
|
|
6658
6739
|
*/
|
|
6659
6740
|
async save2Album(imagePath, options = {}) {
|
|
6660
|
-
var
|
|
6741
|
+
var _a2;
|
|
6661
6742
|
const { fileName, format = "PNG", timeout } = options;
|
|
6662
6743
|
const response = await this.asyncCall(
|
|
6663
6744
|
"save2Album",
|
|
@@ -6665,7 +6746,7 @@ var ImageUtils = class {
|
|
|
6665
6746
|
timeout
|
|
6666
6747
|
);
|
|
6667
6748
|
if (!response.isSuccess()) {
|
|
6668
|
-
throw new Error(((
|
|
6749
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u4FDD\u5B58\u56FE\u7247\u5230\u76F8\u518C\u5931\u8D25");
|
|
6669
6750
|
}
|
|
6670
6751
|
return response.data;
|
|
6671
6752
|
}
|
|
@@ -6740,7 +6821,7 @@ var Gallery = class {
|
|
|
6740
6821
|
* @returns Promise<相册操作响应>
|
|
6741
6822
|
*/
|
|
6742
6823
|
async addImageToGallery(filePath, displayName, timeout) {
|
|
6743
|
-
var
|
|
6824
|
+
var _a2;
|
|
6744
6825
|
if (!filePath) {
|
|
6745
6826
|
throw new Error("filePath\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A");
|
|
6746
6827
|
}
|
|
@@ -6750,7 +6831,7 @@ var Gallery = class {
|
|
|
6750
6831
|
timeout
|
|
6751
6832
|
);
|
|
6752
6833
|
if (!response.isSuccess()) {
|
|
6753
|
-
throw new Error(((
|
|
6834
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u56FE\u7247\u5230\u76F8\u518C\u5931\u8D25");
|
|
6754
6835
|
}
|
|
6755
6836
|
return response.data;
|
|
6756
6837
|
}
|
|
@@ -6762,7 +6843,7 @@ var Gallery = class {
|
|
|
6762
6843
|
* @returns Promise<相册操作响应>
|
|
6763
6844
|
*/
|
|
6764
6845
|
async addVideoToGallery(filePath, displayName, timeout) {
|
|
6765
|
-
var
|
|
6846
|
+
var _a2;
|
|
6766
6847
|
if (!filePath) {
|
|
6767
6848
|
throw new Error("filePath\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A");
|
|
6768
6849
|
}
|
|
@@ -6772,7 +6853,7 @@ var Gallery = class {
|
|
|
6772
6853
|
timeout
|
|
6773
6854
|
);
|
|
6774
6855
|
if (!response.isSuccess()) {
|
|
6775
|
-
throw new Error(((
|
|
6856
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u89C6\u9891\u5230\u76F8\u518C\u5931\u8D25");
|
|
6776
6857
|
}
|
|
6777
6858
|
return response.data;
|
|
6778
6859
|
}
|
|
@@ -6783,7 +6864,7 @@ var Gallery = class {
|
|
|
6783
6864
|
* @returns Promise<删除响应>
|
|
6784
6865
|
*/
|
|
6785
6866
|
async deleteFromGalleryByUri(uri, timeout) {
|
|
6786
|
-
var
|
|
6867
|
+
var _a2;
|
|
6787
6868
|
if (!uri) {
|
|
6788
6869
|
throw new Error("uri\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A");
|
|
6789
6870
|
}
|
|
@@ -6793,7 +6874,7 @@ var Gallery = class {
|
|
|
6793
6874
|
timeout
|
|
6794
6875
|
);
|
|
6795
6876
|
if (!response.isSuccess()) {
|
|
6796
|
-
throw new Error(((
|
|
6877
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u4ECE\u76F8\u518C\u5220\u9664\u5931\u8D25");
|
|
6797
6878
|
}
|
|
6798
6879
|
return response.data;
|
|
6799
6880
|
}
|
|
@@ -6805,7 +6886,7 @@ var Gallery = class {
|
|
|
6805
6886
|
* @returns Promise<删除响应>
|
|
6806
6887
|
*/
|
|
6807
6888
|
async deleteFromGalleryById(id, type, timeout) {
|
|
6808
|
-
var
|
|
6889
|
+
var _a2;
|
|
6809
6890
|
if (id === void 0 || id === null) {
|
|
6810
6891
|
throw new Error("id\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A");
|
|
6811
6892
|
}
|
|
@@ -6818,7 +6899,7 @@ var Gallery = class {
|
|
|
6818
6899
|
timeout
|
|
6819
6900
|
);
|
|
6820
6901
|
if (!response.isSuccess()) {
|
|
6821
|
-
throw new Error(((
|
|
6902
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u4ECE\u76F8\u518C\u5220\u9664\u5931\u8D25");
|
|
6822
6903
|
}
|
|
6823
6904
|
return response.data;
|
|
6824
6905
|
}
|
|
@@ -6916,7 +6997,7 @@ var Mlkit = class {
|
|
|
6916
6997
|
* @returns Promise<识别结果>
|
|
6917
6998
|
*/
|
|
6918
6999
|
async findPhrasePositions(targetText, options = {}) {
|
|
6919
|
-
var
|
|
7000
|
+
var _a2;
|
|
6920
7001
|
if (!targetText || targetText.trim() === "") {
|
|
6921
7002
|
throw new Error("targetText cannot be empty");
|
|
6922
7003
|
}
|
|
@@ -6940,7 +7021,7 @@ var Mlkit = class {
|
|
|
6940
7021
|
timeout
|
|
6941
7022
|
);
|
|
6942
7023
|
if (!response.isSuccess()) {
|
|
6943
|
-
throw new Error(((
|
|
7024
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Recognition failed");
|
|
6944
7025
|
}
|
|
6945
7026
|
return response.data;
|
|
6946
7027
|
}
|
|
@@ -6950,7 +7031,7 @@ var Mlkit = class {
|
|
|
6950
7031
|
* @returns Promise<识别结果>
|
|
6951
7032
|
*/
|
|
6952
7033
|
async getScreenTextPositions(options = {}) {
|
|
6953
|
-
var
|
|
7034
|
+
var _a2;
|
|
6954
7035
|
const {
|
|
6955
7036
|
region,
|
|
6956
7037
|
rotationDegrees = 0,
|
|
@@ -6970,7 +7051,7 @@ var Mlkit = class {
|
|
|
6970
7051
|
timeout
|
|
6971
7052
|
);
|
|
6972
7053
|
if (!response.isSuccess()) {
|
|
6973
|
-
throw new Error(((
|
|
7054
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Recognition failed");
|
|
6974
7055
|
}
|
|
6975
7056
|
return response.data;
|
|
6976
7057
|
}
|
|
@@ -6981,7 +7062,7 @@ var Mlkit = class {
|
|
|
6981
7062
|
* @returns Promise<JSON 字符串结果>
|
|
6982
7063
|
*/
|
|
6983
7064
|
async findPhrasePositionsOnScreenAsJson(targetText, options = {}) {
|
|
6984
|
-
var
|
|
7065
|
+
var _a2;
|
|
6985
7066
|
if (!targetText || targetText.trim() === "") {
|
|
6986
7067
|
throw new Error("targetText cannot be empty");
|
|
6987
7068
|
}
|
|
@@ -7005,7 +7086,7 @@ var Mlkit = class {
|
|
|
7005
7086
|
timeout
|
|
7006
7087
|
);
|
|
7007
7088
|
if (!response.isSuccess()) {
|
|
7008
|
-
throw new Error(((
|
|
7089
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Recognition failed");
|
|
7009
7090
|
}
|
|
7010
7091
|
const data = response.data;
|
|
7011
7092
|
return data.jsonResult;
|
|
@@ -7016,7 +7097,7 @@ var Mlkit = class {
|
|
|
7016
7097
|
* @returns Promise<JSON 字符串结果>
|
|
7017
7098
|
*/
|
|
7018
7099
|
async getScreenTextPositionsAsJson(options = {}) {
|
|
7019
|
-
var
|
|
7100
|
+
var _a2;
|
|
7020
7101
|
const {
|
|
7021
7102
|
region,
|
|
7022
7103
|
rotationDegrees = 0,
|
|
@@ -7036,7 +7117,7 @@ var Mlkit = class {
|
|
|
7036
7117
|
timeout
|
|
7037
7118
|
);
|
|
7038
7119
|
if (!response.isSuccess()) {
|
|
7039
|
-
throw new Error(((
|
|
7120
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Recognition failed");
|
|
7040
7121
|
}
|
|
7041
7122
|
const data = response.data;
|
|
7042
7123
|
return data.jsonResult;
|
|
@@ -7203,10 +7284,10 @@ var BarUtils = class {
|
|
|
7203
7284
|
}
|
|
7204
7285
|
/** Set status bar color. color: Android color int (e.g. 0xff0000). isDecor: whether to apply to decor. */
|
|
7205
7286
|
async setStatusBarColor(color, options, timeout) {
|
|
7206
|
-
var
|
|
7287
|
+
var _a2;
|
|
7207
7288
|
const res = await this.asyncCall(
|
|
7208
7289
|
BarUtilsCallMethod.setStatusBarColor,
|
|
7209
|
-
{ color, isDecor: (
|
|
7290
|
+
{ color, isDecor: (_a2 = options == null ? void 0 : options.isDecor) != null ? _a2 : false },
|
|
7210
7291
|
timeout
|
|
7211
7292
|
);
|
|
7212
7293
|
if (!res.isSuccess()) {
|
|
@@ -7671,28 +7752,28 @@ var Log = class {
|
|
|
7671
7752
|
}
|
|
7672
7753
|
/** 读取当前日志全文 */
|
|
7673
7754
|
async readAllText(timeout) {
|
|
7674
|
-
var
|
|
7755
|
+
var _a2;
|
|
7675
7756
|
const res = await this.asyncCall(
|
|
7676
7757
|
LogCallMethod.readAllText,
|
|
7677
7758
|
void 0,
|
|
7678
7759
|
timeout
|
|
7679
7760
|
);
|
|
7680
7761
|
const d = res.getDataOrNull();
|
|
7681
|
-
return (
|
|
7762
|
+
return (_a2 = d == null ? void 0 : d.text) != null ? _a2 : "";
|
|
7682
7763
|
}
|
|
7683
7764
|
/**
|
|
7684
7765
|
* 获取日志服务当前域名(origin,无路径;与上传、管理后台同源)。
|
|
7685
7766
|
* 与 Kotlin getLogServiceBaseUrl / adminWebBaseUrl 对齐。
|
|
7686
7767
|
*/
|
|
7687
7768
|
async getLogServiceBaseUrl(timeout) {
|
|
7688
|
-
var
|
|
7769
|
+
var _a2;
|
|
7689
7770
|
const res = await this.asyncCall(
|
|
7690
7771
|
LogCallMethod.getLogServiceBaseUrl,
|
|
7691
7772
|
void 0,
|
|
7692
7773
|
timeout
|
|
7693
7774
|
);
|
|
7694
7775
|
const d = res.getDataOrNull();
|
|
7695
|
-
return (
|
|
7776
|
+
return (_a2 = d == null ? void 0 : d.baseUrl) != null ? _a2 : "";
|
|
7696
7777
|
}
|
|
7697
7778
|
/** 清空日志 */
|
|
7698
7779
|
async clear(timeout) {
|
|
@@ -7748,10 +7829,10 @@ var Log = class {
|
|
|
7748
7829
|
* resolve 后请保留 dispose 或调用 unsubscribe(subscriptionId) 以释放原生协程与 JS 回调。
|
|
7749
7830
|
*/
|
|
7750
7831
|
async subscribe(stream, onUpdate, options) {
|
|
7751
|
-
var
|
|
7832
|
+
var _a2;
|
|
7752
7833
|
const self = this;
|
|
7753
7834
|
const callbackId = generateUUID();
|
|
7754
|
-
const timeoutSec = (
|
|
7835
|
+
const timeoutSec = (_a2 = options == null ? void 0 : options.timeout) != null ? _a2 : 30;
|
|
7755
7836
|
return new Promise((resolve, reject) => {
|
|
7756
7837
|
let settled = false;
|
|
7757
7838
|
const timer = setTimeout(() => {
|
|
@@ -7762,7 +7843,7 @@ var Log = class {
|
|
|
7762
7843
|
}
|
|
7763
7844
|
}, timeoutSec * 1e3);
|
|
7764
7845
|
streamHandlers.set(callbackId, (raw) => {
|
|
7765
|
-
var
|
|
7846
|
+
var _a3, _b, _c;
|
|
7766
7847
|
let response;
|
|
7767
7848
|
try {
|
|
7768
7849
|
response = JSON.parse(raw);
|
|
@@ -7778,7 +7859,7 @@ var Log = class {
|
|
|
7778
7859
|
streamHandlers.delete(callbackId);
|
|
7779
7860
|
reject(
|
|
7780
7861
|
new Error(
|
|
7781
|
-
(
|
|
7862
|
+
(_a3 = response.message) != null ? _a3 : "Log subscribe failed"
|
|
7782
7863
|
)
|
|
7783
7864
|
);
|
|
7784
7865
|
}
|
|
@@ -7925,6 +8006,8 @@ var log = new Log();
|
|
|
7925
8006
|
LogStream,
|
|
7926
8007
|
Mlkit,
|
|
7927
8008
|
MlkitCallMethod,
|
|
8009
|
+
NODE_LOOKUP_SCOPE_ACTIVE_WINDOW,
|
|
8010
|
+
NODE_LOOKUP_SCOPE_ALL_WINDOWS,
|
|
7928
8011
|
Node,
|
|
7929
8012
|
NodeAsync,
|
|
7930
8013
|
NodeClassValue,
|