assistsx-js 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -2
- package/dist/index.cjs +483 -358
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +616 -1717
- package/dist/index.d.ts +616 -1717
- package/dist/index.global.js +3 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +480 -358
- package/dist/index.js.map +1 -1
- package/dist/step-DnFA4DEb.d.mts +1196 -0
- package/dist/step-DnFA4DEb.d.ts +1196 -0
- package/dist/step-flow/index.cjs +4367 -0
- package/dist/step-flow/index.cjs.map +1 -0
- package/dist/step-flow/index.d.mts +83 -0
- package/dist/step-flow/index.d.ts +83 -0
- package/dist/step-flow/index.js +4331 -0
- package/dist/step-flow/index.js.map +1 -0
- package/package.json +6 -1
- package/src/assistsx-async.ts +83 -8
- package/src/assistsx.ts +54 -11
- package/src/index.ts +2 -0
- package/src/log/log.ts +20 -0
- package/src/node-lookup-scope.ts +10 -0
- package/src/pinia-ensure.ts +15 -0
- package/src/step-async.ts +71 -9
- package/src/step-flow/index.ts +5 -0
- package/src/step-flow/legacy-handoff.ts +50 -0
- package/src/step-flow/outcome.ts +16 -0
- package/src/step-flow/payload.ts +23 -0
- package/src/step-flow/runner.ts +128 -0
- package/src/step-flow/types.ts +41 -0
- package/src/step.ts +90 -24
package/dist/index.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,
|
|
@@ -57,6 +59,7 @@ __export(index_exports, {
|
|
|
57
59
|
barUtils: () => barUtils,
|
|
58
60
|
callbacks: () => callbacks,
|
|
59
61
|
decodeBase64UTF8: () => decodeBase64UTF8,
|
|
62
|
+
ensureAssistsXPinia: () => ensureAssistsXPinia,
|
|
60
63
|
fileIO: () => fileIO,
|
|
61
64
|
fileUtils: () => fileUtils,
|
|
62
65
|
float: () => float,
|
|
@@ -75,6 +78,10 @@ __export(index_exports, {
|
|
|
75
78
|
});
|
|
76
79
|
module.exports = __toCommonJS(index_exports);
|
|
77
80
|
|
|
81
|
+
// src/node-lookup-scope.ts
|
|
82
|
+
var NODE_LOOKUP_SCOPE_ACTIVE_WINDOW = "active_window";
|
|
83
|
+
var NODE_LOOKUP_SCOPE_ALL_WINDOWS = "all_windows";
|
|
84
|
+
|
|
78
85
|
// src/bounds.ts
|
|
79
86
|
var Bounds = class _Bounds {
|
|
80
87
|
// 构造函数
|
|
@@ -272,8 +279,8 @@ var CallResponse = class {
|
|
|
272
279
|
}
|
|
273
280
|
// 获取数据,如果数据为空则返回默认值
|
|
274
281
|
getDataOrDefault(defaultValue) {
|
|
275
|
-
var
|
|
276
|
-
return (
|
|
282
|
+
var _a2;
|
|
283
|
+
return (_a2 = this.data) != null ? _a2 : defaultValue;
|
|
277
284
|
}
|
|
278
285
|
};
|
|
279
286
|
|
|
@@ -314,9 +321,9 @@ var AppInfo = class _AppInfo {
|
|
|
314
321
|
* @returns AppInfo实例
|
|
315
322
|
*/
|
|
316
323
|
static fromJSON(data) {
|
|
317
|
-
var
|
|
324
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
|
318
325
|
return new _AppInfo(
|
|
319
|
-
(
|
|
326
|
+
(_a2 = data.isSystem) != null ? _a2 : false,
|
|
320
327
|
(_b = data.minSdkVersion) != null ? _b : 0,
|
|
321
328
|
(_c = data.name) != null ? _c : "",
|
|
322
329
|
(_d = data.packageName) != null ? _d : "",
|
|
@@ -365,9 +372,9 @@ var DeviceInfo = class _DeviceInfo {
|
|
|
365
372
|
* @returns DeviceInfo实例
|
|
366
373
|
*/
|
|
367
374
|
static fromJSON(data) {
|
|
368
|
-
var
|
|
375
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
369
376
|
return new _DeviceInfo(
|
|
370
|
-
(
|
|
377
|
+
(_a2 = data.uniqueDeviceId) != null ? _a2 : "",
|
|
371
378
|
(_b = data.androidID) != null ? _b : "",
|
|
372
379
|
(_c = data.macAddress) != null ? _c : "",
|
|
373
380
|
(_d = data.isDeviceRooted) != null ? _d : false,
|
|
@@ -490,10 +497,17 @@ var AssistsXAsync = class {
|
|
|
490
497
|
filterViewId,
|
|
491
498
|
filterDes,
|
|
492
499
|
filterText,
|
|
493
|
-
timeout
|
|
500
|
+
timeout,
|
|
501
|
+
scope
|
|
494
502
|
} = {}) {
|
|
495
503
|
const response = await this.asyncCall(CallMethod.getAllNodes, {
|
|
496
|
-
args: {
|
|
504
|
+
args: {
|
|
505
|
+
filterClass,
|
|
506
|
+
filterViewId,
|
|
507
|
+
filterDes,
|
|
508
|
+
filterText,
|
|
509
|
+
...scope !== void 0 ? { scope } : {}
|
|
510
|
+
},
|
|
497
511
|
timeout
|
|
498
512
|
});
|
|
499
513
|
const data = response.getDataOrDefault([]);
|
|
@@ -718,13 +732,11 @@ var AssistsXAsync = class {
|
|
|
718
732
|
});
|
|
719
733
|
return response.getDataOrDefault(false);
|
|
720
734
|
}
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
* @returns 包名
|
|
725
|
-
*/
|
|
726
|
-
static async getPackageName(timeout) {
|
|
735
|
+
static async getPackageName(timeoutOrOptions) {
|
|
736
|
+
const normalized = typeof timeoutOrOptions === "number" ? { timeout: timeoutOrOptions } : timeoutOrOptions != null ? timeoutOrOptions : {};
|
|
737
|
+
const { timeout, scope } = normalized;
|
|
727
738
|
const response = await this.asyncCall(CallMethod.getPackageName, {
|
|
739
|
+
args: scope !== void 0 ? { scope } : void 0,
|
|
728
740
|
timeout
|
|
729
741
|
});
|
|
730
742
|
return response.getDataOrDefault("");
|
|
@@ -758,10 +770,17 @@ var AssistsXAsync = class {
|
|
|
758
770
|
filterText,
|
|
759
771
|
filterDes,
|
|
760
772
|
node,
|
|
761
|
-
timeout
|
|
773
|
+
timeout,
|
|
774
|
+
scope
|
|
762
775
|
} = {}) {
|
|
763
776
|
const response = await this.asyncCall(CallMethod.findById, {
|
|
764
|
-
args: {
|
|
777
|
+
args: {
|
|
778
|
+
id,
|
|
779
|
+
filterClass,
|
|
780
|
+
filterText,
|
|
781
|
+
filterDes,
|
|
782
|
+
...scope !== void 0 ? { scope } : {}
|
|
783
|
+
},
|
|
765
784
|
node,
|
|
766
785
|
timeout
|
|
767
786
|
});
|
|
@@ -788,10 +807,17 @@ var AssistsXAsync = class {
|
|
|
788
807
|
filterViewId,
|
|
789
808
|
filterDes,
|
|
790
809
|
node,
|
|
791
|
-
timeout
|
|
810
|
+
timeout,
|
|
811
|
+
scope
|
|
792
812
|
} = {}) {
|
|
793
813
|
const response = await this.asyncCall(CallMethod.findByText, {
|
|
794
|
-
args: {
|
|
814
|
+
args: {
|
|
815
|
+
text,
|
|
816
|
+
filterClass,
|
|
817
|
+
filterViewId,
|
|
818
|
+
filterDes,
|
|
819
|
+
...scope !== void 0 ? { scope } : {}
|
|
820
|
+
},
|
|
795
821
|
node,
|
|
796
822
|
timeout
|
|
797
823
|
});
|
|
@@ -818,10 +844,17 @@ var AssistsXAsync = class {
|
|
|
818
844
|
filterViewId,
|
|
819
845
|
filterDes,
|
|
820
846
|
node,
|
|
821
|
-
timeout
|
|
847
|
+
timeout,
|
|
848
|
+
scope
|
|
822
849
|
} = {}) {
|
|
823
850
|
const response = await this.asyncCall(CallMethod.findByTags, {
|
|
824
|
-
args: {
|
|
851
|
+
args: {
|
|
852
|
+
className,
|
|
853
|
+
filterText,
|
|
854
|
+
filterViewId,
|
|
855
|
+
filterDes,
|
|
856
|
+
...scope !== void 0 ? { scope } : {}
|
|
857
|
+
},
|
|
825
858
|
node,
|
|
826
859
|
timeout
|
|
827
860
|
});
|
|
@@ -833,15 +866,14 @@ var AssistsXAsync = class {
|
|
|
833
866
|
}
|
|
834
867
|
return Node.fromJSONArray(data);
|
|
835
868
|
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
* @param timeout 超时时间(秒),默认30秒
|
|
840
|
-
* @returns 节点数组
|
|
841
|
-
*/
|
|
842
|
-
static async findByTextAllMatch(text, timeout) {
|
|
869
|
+
static async findByTextAllMatch(text, timeoutOrOptions) {
|
|
870
|
+
const normalized = typeof timeoutOrOptions === "number" ? { timeout: timeoutOrOptions } : timeoutOrOptions != null ? timeoutOrOptions : {};
|
|
871
|
+
const { timeout, scope } = normalized;
|
|
843
872
|
const response = await this.asyncCall(CallMethod.findByTextAllMatch, {
|
|
844
|
-
args: {
|
|
873
|
+
args: {
|
|
874
|
+
text,
|
|
875
|
+
...scope !== void 0 ? { scope } : {}
|
|
876
|
+
},
|
|
845
877
|
timeout
|
|
846
878
|
});
|
|
847
879
|
const data = response.getDataOrDefault([]);
|
|
@@ -1362,18 +1394,21 @@ var AssistsXAsync = class {
|
|
|
1362
1394
|
* @param options.filePath 文件路径(可选,不提供则自动生成)
|
|
1363
1395
|
* @param options.prettyPrint 是否格式化输出,默认为 true
|
|
1364
1396
|
* @param options.timeout 超时时间(秒),默认30秒
|
|
1397
|
+
* @param options.scope 节点查找范围(可选)
|
|
1365
1398
|
* @returns 保存的文件路径
|
|
1366
1399
|
*/
|
|
1367
1400
|
static async saveRootNodeTreeJson(options = {}) {
|
|
1368
1401
|
const {
|
|
1369
1402
|
filePath,
|
|
1370
1403
|
prettyPrint = true,
|
|
1371
|
-
timeout
|
|
1404
|
+
timeout,
|
|
1405
|
+
scope
|
|
1372
1406
|
} = options;
|
|
1373
1407
|
const response = await this.asyncCall(CallMethod.saveRootNodeTreeJson, {
|
|
1374
1408
|
args: {
|
|
1375
1409
|
filePath,
|
|
1376
|
-
prettyPrint
|
|
1410
|
+
prettyPrint,
|
|
1411
|
+
...scope !== void 0 ? { scope } : {}
|
|
1377
1412
|
},
|
|
1378
1413
|
timeout
|
|
1379
1414
|
});
|
|
@@ -1452,6 +1487,17 @@ var useStepStore = (0, import_pinia.defineStore)("step", {
|
|
|
1452
1487
|
}
|
|
1453
1488
|
});
|
|
1454
1489
|
|
|
1490
|
+
// src/pinia-ensure.ts
|
|
1491
|
+
var import_pinia2 = require("pinia");
|
|
1492
|
+
var fallbackPinia = null;
|
|
1493
|
+
function ensureAssistsXPinia() {
|
|
1494
|
+
if ((0, import_pinia2.getActivePinia)() !== void 0) return;
|
|
1495
|
+
if (fallbackPinia === null) {
|
|
1496
|
+
fallbackPinia = (0, import_pinia2.createPinia)();
|
|
1497
|
+
}
|
|
1498
|
+
(0, import_pinia2.setActivePinia)(fallbackPinia);
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1455
1501
|
// src/step-error.ts
|
|
1456
1502
|
var StepError = class extends Error {
|
|
1457
1503
|
constructor(message, data, impl, tag, originalError, currentStep) {
|
|
@@ -1522,14 +1568,16 @@ var StepAsync = class {
|
|
|
1522
1568
|
filterClass,
|
|
1523
1569
|
filterViewId,
|
|
1524
1570
|
filterDes,
|
|
1525
|
-
filterText
|
|
1571
|
+
filterText,
|
|
1572
|
+
scope
|
|
1526
1573
|
} = {}) {
|
|
1527
1574
|
Step.assert(this.step.stepId);
|
|
1528
1575
|
const nodes = await AssistsXAsync.getAllNodes({
|
|
1529
1576
|
filterClass,
|
|
1530
1577
|
filterViewId,
|
|
1531
1578
|
filterDes,
|
|
1532
|
-
filterText
|
|
1579
|
+
filterText,
|
|
1580
|
+
scope
|
|
1533
1581
|
});
|
|
1534
1582
|
Step.assert(this.step.stepId);
|
|
1535
1583
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
@@ -1546,13 +1594,9 @@ var StepAsync = class {
|
|
|
1546
1594
|
Step.assert(this.step.stepId);
|
|
1547
1595
|
return result;
|
|
1548
1596
|
}
|
|
1549
|
-
|
|
1550
|
-
* 获取当前应用包名
|
|
1551
|
-
* @returns 包名
|
|
1552
|
-
*/
|
|
1553
|
-
async getPackageName() {
|
|
1597
|
+
async getPackageName(timeoutOrOptions) {
|
|
1554
1598
|
Step.assert(this.step.stepId);
|
|
1555
|
-
const result = await AssistsXAsync.getPackageName();
|
|
1599
|
+
const result = typeof timeoutOrOptions === "number" ? await AssistsXAsync.getPackageName(timeoutOrOptions) : await AssistsXAsync.getPackageName(timeoutOrOptions != null ? timeoutOrOptions : {});
|
|
1556
1600
|
Step.assert(this.step.stepId);
|
|
1557
1601
|
return result;
|
|
1558
1602
|
}
|
|
@@ -1567,13 +1611,15 @@ var StepAsync = class {
|
|
|
1567
1611
|
async findById(id, {
|
|
1568
1612
|
filterClass,
|
|
1569
1613
|
filterText,
|
|
1570
|
-
filterDes
|
|
1614
|
+
filterDes,
|
|
1615
|
+
scope
|
|
1571
1616
|
} = {}) {
|
|
1572
1617
|
Step.assert(this.step.stepId);
|
|
1573
1618
|
const nodes = await AssistsXAsync.findById(id, {
|
|
1574
1619
|
filterClass,
|
|
1575
1620
|
filterText,
|
|
1576
|
-
filterDes
|
|
1621
|
+
filterDes,
|
|
1622
|
+
scope
|
|
1577
1623
|
});
|
|
1578
1624
|
Step.assert(this.step.stepId);
|
|
1579
1625
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
@@ -1590,13 +1636,15 @@ var StepAsync = class {
|
|
|
1590
1636
|
async findByText(text, {
|
|
1591
1637
|
filterClass,
|
|
1592
1638
|
filterViewId,
|
|
1593
|
-
filterDes
|
|
1639
|
+
filterDes,
|
|
1640
|
+
scope
|
|
1594
1641
|
} = {}) {
|
|
1595
1642
|
Step.assert(this.step.stepId);
|
|
1596
1643
|
const nodes = await AssistsXAsync.findByText(text, {
|
|
1597
1644
|
filterClass,
|
|
1598
1645
|
filterViewId,
|
|
1599
|
-
filterDes
|
|
1646
|
+
filterDes,
|
|
1647
|
+
scope
|
|
1600
1648
|
});
|
|
1601
1649
|
Step.assert(this.step.stepId);
|
|
1602
1650
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
@@ -1613,26 +1661,23 @@ var StepAsync = class {
|
|
|
1613
1661
|
async findByTags(className, {
|
|
1614
1662
|
filterText,
|
|
1615
1663
|
filterViewId,
|
|
1616
|
-
filterDes
|
|
1664
|
+
filterDes,
|
|
1665
|
+
scope
|
|
1617
1666
|
} = {}) {
|
|
1618
1667
|
Step.assert(this.step.stepId);
|
|
1619
1668
|
const nodes = await AssistsXAsync.findByTags(className, {
|
|
1620
1669
|
filterText,
|
|
1621
1670
|
filterViewId,
|
|
1622
|
-
filterDes
|
|
1671
|
+
filterDes,
|
|
1672
|
+
scope
|
|
1623
1673
|
});
|
|
1624
1674
|
Step.assert(this.step.stepId);
|
|
1625
1675
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
1626
1676
|
return nodes;
|
|
1627
1677
|
}
|
|
1628
|
-
|
|
1629
|
-
* 查找所有匹配文本的节点
|
|
1630
|
-
* @param text 要查找的文本
|
|
1631
|
-
* @returns 节点数组
|
|
1632
|
-
*/
|
|
1633
|
-
async findByTextAllMatch(text) {
|
|
1678
|
+
async findByTextAllMatch(text, timeoutOrOptions) {
|
|
1634
1679
|
Step.assert(this.step.stepId);
|
|
1635
|
-
const nodes = await AssistsXAsync.findByTextAllMatch(text);
|
|
1680
|
+
const nodes = typeof timeoutOrOptions === "number" ? await AssistsXAsync.findByTextAllMatch(text, timeoutOrOptions) : timeoutOrOptions !== void 0 ? await AssistsXAsync.findByTextAllMatch(text, timeoutOrOptions) : await AssistsXAsync.findByTextAllMatch(text);
|
|
1636
1681
|
Step.assert(this.step.stepId);
|
|
1637
1682
|
Step.assignIdsToNodes(nodes, this.step.stepId);
|
|
1638
1683
|
return nodes;
|
|
@@ -1814,13 +1859,31 @@ var _Step = class _Step {
|
|
|
1814
1859
|
this.delayMs = _Step.delayMsDefault;
|
|
1815
1860
|
this.tag = tag;
|
|
1816
1861
|
this.stepId = stepId;
|
|
1817
|
-
this.data = data
|
|
1862
|
+
this.data = _Step.resolveStepData(data);
|
|
1818
1863
|
this.impl = impl;
|
|
1819
1864
|
this.delayMs = delayMs;
|
|
1820
1865
|
this.repeatCountMax = repeatCountMax;
|
|
1821
1866
|
this.exceptionRetryCountMax = exceptionRetryCountMax;
|
|
1822
1867
|
this.isEnd = isEnd;
|
|
1823
1868
|
}
|
|
1869
|
+
/**
|
|
1870
|
+
* 判断步骤数据是否有效(非空且为普通对象)
|
|
1871
|
+
*/
|
|
1872
|
+
static isValidStepData(data) {
|
|
1873
|
+
return data !== null && data !== void 0 && typeof data === "object" && !Array.isArray(data);
|
|
1874
|
+
}
|
|
1875
|
+
/**
|
|
1876
|
+
* 解析步骤数据:优先使用传入值,否则使用当前值,均无效时返回空对象
|
|
1877
|
+
*/
|
|
1878
|
+
static resolveStepData(provided, fallback) {
|
|
1879
|
+
if (provided !== void 0 && _Step.isValidStepData(provided)) {
|
|
1880
|
+
return provided;
|
|
1881
|
+
}
|
|
1882
|
+
if (fallback !== void 0 && _Step.isValidStepData(fallback)) {
|
|
1883
|
+
return fallback;
|
|
1884
|
+
}
|
|
1885
|
+
return {};
|
|
1886
|
+
}
|
|
1824
1887
|
/**
|
|
1825
1888
|
* 运行步骤实现
|
|
1826
1889
|
* @param impl 步骤实现函数
|
|
@@ -1835,9 +1898,11 @@ var _Step = class _Step {
|
|
|
1835
1898
|
delayMs = _Step.delayMsDefault,
|
|
1836
1899
|
exceptionRetryCountMax = _Step.exceptionRetryCountMaxDefault
|
|
1837
1900
|
} = {}) {
|
|
1838
|
-
var
|
|
1901
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
1839
1902
|
this.exception = void 0;
|
|
1903
|
+
ensureAssistsXPinia();
|
|
1840
1904
|
const stepStore = useStepStore();
|
|
1905
|
+
const resolvedData = _Step.resolveStepData(data);
|
|
1841
1906
|
let implnName = impl.name;
|
|
1842
1907
|
let currentStep;
|
|
1843
1908
|
let nextStep;
|
|
@@ -1853,12 +1918,12 @@ var _Step = class _Step {
|
|
|
1853
1918
|
console.log(`\u751F\u6210\u6B65\u9AA4ID: ${this._stepId}`);
|
|
1854
1919
|
}
|
|
1855
1920
|
}
|
|
1856
|
-
stepStore.startStep(this._stepId, tag,
|
|
1921
|
+
stepStore.startStep(this._stepId, tag, resolvedData);
|
|
1857
1922
|
currentStep = new _Step({
|
|
1858
1923
|
stepId: this._stepId,
|
|
1859
1924
|
impl,
|
|
1860
1925
|
tag,
|
|
1861
|
-
data,
|
|
1926
|
+
data: resolvedData,
|
|
1862
1927
|
delayMs,
|
|
1863
1928
|
exceptionRetryCountMax
|
|
1864
1929
|
});
|
|
@@ -1873,7 +1938,7 @@ var _Step = class _Step {
|
|
|
1873
1938
|
await currentStep.delay(currentStep.delayMs);
|
|
1874
1939
|
_Step.assert(currentStep.stepId);
|
|
1875
1940
|
}
|
|
1876
|
-
implnName = (_b = (
|
|
1941
|
+
implnName = (_b = (_a2 = currentStep.impl) == null ? void 0 : _a2.name) != null ? _b : "undefined";
|
|
1877
1942
|
if (_Step.showLog) {
|
|
1878
1943
|
console.log(
|
|
1879
1944
|
`\u6267\u884C\u6B65\u9AA4${implnName}\uFF0C\u91CD\u590D\u6B21\u6570${currentStep.repeatCount}`
|
|
@@ -1967,7 +2032,7 @@ var _Step = class _Step {
|
|
|
1967
2032
|
const errorMsg = JSON.stringify({
|
|
1968
2033
|
impl: implnName,
|
|
1969
2034
|
tag,
|
|
1970
|
-
data,
|
|
2035
|
+
data: resolvedData,
|
|
1971
2036
|
error: (_f = e == null ? void 0 : e.message) != null ? _f : String(e)
|
|
1972
2037
|
});
|
|
1973
2038
|
stepStore.setError(errorMsg);
|
|
@@ -2110,13 +2175,12 @@ var _Step = class _Step {
|
|
|
2110
2175
|
repeatCountMax = _Step.repeatCountMaxDefault,
|
|
2111
2176
|
exceptionRetryCountMax = _Step.exceptionRetryCountMaxDefault
|
|
2112
2177
|
} = {}) {
|
|
2113
|
-
var _a;
|
|
2114
2178
|
_Step.assert(this.stepId);
|
|
2115
2179
|
return new _Step({
|
|
2116
2180
|
stepId: this.stepId,
|
|
2117
2181
|
impl,
|
|
2118
2182
|
tag,
|
|
2119
|
-
data: (
|
|
2183
|
+
data: _Step.resolveStepData(data, this.data),
|
|
2120
2184
|
delayMs,
|
|
2121
2185
|
repeatCountMax,
|
|
2122
2186
|
exceptionRetryCountMax
|
|
@@ -2129,13 +2193,12 @@ var _Step = class _Step {
|
|
|
2129
2193
|
repeatCountMax = _Step.repeatCountMaxDefault,
|
|
2130
2194
|
exceptionRetryCountMax = _Step.exceptionRetryCountMaxDefault
|
|
2131
2195
|
} = {}) {
|
|
2132
|
-
var _a;
|
|
2133
2196
|
_Step.assert(this.stepId);
|
|
2134
2197
|
return new _Step({
|
|
2135
2198
|
stepId: this.stepId,
|
|
2136
2199
|
impl: void 0,
|
|
2137
2200
|
tag,
|
|
2138
|
-
data: (
|
|
2201
|
+
data: _Step.resolveStepData(data, this.data),
|
|
2139
2202
|
delayMs,
|
|
2140
2203
|
repeatCountMax,
|
|
2141
2204
|
exceptionRetryCountMax,
|
|
@@ -2153,7 +2216,7 @@ var _Step = class _Step {
|
|
|
2153
2216
|
repeat({
|
|
2154
2217
|
stepId = this.stepId,
|
|
2155
2218
|
tag = this.tag,
|
|
2156
|
-
data
|
|
2219
|
+
data,
|
|
2157
2220
|
delayMs = this.delayMs,
|
|
2158
2221
|
repeatCountMax = this.repeatCountMax,
|
|
2159
2222
|
exceptionRetryCountMax = this.exceptionRetryCountMax
|
|
@@ -2162,7 +2225,7 @@ var _Step = class _Step {
|
|
|
2162
2225
|
this.repeatCount++;
|
|
2163
2226
|
this.stepId = stepId;
|
|
2164
2227
|
this.tag = tag;
|
|
2165
|
-
this.data = data;
|
|
2228
|
+
this.data = _Step.resolveStepData(data, this.data);
|
|
2166
2229
|
this.delayMs = delayMs;
|
|
2167
2230
|
this.repeatCountMax = repeatCountMax;
|
|
2168
2231
|
this.exceptionRetryCountMax = exceptionRetryCountMax;
|
|
@@ -2237,14 +2300,16 @@ var _Step = class _Step {
|
|
|
2237
2300
|
filterClass,
|
|
2238
2301
|
filterViewId,
|
|
2239
2302
|
filterDes,
|
|
2240
|
-
filterText
|
|
2303
|
+
filterText,
|
|
2304
|
+
scope
|
|
2241
2305
|
} = {}) {
|
|
2242
2306
|
_Step.assert(this.stepId);
|
|
2243
2307
|
const nodes = AssistsX2.getAllNodes({
|
|
2244
2308
|
filterClass,
|
|
2245
2309
|
filterViewId,
|
|
2246
2310
|
filterDes,
|
|
2247
|
-
filterText
|
|
2311
|
+
filterText,
|
|
2312
|
+
scope
|
|
2248
2313
|
});
|
|
2249
2314
|
_Step.assert(this.stepId);
|
|
2250
2315
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
@@ -2263,11 +2328,11 @@ var _Step = class _Step {
|
|
|
2263
2328
|
}
|
|
2264
2329
|
/**
|
|
2265
2330
|
* 获取当前应用包名
|
|
2266
|
-
* @
|
|
2331
|
+
* @param options.scope 节点查找范围(可选)
|
|
2267
2332
|
*/
|
|
2268
|
-
getPackageName() {
|
|
2333
|
+
getPackageName(options = {}) {
|
|
2269
2334
|
_Step.assert(this.stepId);
|
|
2270
|
-
const result = AssistsX2.getPackageName();
|
|
2335
|
+
const result = AssistsX2.getPackageName(options);
|
|
2271
2336
|
_Step.assert(this.stepId);
|
|
2272
2337
|
return result;
|
|
2273
2338
|
}
|
|
@@ -2282,10 +2347,16 @@ var _Step = class _Step {
|
|
|
2282
2347
|
findById(id, {
|
|
2283
2348
|
filterClass,
|
|
2284
2349
|
filterText,
|
|
2285
|
-
filterDes
|
|
2350
|
+
filterDes,
|
|
2351
|
+
scope
|
|
2286
2352
|
} = {}) {
|
|
2287
2353
|
_Step.assert(this.stepId);
|
|
2288
|
-
const nodes = AssistsX2.findById(id, {
|
|
2354
|
+
const nodes = AssistsX2.findById(id, {
|
|
2355
|
+
filterClass,
|
|
2356
|
+
filterText,
|
|
2357
|
+
filterDes,
|
|
2358
|
+
scope
|
|
2359
|
+
});
|
|
2289
2360
|
_Step.assert(this.stepId);
|
|
2290
2361
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
2291
2362
|
return nodes;
|
|
@@ -2301,13 +2372,15 @@ var _Step = class _Step {
|
|
|
2301
2372
|
findByText(text, {
|
|
2302
2373
|
filterClass,
|
|
2303
2374
|
filterViewId,
|
|
2304
|
-
filterDes
|
|
2375
|
+
filterDes,
|
|
2376
|
+
scope
|
|
2305
2377
|
} = {}) {
|
|
2306
2378
|
_Step.assert(this.stepId);
|
|
2307
2379
|
const nodes = AssistsX2.findByText(text, {
|
|
2308
2380
|
filterClass,
|
|
2309
2381
|
filterViewId,
|
|
2310
|
-
filterDes
|
|
2382
|
+
filterDes,
|
|
2383
|
+
scope
|
|
2311
2384
|
});
|
|
2312
2385
|
_Step.assert(this.stepId);
|
|
2313
2386
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
@@ -2324,13 +2397,15 @@ var _Step = class _Step {
|
|
|
2324
2397
|
findByTags(className, {
|
|
2325
2398
|
filterText,
|
|
2326
2399
|
filterViewId,
|
|
2327
|
-
filterDes
|
|
2400
|
+
filterDes,
|
|
2401
|
+
scope
|
|
2328
2402
|
} = {}) {
|
|
2329
2403
|
_Step.assert(this.stepId);
|
|
2330
2404
|
const nodes = AssistsX2.findByTags(className, {
|
|
2331
2405
|
filterText,
|
|
2332
2406
|
filterViewId,
|
|
2333
|
-
filterDes
|
|
2407
|
+
filterDes,
|
|
2408
|
+
scope
|
|
2334
2409
|
});
|
|
2335
2410
|
_Step.assert(this.stepId);
|
|
2336
2411
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
@@ -2339,11 +2414,11 @@ var _Step = class _Step {
|
|
|
2339
2414
|
/**
|
|
2340
2415
|
* 查找所有匹配文本的节点
|
|
2341
2416
|
* @param text 要查找的文本
|
|
2342
|
-
* @
|
|
2417
|
+
* @param options.scope 节点查找范围(可选)
|
|
2343
2418
|
*/
|
|
2344
|
-
findByTextAllMatch(text) {
|
|
2419
|
+
findByTextAllMatch(text, { scope } = {}) {
|
|
2345
2420
|
_Step.assert(this.stepId);
|
|
2346
|
-
const nodes = AssistsX2.findByTextAllMatch(text);
|
|
2421
|
+
const nodes = AssistsX2.findByTextAllMatch(text, { scope });
|
|
2347
2422
|
_Step.assert(this.stepId);
|
|
2348
2423
|
_Step.assignIdsToNodes(nodes, this.stepId);
|
|
2349
2424
|
return nodes;
|
|
@@ -2859,7 +2934,7 @@ var Node = class _Node {
|
|
|
2859
2934
|
* @param params 节点参数对象
|
|
2860
2935
|
*/
|
|
2861
2936
|
constructor(params) {
|
|
2862
|
-
var
|
|
2937
|
+
var _a2;
|
|
2863
2938
|
this.nodeId = params.nodeId;
|
|
2864
2939
|
this.text = params.text;
|
|
2865
2940
|
this.des = params.des;
|
|
@@ -2879,7 +2954,7 @@ var Node = class _Node {
|
|
|
2879
2954
|
this.isSelected = params.isSelected;
|
|
2880
2955
|
this.isVisibleToUser = params.isVisibleToUser;
|
|
2881
2956
|
this.drawingOrder = params.drawingOrder;
|
|
2882
|
-
const rawBounds = (
|
|
2957
|
+
const rawBounds = (_a2 = params.bounds) != null ? _a2 : params.boundsInScreen;
|
|
2883
2958
|
this.bounds = rawBounds instanceof Bounds ? rawBounds : Bounds.fromData(rawBounds);
|
|
2884
2959
|
}
|
|
2885
2960
|
get async() {
|
|
@@ -3242,7 +3317,7 @@ var Node = class _Node {
|
|
|
3242
3317
|
// src/assistsx.ts
|
|
3243
3318
|
var callbacks = /* @__PURE__ */ new Map();
|
|
3244
3319
|
var accessibilityEventListeners = [];
|
|
3245
|
-
var screen
|
|
3320
|
+
var screen;
|
|
3246
3321
|
if (typeof window !== "undefined" && !window.assistsxCallback) {
|
|
3247
3322
|
window.assistsxCallback = (data) => {
|
|
3248
3323
|
let callbackId;
|
|
@@ -3393,10 +3468,17 @@ var AssistsX2 = class {
|
|
|
3393
3468
|
filterClass,
|
|
3394
3469
|
filterViewId,
|
|
3395
3470
|
filterDes,
|
|
3396
|
-
filterText
|
|
3471
|
+
filterText,
|
|
3472
|
+
scope
|
|
3397
3473
|
} = {}) {
|
|
3398
3474
|
const response = this.call(CallMethod.getAllNodes, {
|
|
3399
|
-
args: {
|
|
3475
|
+
args: {
|
|
3476
|
+
filterClass,
|
|
3477
|
+
filterViewId,
|
|
3478
|
+
filterDes,
|
|
3479
|
+
filterText,
|
|
3480
|
+
...scope !== void 0 ? { scope } : {}
|
|
3481
|
+
}
|
|
3400
3482
|
});
|
|
3401
3483
|
const data = response.getDataOrDefault([]);
|
|
3402
3484
|
if (!Array.isArray(data)) {
|
|
@@ -3560,8 +3642,12 @@ var AssistsX2 = class {
|
|
|
3560
3642
|
* 获取当前应用包名
|
|
3561
3643
|
* @returns 包名
|
|
3562
3644
|
*/
|
|
3563
|
-
static getPackageName() {
|
|
3564
|
-
const
|
|
3645
|
+
static getPackageName(options = {}) {
|
|
3646
|
+
const { scope } = options;
|
|
3647
|
+
const response = this.call(
|
|
3648
|
+
CallMethod.getPackageName,
|
|
3649
|
+
scope !== void 0 ? { args: { scope } } : {}
|
|
3650
|
+
);
|
|
3565
3651
|
return response.getDataOrDefault("");
|
|
3566
3652
|
}
|
|
3567
3653
|
/**
|
|
@@ -3589,10 +3675,17 @@ var AssistsX2 = class {
|
|
|
3589
3675
|
filterClass,
|
|
3590
3676
|
filterText,
|
|
3591
3677
|
filterDes,
|
|
3592
|
-
node
|
|
3678
|
+
node,
|
|
3679
|
+
scope
|
|
3593
3680
|
} = {}) {
|
|
3594
3681
|
const response = this.call(CallMethod.findById, {
|
|
3595
|
-
args: {
|
|
3682
|
+
args: {
|
|
3683
|
+
id,
|
|
3684
|
+
filterClass,
|
|
3685
|
+
filterText,
|
|
3686
|
+
filterDes,
|
|
3687
|
+
...scope !== void 0 ? { scope } : {}
|
|
3688
|
+
},
|
|
3596
3689
|
node
|
|
3597
3690
|
});
|
|
3598
3691
|
const data = response.getDataOrDefault([]);
|
|
@@ -3616,10 +3709,17 @@ var AssistsX2 = class {
|
|
|
3616
3709
|
filterClass,
|
|
3617
3710
|
filterViewId,
|
|
3618
3711
|
filterDes,
|
|
3619
|
-
node
|
|
3712
|
+
node,
|
|
3713
|
+
scope
|
|
3620
3714
|
} = {}) {
|
|
3621
3715
|
const response = this.call(CallMethod.findByText, {
|
|
3622
|
-
args: {
|
|
3716
|
+
args: {
|
|
3717
|
+
text,
|
|
3718
|
+
filterClass,
|
|
3719
|
+
filterViewId,
|
|
3720
|
+
filterDes,
|
|
3721
|
+
...scope !== void 0 ? { scope } : {}
|
|
3722
|
+
},
|
|
3623
3723
|
node
|
|
3624
3724
|
});
|
|
3625
3725
|
const data = response.getDataOrDefault([]);
|
|
@@ -3643,10 +3743,17 @@ var AssistsX2 = class {
|
|
|
3643
3743
|
filterText,
|
|
3644
3744
|
filterViewId,
|
|
3645
3745
|
filterDes,
|
|
3646
|
-
node
|
|
3746
|
+
node,
|
|
3747
|
+
scope
|
|
3647
3748
|
} = {}) {
|
|
3648
3749
|
const response = this.call(CallMethod.findByTags, {
|
|
3649
|
-
args: {
|
|
3750
|
+
args: {
|
|
3751
|
+
className,
|
|
3752
|
+
filterText,
|
|
3753
|
+
filterViewId,
|
|
3754
|
+
filterDes,
|
|
3755
|
+
...scope !== void 0 ? { scope } : {}
|
|
3756
|
+
},
|
|
3650
3757
|
node
|
|
3651
3758
|
});
|
|
3652
3759
|
const data = response.getDataOrDefault([]);
|
|
@@ -3660,11 +3767,14 @@ var AssistsX2 = class {
|
|
|
3660
3767
|
/**
|
|
3661
3768
|
* 查找所有匹配文本的节点
|
|
3662
3769
|
* @param text 要查找的文本
|
|
3663
|
-
* @
|
|
3770
|
+
* @param options.scope 节点查找范围(可选)
|
|
3664
3771
|
*/
|
|
3665
|
-
static findByTextAllMatch(text) {
|
|
3772
|
+
static findByTextAllMatch(text, { scope } = {}) {
|
|
3666
3773
|
const response = this.call(CallMethod.findByTextAllMatch, {
|
|
3667
|
-
args: {
|
|
3774
|
+
args: {
|
|
3775
|
+
text,
|
|
3776
|
+
...scope !== void 0 ? { scope } : {}
|
|
3777
|
+
}
|
|
3668
3778
|
});
|
|
3669
3779
|
const data = response.getDataOrDefault([]);
|
|
3670
3780
|
if (!Array.isArray(data)) {
|
|
@@ -4117,10 +4227,11 @@ function normalizeScreen(data) {
|
|
|
4117
4227
|
if (typeof w !== "number" || typeof h !== "number") return null;
|
|
4118
4228
|
return { width: Math.floor(w), height: Math.floor(h) };
|
|
4119
4229
|
}
|
|
4230
|
+
var _a;
|
|
4120
4231
|
if (typeof window !== "undefined") {
|
|
4121
4232
|
try {
|
|
4122
4233
|
if (window.assistsx && typeof window.assistsx.call === "function") {
|
|
4123
|
-
screen = AssistsX2.getScreenSize();
|
|
4234
|
+
screen = (_a = AssistsX2.getScreenSize()) != null ? _a : { width: 0, height: 0 };
|
|
4124
4235
|
}
|
|
4125
4236
|
} catch (e) {
|
|
4126
4237
|
console.log("Failed to initialize screen size:", e);
|
|
@@ -4255,8 +4366,8 @@ WindowFlags.FLAG_HARDWARE_ACCELERATED = 16777216;
|
|
|
4255
4366
|
// src/accessibility-event-filter.ts
|
|
4256
4367
|
var AccessibilityEventFilter = class _AccessibilityEventFilter {
|
|
4257
4368
|
constructor(config = {}) {
|
|
4258
|
-
var
|
|
4259
|
-
this.packageName = (
|
|
4369
|
+
var _a2, _b, _c, _d, _e;
|
|
4370
|
+
this.packageName = (_a2 = config.packageName) != null ? _a2 : null;
|
|
4260
4371
|
this.processInBackground = (_b = config.processInBackground) != null ? _b : true;
|
|
4261
4372
|
this.fetchNodeInfo = (_c = config.fetchNodeInfo) != null ? _c : true;
|
|
4262
4373
|
this.enableLogging = (_d = config.enableLogging) != null ? _d : false;
|
|
@@ -4277,8 +4388,8 @@ var AccessibilityEventFilter = class _AccessibilityEventFilter {
|
|
|
4277
4388
|
* @returns true表示应该处理,false表示应该过滤
|
|
4278
4389
|
*/
|
|
4279
4390
|
shouldProcessEventType(eventType) {
|
|
4280
|
-
var
|
|
4281
|
-
return this.eventTypes === null || ((_b = (
|
|
4391
|
+
var _a2, _b;
|
|
4392
|
+
return this.eventTypes === null || ((_b = (_a2 = this.eventTypes) == null ? void 0 : _a2.includes(eventType)) != null ? _b : false);
|
|
4282
4393
|
}
|
|
4283
4394
|
/**
|
|
4284
4395
|
* 创建默认的过滤配置
|
|
@@ -4406,14 +4517,14 @@ var Http = class {
|
|
|
4406
4517
|
* @returns Promise<HTTP响应>
|
|
4407
4518
|
*/
|
|
4408
4519
|
async httpGet(url, headers, timeout) {
|
|
4409
|
-
var
|
|
4520
|
+
var _a2;
|
|
4410
4521
|
const response = await this.asyncCall(
|
|
4411
4522
|
"httpGet",
|
|
4412
4523
|
{ url, headers },
|
|
4413
4524
|
timeout
|
|
4414
4525
|
);
|
|
4415
4526
|
if (!response.isSuccess()) {
|
|
4416
|
-
throw new Error(((
|
|
4527
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP GET request failed");
|
|
4417
4528
|
}
|
|
4418
4529
|
return response.data;
|
|
4419
4530
|
}
|
|
@@ -4426,14 +4537,14 @@ var Http = class {
|
|
|
4426
4537
|
* @returns Promise<HTTP响应>
|
|
4427
4538
|
*/
|
|
4428
4539
|
async httpPost(url, body, headers, timeout) {
|
|
4429
|
-
var
|
|
4540
|
+
var _a2;
|
|
4430
4541
|
const response = await this.asyncCall(
|
|
4431
4542
|
"httpPost",
|
|
4432
4543
|
{ url, body, headers },
|
|
4433
4544
|
timeout
|
|
4434
4545
|
);
|
|
4435
4546
|
if (!response.isSuccess()) {
|
|
4436
|
-
throw new Error(((
|
|
4547
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP POST request failed");
|
|
4437
4548
|
}
|
|
4438
4549
|
return response.data;
|
|
4439
4550
|
}
|
|
@@ -4466,7 +4577,7 @@ var Http = class {
|
|
|
4466
4577
|
* ], { description: "My files" });
|
|
4467
4578
|
*/
|
|
4468
4579
|
async httpPostFile(url, files, formData, headers, timeout) {
|
|
4469
|
-
var
|
|
4580
|
+
var _a2;
|
|
4470
4581
|
if (!files || files.length === 0) {
|
|
4471
4582
|
throw new Error("files\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF0C\u81F3\u5C11\u9700\u8981\u4E0A\u4F20\u4E00\u4E2A\u6587\u4EF6");
|
|
4472
4583
|
}
|
|
@@ -4481,7 +4592,7 @@ var Http = class {
|
|
|
4481
4592
|
timeout
|
|
4482
4593
|
);
|
|
4483
4594
|
if (!response.isSuccess()) {
|
|
4484
|
-
throw new Error(((
|
|
4595
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP POST file request failed");
|
|
4485
4596
|
}
|
|
4486
4597
|
return response.data;
|
|
4487
4598
|
}
|
|
@@ -4496,14 +4607,14 @@ var Http = class {
|
|
|
4496
4607
|
* @returns Promise<下载响应>
|
|
4497
4608
|
*/
|
|
4498
4609
|
async httpDownload(url, savePath, headers, saveToGallery, displayName, timeout) {
|
|
4499
|
-
var
|
|
4610
|
+
var _a2;
|
|
4500
4611
|
const response = await this.asyncCall(
|
|
4501
4612
|
"httpDownload",
|
|
4502
4613
|
{ url, savePath, headers, saveToGallery, displayName },
|
|
4503
4614
|
timeout
|
|
4504
4615
|
);
|
|
4505
4616
|
if (!response.isSuccess()) {
|
|
4506
|
-
throw new Error(((
|
|
4617
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP download failed");
|
|
4507
4618
|
}
|
|
4508
4619
|
return response.data;
|
|
4509
4620
|
}
|
|
@@ -4514,14 +4625,14 @@ var Http = class {
|
|
|
4514
4625
|
* @returns Promise<配置信息>
|
|
4515
4626
|
*/
|
|
4516
4627
|
async httpConfigure(config, timeout) {
|
|
4517
|
-
var
|
|
4628
|
+
var _a2;
|
|
4518
4629
|
const response = await this.asyncCall(
|
|
4519
4630
|
"httpConfigure",
|
|
4520
4631
|
config,
|
|
4521
4632
|
timeout
|
|
4522
4633
|
);
|
|
4523
4634
|
if (!response.isSuccess()) {
|
|
4524
|
-
throw new Error(((
|
|
4635
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP configure failed");
|
|
4525
4636
|
}
|
|
4526
4637
|
return response.data;
|
|
4527
4638
|
}
|
|
@@ -4531,10 +4642,10 @@ var Http = class {
|
|
|
4531
4642
|
* @returns Promise<配置信息>
|
|
4532
4643
|
*/
|
|
4533
4644
|
async httpReset(timeout) {
|
|
4534
|
-
var
|
|
4645
|
+
var _a2;
|
|
4535
4646
|
const response = await this.asyncCall("httpReset", void 0, timeout);
|
|
4536
4647
|
if (!response.isSuccess()) {
|
|
4537
|
-
throw new Error(((
|
|
4648
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "HTTP reset failed");
|
|
4538
4649
|
}
|
|
4539
4650
|
return response.data;
|
|
4540
4651
|
}
|
|
@@ -4544,10 +4655,10 @@ var Http = class {
|
|
|
4544
4655
|
* @returns Promise<配置信息>
|
|
4545
4656
|
*/
|
|
4546
4657
|
async httpGetConfig(timeout) {
|
|
4547
|
-
var
|
|
4658
|
+
var _a2;
|
|
4548
4659
|
const response = await this.asyncCall("httpGetConfig", void 0, timeout);
|
|
4549
4660
|
if (!response.isSuccess()) {
|
|
4550
|
-
throw new Error(((
|
|
4661
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get HTTP config failed");
|
|
4551
4662
|
}
|
|
4552
4663
|
return response.data;
|
|
4553
4664
|
}
|
|
@@ -4620,10 +4731,10 @@ var Path = class {
|
|
|
4620
4731
|
* @returns Promise<路径字符串>
|
|
4621
4732
|
*/
|
|
4622
4733
|
async getRootPath(timeout) {
|
|
4623
|
-
var
|
|
4734
|
+
var _a2;
|
|
4624
4735
|
const response = await this.asyncCall("getRootPath", void 0, timeout);
|
|
4625
4736
|
if (!response.isSuccess()) {
|
|
4626
|
-
throw new Error(((
|
|
4737
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get root path failed");
|
|
4627
4738
|
}
|
|
4628
4739
|
return response.data;
|
|
4629
4740
|
}
|
|
@@ -4633,10 +4744,10 @@ var Path = class {
|
|
|
4633
4744
|
* @returns Promise<路径字符串>
|
|
4634
4745
|
*/
|
|
4635
4746
|
async getDataPath(timeout) {
|
|
4636
|
-
var
|
|
4747
|
+
var _a2;
|
|
4637
4748
|
const response = await this.asyncCall("getDataPath", void 0, timeout);
|
|
4638
4749
|
if (!response.isSuccess()) {
|
|
4639
|
-
throw new Error(((
|
|
4750
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get data path failed");
|
|
4640
4751
|
}
|
|
4641
4752
|
return response.data;
|
|
4642
4753
|
}
|
|
@@ -4646,10 +4757,10 @@ var Path = class {
|
|
|
4646
4757
|
* @returns Promise<路径字符串>
|
|
4647
4758
|
*/
|
|
4648
4759
|
async getDownloadCachePath(timeout) {
|
|
4649
|
-
var
|
|
4760
|
+
var _a2;
|
|
4650
4761
|
const response = await this.asyncCall("getDownloadCachePath", void 0, timeout);
|
|
4651
4762
|
if (!response.isSuccess()) {
|
|
4652
|
-
throw new Error(((
|
|
4763
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get download cache path failed");
|
|
4653
4764
|
}
|
|
4654
4765
|
return response.data;
|
|
4655
4766
|
}
|
|
@@ -4659,10 +4770,10 @@ var Path = class {
|
|
|
4659
4770
|
* @returns Promise<路径字符串>
|
|
4660
4771
|
*/
|
|
4661
4772
|
async getInternalAppDataPath(timeout) {
|
|
4662
|
-
var
|
|
4773
|
+
var _a2;
|
|
4663
4774
|
const response = await this.asyncCall("getInternalAppDataPath", void 0, timeout);
|
|
4664
4775
|
if (!response.isSuccess()) {
|
|
4665
|
-
throw new Error(((
|
|
4776
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app data path failed");
|
|
4666
4777
|
}
|
|
4667
4778
|
return response.data;
|
|
4668
4779
|
}
|
|
@@ -4672,10 +4783,10 @@ var Path = class {
|
|
|
4672
4783
|
* @returns Promise<路径字符串>
|
|
4673
4784
|
*/
|
|
4674
4785
|
async getInternalAppCodeCacheDir(timeout) {
|
|
4675
|
-
var
|
|
4786
|
+
var _a2;
|
|
4676
4787
|
const response = await this.asyncCall("getInternalAppCodeCacheDir", void 0, timeout);
|
|
4677
4788
|
if (!response.isSuccess()) {
|
|
4678
|
-
throw new Error(((
|
|
4789
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app code cache dir failed");
|
|
4679
4790
|
}
|
|
4680
4791
|
return response.data;
|
|
4681
4792
|
}
|
|
@@ -4685,10 +4796,10 @@ var Path = class {
|
|
|
4685
4796
|
* @returns Promise<路径字符串>
|
|
4686
4797
|
*/
|
|
4687
4798
|
async getInternalAppCachePath(timeout) {
|
|
4688
|
-
var
|
|
4799
|
+
var _a2;
|
|
4689
4800
|
const response = await this.asyncCall("getInternalAppCachePath", void 0, timeout);
|
|
4690
4801
|
if (!response.isSuccess()) {
|
|
4691
|
-
throw new Error(((
|
|
4802
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app cache path failed");
|
|
4692
4803
|
}
|
|
4693
4804
|
return response.data;
|
|
4694
4805
|
}
|
|
@@ -4698,10 +4809,10 @@ var Path = class {
|
|
|
4698
4809
|
* @returns Promise<路径字符串>
|
|
4699
4810
|
*/
|
|
4700
4811
|
async getInternalAppDbsPath(timeout) {
|
|
4701
|
-
var
|
|
4812
|
+
var _a2;
|
|
4702
4813
|
const response = await this.asyncCall("getInternalAppDbsPath", void 0, timeout);
|
|
4703
4814
|
if (!response.isSuccess()) {
|
|
4704
|
-
throw new Error(((
|
|
4815
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app dbs path failed");
|
|
4705
4816
|
}
|
|
4706
4817
|
return response.data;
|
|
4707
4818
|
}
|
|
@@ -4712,10 +4823,10 @@ var Path = class {
|
|
|
4712
4823
|
* @returns Promise<路径字符串>
|
|
4713
4824
|
*/
|
|
4714
4825
|
async getInternalAppDbPath(dbName, timeout) {
|
|
4715
|
-
var
|
|
4826
|
+
var _a2;
|
|
4716
4827
|
const response = await this.asyncCall("getInternalAppDbPath", { dbName }, timeout);
|
|
4717
4828
|
if (!response.isSuccess()) {
|
|
4718
|
-
throw new Error(((
|
|
4829
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app db path failed");
|
|
4719
4830
|
}
|
|
4720
4831
|
return response.data;
|
|
4721
4832
|
}
|
|
@@ -4725,10 +4836,10 @@ var Path = class {
|
|
|
4725
4836
|
* @returns Promise<路径字符串>
|
|
4726
4837
|
*/
|
|
4727
4838
|
async getInternalAppFilesPath(timeout) {
|
|
4728
|
-
var
|
|
4839
|
+
var _a2;
|
|
4729
4840
|
const response = await this.asyncCall("getInternalAppFilesPath", void 0, timeout);
|
|
4730
4841
|
if (!response.isSuccess()) {
|
|
4731
|
-
throw new Error(((
|
|
4842
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app files path failed");
|
|
4732
4843
|
}
|
|
4733
4844
|
return response.data;
|
|
4734
4845
|
}
|
|
@@ -4738,10 +4849,10 @@ var Path = class {
|
|
|
4738
4849
|
* @returns Promise<路径字符串>
|
|
4739
4850
|
*/
|
|
4740
4851
|
async getInternalAppSpPath(timeout) {
|
|
4741
|
-
var
|
|
4852
|
+
var _a2;
|
|
4742
4853
|
const response = await this.asyncCall("getInternalAppSpPath", void 0, timeout);
|
|
4743
4854
|
if (!response.isSuccess()) {
|
|
4744
|
-
throw new Error(((
|
|
4855
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app sp path failed");
|
|
4745
4856
|
}
|
|
4746
4857
|
return response.data;
|
|
4747
4858
|
}
|
|
@@ -4751,10 +4862,10 @@ var Path = class {
|
|
|
4751
4862
|
* @returns Promise<路径字符串>
|
|
4752
4863
|
*/
|
|
4753
4864
|
async getInternalAppNoBackupFilesPath(timeout) {
|
|
4754
|
-
var
|
|
4865
|
+
var _a2;
|
|
4755
4866
|
const response = await this.asyncCall("getInternalAppNoBackupFilesPath", void 0, timeout);
|
|
4756
4867
|
if (!response.isSuccess()) {
|
|
4757
|
-
throw new Error(((
|
|
4868
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get internal app no backup files path failed");
|
|
4758
4869
|
}
|
|
4759
4870
|
return response.data;
|
|
4760
4871
|
}
|
|
@@ -4764,10 +4875,10 @@ var Path = class {
|
|
|
4764
4875
|
* @returns Promise<路径字符串>
|
|
4765
4876
|
*/
|
|
4766
4877
|
async getExternalStoragePath(timeout) {
|
|
4767
|
-
var
|
|
4878
|
+
var _a2;
|
|
4768
4879
|
const response = await this.asyncCall("getExternalStoragePath", void 0, timeout);
|
|
4769
4880
|
if (!response.isSuccess()) {
|
|
4770
|
-
throw new Error(((
|
|
4881
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external storage path failed");
|
|
4771
4882
|
}
|
|
4772
4883
|
return response.data;
|
|
4773
4884
|
}
|
|
@@ -4777,10 +4888,10 @@ var Path = class {
|
|
|
4777
4888
|
* @returns Promise<路径字符串>
|
|
4778
4889
|
*/
|
|
4779
4890
|
async getExternalMusicPath(timeout) {
|
|
4780
|
-
var
|
|
4891
|
+
var _a2;
|
|
4781
4892
|
const response = await this.asyncCall("getExternalMusicPath", void 0, timeout);
|
|
4782
4893
|
if (!response.isSuccess()) {
|
|
4783
|
-
throw new Error(((
|
|
4894
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external music path failed");
|
|
4784
4895
|
}
|
|
4785
4896
|
return response.data;
|
|
4786
4897
|
}
|
|
@@ -4790,10 +4901,10 @@ var Path = class {
|
|
|
4790
4901
|
* @returns Promise<路径字符串>
|
|
4791
4902
|
*/
|
|
4792
4903
|
async getExternalPodcastsPath(timeout) {
|
|
4793
|
-
var
|
|
4904
|
+
var _a2;
|
|
4794
4905
|
const response = await this.asyncCall("getExternalPodcastsPath", void 0, timeout);
|
|
4795
4906
|
if (!response.isSuccess()) {
|
|
4796
|
-
throw new Error(((
|
|
4907
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external podcasts path failed");
|
|
4797
4908
|
}
|
|
4798
4909
|
return response.data;
|
|
4799
4910
|
}
|
|
@@ -4803,10 +4914,10 @@ var Path = class {
|
|
|
4803
4914
|
* @returns Promise<路径字符串>
|
|
4804
4915
|
*/
|
|
4805
4916
|
async getExternalRingtonesPath(timeout) {
|
|
4806
|
-
var
|
|
4917
|
+
var _a2;
|
|
4807
4918
|
const response = await this.asyncCall("getExternalRingtonesPath", void 0, timeout);
|
|
4808
4919
|
if (!response.isSuccess()) {
|
|
4809
|
-
throw new Error(((
|
|
4920
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external ringtones path failed");
|
|
4810
4921
|
}
|
|
4811
4922
|
return response.data;
|
|
4812
4923
|
}
|
|
@@ -4816,10 +4927,10 @@ var Path = class {
|
|
|
4816
4927
|
* @returns Promise<路径字符串>
|
|
4817
4928
|
*/
|
|
4818
4929
|
async getExternalAlarmsPath(timeout) {
|
|
4819
|
-
var
|
|
4930
|
+
var _a2;
|
|
4820
4931
|
const response = await this.asyncCall("getExternalAlarmsPath", void 0, timeout);
|
|
4821
4932
|
if (!response.isSuccess()) {
|
|
4822
|
-
throw new Error(((
|
|
4933
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external alarms path failed");
|
|
4823
4934
|
}
|
|
4824
4935
|
return response.data;
|
|
4825
4936
|
}
|
|
@@ -4829,10 +4940,10 @@ var Path = class {
|
|
|
4829
4940
|
* @returns Promise<路径字符串>
|
|
4830
4941
|
*/
|
|
4831
4942
|
async getExternalNotificationsPath(timeout) {
|
|
4832
|
-
var
|
|
4943
|
+
var _a2;
|
|
4833
4944
|
const response = await this.asyncCall("getExternalNotificationsPath", void 0, timeout);
|
|
4834
4945
|
if (!response.isSuccess()) {
|
|
4835
|
-
throw new Error(((
|
|
4946
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external notifications path failed");
|
|
4836
4947
|
}
|
|
4837
4948
|
return response.data;
|
|
4838
4949
|
}
|
|
@@ -4842,10 +4953,10 @@ var Path = class {
|
|
|
4842
4953
|
* @returns Promise<路径字符串>
|
|
4843
4954
|
*/
|
|
4844
4955
|
async getExternalPicturesPath(timeout) {
|
|
4845
|
-
var
|
|
4956
|
+
var _a2;
|
|
4846
4957
|
const response = await this.asyncCall("getExternalPicturesPath", void 0, timeout);
|
|
4847
4958
|
if (!response.isSuccess()) {
|
|
4848
|
-
throw new Error(((
|
|
4959
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external pictures path failed");
|
|
4849
4960
|
}
|
|
4850
4961
|
return response.data;
|
|
4851
4962
|
}
|
|
@@ -4855,10 +4966,10 @@ var Path = class {
|
|
|
4855
4966
|
* @returns Promise<路径字符串>
|
|
4856
4967
|
*/
|
|
4857
4968
|
async getExternalMoviesPath(timeout) {
|
|
4858
|
-
var
|
|
4969
|
+
var _a2;
|
|
4859
4970
|
const response = await this.asyncCall("getExternalMoviesPath", void 0, timeout);
|
|
4860
4971
|
if (!response.isSuccess()) {
|
|
4861
|
-
throw new Error(((
|
|
4972
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external movies path failed");
|
|
4862
4973
|
}
|
|
4863
4974
|
return response.data;
|
|
4864
4975
|
}
|
|
@@ -4868,10 +4979,10 @@ var Path = class {
|
|
|
4868
4979
|
* @returns Promise<路径字符串>
|
|
4869
4980
|
*/
|
|
4870
4981
|
async getExternalDownloadsPath(timeout) {
|
|
4871
|
-
var
|
|
4982
|
+
var _a2;
|
|
4872
4983
|
const response = await this.asyncCall("getExternalDownloadsPath", void 0, timeout);
|
|
4873
4984
|
if (!response.isSuccess()) {
|
|
4874
|
-
throw new Error(((
|
|
4985
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external downloads path failed");
|
|
4875
4986
|
}
|
|
4876
4987
|
return response.data;
|
|
4877
4988
|
}
|
|
@@ -4881,10 +4992,10 @@ var Path = class {
|
|
|
4881
4992
|
* @returns Promise<路径字符串>
|
|
4882
4993
|
*/
|
|
4883
4994
|
async getExternalDcimPath(timeout) {
|
|
4884
|
-
var
|
|
4995
|
+
var _a2;
|
|
4885
4996
|
const response = await this.asyncCall("getExternalDcimPath", void 0, timeout);
|
|
4886
4997
|
if (!response.isSuccess()) {
|
|
4887
|
-
throw new Error(((
|
|
4998
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external dcim path failed");
|
|
4888
4999
|
}
|
|
4889
5000
|
return response.data;
|
|
4890
5001
|
}
|
|
@@ -4894,10 +5005,10 @@ var Path = class {
|
|
|
4894
5005
|
* @returns Promise<路径字符串>
|
|
4895
5006
|
*/
|
|
4896
5007
|
async getExternalDocumentsPath(timeout) {
|
|
4897
|
-
var
|
|
5008
|
+
var _a2;
|
|
4898
5009
|
const response = await this.asyncCall("getExternalDocumentsPath", void 0, timeout);
|
|
4899
5010
|
if (!response.isSuccess()) {
|
|
4900
|
-
throw new Error(((
|
|
5011
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external documents path failed");
|
|
4901
5012
|
}
|
|
4902
5013
|
return response.data;
|
|
4903
5014
|
}
|
|
@@ -4907,10 +5018,10 @@ var Path = class {
|
|
|
4907
5018
|
* @returns Promise<路径字符串>
|
|
4908
5019
|
*/
|
|
4909
5020
|
async getExternalAppDataPath(timeout) {
|
|
4910
|
-
var
|
|
5021
|
+
var _a2;
|
|
4911
5022
|
const response = await this.asyncCall("getExternalAppDataPath", void 0, timeout);
|
|
4912
5023
|
if (!response.isSuccess()) {
|
|
4913
|
-
throw new Error(((
|
|
5024
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app data path failed");
|
|
4914
5025
|
}
|
|
4915
5026
|
return response.data;
|
|
4916
5027
|
}
|
|
@@ -4920,10 +5031,10 @@ var Path = class {
|
|
|
4920
5031
|
* @returns Promise<路径字符串>
|
|
4921
5032
|
*/
|
|
4922
5033
|
async getExternalAppCachePath(timeout) {
|
|
4923
|
-
var
|
|
5034
|
+
var _a2;
|
|
4924
5035
|
const response = await this.asyncCall("getExternalAppCachePath", void 0, timeout);
|
|
4925
5036
|
if (!response.isSuccess()) {
|
|
4926
|
-
throw new Error(((
|
|
5037
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app cache path failed");
|
|
4927
5038
|
}
|
|
4928
5039
|
return response.data;
|
|
4929
5040
|
}
|
|
@@ -4933,10 +5044,10 @@ var Path = class {
|
|
|
4933
5044
|
* @returns Promise<路径字符串>
|
|
4934
5045
|
*/
|
|
4935
5046
|
async getExternalAppFilesPath(timeout) {
|
|
4936
|
-
var
|
|
5047
|
+
var _a2;
|
|
4937
5048
|
const response = await this.asyncCall("getExternalAppFilesPath", void 0, timeout);
|
|
4938
5049
|
if (!response.isSuccess()) {
|
|
4939
|
-
throw new Error(((
|
|
5050
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app files path failed");
|
|
4940
5051
|
}
|
|
4941
5052
|
return response.data;
|
|
4942
5053
|
}
|
|
@@ -4946,10 +5057,10 @@ var Path = class {
|
|
|
4946
5057
|
* @returns Promise<路径字符串>
|
|
4947
5058
|
*/
|
|
4948
5059
|
async getExternalAppMusicPath(timeout) {
|
|
4949
|
-
var
|
|
5060
|
+
var _a2;
|
|
4950
5061
|
const response = await this.asyncCall("getExternalAppMusicPath", void 0, timeout);
|
|
4951
5062
|
if (!response.isSuccess()) {
|
|
4952
|
-
throw new Error(((
|
|
5063
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app music path failed");
|
|
4953
5064
|
}
|
|
4954
5065
|
return response.data;
|
|
4955
5066
|
}
|
|
@@ -4959,10 +5070,10 @@ var Path = class {
|
|
|
4959
5070
|
* @returns Promise<路径字符串>
|
|
4960
5071
|
*/
|
|
4961
5072
|
async getExternalAppPodcastsPath(timeout) {
|
|
4962
|
-
var
|
|
5073
|
+
var _a2;
|
|
4963
5074
|
const response = await this.asyncCall("getExternalAppPodcastsPath", void 0, timeout);
|
|
4964
5075
|
if (!response.isSuccess()) {
|
|
4965
|
-
throw new Error(((
|
|
5076
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app podcasts path failed");
|
|
4966
5077
|
}
|
|
4967
5078
|
return response.data;
|
|
4968
5079
|
}
|
|
@@ -4972,10 +5083,10 @@ var Path = class {
|
|
|
4972
5083
|
* @returns Promise<路径字符串>
|
|
4973
5084
|
*/
|
|
4974
5085
|
async getExternalAppRingtonesPath(timeout) {
|
|
4975
|
-
var
|
|
5086
|
+
var _a2;
|
|
4976
5087
|
const response = await this.asyncCall("getExternalAppRingtonesPath", void 0, timeout);
|
|
4977
5088
|
if (!response.isSuccess()) {
|
|
4978
|
-
throw new Error(((
|
|
5089
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app ringtones path failed");
|
|
4979
5090
|
}
|
|
4980
5091
|
return response.data;
|
|
4981
5092
|
}
|
|
@@ -4985,10 +5096,10 @@ var Path = class {
|
|
|
4985
5096
|
* @returns Promise<路径字符串>
|
|
4986
5097
|
*/
|
|
4987
5098
|
async getExternalAppAlarmsPath(timeout) {
|
|
4988
|
-
var
|
|
5099
|
+
var _a2;
|
|
4989
5100
|
const response = await this.asyncCall("getExternalAppAlarmsPath", void 0, timeout);
|
|
4990
5101
|
if (!response.isSuccess()) {
|
|
4991
|
-
throw new Error(((
|
|
5102
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app alarms path failed");
|
|
4992
5103
|
}
|
|
4993
5104
|
return response.data;
|
|
4994
5105
|
}
|
|
@@ -4998,10 +5109,10 @@ var Path = class {
|
|
|
4998
5109
|
* @returns Promise<路径字符串>
|
|
4999
5110
|
*/
|
|
5000
5111
|
async getExternalAppNotificationsPath(timeout) {
|
|
5001
|
-
var
|
|
5112
|
+
var _a2;
|
|
5002
5113
|
const response = await this.asyncCall("getExternalAppNotificationsPath", void 0, timeout);
|
|
5003
5114
|
if (!response.isSuccess()) {
|
|
5004
|
-
throw new Error(((
|
|
5115
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app notifications path failed");
|
|
5005
5116
|
}
|
|
5006
5117
|
return response.data;
|
|
5007
5118
|
}
|
|
@@ -5011,10 +5122,10 @@ var Path = class {
|
|
|
5011
5122
|
* @returns Promise<路径字符串>
|
|
5012
5123
|
*/
|
|
5013
5124
|
async getExternalAppPicturesPath(timeout) {
|
|
5014
|
-
var
|
|
5125
|
+
var _a2;
|
|
5015
5126
|
const response = await this.asyncCall("getExternalAppPicturesPath", void 0, timeout);
|
|
5016
5127
|
if (!response.isSuccess()) {
|
|
5017
|
-
throw new Error(((
|
|
5128
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app pictures path failed");
|
|
5018
5129
|
}
|
|
5019
5130
|
return response.data;
|
|
5020
5131
|
}
|
|
@@ -5024,10 +5135,10 @@ var Path = class {
|
|
|
5024
5135
|
* @returns Promise<路径字符串>
|
|
5025
5136
|
*/
|
|
5026
5137
|
async getExternalAppMoviesPath(timeout) {
|
|
5027
|
-
var
|
|
5138
|
+
var _a2;
|
|
5028
5139
|
const response = await this.asyncCall("getExternalAppMoviesPath", void 0, timeout);
|
|
5029
5140
|
if (!response.isSuccess()) {
|
|
5030
|
-
throw new Error(((
|
|
5141
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app movies path failed");
|
|
5031
5142
|
}
|
|
5032
5143
|
return response.data;
|
|
5033
5144
|
}
|
|
@@ -5037,10 +5148,10 @@ var Path = class {
|
|
|
5037
5148
|
* @returns Promise<路径字符串>
|
|
5038
5149
|
*/
|
|
5039
5150
|
async getExternalAppDownloadPath(timeout) {
|
|
5040
|
-
var
|
|
5151
|
+
var _a2;
|
|
5041
5152
|
const response = await this.asyncCall("getExternalAppDownloadPath", void 0, timeout);
|
|
5042
5153
|
if (!response.isSuccess()) {
|
|
5043
|
-
throw new Error(((
|
|
5154
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app download path failed");
|
|
5044
5155
|
}
|
|
5045
5156
|
return response.data;
|
|
5046
5157
|
}
|
|
@@ -5050,10 +5161,10 @@ var Path = class {
|
|
|
5050
5161
|
* @returns Promise<路径字符串>
|
|
5051
5162
|
*/
|
|
5052
5163
|
async getExternalAppDcimPath(timeout) {
|
|
5053
|
-
var
|
|
5164
|
+
var _a2;
|
|
5054
5165
|
const response = await this.asyncCall("getExternalAppDcimPath", void 0, timeout);
|
|
5055
5166
|
if (!response.isSuccess()) {
|
|
5056
|
-
throw new Error(((
|
|
5167
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app dcim path failed");
|
|
5057
5168
|
}
|
|
5058
5169
|
return response.data;
|
|
5059
5170
|
}
|
|
@@ -5063,10 +5174,10 @@ var Path = class {
|
|
|
5063
5174
|
* @returns Promise<路径字符串>
|
|
5064
5175
|
*/
|
|
5065
5176
|
async getExternalAppDocumentsPath(timeout) {
|
|
5066
|
-
var
|
|
5177
|
+
var _a2;
|
|
5067
5178
|
const response = await this.asyncCall("getExternalAppDocumentsPath", void 0, timeout);
|
|
5068
5179
|
if (!response.isSuccess()) {
|
|
5069
|
-
throw new Error(((
|
|
5180
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app documents path failed");
|
|
5070
5181
|
}
|
|
5071
5182
|
return response.data;
|
|
5072
5183
|
}
|
|
@@ -5076,10 +5187,10 @@ var Path = class {
|
|
|
5076
5187
|
* @returns Promise<路径字符串>
|
|
5077
5188
|
*/
|
|
5078
5189
|
async getExternalAppObbPath(timeout) {
|
|
5079
|
-
var
|
|
5190
|
+
var _a2;
|
|
5080
5191
|
const response = await this.asyncCall("getExternalAppObbPath", void 0, timeout);
|
|
5081
5192
|
if (!response.isSuccess()) {
|
|
5082
|
-
throw new Error(((
|
|
5193
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get external app obb path failed");
|
|
5083
5194
|
}
|
|
5084
5195
|
return response.data;
|
|
5085
5196
|
}
|
|
@@ -5089,10 +5200,10 @@ var Path = class {
|
|
|
5089
5200
|
* @returns Promise<路径字符串>
|
|
5090
5201
|
*/
|
|
5091
5202
|
async getRootPathExternalFirst(timeout) {
|
|
5092
|
-
var
|
|
5203
|
+
var _a2;
|
|
5093
5204
|
const response = await this.asyncCall("getRootPathExternalFirst", void 0, timeout);
|
|
5094
5205
|
if (!response.isSuccess()) {
|
|
5095
|
-
throw new Error(((
|
|
5206
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get root path external first failed");
|
|
5096
5207
|
}
|
|
5097
5208
|
return response.data;
|
|
5098
5209
|
}
|
|
@@ -5102,10 +5213,10 @@ var Path = class {
|
|
|
5102
5213
|
* @returns Promise<路径字符串>
|
|
5103
5214
|
*/
|
|
5104
5215
|
async getAppDataPathExternalFirst(timeout) {
|
|
5105
|
-
var
|
|
5216
|
+
var _a2;
|
|
5106
5217
|
const response = await this.asyncCall("getAppDataPathExternalFirst", void 0, timeout);
|
|
5107
5218
|
if (!response.isSuccess()) {
|
|
5108
|
-
throw new Error(((
|
|
5219
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get app data path external first failed");
|
|
5109
5220
|
}
|
|
5110
5221
|
return response.data;
|
|
5111
5222
|
}
|
|
@@ -5115,10 +5226,10 @@ var Path = class {
|
|
|
5115
5226
|
* @returns Promise<路径字符串>
|
|
5116
5227
|
*/
|
|
5117
5228
|
async getFilesPathExternalFirst(timeout) {
|
|
5118
|
-
var
|
|
5229
|
+
var _a2;
|
|
5119
5230
|
const response = await this.asyncCall("getFilesPathExternalFirst", void 0, timeout);
|
|
5120
5231
|
if (!response.isSuccess()) {
|
|
5121
|
-
throw new Error(((
|
|
5232
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get files path external first failed");
|
|
5122
5233
|
}
|
|
5123
5234
|
return response.data;
|
|
5124
5235
|
}
|
|
@@ -5128,10 +5239,10 @@ var Path = class {
|
|
|
5128
5239
|
* @returns Promise<路径字符串>
|
|
5129
5240
|
*/
|
|
5130
5241
|
async getCachePathExternalFirst(timeout) {
|
|
5131
|
-
var
|
|
5242
|
+
var _a2;
|
|
5132
5243
|
const response = await this.asyncCall("getCachePathExternalFirst", void 0, timeout);
|
|
5133
5244
|
if (!response.isSuccess()) {
|
|
5134
|
-
throw new Error(((
|
|
5245
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get cache path external first failed");
|
|
5135
5246
|
}
|
|
5136
5247
|
return response.data;
|
|
5137
5248
|
}
|
|
@@ -5207,14 +5318,14 @@ var FileIO = class {
|
|
|
5207
5318
|
* @returns Promise<是否成功>
|
|
5208
5319
|
*/
|
|
5209
5320
|
async writeFileFromIS(filePath, inputStreamBase64, append = false, timeout) {
|
|
5210
|
-
var
|
|
5321
|
+
var _a2;
|
|
5211
5322
|
const response = await this.asyncCall(
|
|
5212
5323
|
"writeFileFromIS",
|
|
5213
5324
|
{ filePath, inputStreamBase64, append },
|
|
5214
5325
|
timeout
|
|
5215
5326
|
);
|
|
5216
5327
|
if (!response.isSuccess()) {
|
|
5217
|
-
throw new Error(((
|
|
5328
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from input stream failed");
|
|
5218
5329
|
}
|
|
5219
5330
|
return response.data;
|
|
5220
5331
|
}
|
|
@@ -5227,14 +5338,14 @@ var FileIO = class {
|
|
|
5227
5338
|
* @returns Promise<是否成功>
|
|
5228
5339
|
*/
|
|
5229
5340
|
async writeFileFromBytesByStream(filePath, bytesBase64, append = false, timeout) {
|
|
5230
|
-
var
|
|
5341
|
+
var _a2;
|
|
5231
5342
|
const response = await this.asyncCall(
|
|
5232
5343
|
"writeFileFromBytesByStream",
|
|
5233
5344
|
{ filePath, bytesBase64, append },
|
|
5234
5345
|
timeout
|
|
5235
5346
|
);
|
|
5236
5347
|
if (!response.isSuccess()) {
|
|
5237
|
-
throw new Error(((
|
|
5348
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from bytes by stream failed");
|
|
5238
5349
|
}
|
|
5239
5350
|
return response.data;
|
|
5240
5351
|
}
|
|
@@ -5247,14 +5358,14 @@ var FileIO = class {
|
|
|
5247
5358
|
* @returns Promise<是否成功>
|
|
5248
5359
|
*/
|
|
5249
5360
|
async writeFileFromBytesByChannel(filePath, bytesBase64, append = false, timeout) {
|
|
5250
|
-
var
|
|
5361
|
+
var _a2;
|
|
5251
5362
|
const response = await this.asyncCall(
|
|
5252
5363
|
"writeFileFromBytesByChannel",
|
|
5253
5364
|
{ filePath, bytesBase64, append },
|
|
5254
5365
|
timeout
|
|
5255
5366
|
);
|
|
5256
5367
|
if (!response.isSuccess()) {
|
|
5257
|
-
throw new Error(((
|
|
5368
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from bytes by channel failed");
|
|
5258
5369
|
}
|
|
5259
5370
|
return response.data;
|
|
5260
5371
|
}
|
|
@@ -5267,14 +5378,14 @@ var FileIO = class {
|
|
|
5267
5378
|
* @returns Promise<是否成功>
|
|
5268
5379
|
*/
|
|
5269
5380
|
async writeFileFromBytesByMap(filePath, bytesBase64, append = false, timeout) {
|
|
5270
|
-
var
|
|
5381
|
+
var _a2;
|
|
5271
5382
|
const response = await this.asyncCall(
|
|
5272
5383
|
"writeFileFromBytesByMap",
|
|
5273
5384
|
{ filePath, bytesBase64, append },
|
|
5274
5385
|
timeout
|
|
5275
5386
|
);
|
|
5276
5387
|
if (!response.isSuccess()) {
|
|
5277
|
-
throw new Error(((
|
|
5388
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from bytes by map failed");
|
|
5278
5389
|
}
|
|
5279
5390
|
return response.data;
|
|
5280
5391
|
}
|
|
@@ -5288,14 +5399,14 @@ var FileIO = class {
|
|
|
5288
5399
|
* @returns Promise<是否成功>
|
|
5289
5400
|
*/
|
|
5290
5401
|
async writeFileFromString(filePath, content, append = false, threadSafe = false, timeout) {
|
|
5291
|
-
var
|
|
5402
|
+
var _a2;
|
|
5292
5403
|
const response = await this.asyncCall(
|
|
5293
5404
|
"writeFileFromString",
|
|
5294
5405
|
{ filePath, content, append, threadSafe },
|
|
5295
5406
|
timeout
|
|
5296
5407
|
);
|
|
5297
5408
|
if (!response.isSuccess()) {
|
|
5298
|
-
throw new Error(((
|
|
5409
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Write file from string failed");
|
|
5299
5410
|
}
|
|
5300
5411
|
return response.data;
|
|
5301
5412
|
}
|
|
@@ -5307,14 +5418,14 @@ var FileIO = class {
|
|
|
5307
5418
|
* @returns Promise<字符串数组>
|
|
5308
5419
|
*/
|
|
5309
5420
|
async readFile2List(filePath, charsetName = "UTF-8", timeout) {
|
|
5310
|
-
var
|
|
5421
|
+
var _a2;
|
|
5311
5422
|
const response = await this.asyncCall(
|
|
5312
5423
|
"readFile2List",
|
|
5313
5424
|
{ filePath, charsetName },
|
|
5314
5425
|
timeout
|
|
5315
5426
|
);
|
|
5316
5427
|
if (!response.isSuccess()) {
|
|
5317
|
-
throw new Error(((
|
|
5428
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to list failed");
|
|
5318
5429
|
}
|
|
5319
5430
|
return response.data;
|
|
5320
5431
|
}
|
|
@@ -5326,14 +5437,14 @@ var FileIO = class {
|
|
|
5326
5437
|
* @returns Promise<文件内容字符串>
|
|
5327
5438
|
*/
|
|
5328
5439
|
async readFile2String(filePath, charsetName = "UTF-8", timeout) {
|
|
5329
|
-
var
|
|
5440
|
+
var _a2;
|
|
5330
5441
|
const response = await this.asyncCall(
|
|
5331
5442
|
"readFile2String",
|
|
5332
5443
|
{ filePath, charsetName },
|
|
5333
5444
|
timeout
|
|
5334
5445
|
);
|
|
5335
5446
|
if (!response.isSuccess()) {
|
|
5336
|
-
throw new Error(((
|
|
5447
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to string failed");
|
|
5337
5448
|
}
|
|
5338
5449
|
return response.data;
|
|
5339
5450
|
}
|
|
@@ -5344,14 +5455,14 @@ var FileIO = class {
|
|
|
5344
5455
|
* @returns Promise<Base64 编码的字节数组>
|
|
5345
5456
|
*/
|
|
5346
5457
|
async readFile2BytesByStream(filePath, timeout) {
|
|
5347
|
-
var
|
|
5458
|
+
var _a2;
|
|
5348
5459
|
const response = await this.asyncCall(
|
|
5349
5460
|
"readFile2BytesByStream",
|
|
5350
5461
|
{ filePath },
|
|
5351
5462
|
timeout
|
|
5352
5463
|
);
|
|
5353
5464
|
if (!response.isSuccess()) {
|
|
5354
|
-
throw new Error(((
|
|
5465
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to bytes by stream failed");
|
|
5355
5466
|
}
|
|
5356
5467
|
return response.data;
|
|
5357
5468
|
}
|
|
@@ -5362,14 +5473,14 @@ var FileIO = class {
|
|
|
5362
5473
|
* @returns Promise<Base64 编码的字节数组>
|
|
5363
5474
|
*/
|
|
5364
5475
|
async readFile2BytesByChannel(filePath, timeout) {
|
|
5365
|
-
var
|
|
5476
|
+
var _a2;
|
|
5366
5477
|
const response = await this.asyncCall(
|
|
5367
5478
|
"readFile2BytesByChannel",
|
|
5368
5479
|
{ filePath },
|
|
5369
5480
|
timeout
|
|
5370
5481
|
);
|
|
5371
5482
|
if (!response.isSuccess()) {
|
|
5372
|
-
throw new Error(((
|
|
5483
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to bytes by channel failed");
|
|
5373
5484
|
}
|
|
5374
5485
|
return response.data;
|
|
5375
5486
|
}
|
|
@@ -5380,14 +5491,14 @@ var FileIO = class {
|
|
|
5380
5491
|
* @returns Promise<Base64 编码的字节数组>
|
|
5381
5492
|
*/
|
|
5382
5493
|
async readFile2BytesByMap(filePath, timeout) {
|
|
5383
|
-
var
|
|
5494
|
+
var _a2;
|
|
5384
5495
|
const response = await this.asyncCall(
|
|
5385
5496
|
"readFile2BytesByMap",
|
|
5386
5497
|
{ filePath },
|
|
5387
5498
|
timeout
|
|
5388
5499
|
);
|
|
5389
5500
|
if (!response.isSuccess()) {
|
|
5390
|
-
throw new Error(((
|
|
5501
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Read file to bytes by map failed");
|
|
5391
5502
|
}
|
|
5392
5503
|
return response.data;
|
|
5393
5504
|
}
|
|
@@ -5398,14 +5509,14 @@ var FileIO = class {
|
|
|
5398
5509
|
* @returns Promise<是否成功>
|
|
5399
5510
|
*/
|
|
5400
5511
|
async setBufferSize(bufferSize, timeout) {
|
|
5401
|
-
var
|
|
5512
|
+
var _a2;
|
|
5402
5513
|
const response = await this.asyncCall(
|
|
5403
5514
|
"setBufferSize",
|
|
5404
5515
|
{ bufferSize },
|
|
5405
5516
|
timeout
|
|
5406
5517
|
);
|
|
5407
5518
|
if (!response.isSuccess()) {
|
|
5408
|
-
throw new Error(((
|
|
5519
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Set buffer size failed");
|
|
5409
5520
|
}
|
|
5410
5521
|
return response.data;
|
|
5411
5522
|
}
|
|
@@ -5479,10 +5590,10 @@ var FileUtils = class {
|
|
|
5479
5590
|
* @returns Promise<文件信息>
|
|
5480
5591
|
*/
|
|
5481
5592
|
async getFileByPath(filePath, timeout) {
|
|
5482
|
-
var
|
|
5593
|
+
var _a2;
|
|
5483
5594
|
const response = await this.asyncCall("getFileByPath", { filePath }, timeout);
|
|
5484
5595
|
if (!response.isSuccess()) {
|
|
5485
|
-
throw new Error(((
|
|
5596
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file by path failed");
|
|
5486
5597
|
}
|
|
5487
5598
|
return response.data;
|
|
5488
5599
|
}
|
|
@@ -5493,10 +5604,10 @@ var FileUtils = class {
|
|
|
5493
5604
|
* @returns Promise<是否存在>
|
|
5494
5605
|
*/
|
|
5495
5606
|
async isFileExists(filePath, timeout) {
|
|
5496
|
-
var
|
|
5607
|
+
var _a2;
|
|
5497
5608
|
const response = await this.asyncCall("isFileExists", { filePath }, timeout);
|
|
5498
5609
|
if (!response.isSuccess()) {
|
|
5499
|
-
throw new Error(((
|
|
5610
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check file exists failed");
|
|
5500
5611
|
}
|
|
5501
5612
|
return response.data;
|
|
5502
5613
|
}
|
|
@@ -5508,10 +5619,10 @@ var FileUtils = class {
|
|
|
5508
5619
|
* @returns Promise<是否成功>
|
|
5509
5620
|
*/
|
|
5510
5621
|
async rename(filePath, newName, timeout) {
|
|
5511
|
-
var
|
|
5622
|
+
var _a2;
|
|
5512
5623
|
const response = await this.asyncCall("rename", { filePath, newName }, timeout);
|
|
5513
5624
|
if (!response.isSuccess()) {
|
|
5514
|
-
throw new Error(((
|
|
5625
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Rename file failed");
|
|
5515
5626
|
}
|
|
5516
5627
|
return response.data;
|
|
5517
5628
|
}
|
|
@@ -5522,10 +5633,10 @@ var FileUtils = class {
|
|
|
5522
5633
|
* @returns Promise<是否为目录>
|
|
5523
5634
|
*/
|
|
5524
5635
|
async isDir(filePath, timeout) {
|
|
5525
|
-
var
|
|
5636
|
+
var _a2;
|
|
5526
5637
|
const response = await this.asyncCall("isDir", { filePath }, timeout);
|
|
5527
5638
|
if (!response.isSuccess()) {
|
|
5528
|
-
throw new Error(((
|
|
5639
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check is directory failed");
|
|
5529
5640
|
}
|
|
5530
5641
|
return response.data;
|
|
5531
5642
|
}
|
|
@@ -5536,10 +5647,10 @@ var FileUtils = class {
|
|
|
5536
5647
|
* @returns Promise<是否为文件>
|
|
5537
5648
|
*/
|
|
5538
5649
|
async isFile(filePath, timeout) {
|
|
5539
|
-
var
|
|
5650
|
+
var _a2;
|
|
5540
5651
|
const response = await this.asyncCall("isFile", { filePath }, timeout);
|
|
5541
5652
|
if (!response.isSuccess()) {
|
|
5542
|
-
throw new Error(((
|
|
5653
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check is file failed");
|
|
5543
5654
|
}
|
|
5544
5655
|
return response.data;
|
|
5545
5656
|
}
|
|
@@ -5550,10 +5661,10 @@ var FileUtils = class {
|
|
|
5550
5661
|
* @returns Promise<是否成功>
|
|
5551
5662
|
*/
|
|
5552
5663
|
async createOrExistsDir(dirPath, timeout) {
|
|
5553
|
-
var
|
|
5664
|
+
var _a2;
|
|
5554
5665
|
const response = await this.asyncCall("createOrExistsDir", { dirPath }, timeout);
|
|
5555
5666
|
if (!response.isSuccess()) {
|
|
5556
|
-
throw new Error(((
|
|
5667
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Create or exists dir failed");
|
|
5557
5668
|
}
|
|
5558
5669
|
return response.data;
|
|
5559
5670
|
}
|
|
@@ -5564,10 +5675,10 @@ var FileUtils = class {
|
|
|
5564
5675
|
* @returns Promise<是否成功>
|
|
5565
5676
|
*/
|
|
5566
5677
|
async createOrExistsFile(filePath, timeout) {
|
|
5567
|
-
var
|
|
5678
|
+
var _a2;
|
|
5568
5679
|
const response = await this.asyncCall("createOrExistsFile", { filePath }, timeout);
|
|
5569
5680
|
if (!response.isSuccess()) {
|
|
5570
|
-
throw new Error(((
|
|
5681
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Create or exists file failed");
|
|
5571
5682
|
}
|
|
5572
5683
|
return response.data;
|
|
5573
5684
|
}
|
|
@@ -5578,10 +5689,10 @@ var FileUtils = class {
|
|
|
5578
5689
|
* @returns Promise<是否成功>
|
|
5579
5690
|
*/
|
|
5580
5691
|
async createFileByDeleteOldFile(filePath, timeout) {
|
|
5581
|
-
var
|
|
5692
|
+
var _a2;
|
|
5582
5693
|
const response = await this.asyncCall("createFileByDeleteOldFile", { filePath }, timeout);
|
|
5583
5694
|
if (!response.isSuccess()) {
|
|
5584
|
-
throw new Error(((
|
|
5695
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Create file by delete old file failed");
|
|
5585
5696
|
}
|
|
5586
5697
|
return response.data;
|
|
5587
5698
|
}
|
|
@@ -5593,10 +5704,10 @@ var FileUtils = class {
|
|
|
5593
5704
|
* @returns Promise<是否成功>
|
|
5594
5705
|
*/
|
|
5595
5706
|
async copy(srcFilePath, destFilePath, timeout) {
|
|
5596
|
-
var
|
|
5707
|
+
var _a2;
|
|
5597
5708
|
const response = await this.asyncCall("copy", { srcFilePath, destFilePath }, timeout);
|
|
5598
5709
|
if (!response.isSuccess()) {
|
|
5599
|
-
throw new Error(((
|
|
5710
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Copy file failed");
|
|
5600
5711
|
}
|
|
5601
5712
|
return response.data;
|
|
5602
5713
|
}
|
|
@@ -5608,10 +5719,10 @@ var FileUtils = class {
|
|
|
5608
5719
|
* @returns Promise<是否成功>
|
|
5609
5720
|
*/
|
|
5610
5721
|
async move(srcFilePath, destFilePath, timeout) {
|
|
5611
|
-
var
|
|
5722
|
+
var _a2;
|
|
5612
5723
|
const response = await this.asyncCall("move", { srcFilePath, destFilePath }, timeout);
|
|
5613
5724
|
if (!response.isSuccess()) {
|
|
5614
|
-
throw new Error(((
|
|
5725
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Move file failed");
|
|
5615
5726
|
}
|
|
5616
5727
|
return response.data;
|
|
5617
5728
|
}
|
|
@@ -5622,10 +5733,10 @@ var FileUtils = class {
|
|
|
5622
5733
|
* @returns Promise<是否成功>
|
|
5623
5734
|
*/
|
|
5624
5735
|
async delete(filePath, timeout) {
|
|
5625
|
-
var
|
|
5736
|
+
var _a2;
|
|
5626
5737
|
const response = await this.asyncCall("delete", { filePath }, timeout);
|
|
5627
5738
|
if (!response.isSuccess()) {
|
|
5628
|
-
throw new Error(((
|
|
5739
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Delete file failed");
|
|
5629
5740
|
}
|
|
5630
5741
|
return response.data;
|
|
5631
5742
|
}
|
|
@@ -5636,10 +5747,10 @@ var FileUtils = class {
|
|
|
5636
5747
|
* @returns Promise<是否成功>
|
|
5637
5748
|
*/
|
|
5638
5749
|
async deleteAllInDir(dirPath, timeout) {
|
|
5639
|
-
var
|
|
5750
|
+
var _a2;
|
|
5640
5751
|
const response = await this.asyncCall("deleteAllInDir", { dirPath }, timeout);
|
|
5641
5752
|
if (!response.isSuccess()) {
|
|
5642
|
-
throw new Error(((
|
|
5753
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Delete all in dir failed");
|
|
5643
5754
|
}
|
|
5644
5755
|
return response.data;
|
|
5645
5756
|
}
|
|
@@ -5650,10 +5761,10 @@ var FileUtils = class {
|
|
|
5650
5761
|
* @returns Promise<是否成功>
|
|
5651
5762
|
*/
|
|
5652
5763
|
async deleteFilesInDir(dirPath, timeout) {
|
|
5653
|
-
var
|
|
5764
|
+
var _a2;
|
|
5654
5765
|
const response = await this.asyncCall("deleteFilesInDir", { dirPath }, timeout);
|
|
5655
5766
|
if (!response.isSuccess()) {
|
|
5656
|
-
throw new Error(((
|
|
5767
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Delete files in dir failed");
|
|
5657
5768
|
}
|
|
5658
5769
|
return response.data;
|
|
5659
5770
|
}
|
|
@@ -5665,14 +5776,14 @@ var FileUtils = class {
|
|
|
5665
5776
|
* @returns Promise<是否成功>
|
|
5666
5777
|
*/
|
|
5667
5778
|
async deleteFilesInDirWithFilter(dirPath, filterPattern, timeout) {
|
|
5668
|
-
var
|
|
5779
|
+
var _a2;
|
|
5669
5780
|
const response = await this.asyncCall(
|
|
5670
5781
|
"deleteFilesInDirWithFilter",
|
|
5671
5782
|
{ dirPath, filterPattern },
|
|
5672
5783
|
timeout
|
|
5673
5784
|
);
|
|
5674
5785
|
if (!response.isSuccess()) {
|
|
5675
|
-
throw new Error(((
|
|
5786
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Delete files in dir with filter failed");
|
|
5676
5787
|
}
|
|
5677
5788
|
return response.data;
|
|
5678
5789
|
}
|
|
@@ -5683,10 +5794,10 @@ var FileUtils = class {
|
|
|
5683
5794
|
* @returns Promise<文件列表>
|
|
5684
5795
|
*/
|
|
5685
5796
|
async listFilesInDir(dirPath, timeout) {
|
|
5686
|
-
var
|
|
5797
|
+
var _a2;
|
|
5687
5798
|
const response = await this.asyncCall("listFilesInDir", { dirPath }, timeout);
|
|
5688
5799
|
if (!response.isSuccess()) {
|
|
5689
|
-
throw new Error(((
|
|
5800
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "List files in dir failed");
|
|
5690
5801
|
}
|
|
5691
5802
|
return response.data;
|
|
5692
5803
|
}
|
|
@@ -5698,14 +5809,14 @@ var FileUtils = class {
|
|
|
5698
5809
|
* @returns Promise<文件列表>
|
|
5699
5810
|
*/
|
|
5700
5811
|
async listFilesInDirWithFilter(dirPath, filterPattern, timeout) {
|
|
5701
|
-
var
|
|
5812
|
+
var _a2;
|
|
5702
5813
|
const response = await this.asyncCall(
|
|
5703
5814
|
"listFilesInDirWithFilter",
|
|
5704
5815
|
{ dirPath, filterPattern },
|
|
5705
5816
|
timeout
|
|
5706
5817
|
);
|
|
5707
5818
|
if (!response.isSuccess()) {
|
|
5708
|
-
throw new Error(((
|
|
5819
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "List files in dir with filter failed");
|
|
5709
5820
|
}
|
|
5710
5821
|
return response.data;
|
|
5711
5822
|
}
|
|
@@ -5716,10 +5827,10 @@ var FileUtils = class {
|
|
|
5716
5827
|
* @returns Promise<时间戳(毫秒)>
|
|
5717
5828
|
*/
|
|
5718
5829
|
async getFileLastModified(filePath, timeout) {
|
|
5719
|
-
var
|
|
5830
|
+
var _a2;
|
|
5720
5831
|
const response = await this.asyncCall("getFileLastModified", { filePath }, timeout);
|
|
5721
5832
|
if (!response.isSuccess()) {
|
|
5722
|
-
throw new Error(((
|
|
5833
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file last modified failed");
|
|
5723
5834
|
}
|
|
5724
5835
|
return response.data;
|
|
5725
5836
|
}
|
|
@@ -5730,10 +5841,10 @@ var FileUtils = class {
|
|
|
5730
5841
|
* @returns Promise<字符集名称>
|
|
5731
5842
|
*/
|
|
5732
5843
|
async getFileCharsetSimple(filePath, timeout) {
|
|
5733
|
-
var
|
|
5844
|
+
var _a2;
|
|
5734
5845
|
const response = await this.asyncCall("getFileCharsetSimple", { filePath }, timeout);
|
|
5735
5846
|
if (!response.isSuccess()) {
|
|
5736
|
-
throw new Error(((
|
|
5847
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file charset simple failed");
|
|
5737
5848
|
}
|
|
5738
5849
|
return response.data;
|
|
5739
5850
|
}
|
|
@@ -5744,10 +5855,10 @@ var FileUtils = class {
|
|
|
5744
5855
|
* @returns Promise<行数>
|
|
5745
5856
|
*/
|
|
5746
5857
|
async getFileLines(filePath, timeout) {
|
|
5747
|
-
var
|
|
5858
|
+
var _a2;
|
|
5748
5859
|
const response = await this.asyncCall("getFileLines", { filePath }, timeout);
|
|
5749
5860
|
if (!response.isSuccess()) {
|
|
5750
|
-
throw new Error(((
|
|
5861
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file lines failed");
|
|
5751
5862
|
}
|
|
5752
5863
|
return response.data;
|
|
5753
5864
|
}
|
|
@@ -5758,10 +5869,10 @@ var FileUtils = class {
|
|
|
5758
5869
|
* @returns Promise<大小(字节)>
|
|
5759
5870
|
*/
|
|
5760
5871
|
async getSize(filePath, timeout) {
|
|
5761
|
-
var
|
|
5872
|
+
var _a2;
|
|
5762
5873
|
const response = await this.asyncCall("getSize", { filePath }, timeout);
|
|
5763
5874
|
if (!response.isSuccess()) {
|
|
5764
|
-
throw new Error(((
|
|
5875
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get size failed");
|
|
5765
5876
|
}
|
|
5766
5877
|
return response.data;
|
|
5767
5878
|
}
|
|
@@ -5772,10 +5883,10 @@ var FileUtils = class {
|
|
|
5772
5883
|
* @returns Promise<长度(字节)>
|
|
5773
5884
|
*/
|
|
5774
5885
|
async getLength(filePath, timeout) {
|
|
5775
|
-
var
|
|
5886
|
+
var _a2;
|
|
5776
5887
|
const response = await this.asyncCall("getLength", { filePath }, timeout);
|
|
5777
5888
|
if (!response.isSuccess()) {
|
|
5778
|
-
throw new Error(((
|
|
5889
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get length failed");
|
|
5779
5890
|
}
|
|
5780
5891
|
return response.data;
|
|
5781
5892
|
}
|
|
@@ -5786,10 +5897,10 @@ var FileUtils = class {
|
|
|
5786
5897
|
* @returns Promise<Base64 编码的 MD5>
|
|
5787
5898
|
*/
|
|
5788
5899
|
async getFileMD5(filePath, timeout) {
|
|
5789
|
-
var
|
|
5900
|
+
var _a2;
|
|
5790
5901
|
const response = await this.asyncCall("getFileMD5", { filePath }, timeout);
|
|
5791
5902
|
if (!response.isSuccess()) {
|
|
5792
|
-
throw new Error(((
|
|
5903
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file MD5 failed");
|
|
5793
5904
|
}
|
|
5794
5905
|
return response.data;
|
|
5795
5906
|
}
|
|
@@ -5800,10 +5911,10 @@ var FileUtils = class {
|
|
|
5800
5911
|
* @returns Promise<MD5 字符串>
|
|
5801
5912
|
*/
|
|
5802
5913
|
async getFileMD5ToString(filePath, timeout) {
|
|
5803
|
-
var
|
|
5914
|
+
var _a2;
|
|
5804
5915
|
const response = await this.asyncCall("getFileMD5ToString", { filePath }, timeout);
|
|
5805
5916
|
if (!response.isSuccess()) {
|
|
5806
|
-
throw new Error(((
|
|
5917
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file MD5 to string failed");
|
|
5807
5918
|
}
|
|
5808
5919
|
return response.data;
|
|
5809
5920
|
}
|
|
@@ -5814,10 +5925,10 @@ var FileUtils = class {
|
|
|
5814
5925
|
* @returns Promise<目录名>
|
|
5815
5926
|
*/
|
|
5816
5927
|
async getDirName(filePath, timeout) {
|
|
5817
|
-
var
|
|
5928
|
+
var _a2;
|
|
5818
5929
|
const response = await this.asyncCall("getDirName", { filePath }, timeout);
|
|
5819
5930
|
if (!response.isSuccess()) {
|
|
5820
|
-
throw new Error(((
|
|
5931
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get dir name failed");
|
|
5821
5932
|
}
|
|
5822
5933
|
return response.data;
|
|
5823
5934
|
}
|
|
@@ -5828,10 +5939,10 @@ var FileUtils = class {
|
|
|
5828
5939
|
* @returns Promise<文件名>
|
|
5829
5940
|
*/
|
|
5830
5941
|
async getFileName(filePath, timeout) {
|
|
5831
|
-
var
|
|
5942
|
+
var _a2;
|
|
5832
5943
|
const response = await this.asyncCall("getFileName", { filePath }, timeout);
|
|
5833
5944
|
if (!response.isSuccess()) {
|
|
5834
|
-
throw new Error(((
|
|
5945
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file name failed");
|
|
5835
5946
|
}
|
|
5836
5947
|
return response.data;
|
|
5837
5948
|
}
|
|
@@ -5842,10 +5953,10 @@ var FileUtils = class {
|
|
|
5842
5953
|
* @returns Promise<文件名(不含扩展名)>
|
|
5843
5954
|
*/
|
|
5844
5955
|
async getFileNameNoExtension(filePath, timeout) {
|
|
5845
|
-
var
|
|
5956
|
+
var _a2;
|
|
5846
5957
|
const response = await this.asyncCall("getFileNameNoExtension", { filePath }, timeout);
|
|
5847
5958
|
if (!response.isSuccess()) {
|
|
5848
|
-
throw new Error(((
|
|
5959
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file name no extension failed");
|
|
5849
5960
|
}
|
|
5850
5961
|
return response.data;
|
|
5851
5962
|
}
|
|
@@ -5856,10 +5967,10 @@ var FileUtils = class {
|
|
|
5856
5967
|
* @returns Promise<扩展名>
|
|
5857
5968
|
*/
|
|
5858
5969
|
async getFileExtension(filePath, timeout) {
|
|
5859
|
-
var
|
|
5970
|
+
var _a2;
|
|
5860
5971
|
const response = await this.asyncCall("getFileExtension", { filePath }, timeout);
|
|
5861
5972
|
if (!response.isSuccess()) {
|
|
5862
|
-
throw new Error(((
|
|
5973
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file extension failed");
|
|
5863
5974
|
}
|
|
5864
5975
|
return response.data;
|
|
5865
5976
|
}
|
|
@@ -5870,10 +5981,10 @@ var FileUtils = class {
|
|
|
5870
5981
|
* @returns Promise<是否成功>
|
|
5871
5982
|
*/
|
|
5872
5983
|
async notifySystemToScan(filePath, timeout) {
|
|
5873
|
-
var
|
|
5984
|
+
var _a2;
|
|
5874
5985
|
const response = await this.asyncCall("notifySystemToScan", { filePath }, timeout);
|
|
5875
5986
|
if (!response.isSuccess()) {
|
|
5876
|
-
throw new Error(((
|
|
5987
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Notify system to scan failed");
|
|
5877
5988
|
}
|
|
5878
5989
|
return response.data;
|
|
5879
5990
|
}
|
|
@@ -5884,10 +5995,10 @@ var FileUtils = class {
|
|
|
5884
5995
|
* @returns Promise<总大小(字节)>
|
|
5885
5996
|
*/
|
|
5886
5997
|
async getFsTotalSize(filePath, timeout) {
|
|
5887
|
-
var
|
|
5998
|
+
var _a2;
|
|
5888
5999
|
const response = await this.asyncCall("getFsTotalSize", { filePath }, timeout);
|
|
5889
6000
|
if (!response.isSuccess()) {
|
|
5890
|
-
throw new Error(((
|
|
6001
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file system total size failed");
|
|
5891
6002
|
}
|
|
5892
6003
|
return response.data;
|
|
5893
6004
|
}
|
|
@@ -5898,10 +6009,10 @@ var FileUtils = class {
|
|
|
5898
6009
|
* @returns Promise<可用大小(字节)>
|
|
5899
6010
|
*/
|
|
5900
6011
|
async getFsAvailableSize(filePath, timeout) {
|
|
5901
|
-
var
|
|
6012
|
+
var _a2;
|
|
5902
6013
|
const response = await this.asyncCall("getFsAvailableSize", { filePath }, timeout);
|
|
5903
6014
|
if (!response.isSuccess()) {
|
|
5904
|
-
throw new Error(((
|
|
6015
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Get file system available size failed");
|
|
5905
6016
|
}
|
|
5906
6017
|
return response.data;
|
|
5907
6018
|
}
|
|
@@ -5985,14 +6096,14 @@ var Ime = class {
|
|
|
5985
6096
|
* @returns Promise<执行结果>
|
|
5986
6097
|
*/
|
|
5987
6098
|
async performEditorAction(actionId = 3 /* SEARCH */, timeout) {
|
|
5988
|
-
var
|
|
6099
|
+
var _a2;
|
|
5989
6100
|
const response = await this.asyncCall(
|
|
5990
6101
|
"performEditorAction",
|
|
5991
6102
|
{ actionId },
|
|
5992
6103
|
timeout
|
|
5993
6104
|
);
|
|
5994
6105
|
if (!response.isSuccess()) {
|
|
5995
|
-
throw new Error(((
|
|
6106
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Perform editor action failed");
|
|
5996
6107
|
}
|
|
5997
6108
|
return response.data;
|
|
5998
6109
|
}
|
|
@@ -6002,14 +6113,14 @@ var Ime = class {
|
|
|
6002
6113
|
* @returns Promise<执行结果>
|
|
6003
6114
|
*/
|
|
6004
6115
|
async openInputMethodSettings(timeout) {
|
|
6005
|
-
var
|
|
6116
|
+
var _a2;
|
|
6006
6117
|
const response = await this.asyncCall(
|
|
6007
6118
|
"openInputMethodSettings",
|
|
6008
6119
|
void 0,
|
|
6009
6120
|
timeout
|
|
6010
6121
|
);
|
|
6011
6122
|
if (!response.isSuccess()) {
|
|
6012
|
-
throw new Error(((
|
|
6123
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Open input method settings failed");
|
|
6013
6124
|
}
|
|
6014
6125
|
return response.data;
|
|
6015
6126
|
}
|
|
@@ -6019,14 +6130,14 @@ var Ime = class {
|
|
|
6019
6130
|
* @returns Promise<检查结果>
|
|
6020
6131
|
*/
|
|
6021
6132
|
async isInputMethodEnabled(timeout) {
|
|
6022
|
-
var
|
|
6133
|
+
var _a2;
|
|
6023
6134
|
const response = await this.asyncCall(
|
|
6024
6135
|
"isInputMethodEnabled",
|
|
6025
6136
|
void 0,
|
|
6026
6137
|
timeout
|
|
6027
6138
|
);
|
|
6028
6139
|
if (!response.isSuccess()) {
|
|
6029
|
-
throw new Error(((
|
|
6140
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check input method enabled failed");
|
|
6030
6141
|
}
|
|
6031
6142
|
return response.data;
|
|
6032
6143
|
}
|
|
@@ -6036,14 +6147,14 @@ var Ime = class {
|
|
|
6036
6147
|
* @returns Promise<检查结果>
|
|
6037
6148
|
*/
|
|
6038
6149
|
async isCurrentInputMethod(timeout) {
|
|
6039
|
-
var
|
|
6150
|
+
var _a2;
|
|
6040
6151
|
const response = await this.asyncCall(
|
|
6041
6152
|
"isCurrentInputMethod",
|
|
6042
6153
|
void 0,
|
|
6043
6154
|
timeout
|
|
6044
6155
|
);
|
|
6045
6156
|
if (!response.isSuccess()) {
|
|
6046
|
-
throw new Error(((
|
|
6157
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Check current input method failed");
|
|
6047
6158
|
}
|
|
6048
6159
|
return response.data;
|
|
6049
6160
|
}
|
|
@@ -6118,10 +6229,10 @@ var ImageUtils = class {
|
|
|
6118
6229
|
* @returns Promise<图片尺寸信息>
|
|
6119
6230
|
*/
|
|
6120
6231
|
async getSize(imagePath, timeout) {
|
|
6121
|
-
var
|
|
6232
|
+
var _a2;
|
|
6122
6233
|
const response = await this.asyncCall("getSize", { imagePath }, timeout);
|
|
6123
6234
|
if (!response.isSuccess()) {
|
|
6124
|
-
throw new Error(((
|
|
6235
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u83B7\u53D6\u56FE\u7247\u5C3A\u5BF8\u5931\u8D25");
|
|
6125
6236
|
}
|
|
6126
6237
|
return response.data;
|
|
6127
6238
|
}
|
|
@@ -6132,10 +6243,10 @@ var ImageUtils = class {
|
|
|
6132
6243
|
* @returns Promise<图片类型信息>
|
|
6133
6244
|
*/
|
|
6134
6245
|
async getImageType(imagePath, timeout) {
|
|
6135
|
-
var
|
|
6246
|
+
var _a2;
|
|
6136
6247
|
const response = await this.asyncCall("getImageType", { imagePath }, timeout);
|
|
6137
6248
|
if (!response.isSuccess()) {
|
|
6138
|
-
throw new Error(((
|
|
6249
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u83B7\u53D6\u56FE\u7247\u7C7B\u578B\u5931\u8D25");
|
|
6139
6250
|
}
|
|
6140
6251
|
return response.data;
|
|
6141
6252
|
}
|
|
@@ -6146,10 +6257,10 @@ var ImageUtils = class {
|
|
|
6146
6257
|
* @returns Promise<是否为图片>
|
|
6147
6258
|
*/
|
|
6148
6259
|
async isImage(fileName, timeout) {
|
|
6149
|
-
var
|
|
6260
|
+
var _a2;
|
|
6150
6261
|
const response = await this.asyncCall("isImage", { fileName }, timeout);
|
|
6151
6262
|
if (!response.isSuccess()) {
|
|
6152
|
-
throw new Error(((
|
|
6263
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u5224\u65AD\u662F\u5426\u4E3A\u56FE\u7247\u5931\u8D25");
|
|
6153
6264
|
}
|
|
6154
6265
|
return response.data.isImage;
|
|
6155
6266
|
}
|
|
@@ -6160,10 +6271,10 @@ var ImageUtils = class {
|
|
|
6160
6271
|
* @returns Promise<图片旋转角度信息>
|
|
6161
6272
|
*/
|
|
6162
6273
|
async getRotateDegree(imagePath, timeout) {
|
|
6163
|
-
var
|
|
6274
|
+
var _a2;
|
|
6164
6275
|
const response = await this.asyncCall("getRotateDegree", { imagePath }, timeout);
|
|
6165
6276
|
if (!response.isSuccess()) {
|
|
6166
|
-
throw new Error(((
|
|
6277
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u83B7\u53D6\u56FE\u7247\u65CB\u8F6C\u89D2\u5EA6\u5931\u8D25");
|
|
6167
6278
|
}
|
|
6168
6279
|
return response.data;
|
|
6169
6280
|
}
|
|
@@ -6180,7 +6291,7 @@ var ImageUtils = class {
|
|
|
6180
6291
|
* @returns Promise<处理后的图片路径>
|
|
6181
6292
|
*/
|
|
6182
6293
|
async scale(imagePath, options = {}) {
|
|
6183
|
-
var
|
|
6294
|
+
var _a2;
|
|
6184
6295
|
const { scaleWidth, scaleHeight, savePath, format, timeout } = options;
|
|
6185
6296
|
const response = await this.asyncCall(
|
|
6186
6297
|
"scale",
|
|
@@ -6188,7 +6299,7 @@ var ImageUtils = class {
|
|
|
6188
6299
|
timeout
|
|
6189
6300
|
);
|
|
6190
6301
|
if (!response.isSuccess()) {
|
|
6191
|
-
throw new Error(((
|
|
6302
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u7F29\u653E\u56FE\u7247\u5931\u8D25");
|
|
6192
6303
|
}
|
|
6193
6304
|
return response.data.filePath;
|
|
6194
6305
|
}
|
|
@@ -6206,7 +6317,7 @@ var ImageUtils = class {
|
|
|
6206
6317
|
* @returns Promise<处理后的图片路径>
|
|
6207
6318
|
*/
|
|
6208
6319
|
async clip(imagePath, options = {}) {
|
|
6209
|
-
var
|
|
6320
|
+
var _a2;
|
|
6210
6321
|
const { x = 0, y = 0, width, height, savePath, format, timeout } = options;
|
|
6211
6322
|
const response = await this.asyncCall(
|
|
6212
6323
|
"clip",
|
|
@@ -6214,7 +6325,7 @@ var ImageUtils = class {
|
|
|
6214
6325
|
timeout
|
|
6215
6326
|
);
|
|
6216
6327
|
if (!response.isSuccess()) {
|
|
6217
|
-
throw new Error(((
|
|
6328
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u88C1\u526A\u56FE\u7247\u5931\u8D25");
|
|
6218
6329
|
}
|
|
6219
6330
|
return response.data.filePath;
|
|
6220
6331
|
}
|
|
@@ -6232,7 +6343,7 @@ var ImageUtils = class {
|
|
|
6232
6343
|
* @returns Promise<处理后的图片路径>
|
|
6233
6344
|
*/
|
|
6234
6345
|
async skew(imagePath, options = {}) {
|
|
6235
|
-
var
|
|
6346
|
+
var _a2;
|
|
6236
6347
|
const { kx = 0, ky = 0, px, py, savePath, format, timeout } = options;
|
|
6237
6348
|
const response = await this.asyncCall(
|
|
6238
6349
|
"skew",
|
|
@@ -6240,7 +6351,7 @@ var ImageUtils = class {
|
|
|
6240
6351
|
timeout
|
|
6241
6352
|
);
|
|
6242
6353
|
if (!response.isSuccess()) {
|
|
6243
|
-
throw new Error(((
|
|
6354
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u503E\u659C\u56FE\u7247\u5931\u8D25");
|
|
6244
6355
|
}
|
|
6245
6356
|
return response.data.filePath;
|
|
6246
6357
|
}
|
|
@@ -6257,7 +6368,7 @@ var ImageUtils = class {
|
|
|
6257
6368
|
* @returns Promise<处理后的图片路径>
|
|
6258
6369
|
*/
|
|
6259
6370
|
async rotate(imagePath, options = {}) {
|
|
6260
|
-
var
|
|
6371
|
+
var _a2;
|
|
6261
6372
|
const { degree = 0, px, py, savePath, format, timeout } = options;
|
|
6262
6373
|
const response = await this.asyncCall(
|
|
6263
6374
|
"rotate",
|
|
@@ -6265,7 +6376,7 @@ var ImageUtils = class {
|
|
|
6265
6376
|
timeout
|
|
6266
6377
|
);
|
|
6267
6378
|
if (!response.isSuccess()) {
|
|
6268
|
-
throw new Error(((
|
|
6379
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u65CB\u8F6C\u56FE\u7247\u5931\u8D25");
|
|
6269
6380
|
}
|
|
6270
6381
|
return response.data.filePath;
|
|
6271
6382
|
}
|
|
@@ -6279,7 +6390,7 @@ var ImageUtils = class {
|
|
|
6279
6390
|
* @returns Promise<处理后的图片路径>
|
|
6280
6391
|
*/
|
|
6281
6392
|
async toRound(imagePath, options = {}) {
|
|
6282
|
-
var
|
|
6393
|
+
var _a2;
|
|
6283
6394
|
const { savePath, format, timeout } = options;
|
|
6284
6395
|
const response = await this.asyncCall(
|
|
6285
6396
|
"toRound",
|
|
@@ -6287,7 +6398,7 @@ var ImageUtils = class {
|
|
|
6287
6398
|
timeout
|
|
6288
6399
|
);
|
|
6289
6400
|
if (!response.isSuccess()) {
|
|
6290
|
-
throw new Error(((
|
|
6401
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u8F6C\u4E3A\u5706\u5F62\u56FE\u7247\u5931\u8D25");
|
|
6291
6402
|
}
|
|
6292
6403
|
return response.data.filePath;
|
|
6293
6404
|
}
|
|
@@ -6302,7 +6413,7 @@ var ImageUtils = class {
|
|
|
6302
6413
|
* @returns Promise<处理后的图片路径>
|
|
6303
6414
|
*/
|
|
6304
6415
|
async toRoundCorner(imagePath, options = {}) {
|
|
6305
|
-
var
|
|
6416
|
+
var _a2;
|
|
6306
6417
|
const { radius = 0, savePath, format, timeout } = options;
|
|
6307
6418
|
const response = await this.asyncCall(
|
|
6308
6419
|
"toRoundCorner",
|
|
@@ -6310,7 +6421,7 @@ var ImageUtils = class {
|
|
|
6310
6421
|
timeout
|
|
6311
6422
|
);
|
|
6312
6423
|
if (!response.isSuccess()) {
|
|
6313
|
-
throw new Error(((
|
|
6424
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u8F6C\u4E3A\u5706\u89D2\u56FE\u7247\u5931\u8D25");
|
|
6314
6425
|
}
|
|
6315
6426
|
return response.data.filePath;
|
|
6316
6427
|
}
|
|
@@ -6327,7 +6438,7 @@ var ImageUtils = class {
|
|
|
6327
6438
|
* @returns Promise<处理后的图片路径>
|
|
6328
6439
|
*/
|
|
6329
6440
|
async addCornerBorder(imagePath, options = {}) {
|
|
6330
|
-
var
|
|
6441
|
+
var _a2;
|
|
6331
6442
|
const { borderSize = 0, color = "#000000", cornerRadius = 0, savePath, format, timeout } = options;
|
|
6332
6443
|
const response = await this.asyncCall(
|
|
6333
6444
|
"addCornerBorder",
|
|
@@ -6335,7 +6446,7 @@ var ImageUtils = class {
|
|
|
6335
6446
|
timeout
|
|
6336
6447
|
);
|
|
6337
6448
|
if (!response.isSuccess()) {
|
|
6338
|
-
throw new Error(((
|
|
6449
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u5706\u89D2\u8FB9\u6846\u5931\u8D25");
|
|
6339
6450
|
}
|
|
6340
6451
|
return response.data.filePath;
|
|
6341
6452
|
}
|
|
@@ -6351,7 +6462,7 @@ var ImageUtils = class {
|
|
|
6351
6462
|
* @returns Promise<处理后的图片路径>
|
|
6352
6463
|
*/
|
|
6353
6464
|
async addCircleBorder(imagePath, options = {}) {
|
|
6354
|
-
var
|
|
6465
|
+
var _a2;
|
|
6355
6466
|
const { borderSize = 0, color = "#000000", savePath, format, timeout } = options;
|
|
6356
6467
|
const response = await this.asyncCall(
|
|
6357
6468
|
"addCircleBorder",
|
|
@@ -6359,7 +6470,7 @@ var ImageUtils = class {
|
|
|
6359
6470
|
timeout
|
|
6360
6471
|
);
|
|
6361
6472
|
if (!response.isSuccess()) {
|
|
6362
|
-
throw new Error(((
|
|
6473
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u5706\u5F62\u8FB9\u6846\u5931\u8D25");
|
|
6363
6474
|
}
|
|
6364
6475
|
return response.data.filePath;
|
|
6365
6476
|
}
|
|
@@ -6374,7 +6485,7 @@ var ImageUtils = class {
|
|
|
6374
6485
|
* @returns Promise<处理后的图片路径>
|
|
6375
6486
|
*/
|
|
6376
6487
|
async addReflection(imagePath, options = {}) {
|
|
6377
|
-
var
|
|
6488
|
+
var _a2;
|
|
6378
6489
|
const { reflectionHeight = 0, savePath, format, timeout } = options;
|
|
6379
6490
|
const response = await this.asyncCall(
|
|
6380
6491
|
"addReflection",
|
|
@@ -6382,7 +6493,7 @@ var ImageUtils = class {
|
|
|
6382
6493
|
timeout
|
|
6383
6494
|
);
|
|
6384
6495
|
if (!response.isSuccess()) {
|
|
6385
|
-
throw new Error(((
|
|
6496
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u5012\u5F71\u5931\u8D25");
|
|
6386
6497
|
}
|
|
6387
6498
|
return response.data.filePath;
|
|
6388
6499
|
}
|
|
@@ -6401,7 +6512,7 @@ var ImageUtils = class {
|
|
|
6401
6512
|
* @returns Promise<处理后的图片路径>
|
|
6402
6513
|
*/
|
|
6403
6514
|
async addTextWatermark(imagePath, options = {}) {
|
|
6404
|
-
var
|
|
6515
|
+
var _a2;
|
|
6405
6516
|
const { text = "", x = 0, y = 0, color = "#000000", size = 16, savePath, format, timeout } = options;
|
|
6406
6517
|
const response = await this.asyncCall(
|
|
6407
6518
|
"addTextWatermark",
|
|
@@ -6409,7 +6520,7 @@ var ImageUtils = class {
|
|
|
6409
6520
|
timeout
|
|
6410
6521
|
);
|
|
6411
6522
|
if (!response.isSuccess()) {
|
|
6412
|
-
throw new Error(((
|
|
6523
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u6587\u5B57\u6C34\u5370\u5931\u8D25");
|
|
6413
6524
|
}
|
|
6414
6525
|
return response.data.filePath;
|
|
6415
6526
|
}
|
|
@@ -6427,7 +6538,7 @@ var ImageUtils = class {
|
|
|
6427
6538
|
* @returns Promise<处理后的图片路径>
|
|
6428
6539
|
*/
|
|
6429
6540
|
async addImageWatermark(imagePath, options) {
|
|
6430
|
-
var
|
|
6541
|
+
var _a2;
|
|
6431
6542
|
const { watermarkPath, x = 0, y = 0, alpha = 255, savePath, format, timeout } = options;
|
|
6432
6543
|
const response = await this.asyncCall(
|
|
6433
6544
|
"addImageWatermark",
|
|
@@ -6435,7 +6546,7 @@ var ImageUtils = class {
|
|
|
6435
6546
|
timeout
|
|
6436
6547
|
);
|
|
6437
6548
|
if (!response.isSuccess()) {
|
|
6438
|
-
throw new Error(((
|
|
6549
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u56FE\u7247\u6C34\u5370\u5931\u8D25");
|
|
6439
6550
|
}
|
|
6440
6551
|
return response.data.filePath;
|
|
6441
6552
|
}
|
|
@@ -6449,7 +6560,7 @@ var ImageUtils = class {
|
|
|
6449
6560
|
* @returns Promise<处理后的图片路径>
|
|
6450
6561
|
*/
|
|
6451
6562
|
async toAlpha(imagePath, options = {}) {
|
|
6452
|
-
var
|
|
6563
|
+
var _a2;
|
|
6453
6564
|
const { savePath, format, timeout } = options;
|
|
6454
6565
|
const response = await this.asyncCall(
|
|
6455
6566
|
"toAlpha",
|
|
@@ -6457,7 +6568,7 @@ var ImageUtils = class {
|
|
|
6457
6568
|
timeout
|
|
6458
6569
|
);
|
|
6459
6570
|
if (!response.isSuccess()) {
|
|
6460
|
-
throw new Error(((
|
|
6571
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u8F6C\u4E3A alpha \u4F4D\u56FE\u5931\u8D25");
|
|
6461
6572
|
}
|
|
6462
6573
|
return response.data.filePath;
|
|
6463
6574
|
}
|
|
@@ -6471,7 +6582,7 @@ var ImageUtils = class {
|
|
|
6471
6582
|
* @returns Promise<处理后的图片路径>
|
|
6472
6583
|
*/
|
|
6473
6584
|
async toGray(imagePath, options = {}) {
|
|
6474
|
-
var
|
|
6585
|
+
var _a2;
|
|
6475
6586
|
const { savePath, format, timeout } = options;
|
|
6476
6587
|
const response = await this.asyncCall(
|
|
6477
6588
|
"toGray",
|
|
@@ -6479,7 +6590,7 @@ var ImageUtils = class {
|
|
|
6479
6590
|
timeout
|
|
6480
6591
|
);
|
|
6481
6592
|
if (!response.isSuccess()) {
|
|
6482
|
-
throw new Error(((
|
|
6593
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u8F6C\u4E3A\u7070\u5EA6\u56FE\u7247\u5931\u8D25");
|
|
6483
6594
|
}
|
|
6484
6595
|
return response.data.filePath;
|
|
6485
6596
|
}
|
|
@@ -6495,7 +6606,7 @@ var ImageUtils = class {
|
|
|
6495
6606
|
* @returns Promise<处理后的图片路径>
|
|
6496
6607
|
*/
|
|
6497
6608
|
async fastBlur(imagePath, options = {}) {
|
|
6498
|
-
var
|
|
6609
|
+
var _a2;
|
|
6499
6610
|
const { radius = 0, scale = 1, savePath, format, timeout } = options;
|
|
6500
6611
|
const response = await this.asyncCall(
|
|
6501
6612
|
"fastBlur",
|
|
@@ -6503,7 +6614,7 @@ var ImageUtils = class {
|
|
|
6503
6614
|
timeout
|
|
6504
6615
|
);
|
|
6505
6616
|
if (!response.isSuccess()) {
|
|
6506
|
-
throw new Error(((
|
|
6617
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u5FEB\u901F\u6A21\u7CCA\u5931\u8D25");
|
|
6507
6618
|
}
|
|
6508
6619
|
return response.data.filePath;
|
|
6509
6620
|
}
|
|
@@ -6518,7 +6629,7 @@ var ImageUtils = class {
|
|
|
6518
6629
|
* @returns Promise<处理后的图片路径>
|
|
6519
6630
|
*/
|
|
6520
6631
|
async renderScriptBlur(imagePath, options = {}) {
|
|
6521
|
-
var
|
|
6632
|
+
var _a2;
|
|
6522
6633
|
const { radius = 0, savePath, format, timeout } = options;
|
|
6523
6634
|
const response = await this.asyncCall(
|
|
6524
6635
|
"renderScriptBlur",
|
|
@@ -6526,7 +6637,7 @@ var ImageUtils = class {
|
|
|
6526
6637
|
timeout
|
|
6527
6638
|
);
|
|
6528
6639
|
if (!response.isSuccess()) {
|
|
6529
|
-
throw new Error(((
|
|
6640
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "RenderScript \u6A21\u7CCA\u5931\u8D25");
|
|
6530
6641
|
}
|
|
6531
6642
|
return response.data.filePath;
|
|
6532
6643
|
}
|
|
@@ -6541,7 +6652,7 @@ var ImageUtils = class {
|
|
|
6541
6652
|
* @returns Promise<处理后的图片路径>
|
|
6542
6653
|
*/
|
|
6543
6654
|
async stackBlur(imagePath, options = {}) {
|
|
6544
|
-
var
|
|
6655
|
+
var _a2;
|
|
6545
6656
|
const { radius = 0, savePath, format, timeout } = options;
|
|
6546
6657
|
const response = await this.asyncCall(
|
|
6547
6658
|
"stackBlur",
|
|
@@ -6549,7 +6660,7 @@ var ImageUtils = class {
|
|
|
6549
6660
|
timeout
|
|
6550
6661
|
);
|
|
6551
6662
|
if (!response.isSuccess()) {
|
|
6552
|
-
throw new Error(((
|
|
6663
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Stack \u6A21\u7CCA\u5931\u8D25");
|
|
6553
6664
|
}
|
|
6554
6665
|
return response.data.filePath;
|
|
6555
6666
|
}
|
|
@@ -6566,7 +6677,7 @@ var ImageUtils = class {
|
|
|
6566
6677
|
* @returns Promise<压缩后的图片路径>
|
|
6567
6678
|
*/
|
|
6568
6679
|
async compressByScale(imagePath, options = {}) {
|
|
6569
|
-
var
|
|
6680
|
+
var _a2;
|
|
6570
6681
|
const { scaleWidth, scaleHeight, savePath, format, timeout } = options;
|
|
6571
6682
|
const response = await this.asyncCall(
|
|
6572
6683
|
"compressByScale",
|
|
@@ -6574,7 +6685,7 @@ var ImageUtils = class {
|
|
|
6574
6685
|
timeout
|
|
6575
6686
|
);
|
|
6576
6687
|
if (!response.isSuccess()) {
|
|
6577
|
-
throw new Error(((
|
|
6688
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6309\u7F29\u653E\u538B\u7F29\u5931\u8D25");
|
|
6578
6689
|
}
|
|
6579
6690
|
return response.data.filePath;
|
|
6580
6691
|
}
|
|
@@ -6589,7 +6700,7 @@ var ImageUtils = class {
|
|
|
6589
6700
|
* @returns Promise<压缩后的图片路径>
|
|
6590
6701
|
*/
|
|
6591
6702
|
async compressByQuality(imagePath, options = {}) {
|
|
6592
|
-
var
|
|
6703
|
+
var _a2;
|
|
6593
6704
|
const { quality = 100, format = "JPEG", savePath, timeout } = options;
|
|
6594
6705
|
const response = await this.asyncCall(
|
|
6595
6706
|
"compressByQuality",
|
|
@@ -6597,7 +6708,7 @@ var ImageUtils = class {
|
|
|
6597
6708
|
timeout
|
|
6598
6709
|
);
|
|
6599
6710
|
if (!response.isSuccess()) {
|
|
6600
|
-
throw new Error(((
|
|
6711
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6309\u8D28\u91CF\u538B\u7F29\u5931\u8D25");
|
|
6601
6712
|
}
|
|
6602
6713
|
return response.data.filePath;
|
|
6603
6714
|
}
|
|
@@ -6612,7 +6723,7 @@ var ImageUtils = class {
|
|
|
6612
6723
|
* @returns Promise<压缩后的图片路径>
|
|
6613
6724
|
*/
|
|
6614
6725
|
async compressBySampleSize(imagePath, options = {}) {
|
|
6615
|
-
var
|
|
6726
|
+
var _a2;
|
|
6616
6727
|
const { sampleSize = 1, savePath, format, timeout } = options;
|
|
6617
6728
|
const response = await this.asyncCall(
|
|
6618
6729
|
"compressBySampleSize",
|
|
@@ -6620,7 +6731,7 @@ var ImageUtils = class {
|
|
|
6620
6731
|
timeout
|
|
6621
6732
|
);
|
|
6622
6733
|
if (!response.isSuccess()) {
|
|
6623
|
-
throw new Error(((
|
|
6734
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6309\u91C7\u6837\u5927\u5C0F\u538B\u7F29\u5931\u8D25");
|
|
6624
6735
|
}
|
|
6625
6736
|
return response.data.filePath;
|
|
6626
6737
|
}
|
|
@@ -6635,7 +6746,7 @@ var ImageUtils = class {
|
|
|
6635
6746
|
* @returns Promise<保存结果>
|
|
6636
6747
|
*/
|
|
6637
6748
|
async save(imagePath, options = {}) {
|
|
6638
|
-
var
|
|
6749
|
+
var _a2;
|
|
6639
6750
|
const { savePath, format = "PNG", timeout } = options;
|
|
6640
6751
|
const response = await this.asyncCall(
|
|
6641
6752
|
"save",
|
|
@@ -6643,7 +6754,7 @@ var ImageUtils = class {
|
|
|
6643
6754
|
timeout
|
|
6644
6755
|
);
|
|
6645
6756
|
if (!response.isSuccess()) {
|
|
6646
|
-
throw new Error(((
|
|
6757
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u4FDD\u5B58\u56FE\u7247\u5931\u8D25");
|
|
6647
6758
|
}
|
|
6648
6759
|
return response.data;
|
|
6649
6760
|
}
|
|
@@ -6657,7 +6768,7 @@ var ImageUtils = class {
|
|
|
6657
6768
|
* @returns Promise<保存结果>
|
|
6658
6769
|
*/
|
|
6659
6770
|
async save2Album(imagePath, options = {}) {
|
|
6660
|
-
var
|
|
6771
|
+
var _a2;
|
|
6661
6772
|
const { fileName, format = "PNG", timeout } = options;
|
|
6662
6773
|
const response = await this.asyncCall(
|
|
6663
6774
|
"save2Album",
|
|
@@ -6665,7 +6776,7 @@ var ImageUtils = class {
|
|
|
6665
6776
|
timeout
|
|
6666
6777
|
);
|
|
6667
6778
|
if (!response.isSuccess()) {
|
|
6668
|
-
throw new Error(((
|
|
6779
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u4FDD\u5B58\u56FE\u7247\u5230\u76F8\u518C\u5931\u8D25");
|
|
6669
6780
|
}
|
|
6670
6781
|
return response.data;
|
|
6671
6782
|
}
|
|
@@ -6740,7 +6851,7 @@ var Gallery = class {
|
|
|
6740
6851
|
* @returns Promise<相册操作响应>
|
|
6741
6852
|
*/
|
|
6742
6853
|
async addImageToGallery(filePath, displayName, timeout) {
|
|
6743
|
-
var
|
|
6854
|
+
var _a2;
|
|
6744
6855
|
if (!filePath) {
|
|
6745
6856
|
throw new Error("filePath\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A");
|
|
6746
6857
|
}
|
|
@@ -6750,7 +6861,7 @@ var Gallery = class {
|
|
|
6750
6861
|
timeout
|
|
6751
6862
|
);
|
|
6752
6863
|
if (!response.isSuccess()) {
|
|
6753
|
-
throw new Error(((
|
|
6864
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u56FE\u7247\u5230\u76F8\u518C\u5931\u8D25");
|
|
6754
6865
|
}
|
|
6755
6866
|
return response.data;
|
|
6756
6867
|
}
|
|
@@ -6762,7 +6873,7 @@ var Gallery = class {
|
|
|
6762
6873
|
* @returns Promise<相册操作响应>
|
|
6763
6874
|
*/
|
|
6764
6875
|
async addVideoToGallery(filePath, displayName, timeout) {
|
|
6765
|
-
var
|
|
6876
|
+
var _a2;
|
|
6766
6877
|
if (!filePath) {
|
|
6767
6878
|
throw new Error("filePath\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A");
|
|
6768
6879
|
}
|
|
@@ -6772,7 +6883,7 @@ var Gallery = class {
|
|
|
6772
6883
|
timeout
|
|
6773
6884
|
);
|
|
6774
6885
|
if (!response.isSuccess()) {
|
|
6775
|
-
throw new Error(((
|
|
6886
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u6DFB\u52A0\u89C6\u9891\u5230\u76F8\u518C\u5931\u8D25");
|
|
6776
6887
|
}
|
|
6777
6888
|
return response.data;
|
|
6778
6889
|
}
|
|
@@ -6783,7 +6894,7 @@ var Gallery = class {
|
|
|
6783
6894
|
* @returns Promise<删除响应>
|
|
6784
6895
|
*/
|
|
6785
6896
|
async deleteFromGalleryByUri(uri, timeout) {
|
|
6786
|
-
var
|
|
6897
|
+
var _a2;
|
|
6787
6898
|
if (!uri) {
|
|
6788
6899
|
throw new Error("uri\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A");
|
|
6789
6900
|
}
|
|
@@ -6793,7 +6904,7 @@ var Gallery = class {
|
|
|
6793
6904
|
timeout
|
|
6794
6905
|
);
|
|
6795
6906
|
if (!response.isSuccess()) {
|
|
6796
|
-
throw new Error(((
|
|
6907
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u4ECE\u76F8\u518C\u5220\u9664\u5931\u8D25");
|
|
6797
6908
|
}
|
|
6798
6909
|
return response.data;
|
|
6799
6910
|
}
|
|
@@ -6805,7 +6916,7 @@ var Gallery = class {
|
|
|
6805
6916
|
* @returns Promise<删除响应>
|
|
6806
6917
|
*/
|
|
6807
6918
|
async deleteFromGalleryById(id, type, timeout) {
|
|
6808
|
-
var
|
|
6919
|
+
var _a2;
|
|
6809
6920
|
if (id === void 0 || id === null) {
|
|
6810
6921
|
throw new Error("id\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A");
|
|
6811
6922
|
}
|
|
@@ -6818,7 +6929,7 @@ var Gallery = class {
|
|
|
6818
6929
|
timeout
|
|
6819
6930
|
);
|
|
6820
6931
|
if (!response.isSuccess()) {
|
|
6821
|
-
throw new Error(((
|
|
6932
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "\u4ECE\u76F8\u518C\u5220\u9664\u5931\u8D25");
|
|
6822
6933
|
}
|
|
6823
6934
|
return response.data;
|
|
6824
6935
|
}
|
|
@@ -6916,7 +7027,7 @@ var Mlkit = class {
|
|
|
6916
7027
|
* @returns Promise<识别结果>
|
|
6917
7028
|
*/
|
|
6918
7029
|
async findPhrasePositions(targetText, options = {}) {
|
|
6919
|
-
var
|
|
7030
|
+
var _a2;
|
|
6920
7031
|
if (!targetText || targetText.trim() === "") {
|
|
6921
7032
|
throw new Error("targetText cannot be empty");
|
|
6922
7033
|
}
|
|
@@ -6940,7 +7051,7 @@ var Mlkit = class {
|
|
|
6940
7051
|
timeout
|
|
6941
7052
|
);
|
|
6942
7053
|
if (!response.isSuccess()) {
|
|
6943
|
-
throw new Error(((
|
|
7054
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Recognition failed");
|
|
6944
7055
|
}
|
|
6945
7056
|
return response.data;
|
|
6946
7057
|
}
|
|
@@ -6950,7 +7061,7 @@ var Mlkit = class {
|
|
|
6950
7061
|
* @returns Promise<识别结果>
|
|
6951
7062
|
*/
|
|
6952
7063
|
async getScreenTextPositions(options = {}) {
|
|
6953
|
-
var
|
|
7064
|
+
var _a2;
|
|
6954
7065
|
const {
|
|
6955
7066
|
region,
|
|
6956
7067
|
rotationDegrees = 0,
|
|
@@ -6970,7 +7081,7 @@ var Mlkit = class {
|
|
|
6970
7081
|
timeout
|
|
6971
7082
|
);
|
|
6972
7083
|
if (!response.isSuccess()) {
|
|
6973
|
-
throw new Error(((
|
|
7084
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Recognition failed");
|
|
6974
7085
|
}
|
|
6975
7086
|
return response.data;
|
|
6976
7087
|
}
|
|
@@ -6981,7 +7092,7 @@ var Mlkit = class {
|
|
|
6981
7092
|
* @returns Promise<JSON 字符串结果>
|
|
6982
7093
|
*/
|
|
6983
7094
|
async findPhrasePositionsOnScreenAsJson(targetText, options = {}) {
|
|
6984
|
-
var
|
|
7095
|
+
var _a2;
|
|
6985
7096
|
if (!targetText || targetText.trim() === "") {
|
|
6986
7097
|
throw new Error("targetText cannot be empty");
|
|
6987
7098
|
}
|
|
@@ -7005,7 +7116,7 @@ var Mlkit = class {
|
|
|
7005
7116
|
timeout
|
|
7006
7117
|
);
|
|
7007
7118
|
if (!response.isSuccess()) {
|
|
7008
|
-
throw new Error(((
|
|
7119
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Recognition failed");
|
|
7009
7120
|
}
|
|
7010
7121
|
const data = response.data;
|
|
7011
7122
|
return data.jsonResult;
|
|
@@ -7016,7 +7127,7 @@ var Mlkit = class {
|
|
|
7016
7127
|
* @returns Promise<JSON 字符串结果>
|
|
7017
7128
|
*/
|
|
7018
7129
|
async getScreenTextPositionsAsJson(options = {}) {
|
|
7019
|
-
var
|
|
7130
|
+
var _a2;
|
|
7020
7131
|
const {
|
|
7021
7132
|
region,
|
|
7022
7133
|
rotationDegrees = 0,
|
|
@@ -7036,7 +7147,7 @@ var Mlkit = class {
|
|
|
7036
7147
|
timeout
|
|
7037
7148
|
);
|
|
7038
7149
|
if (!response.isSuccess()) {
|
|
7039
|
-
throw new Error(((
|
|
7150
|
+
throw new Error(((_a2 = response.data) == null ? void 0 : _a2.message) || "Recognition failed");
|
|
7040
7151
|
}
|
|
7041
7152
|
const data = response.data;
|
|
7042
7153
|
return data.jsonResult;
|
|
@@ -7203,10 +7314,10 @@ var BarUtils = class {
|
|
|
7203
7314
|
}
|
|
7204
7315
|
/** Set status bar color. color: Android color int (e.g. 0xff0000). isDecor: whether to apply to decor. */
|
|
7205
7316
|
async setStatusBarColor(color, options, timeout) {
|
|
7206
|
-
var
|
|
7317
|
+
var _a2;
|
|
7207
7318
|
const res = await this.asyncCall(
|
|
7208
7319
|
BarUtilsCallMethod.setStatusBarColor,
|
|
7209
|
-
{ color, isDecor: (
|
|
7320
|
+
{ color, isDecor: (_a2 = options == null ? void 0 : options.isDecor) != null ? _a2 : false },
|
|
7210
7321
|
timeout
|
|
7211
7322
|
);
|
|
7212
7323
|
if (!res.isSuccess()) {
|
|
@@ -7671,28 +7782,28 @@ var Log = class {
|
|
|
7671
7782
|
}
|
|
7672
7783
|
/** 读取当前日志全文 */
|
|
7673
7784
|
async readAllText(timeout) {
|
|
7674
|
-
var
|
|
7785
|
+
var _a2;
|
|
7675
7786
|
const res = await this.asyncCall(
|
|
7676
7787
|
LogCallMethod.readAllText,
|
|
7677
7788
|
void 0,
|
|
7678
7789
|
timeout
|
|
7679
7790
|
);
|
|
7680
7791
|
const d = res.getDataOrNull();
|
|
7681
|
-
return (
|
|
7792
|
+
return (_a2 = d == null ? void 0 : d.text) != null ? _a2 : "";
|
|
7682
7793
|
}
|
|
7683
7794
|
/**
|
|
7684
7795
|
* 获取日志服务当前域名(origin,无路径;与上传、管理后台同源)。
|
|
7685
7796
|
* 与 Kotlin getLogServiceBaseUrl / adminWebBaseUrl 对齐。
|
|
7686
7797
|
*/
|
|
7687
7798
|
async getLogServiceBaseUrl(timeout) {
|
|
7688
|
-
var
|
|
7799
|
+
var _a2;
|
|
7689
7800
|
const res = await this.asyncCall(
|
|
7690
7801
|
LogCallMethod.getLogServiceBaseUrl,
|
|
7691
7802
|
void 0,
|
|
7692
7803
|
timeout
|
|
7693
7804
|
);
|
|
7694
7805
|
const d = res.getDataOrNull();
|
|
7695
|
-
return (
|
|
7806
|
+
return (_a2 = d == null ? void 0 : d.baseUrl) != null ? _a2 : "";
|
|
7696
7807
|
}
|
|
7697
7808
|
/** 清空日志 */
|
|
7698
7809
|
async clear(timeout) {
|
|
@@ -7734,6 +7845,17 @@ var Log = class {
|
|
|
7734
7845
|
);
|
|
7735
7846
|
return res.isSuccess();
|
|
7736
7847
|
}
|
|
7848
|
+
/**
|
|
7849
|
+
* 追加日志(appendTimestampedEntry / appendLine 简写)。
|
|
7850
|
+
* 默认带时间戳;`timestamped: false` 时走 appendLine。
|
|
7851
|
+
*/
|
|
7852
|
+
async append(text, options) {
|
|
7853
|
+
const { timestamped = true, maxLength, timeout } = options != null ? options : {};
|
|
7854
|
+
if (timestamped) {
|
|
7855
|
+
return this.appendTimestampedEntry(text, timeout);
|
|
7856
|
+
}
|
|
7857
|
+
return this.appendLine(text, maxLength, timeout);
|
|
7858
|
+
}
|
|
7737
7859
|
/** 替换全部内容 */
|
|
7738
7860
|
async replaceAll(content, timeout) {
|
|
7739
7861
|
const res = await this.asyncCall(
|
|
@@ -7748,10 +7870,10 @@ var Log = class {
|
|
|
7748
7870
|
* resolve 后请保留 dispose 或调用 unsubscribe(subscriptionId) 以释放原生协程与 JS 回调。
|
|
7749
7871
|
*/
|
|
7750
7872
|
async subscribe(stream, onUpdate, options) {
|
|
7751
|
-
var
|
|
7873
|
+
var _a2;
|
|
7752
7874
|
const self = this;
|
|
7753
7875
|
const callbackId = generateUUID();
|
|
7754
|
-
const timeoutSec = (
|
|
7876
|
+
const timeoutSec = (_a2 = options == null ? void 0 : options.timeout) != null ? _a2 : 30;
|
|
7755
7877
|
return new Promise((resolve, reject) => {
|
|
7756
7878
|
let settled = false;
|
|
7757
7879
|
const timer = setTimeout(() => {
|
|
@@ -7762,7 +7884,7 @@ var Log = class {
|
|
|
7762
7884
|
}
|
|
7763
7885
|
}, timeoutSec * 1e3);
|
|
7764
7886
|
streamHandlers.set(callbackId, (raw) => {
|
|
7765
|
-
var
|
|
7887
|
+
var _a3, _b, _c;
|
|
7766
7888
|
let response;
|
|
7767
7889
|
try {
|
|
7768
7890
|
response = JSON.parse(raw);
|
|
@@ -7778,7 +7900,7 @@ var Log = class {
|
|
|
7778
7900
|
streamHandlers.delete(callbackId);
|
|
7779
7901
|
reject(
|
|
7780
7902
|
new Error(
|
|
7781
|
-
(
|
|
7903
|
+
(_a3 = response.message) != null ? _a3 : "Log subscribe failed"
|
|
7782
7904
|
)
|
|
7783
7905
|
);
|
|
7784
7906
|
}
|
|
@@ -7925,6 +8047,8 @@ var log = new Log();
|
|
|
7925
8047
|
LogStream,
|
|
7926
8048
|
Mlkit,
|
|
7927
8049
|
MlkitCallMethod,
|
|
8050
|
+
NODE_LOOKUP_SCOPE_ACTIVE_WINDOW,
|
|
8051
|
+
NODE_LOOKUP_SCOPE_ALL_WINDOWS,
|
|
7928
8052
|
Node,
|
|
7929
8053
|
NodeAsync,
|
|
7930
8054
|
NodeClassValue,
|
|
@@ -7938,6 +8062,7 @@ var log = new Log();
|
|
|
7938
8062
|
barUtils,
|
|
7939
8063
|
callbacks,
|
|
7940
8064
|
decodeBase64UTF8,
|
|
8065
|
+
ensureAssistsXPinia,
|
|
7941
8066
|
fileIO,
|
|
7942
8067
|
fileUtils,
|
|
7943
8068
|
float,
|