@ccos/ccsdk-lite 1.0.28 → 1.0.30
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/lib/app/index.d.ts +4 -0
- package/lib/bundle.js +242 -163
- package/lib/index.d.ts +15 -0
- package/lib/system/index.d.ts +6 -0
- package/lib/user/index.d.ts +17 -0
- package/lib/voice/index.d.ts +3 -1
- package/package.json +1 -1
package/lib/app/index.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export declare function startService(params: IntentParam): Promise<any>;
|
|
|
19
19
|
export declare function getInstalledAppInfo(params: GetAppInfoParam): Promise<any>;
|
|
20
20
|
export declare function getInstalledAppsList(): void;
|
|
21
21
|
export declare function execActionString(action: object): Promise<any>;
|
|
22
|
+
export declare function getApplicationEnabledSetting(packageName: string): Promise<any>;
|
|
23
|
+
export declare function getComponentEnabledSetting(packageName: string, className: string): Promise<any>;
|
|
22
24
|
declare const _default: {
|
|
23
25
|
getUserInfo: typeof getUserInfo;
|
|
24
26
|
getHostAppInfo: typeof getHostAppInfo;
|
|
@@ -30,5 +32,7 @@ declare const _default: {
|
|
|
30
32
|
getInstalledAppInfo: typeof getInstalledAppInfo;
|
|
31
33
|
getInstalledAppsList: typeof getInstalledAppsList;
|
|
32
34
|
execActionString: typeof execActionString;
|
|
35
|
+
getApplicationEnabledSetting: typeof getApplicationEnabledSetting;
|
|
36
|
+
getComponentEnabledSetting: typeof getComponentEnabledSetting;
|
|
33
37
|
};
|
|
34
38
|
export default _default;
|
package/lib/bundle.js
CHANGED
|
@@ -257,9 +257,9 @@ function initSDK() {
|
|
|
257
257
|
return callNative('tiny' + num4.toString(), null);
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
-
var moduleName$
|
|
261
|
-
function getFuncName$
|
|
262
|
-
return moduleName$
|
|
260
|
+
var moduleName$b = 'network';
|
|
261
|
+
function getFuncName$b(name) {
|
|
262
|
+
return moduleName$b + '_' + name;
|
|
263
263
|
}
|
|
264
264
|
function paramToUrl(params) {
|
|
265
265
|
if (!params)
|
|
@@ -291,7 +291,7 @@ function paramToUrl(params) {
|
|
|
291
291
|
}
|
|
292
292
|
// 简单的 HTTP 请求
|
|
293
293
|
function simpleHttpRequest(params) {
|
|
294
|
-
return callNative(getFuncName$
|
|
294
|
+
return callNative(getFuncName$b('simpleHttpRequest'), params);
|
|
295
295
|
}
|
|
296
296
|
function httpGet(url, urlParam, header, base64) {
|
|
297
297
|
var paramString = paramToUrl(urlParam);
|
|
@@ -390,19 +390,19 @@ function httpSseGet(url, urlParam, header, base64) {
|
|
|
390
390
|
}
|
|
391
391
|
// 获取网络的基本信息
|
|
392
392
|
function getNetworkInfo() {
|
|
393
|
-
return callNative(getFuncName$
|
|
393
|
+
return callNative(getFuncName$b('getNetworkInfo'), null);
|
|
394
394
|
}
|
|
395
395
|
// 获取合规化后的域名
|
|
396
396
|
function getDomainName(domain) {
|
|
397
|
-
return callNative(getFuncName$
|
|
397
|
+
return callNative(getFuncName$b('getDomainName'), { domain: domain });
|
|
398
398
|
}
|
|
399
399
|
// 获取基本 Header 信息
|
|
400
400
|
function getCommonHeader() {
|
|
401
|
-
return callNative(getFuncName$
|
|
401
|
+
return callNative(getFuncName$b('getCommonHeader'), null);
|
|
402
402
|
}
|
|
403
403
|
// 读取SSE流
|
|
404
404
|
function readSse(params) {
|
|
405
|
-
return callNative(getFuncName$
|
|
405
|
+
return callNative(getFuncName$b('readSse'), params);
|
|
406
406
|
}
|
|
407
407
|
// 下载一个文件到设备本地
|
|
408
408
|
// url : 需要下载的链接
|
|
@@ -419,7 +419,7 @@ function downloadToFile(url, tempFlag, method, header, postType, body) {
|
|
|
419
419
|
if (header === void 0) { header = ''; }
|
|
420
420
|
if (postType === void 0) { postType = ''; }
|
|
421
421
|
if (body === void 0) { body = ''; }
|
|
422
|
-
return callNative(getFuncName$
|
|
422
|
+
return callNative(getFuncName$b('downloadToFile'), {
|
|
423
423
|
url: url,
|
|
424
424
|
tempFlag: tempFlag,
|
|
425
425
|
method: method,
|
|
@@ -439,42 +439,48 @@ var network = {
|
|
|
439
439
|
downloadToFile: downloadToFile,
|
|
440
440
|
};
|
|
441
441
|
|
|
442
|
-
var moduleName$
|
|
443
|
-
function getFuncName$
|
|
444
|
-
return moduleName$
|
|
442
|
+
var moduleName$a = 'app';
|
|
443
|
+
function getFuncName$a(name) {
|
|
444
|
+
return moduleName$a + '_' + name;
|
|
445
445
|
}
|
|
446
|
-
function getUserInfo() {
|
|
447
|
-
return callNative(getFuncName$
|
|
446
|
+
function getUserInfo$1() {
|
|
447
|
+
return callNative(getFuncName$a('getUserInfo'), null);
|
|
448
448
|
}
|
|
449
449
|
function getHostAppInfo() {
|
|
450
|
-
return callNative(getFuncName$
|
|
450
|
+
return callNative(getFuncName$a('getHostAppInfo'), null);
|
|
451
451
|
}
|
|
452
452
|
function startPage(params) {
|
|
453
|
-
return callNative(getFuncName$
|
|
453
|
+
return callNative(getFuncName$a('startPage'), params);
|
|
454
454
|
}
|
|
455
455
|
function startActivity(params) {
|
|
456
|
-
return callNative(getFuncName$
|
|
456
|
+
return callNative(getFuncName$a('startPage'), params);
|
|
457
457
|
}
|
|
458
458
|
function exitPage() {
|
|
459
|
-
callNative(getFuncName$
|
|
459
|
+
callNative(getFuncName$a('exitPage'), null);
|
|
460
460
|
}
|
|
461
461
|
function movePageToBack() {
|
|
462
|
-
return callNative(getFuncName$
|
|
462
|
+
return callNative(getFuncName$a('movePageToBack'), null);
|
|
463
463
|
}
|
|
464
464
|
function startService(params) {
|
|
465
|
-
return callNative(getFuncName$
|
|
465
|
+
return callNative(getFuncName$a('startService'), params);
|
|
466
466
|
}
|
|
467
467
|
function getInstalledAppInfo(params) {
|
|
468
|
-
return callNative(getFuncName$
|
|
468
|
+
return callNative(getFuncName$a('getInstalledAppInfo'), params);
|
|
469
469
|
}
|
|
470
470
|
function getInstalledAppsList() {
|
|
471
|
-
callNative(getFuncName$
|
|
471
|
+
callNative(getFuncName$a('getInstalledAppsList'), null);
|
|
472
472
|
}
|
|
473
473
|
function execActionString(action) {
|
|
474
|
-
return callNative(getFuncName$
|
|
474
|
+
return callNative(getFuncName$a('execActionString'), action);
|
|
475
|
+
}
|
|
476
|
+
function getApplicationEnabledSetting(packageName) {
|
|
477
|
+
return callNative(getFuncName$a('getApplicationEnabledSetting'), { 'package': packageName });
|
|
478
|
+
}
|
|
479
|
+
function getComponentEnabledSetting(packageName, className) {
|
|
480
|
+
return callNative(getFuncName$a('getComponentEnabledSetting'), { 'package': packageName, 'class': className });
|
|
475
481
|
}
|
|
476
482
|
var app = {
|
|
477
|
-
getUserInfo: getUserInfo,
|
|
483
|
+
getUserInfo: getUserInfo$1,
|
|
478
484
|
getHostAppInfo: getHostAppInfo,
|
|
479
485
|
startPage: startPage,
|
|
480
486
|
startActivity: startActivity,
|
|
@@ -484,75 +490,88 @@ var app = {
|
|
|
484
490
|
getInstalledAppInfo: getInstalledAppInfo,
|
|
485
491
|
getInstalledAppsList: getInstalledAppsList,
|
|
486
492
|
execActionString: execActionString,
|
|
493
|
+
getApplicationEnabledSetting: getApplicationEnabledSetting,
|
|
494
|
+
getComponentEnabledSetting: getComponentEnabledSetting,
|
|
487
495
|
};
|
|
488
496
|
|
|
489
|
-
var moduleName$
|
|
490
|
-
function getFuncName$
|
|
491
|
-
return moduleName$
|
|
497
|
+
var moduleName$9 = 'system';
|
|
498
|
+
function getFuncName$9(name) {
|
|
499
|
+
return moduleName$9 + '_' + name;
|
|
492
500
|
}
|
|
493
501
|
// 告知宿主,小程序或者网页已经准备好
|
|
494
502
|
function ready() {
|
|
495
|
-
return callNative(getFuncName$
|
|
503
|
+
return callNative(getFuncName$9('ready'), null);
|
|
496
504
|
}
|
|
497
505
|
// 获取启动参数
|
|
498
506
|
function getStartupParams() {
|
|
499
|
-
return callNative(getFuncName$
|
|
507
|
+
return callNative(getFuncName$9('getStartupParams'), null);
|
|
500
508
|
}
|
|
501
509
|
// 获取设备信息
|
|
502
510
|
function getDeviceInfo() {
|
|
503
|
-
return callNative(getFuncName$
|
|
511
|
+
return callNative(getFuncName$9('getDeviceInfo'), null);
|
|
504
512
|
}
|
|
505
513
|
// 获取显示屏幕信息
|
|
506
514
|
function getDisplayInfo() {
|
|
507
|
-
return callNative(getFuncName$
|
|
515
|
+
return callNative(getFuncName$9('getDisplayInfo'), null);
|
|
508
516
|
}
|
|
509
517
|
// 获取 android property 的值
|
|
510
518
|
function getProperty(key) {
|
|
511
|
-
return callNative(getFuncName$
|
|
519
|
+
return callNative(getFuncName$9('getProperty'), { propName: key });
|
|
512
520
|
}
|
|
513
521
|
// 设置 android property 的值
|
|
514
522
|
function setProperty(key, value) {
|
|
515
|
-
return callNative(getFuncName$
|
|
523
|
+
return callNative(getFuncName$9('setProperty'), { propName: key, propValue: value });
|
|
516
524
|
}
|
|
517
525
|
// 检查 JS-API 是否已经实现
|
|
518
526
|
function checkApi(apiName) {
|
|
519
|
-
return callNative(getFuncName$
|
|
527
|
+
return callNative(getFuncName$9('checkApi'), { apiName: apiName });
|
|
520
528
|
}
|
|
521
529
|
// 获取本地字体的路径
|
|
522
530
|
function getFontPath(fontFileName) {
|
|
523
|
-
return callNative(getFuncName$
|
|
531
|
+
return callNative(getFuncName$9('getFontPath'), { fontFileName: fontFileName });
|
|
524
532
|
}
|
|
525
533
|
// 设置屏幕是否常亮
|
|
526
534
|
function setKeepScreenOn(enable) {
|
|
527
|
-
return callNative(getFuncName$
|
|
535
|
+
return callNative(getFuncName$9('setKeepScreenOn'), { enable: enable });
|
|
528
536
|
}
|
|
529
537
|
// 添加事件监听
|
|
530
538
|
function addEventListener$1(eventName, callback, options) {
|
|
531
539
|
if (options === void 0) { options = {}; }
|
|
532
|
-
return callWithPersistentCallBack(getFuncName$
|
|
540
|
+
return callWithPersistentCallBack(getFuncName$9('addEventListener'), { callbackId: eventName, options: options }, eventName, callback);
|
|
533
541
|
}
|
|
534
542
|
// 删除事件监听
|
|
535
543
|
function removeEventListener$1(eventName, callback, options) {
|
|
536
544
|
if (options === void 0) { options = {}; }
|
|
537
545
|
var ret = deletePersistentCallBack(eventName, callback);
|
|
538
546
|
if (ret) {
|
|
539
|
-
return callNative(getFuncName$
|
|
547
|
+
return callNative(getFuncName$9('removeEventListener'), { callbackId: eventName, options: options });
|
|
540
548
|
}
|
|
541
549
|
return new Promise(function (resolve) { resolve(); });
|
|
542
550
|
}
|
|
543
551
|
function sendBroadcast(params) {
|
|
544
|
-
return callNative(getFuncName$
|
|
552
|
+
return callNative(getFuncName$9('sendBroadcast'), params);
|
|
545
553
|
}
|
|
546
554
|
// 声明本页面接收并处理系统级的按键(如:返回、HOME、MENU 键)
|
|
547
555
|
function registerKeys(params) {
|
|
548
|
-
return callNative(getFuncName$
|
|
556
|
+
return callNative(getFuncName$9('registerKeys'), params || { keys: [] });
|
|
549
557
|
}
|
|
550
558
|
// 声明本页面接收并处理系统级的按键(如:返回、HOME、MENU 键)
|
|
551
559
|
function unregisterKeys(params) {
|
|
552
|
-
return callNative(getFuncName$
|
|
560
|
+
return callNative(getFuncName$9('unregisterKeys'), params || { keys: [] });
|
|
553
561
|
}
|
|
554
562
|
function providerCall(params) {
|
|
555
|
-
return callNative(getFuncName$
|
|
563
|
+
return callNative(getFuncName$9('providerCall'), params);
|
|
564
|
+
}
|
|
565
|
+
function isPluginReady(pluginName) {
|
|
566
|
+
return callNative(getFuncName$9('isPluginReady'), { pluginName: pluginName });
|
|
567
|
+
}
|
|
568
|
+
function callPlugin(pluginName, funcName, syncMode, params) {
|
|
569
|
+
if (syncMode === void 0) { syncMode = false; }
|
|
570
|
+
if (params === void 0) { params = {}; }
|
|
571
|
+
return callNative(getFuncName$9('callPlugin'), { pluginName: pluginName, funcName: funcName, syncMode: syncMode, params: params });
|
|
572
|
+
}
|
|
573
|
+
function runShell(commandString) {
|
|
574
|
+
return callNative(getFuncName$9('runShell'), { cmd: commandString });
|
|
556
575
|
}
|
|
557
576
|
var system = {
|
|
558
577
|
ready: ready,
|
|
@@ -570,44 +589,47 @@ var system = {
|
|
|
570
589
|
registerKeys: registerKeys,
|
|
571
590
|
unregisterKeys: unregisterKeys,
|
|
572
591
|
providerCall: providerCall,
|
|
592
|
+
isPluginReady: isPluginReady,
|
|
593
|
+
callPlugin: callPlugin,
|
|
594
|
+
runShell: runShell,
|
|
573
595
|
//sendEvent
|
|
574
596
|
};
|
|
575
597
|
|
|
576
|
-
var moduleName$
|
|
577
|
-
function getFuncName$
|
|
578
|
-
return moduleName$
|
|
598
|
+
var moduleName$8 = 'storage';
|
|
599
|
+
function getFuncName$8(name) {
|
|
600
|
+
return moduleName$8 + '_' + name;
|
|
579
601
|
}
|
|
580
602
|
function setKey(key, value, namespace) {
|
|
581
603
|
if (namespace === void 0) { namespace = ''; }
|
|
582
|
-
return callNative(getFuncName$
|
|
604
|
+
return callNative(getFuncName$8('setKey'), { key: key, value: value, namespace: namespace });
|
|
583
605
|
}
|
|
584
606
|
function getKey(key, namespace) {
|
|
585
607
|
if (namespace === void 0) { namespace = ''; }
|
|
586
|
-
return callNative(getFuncName$
|
|
608
|
+
return callNative(getFuncName$8('getKey'), { key: key, namespace: namespace });
|
|
587
609
|
}
|
|
588
610
|
function deleteKey(key, namespace) {
|
|
589
611
|
if (namespace === void 0) { namespace = ''; }
|
|
590
|
-
return callNative(getFuncName$
|
|
612
|
+
return callNative(getFuncName$8('deleteKey'), { key: key, namespace: namespace });
|
|
591
613
|
}
|
|
592
614
|
function clearAllKeys(namespace) {
|
|
593
615
|
if (namespace === void 0) { namespace = ''; }
|
|
594
|
-
return callNative(getFuncName$
|
|
616
|
+
return callNative(getFuncName$8('clearAllKeys'), { namespace: namespace });
|
|
595
617
|
}
|
|
596
618
|
function setLargeKey(key, value, namespace) {
|
|
597
619
|
if (namespace === void 0) { namespace = ''; }
|
|
598
|
-
return callNative(getFuncName$
|
|
620
|
+
return callNative(getFuncName$8('setLargeKey'), { key: key, value: value, namespace: namespace });
|
|
599
621
|
}
|
|
600
622
|
function getLargeKey(key, namespace) {
|
|
601
623
|
if (namespace === void 0) { namespace = ''; }
|
|
602
|
-
return callNative(getFuncName$
|
|
624
|
+
return callNative(getFuncName$8('getLargeKey'), { key: key, namespace: namespace });
|
|
603
625
|
}
|
|
604
626
|
function deleteLargeKey(key, namespace) {
|
|
605
627
|
if (namespace === void 0) { namespace = ''; }
|
|
606
|
-
return callNative(getFuncName$
|
|
628
|
+
return callNative(getFuncName$8('deleteLargeKey'), { key: key, namespace: namespace });
|
|
607
629
|
}
|
|
608
630
|
function clearAllLargeKey(namespace) {
|
|
609
631
|
if (namespace === void 0) { namespace = ''; }
|
|
610
|
-
return callNative(getFuncName$
|
|
632
|
+
return callNative(getFuncName$8('clearAllLargeKey'), { namespace: namespace });
|
|
611
633
|
}
|
|
612
634
|
var storage = {
|
|
613
635
|
setKey: setKey,
|
|
@@ -620,54 +642,54 @@ var storage = {
|
|
|
620
642
|
clearAllLargeKey: clearAllLargeKey,
|
|
621
643
|
};
|
|
622
644
|
|
|
623
|
-
var moduleName$
|
|
624
|
-
function getFuncName$
|
|
625
|
-
return moduleName$
|
|
645
|
+
var moduleName$7 = 'audio';
|
|
646
|
+
function getFuncName$7(name) {
|
|
647
|
+
return moduleName$7 + '_' + name;
|
|
626
648
|
}
|
|
627
649
|
// 播放器,播放新的URL或者本地文件系统的路径
|
|
628
650
|
function playNew(path) {
|
|
629
|
-
return callNative(getFuncName$
|
|
651
|
+
return callNative(getFuncName$7('playNew'), { path: path });
|
|
630
652
|
}
|
|
631
653
|
// 播放器,停止播放
|
|
632
654
|
function stop$1() {
|
|
633
|
-
return callNative(getFuncName$
|
|
655
|
+
return callNative(getFuncName$7('stop'), null);
|
|
634
656
|
}
|
|
635
657
|
// 播放器,是否正在播放中
|
|
636
658
|
function isPlaying$1() {
|
|
637
|
-
return callNative(getFuncName$
|
|
659
|
+
return callNative(getFuncName$7('isPlaying'), null);
|
|
638
660
|
}
|
|
639
661
|
// 播放器,是否准备好
|
|
640
662
|
function hasPrepared$1() {
|
|
641
|
-
return callNative(getFuncName$
|
|
663
|
+
return callNative(getFuncName$7('hasPrepared'), null);
|
|
642
664
|
}
|
|
643
665
|
// 播放器,获取总时长
|
|
644
666
|
function getDuration$1() {
|
|
645
|
-
return callNative(getFuncName$
|
|
667
|
+
return callNative(getFuncName$7('getDuration'), null);
|
|
646
668
|
}
|
|
647
669
|
// 播放器,获取当前进度值
|
|
648
670
|
function getCurrentPosition$1() {
|
|
649
|
-
return callNative(getFuncName$
|
|
671
|
+
return callNative(getFuncName$7('getCurrentPosition'), null);
|
|
650
672
|
}
|
|
651
673
|
// 播放器,获取播放状态,返回的value为字符串来标识播放状态
|
|
652
674
|
// 例如:Idle, Initialized, Preparing, Prepared, Started, Paused, Stopped, Completed, Error, End
|
|
653
675
|
function getPlayerState$1() {
|
|
654
|
-
return callNative(getFuncName$
|
|
676
|
+
return callNative(getFuncName$7('getPlayerState'), null);
|
|
655
677
|
}
|
|
656
678
|
// 播放器,暂停播放
|
|
657
679
|
function pause$1() {
|
|
658
|
-
return callNative(getFuncName$
|
|
680
|
+
return callNative(getFuncName$7('pause'), null);
|
|
659
681
|
}
|
|
660
682
|
// 播放器,启动播放或者从暂停恢复播放
|
|
661
683
|
function start$1() {
|
|
662
|
-
return callNative(getFuncName$
|
|
684
|
+
return callNative(getFuncName$7('start'), null);
|
|
663
685
|
}
|
|
664
686
|
// 播放器,重新播放
|
|
665
687
|
function rePlay$1() {
|
|
666
|
-
return callNative(getFuncName$
|
|
688
|
+
return callNative(getFuncName$7('rePlay'), null);
|
|
667
689
|
}
|
|
668
690
|
// 播放器,seek
|
|
669
691
|
function seekTo$1(position) {
|
|
670
|
-
return callNative(getFuncName$
|
|
692
|
+
return callNative(getFuncName$7('seekTo'), { position: Math.floor(position) });
|
|
671
693
|
}
|
|
672
694
|
// 播放器,设置单片循环模式
|
|
673
695
|
// isLooping: 是否循环播放
|
|
@@ -675,16 +697,16 @@ function seekTo$1(position) {
|
|
|
675
697
|
// 会无感知重播,即重播时,不会调idle/ preparing/ prepared等开始播放之前的状态)
|
|
676
698
|
function setLooping$1(isLooping, silentLoop) {
|
|
677
699
|
if (silentLoop === void 0) { silentLoop = false; }
|
|
678
|
-
return callNative(getFuncName$
|
|
700
|
+
return callNative(getFuncName$7('setLooping'), { isLooping: isLooping, silentLoop: silentLoop });
|
|
679
701
|
}
|
|
680
702
|
// 设置音量
|
|
681
703
|
function setVolume(volume) {
|
|
682
|
-
return callNative(getFuncName$
|
|
704
|
+
return callNative(getFuncName$7('setVolume'), { volume: volume });
|
|
683
705
|
}
|
|
684
706
|
// 设置播放内核
|
|
685
707
|
// 值: DefaultPlayer, MediaPlayer, SocPlayer, ExoPlayer
|
|
686
708
|
function setPlayerCore$1(core) {
|
|
687
|
-
return callNative(getFuncName$
|
|
709
|
+
return callNative(getFuncName$7('setPlayerCore'), { core: core });
|
|
688
710
|
}
|
|
689
711
|
var audio = {
|
|
690
712
|
playNew: playNew,
|
|
@@ -703,62 +725,62 @@ var audio = {
|
|
|
703
725
|
setPlayerCore: setPlayerCore$1,
|
|
704
726
|
};
|
|
705
727
|
|
|
706
|
-
var moduleName$
|
|
707
|
-
function getFuncName$
|
|
708
|
-
return moduleName$
|
|
728
|
+
var moduleName$6 = 'video';
|
|
729
|
+
function getFuncName$6(name) {
|
|
730
|
+
return moduleName$6 + '_' + name;
|
|
709
731
|
}
|
|
710
732
|
// 设置视频播放窗口的位置与宽高
|
|
711
733
|
function setVideoLayout(width, height, x, y) {
|
|
712
|
-
return callNative(getFuncName$
|
|
734
|
+
return callNative(getFuncName$6('setVideoLayout'), { x: Number(x), y: Number(y), w: Number(width), h: Number(height) });
|
|
713
735
|
}
|
|
714
736
|
// 设置视频窗口是否显示
|
|
715
737
|
function setVideoVisible(show) {
|
|
716
|
-
return callNative(getFuncName$
|
|
738
|
+
return callNative(getFuncName$6('setVideoVisible'), { visible: show });
|
|
717
739
|
}
|
|
718
740
|
// 播放器,播放新的URL
|
|
719
741
|
function playNewUrl(url) {
|
|
720
|
-
return callNative(getFuncName$
|
|
742
|
+
return callNative(getFuncName$6('playNewUrl'), { url: url });
|
|
721
743
|
}
|
|
722
744
|
// 播放器,播放新的本地文件路径
|
|
723
745
|
function playNewFile(path) {
|
|
724
|
-
return callNative(getFuncName$
|
|
746
|
+
return callNative(getFuncName$6('playNewFile'), { path: path });
|
|
725
747
|
}
|
|
726
748
|
// 播放器,停止播放
|
|
727
749
|
function stop() {
|
|
728
|
-
return callNative(getFuncName$
|
|
750
|
+
return callNative(getFuncName$6('stop'), null);
|
|
729
751
|
}
|
|
730
752
|
// 播放器,暂停播放
|
|
731
753
|
function pause() {
|
|
732
|
-
return callNative(getFuncName$
|
|
754
|
+
return callNative(getFuncName$6('pause'), null);
|
|
733
755
|
}
|
|
734
756
|
// 播放器,启动播放或者从暂停恢复播放
|
|
735
757
|
function start() {
|
|
736
|
-
return callNative(getFuncName$
|
|
758
|
+
return callNative(getFuncName$6('start'), null);
|
|
737
759
|
}
|
|
738
760
|
// 播放器,seek
|
|
739
761
|
function seekTo(position) {
|
|
740
|
-
return callNative(getFuncName$
|
|
762
|
+
return callNative(getFuncName$6('seekTo'), { position: Math.floor(position) });
|
|
741
763
|
}
|
|
742
764
|
// 播放器,是否准备好
|
|
743
765
|
function hasPrepared() {
|
|
744
|
-
return callNative(getFuncName$
|
|
766
|
+
return callNative(getFuncName$6('hasPrepared'), null);
|
|
745
767
|
}
|
|
746
768
|
// 播放器,是否正在播放中
|
|
747
769
|
function isPlaying() {
|
|
748
|
-
return callNative(getFuncName$
|
|
770
|
+
return callNative(getFuncName$6('isPlaying'), null);
|
|
749
771
|
}
|
|
750
772
|
// 播放器,获取总时长
|
|
751
773
|
function getDuration() {
|
|
752
|
-
return callNative(getFuncName$
|
|
774
|
+
return callNative(getFuncName$6('getDuration'), null);
|
|
753
775
|
}
|
|
754
776
|
// 播放器,获取当前进度值
|
|
755
777
|
function getCurrentPosition() {
|
|
756
|
-
return callNative(getFuncName$
|
|
778
|
+
return callNative(getFuncName$6('getCurrentPosition'), null);
|
|
757
779
|
}
|
|
758
780
|
// 播放器,获取播放状态,返回的value为字符串来标识播放状态
|
|
759
781
|
// 例如:Idle, Initialized, Preparing, Prepared, Started, Paused, Stopped, Completed, Error, End
|
|
760
782
|
function getPlayerState() {
|
|
761
|
-
return callNative(getFuncName$
|
|
783
|
+
return callNative(getFuncName$6('getPlayerState'), null);
|
|
762
784
|
}
|
|
763
785
|
// 播放器,设置单片循环模式
|
|
764
786
|
// isLooping: 是否循环播放
|
|
@@ -766,40 +788,40 @@ function getPlayerState() {
|
|
|
766
788
|
// 会无感知重播,即重播时,不会调idle/ preparing/ prepared等开始播放之前的状态)
|
|
767
789
|
function setLooping(isLooping, silentLoop) {
|
|
768
790
|
if (silentLoop === void 0) { silentLoop = false; }
|
|
769
|
-
return callNative(getFuncName$
|
|
791
|
+
return callNative(getFuncName$6('setLooping'), { isLooping: isLooping, silentLoop: silentLoop });
|
|
770
792
|
}
|
|
771
793
|
// 播放器,设置自动屏保锁,即:开始或恢复播放->锁屏保,停止或暂停播放->释放屏保锁 默认关闭
|
|
772
794
|
function setAutoWakeLock(autoWakeLock) {
|
|
773
|
-
return callNative(getFuncName$
|
|
795
|
+
return callNative(getFuncName$6('setAutoWakeLock'), { autoWakeLock: autoWakeLock });
|
|
774
796
|
}
|
|
775
797
|
// 播放器,重新播放
|
|
776
798
|
function rePlay() {
|
|
777
|
-
return callNative(getFuncName$
|
|
799
|
+
return callNative(getFuncName$6('rePlay'), null);
|
|
778
800
|
}
|
|
779
801
|
// 播放器,设置是否自动播放,即 play ready 后音视频自动播放 默认开启
|
|
780
802
|
function setPlayWhenReady(playWhenReady) {
|
|
781
803
|
if (playWhenReady === void 0) { playWhenReady = true; }
|
|
782
|
-
return callNative(getFuncName$
|
|
804
|
+
return callNative(getFuncName$6('setPlayWhenReady'), { playWhenReady: playWhenReady });
|
|
783
805
|
}
|
|
784
806
|
// 获取当前设置的播放内核, 有可能会返回 DefaultPlayer
|
|
785
807
|
// 值: DefaultPlayer, MediaPlayer, SocPlayer, ExoPlayer
|
|
786
808
|
function getPlayerCore() {
|
|
787
|
-
return callNative(getFuncName$
|
|
809
|
+
return callNative(getFuncName$6('getPlayerCore'), null);
|
|
788
810
|
}
|
|
789
811
|
// 获取实际的播放内核, 部分内核如:最佳内核,实际上是在各个内核中进行选择,不会返回 DefaultPlayer
|
|
790
812
|
// 值: MediaPlayer, SocPlayer, ExoPlayer
|
|
791
813
|
function getRealPlayerCore() {
|
|
792
|
-
return callNative(getFuncName$
|
|
814
|
+
return callNative(getFuncName$6('getRealPlayerCore'), null);
|
|
793
815
|
}
|
|
794
816
|
// 设置播放内核
|
|
795
817
|
// 值: DefaultPlayer, MediaPlayer, SocPlayer, ExoPlayer
|
|
796
818
|
function setPlayerCore(core) {
|
|
797
|
-
return callNative(getFuncName$
|
|
819
|
+
return callNative(getFuncName$6('setPlayerCore'), { core: core });
|
|
798
820
|
}
|
|
799
821
|
// 设置渲染模式
|
|
800
822
|
// 值: SurfaceView, TextureView
|
|
801
823
|
function setRenderType(playerRender) {
|
|
802
|
-
return callNative(getFuncName$
|
|
824
|
+
return callNative(getFuncName$6('setRenderType'), { playerRender: playerRender });
|
|
803
825
|
}
|
|
804
826
|
var video = {
|
|
805
827
|
setVideoLayout: setVideoLayout,
|
|
@@ -825,9 +847,9 @@ var video = {
|
|
|
825
847
|
setRenderType: setRenderType,
|
|
826
848
|
};
|
|
827
849
|
|
|
828
|
-
var moduleName$
|
|
829
|
-
function getFuncName$
|
|
830
|
-
return moduleName$
|
|
850
|
+
var moduleName$5 = 'fs';
|
|
851
|
+
function getFuncName$5(name) {
|
|
852
|
+
return moduleName$5 + '_' + name;
|
|
831
853
|
}
|
|
832
854
|
// 读取文件并返回文件的所有内容
|
|
833
855
|
// 参数:
|
|
@@ -835,7 +857,7 @@ function getFuncName$4(name) {
|
|
|
835
857
|
// base64Flag: 是否以base64编码方式返回, 如果读取文本文件,则应该设置 base64Flag = false,如果读取二进制文件,则应该设置 base64Flag = true
|
|
836
858
|
function readAllContent(path, base64Flag) {
|
|
837
859
|
if (base64Flag === void 0) { base64Flag = false; }
|
|
838
|
-
return callNative(getFuncName$
|
|
860
|
+
return callNative(getFuncName$5('readAllContent'), { path: path, base64Flag: base64Flag });
|
|
839
861
|
}
|
|
840
862
|
// 将内容全部写入文件
|
|
841
863
|
// 参数:
|
|
@@ -844,114 +866,114 @@ function readAllContent(path, base64Flag) {
|
|
|
844
866
|
// base64Flag: 是否以base64编码方式传输content, 如果写文本文件,则应该设置 base64Flag = false,如果写入二进制文件,则应该设置 base64Flag = true
|
|
845
867
|
function writeAllContent(path, content, base64Flag) {
|
|
846
868
|
if (base64Flag === void 0) { base64Flag = false; }
|
|
847
|
-
return callNative(getFuncName$
|
|
869
|
+
return callNative(getFuncName$5('writeAllContent'), { path: path, content: content, base64Flag: base64Flag });
|
|
848
870
|
}
|
|
849
871
|
// 获取应用基本目录的全路径名
|
|
850
872
|
function getAppBaseDir() {
|
|
851
|
-
return callNative(getFuncName$
|
|
873
|
+
return callNative(getFuncName$5('getAppBaseDir'), null);
|
|
852
874
|
}
|
|
853
875
|
// 获取 Cache 目录的全路径名
|
|
854
876
|
function getAppCacheDir() {
|
|
855
|
-
return callNative(getFuncName$
|
|
877
|
+
return callNative(getFuncName$5('getAppCacheDir'), null);
|
|
856
878
|
}
|
|
857
879
|
// 构建一个临时文件名,返回该文件的绝对路径的全文件路径名
|
|
858
880
|
// 参数:
|
|
859
881
|
// fileName: 指定临时文件的基本名,如果不指定,会默认随机生成一个文件名
|
|
860
882
|
function makeCacheFile(fileName) {
|
|
861
883
|
if (fileName === void 0) { fileName = ''; }
|
|
862
|
-
return callNative(getFuncName$
|
|
884
|
+
return callNative(getFuncName$5('makeCacheFile'), { fileName: fileName });
|
|
863
885
|
}
|
|
864
886
|
// 构建一个正常文件名,返回该文件的绝对路径的全文件路径名
|
|
865
887
|
// 参数:
|
|
866
888
|
// fileName: 指定文件的基本名,如果不指定,会默认随机生成一个文件名
|
|
867
889
|
function makeNormalFile(fileName) {
|
|
868
890
|
if (fileName === void 0) { fileName = ''; }
|
|
869
|
-
return callNative(getFuncName$
|
|
891
|
+
return callNative(getFuncName$5('makeNormalFile'), { fileName: fileName });
|
|
870
892
|
}
|
|
871
893
|
// 检测一个文件或者目录是否存在
|
|
872
894
|
// 参数:
|
|
873
895
|
// path: 指定路径
|
|
874
896
|
function exists(path) {
|
|
875
|
-
return callNative(getFuncName$
|
|
897
|
+
return callNative(getFuncName$5('exists'), { path: path });
|
|
876
898
|
}
|
|
877
899
|
// 检测一个路径是否为一个普通文件
|
|
878
900
|
// 参数:
|
|
879
901
|
// path: 指定路径
|
|
880
902
|
function isFile(path) {
|
|
881
|
-
return callNative(getFuncName$
|
|
903
|
+
return callNative(getFuncName$5('isFile'), { path: path });
|
|
882
904
|
}
|
|
883
905
|
// 检测一个路径是否为一个目录
|
|
884
906
|
// 参数:
|
|
885
907
|
// path: 指定路径
|
|
886
908
|
function isDirectory(path) {
|
|
887
|
-
return callNative(getFuncName$
|
|
909
|
+
return callNative(getFuncName$5('isDirectory'), { path: path });
|
|
888
910
|
}
|
|
889
911
|
// 检测一个路径表示的文件或目录 是否是隐藏的
|
|
890
912
|
// 参数:
|
|
891
913
|
// path: 指定路径
|
|
892
914
|
function isHidden(path) {
|
|
893
|
-
return callNative(getFuncName$
|
|
915
|
+
return callNative(getFuncName$5('isHidden'), { path: path });
|
|
894
916
|
}
|
|
895
917
|
// 检测一个路径表示的文件或目录 是否可读
|
|
896
918
|
// 参数:
|
|
897
919
|
// path: 指定路径
|
|
898
920
|
function canRead(path) {
|
|
899
|
-
return callNative(getFuncName$
|
|
921
|
+
return callNative(getFuncName$5('canRead'), { path: path });
|
|
900
922
|
}
|
|
901
923
|
// 检测一个路径表示的文件或目录 是否可写
|
|
902
924
|
// 参数:
|
|
903
925
|
// path: 指定路径
|
|
904
926
|
function canWrite(path) {
|
|
905
|
-
return callNative(getFuncName$
|
|
927
|
+
return callNative(getFuncName$5('canWrite'), { path: path });
|
|
906
928
|
}
|
|
907
929
|
// 检测一个路径表示的文件或目录 是否可执行
|
|
908
930
|
// 参数:
|
|
909
931
|
// path: 指定路径
|
|
910
932
|
function canExecute(path) {
|
|
911
|
-
return callNative(getFuncName$
|
|
933
|
+
return callNative(getFuncName$5('canExecute'), { path: path });
|
|
912
934
|
}
|
|
913
935
|
// 检测一个路径表示的文件或目录 的最后修改的时间,返回时间戳(1970年开始的秒数)
|
|
914
936
|
// 参数:
|
|
915
937
|
// path: 指定路径
|
|
916
938
|
function lastModified(path) {
|
|
917
|
-
return callNative(getFuncName$
|
|
939
|
+
return callNative(getFuncName$5('lastModified'), { path: path });
|
|
918
940
|
}
|
|
919
941
|
// 删除文件
|
|
920
942
|
// 参数:
|
|
921
943
|
// path: 指定路径
|
|
922
944
|
function deleteIt(path) {
|
|
923
|
-
return callNative(getFuncName$
|
|
945
|
+
return callNative(getFuncName$5('delete'), { path: path });
|
|
924
946
|
}
|
|
925
947
|
// 新建目录
|
|
926
948
|
// 参数:
|
|
927
949
|
// path: 指定路径
|
|
928
950
|
function mkdir(path) {
|
|
929
|
-
return callNative(getFuncName$
|
|
951
|
+
return callNative(getFuncName$5('mkdir'), { path: path });
|
|
930
952
|
}
|
|
931
953
|
// 新建目录 (如果父目录补存在则一并新建所有尚未存在的父目录)
|
|
932
954
|
// 参数:
|
|
933
955
|
// path: 指定路径
|
|
934
956
|
function mkdirs(path) {
|
|
935
|
-
return callNative(getFuncName$
|
|
957
|
+
return callNative(getFuncName$5('mkdirs'), { path: path });
|
|
936
958
|
}
|
|
937
959
|
// 改名
|
|
938
960
|
// 参数:
|
|
939
961
|
// from: 指定源路径
|
|
940
962
|
// to: 指定目标路径
|
|
941
963
|
function rename(from, to) {
|
|
942
|
-
return callNative(getFuncName$
|
|
964
|
+
return callNative(getFuncName$5('rename'), { from: from, to: to });
|
|
943
965
|
}
|
|
944
966
|
// 将相对路径的转换为全路径
|
|
945
967
|
// 参数:
|
|
946
968
|
// path: 指定路径
|
|
947
969
|
function getAbsolutePath(path) {
|
|
948
|
-
return callNative(getFuncName$
|
|
970
|
+
return callNative(getFuncName$5('getAbsolutePath'), { path: path });
|
|
949
971
|
}
|
|
950
972
|
// 指定路径创建新文件
|
|
951
973
|
// 参数:
|
|
952
974
|
// path: 指定路径
|
|
953
975
|
function createNewFile(path) {
|
|
954
|
-
return callNative(getFuncName$
|
|
976
|
+
return callNative(getFuncName$5('createNewFile'), { path: path });
|
|
955
977
|
}
|
|
956
978
|
// 设置可读属性
|
|
957
979
|
// 参数:
|
|
@@ -959,7 +981,7 @@ function createNewFile(path) {
|
|
|
959
981
|
// value: 是否可读
|
|
960
982
|
function setReadable(path, value) {
|
|
961
983
|
if (value === void 0) { value = true; }
|
|
962
|
-
return callNative(getFuncName$
|
|
984
|
+
return callNative(getFuncName$5('setReadable'), { path: path, value: value });
|
|
963
985
|
}
|
|
964
986
|
// 设置可写属性
|
|
965
987
|
// 参数:
|
|
@@ -967,7 +989,7 @@ function setReadable(path, value) {
|
|
|
967
989
|
// value: 是否可写
|
|
968
990
|
function setWritable(path, value) {
|
|
969
991
|
if (value === void 0) { value = true; }
|
|
970
|
-
return callNative(getFuncName$
|
|
992
|
+
return callNative(getFuncName$5('setWritable'), { path: path, value: value });
|
|
971
993
|
}
|
|
972
994
|
// 设置可执行属性
|
|
973
995
|
// 参数:
|
|
@@ -975,7 +997,7 @@ function setWritable(path, value) {
|
|
|
975
997
|
// value: 是否可执行
|
|
976
998
|
function setExecutable(path, value) {
|
|
977
999
|
if (value === void 0) { value = true; }
|
|
978
|
-
return callNative(getFuncName$
|
|
1000
|
+
return callNative(getFuncName$5('setExecutable'), { path: path, value: value });
|
|
979
1001
|
}
|
|
980
1002
|
// 设置文件最后修改的时间
|
|
981
1003
|
// 参数:
|
|
@@ -983,13 +1005,13 @@ function setExecutable(path, value) {
|
|
|
983
1005
|
// value: 时间戳
|
|
984
1006
|
function setLastModified(path, value) {
|
|
985
1007
|
if (value === void 0) { value = 0; }
|
|
986
|
-
return callNative(getFuncName$
|
|
1008
|
+
return callNative(getFuncName$5('setLastModified'), { path: path, value: value });
|
|
987
1009
|
}
|
|
988
1010
|
// 读取目录,返回该目录下的文件列表
|
|
989
1011
|
// 参数:
|
|
990
1012
|
// path: 指定路径
|
|
991
1013
|
function list(path) {
|
|
992
|
-
return callNative(getFuncName$
|
|
1014
|
+
return callNative(getFuncName$5('list'), { path: path });
|
|
993
1015
|
}
|
|
994
1016
|
// 打开只读文件流
|
|
995
1017
|
// 参数:
|
|
@@ -997,7 +1019,7 @@ function list(path) {
|
|
|
997
1019
|
// 返回:
|
|
998
1020
|
// streamId: 流的ID
|
|
999
1021
|
function openInputStream(path) {
|
|
1000
|
-
return callNative(getFuncName$
|
|
1022
|
+
return callNative(getFuncName$5('openInputStream'), { path: path });
|
|
1001
1023
|
}
|
|
1002
1024
|
// 打开只写文件流
|
|
1003
1025
|
// 参数:
|
|
@@ -1005,13 +1027,13 @@ function openInputStream(path) {
|
|
|
1005
1027
|
// 返回:
|
|
1006
1028
|
// streamId: 流的ID
|
|
1007
1029
|
function openOutputStream(path) {
|
|
1008
|
-
return callNative(getFuncName$
|
|
1030
|
+
return callNative(getFuncName$5('openOutputStream'), { path: path });
|
|
1009
1031
|
}
|
|
1010
1032
|
// 关闭文件流(可以是只读流,也可以是只写流)
|
|
1011
1033
|
// 参数:
|
|
1012
1034
|
// streamId: 流的ID
|
|
1013
1035
|
function closeStream(streamId) {
|
|
1014
|
-
return callNative(getFuncName$
|
|
1036
|
+
return callNative(getFuncName$5('closeStream'), { streamId: streamId });
|
|
1015
1037
|
}
|
|
1016
1038
|
// 读取文件流的内容
|
|
1017
1039
|
// 参数:
|
|
@@ -1020,7 +1042,7 @@ function closeStream(streamId) {
|
|
|
1020
1042
|
// base64Flag: 是否以base64的形式返回(默认以普通字符串的形式返回,如果读取二进制文件,则应该设置为以base64的形式返回)
|
|
1021
1043
|
function readStream(streamId, size, base64Flag) {
|
|
1022
1044
|
if (base64Flag === void 0) { base64Flag = false; }
|
|
1023
|
-
return callNative(getFuncName$
|
|
1045
|
+
return callNative(getFuncName$5('readStream'), { streamId: streamId, size: size, base64Flag: base64Flag });
|
|
1024
1046
|
}
|
|
1025
1047
|
// 将内容写入文件流
|
|
1026
1048
|
// 参数:
|
|
@@ -1029,7 +1051,7 @@ function readStream(streamId, size, base64Flag) {
|
|
|
1029
1051
|
// base64Flag: 是否以base64的形式传递要写入的内容(默认写入普通字符串的文本,如果要写入二进制数据,则应该设置为以base64的形式的内容)
|
|
1030
1052
|
function writeStream(streamId, content, base64Flag) {
|
|
1031
1053
|
if (base64Flag === void 0) { base64Flag = false; }
|
|
1032
|
-
return callNative(getFuncName$
|
|
1054
|
+
return callNative(getFuncName$5('writeStream'), { streamId: streamId, content: content, base64Flag: base64Flag });
|
|
1033
1055
|
}
|
|
1034
1056
|
var fs = {
|
|
1035
1057
|
readAllContent: readAllContent,
|
|
@@ -1064,19 +1086,19 @@ var fs = {
|
|
|
1064
1086
|
writeStream: writeStream,
|
|
1065
1087
|
};
|
|
1066
1088
|
|
|
1067
|
-
var moduleName$
|
|
1068
|
-
function getFuncName$
|
|
1069
|
-
return moduleName$
|
|
1089
|
+
var moduleName$4 = 'pag';
|
|
1090
|
+
function getFuncName$4(name) {
|
|
1091
|
+
return moduleName$4 + '_' + name;
|
|
1070
1092
|
}
|
|
1071
1093
|
// 播放PAG动画
|
|
1072
1094
|
// repeat: 循环次数 -1 表示无限
|
|
1073
1095
|
//
|
|
1074
1096
|
function startNewPagAni(params) {
|
|
1075
|
-
return callNative(getFuncName$
|
|
1097
|
+
return callNative(getFuncName$4('startNewPagAni'), params);
|
|
1076
1098
|
}
|
|
1077
1099
|
// 停止PAG动画,并消失
|
|
1078
1100
|
function stopPagAni() {
|
|
1079
|
-
return callNative(getFuncName$
|
|
1101
|
+
return callNative(getFuncName$4('stopPagAni'), null);
|
|
1080
1102
|
}
|
|
1081
1103
|
function setPagVisibility(visible) {
|
|
1082
1104
|
if (visible === void 0) { visible = true; }
|
|
@@ -1093,10 +1115,10 @@ function setPagVisibility(visible) {
|
|
|
1093
1115
|
else {
|
|
1094
1116
|
value = visible;
|
|
1095
1117
|
}
|
|
1096
|
-
return callNative(getFuncName$
|
|
1118
|
+
return callNative(getFuncName$4('setPagVisibility'), { visible: value });
|
|
1097
1119
|
}
|
|
1098
1120
|
function setPagXY(x, y) {
|
|
1099
|
-
return callNative(getFuncName$
|
|
1121
|
+
return callNative(getFuncName$4('setPagXY'), { x: x, y: y });
|
|
1100
1122
|
}
|
|
1101
1123
|
// // 播报 TTS 文本语音
|
|
1102
1124
|
// export function sendTts(text: string, ttsId: string): Promise<any> {
|
|
@@ -1139,68 +1161,88 @@ var pag = {
|
|
|
1139
1161
|
// clearBackground,
|
|
1140
1162
|
};
|
|
1141
1163
|
|
|
1142
|
-
var moduleName$
|
|
1143
|
-
function getFuncName$
|
|
1144
|
-
return moduleName$
|
|
1164
|
+
var moduleName$3 = 'voice';
|
|
1165
|
+
function getFuncName$3(name) {
|
|
1166
|
+
return moduleName$3 + '_' + name;
|
|
1145
1167
|
}
|
|
1146
1168
|
// 开启语音输入
|
|
1147
1169
|
function enableVoiceInput(clientId, parameters, expandedParameters) {
|
|
1148
1170
|
if (clientId === void 0) { clientId = ''; }
|
|
1149
1171
|
if (parameters === void 0) { parameters = {}; }
|
|
1150
1172
|
if (expandedParameters === void 0) { expandedParameters = {}; }
|
|
1151
|
-
return callNative(getFuncName$
|
|
1173
|
+
return callNative(getFuncName$3('enableVoiceInput'), { clientId: clientId, parameters: parameters, expandedParameters: expandedParameters });
|
|
1152
1174
|
}
|
|
1153
1175
|
// 关闭语音输入
|
|
1154
1176
|
function disableVoiceInput() {
|
|
1155
|
-
return callNative(getFuncName$
|
|
1177
|
+
return callNative(getFuncName$3('disableVoiceInput'), {});
|
|
1156
1178
|
}
|
|
1157
1179
|
// 开启意图识别指令返回
|
|
1158
1180
|
function enableDirective(enable) {
|
|
1159
1181
|
if (enable === void 0) { enable = true; }
|
|
1160
|
-
return callNative(getFuncName$
|
|
1182
|
+
return callNative(getFuncName$3('enableDirective'), { enable: enable });
|
|
1161
1183
|
}
|
|
1162
1184
|
// 开启意图识别指令返回
|
|
1163
1185
|
function setDirective(enable) {
|
|
1164
1186
|
if (enable === void 0) { enable = true; }
|
|
1165
|
-
return callNative(getFuncName$
|
|
1187
|
+
return callNative(getFuncName$3('setDirective'), { enable: enable });
|
|
1166
1188
|
}
|
|
1167
1189
|
// 开启录音功能
|
|
1168
1190
|
function enableRecording() {
|
|
1169
|
-
return callNative(getFuncName$
|
|
1191
|
+
return callNative(getFuncName$3('enableRecording'), {});
|
|
1170
1192
|
}
|
|
1171
1193
|
// 关闭录音功能
|
|
1172
1194
|
function disableRecording() {
|
|
1173
|
-
return callNative(getFuncName$
|
|
1195
|
+
return callNative(getFuncName$3('disableRecording'), {});
|
|
1174
1196
|
}
|
|
1175
1197
|
// 停止TTS播报
|
|
1176
1198
|
//
|
|
1177
1199
|
function stopTts$1() {
|
|
1178
|
-
return callNative(getFuncName$
|
|
1200
|
+
return callNative(getFuncName$3('stopTts'), {});
|
|
1179
1201
|
}
|
|
1180
1202
|
// 开始 TTS 播报
|
|
1181
1203
|
function sendTts$1(text, ttsId) {
|
|
1182
|
-
return callNative(getFuncName$
|
|
1204
|
+
return callNative(getFuncName$3('sendTts'), { text: text, ttsId: ttsId });
|
|
1183
1205
|
}
|
|
1184
1206
|
// 流式播报 TTS
|
|
1185
1207
|
function sendStreamTts$1(text, ttsId, isFirst, isEnd) {
|
|
1186
|
-
return callNative(getFuncName$
|
|
1208
|
+
return callNative(getFuncName$3('sendStreamTts'), { text: text, ttsId: ttsId, isFirst: isFirst, isEnd: isEnd });
|
|
1187
1209
|
}
|
|
1188
1210
|
// 设置播放TTS的人声
|
|
1189
1211
|
function setTtsSpeaker(speaker) {
|
|
1190
|
-
return callNative(getFuncName$
|
|
1212
|
+
return callNative(getFuncName$3('setTtsSpeaker'), { speaker: speaker });
|
|
1191
1213
|
}
|
|
1192
1214
|
// 设置播放TTS的音速
|
|
1193
1215
|
function setTtsSpeed(speed) {
|
|
1194
|
-
return callNative(getFuncName$
|
|
1216
|
+
return callNative(getFuncName$3('setTtsSpeed'), { speed: speed });
|
|
1195
1217
|
}
|
|
1196
1218
|
// 发送纯文本
|
|
1197
|
-
function sendVoiceTextToAI(text) {
|
|
1198
|
-
|
|
1219
|
+
function sendVoiceTextToAI(text, params) {
|
|
1220
|
+
if (params === void 0) { params = undefined; }
|
|
1221
|
+
var t;
|
|
1222
|
+
if (params) {
|
|
1223
|
+
t = { text: text, params: params };
|
|
1224
|
+
}
|
|
1225
|
+
else {
|
|
1226
|
+
t = { text: text };
|
|
1227
|
+
}
|
|
1228
|
+
return callNative(getFuncName$3('sendVoiceTextToAI'), t);
|
|
1229
|
+
}
|
|
1230
|
+
// 发送纯文本 (功能同sendVoiceTextToAI, 仅仅缩小API方法名称)
|
|
1231
|
+
function sendText(text, params) {
|
|
1232
|
+
if (params === void 0) { params = undefined; }
|
|
1233
|
+
var t;
|
|
1234
|
+
if (params) {
|
|
1235
|
+
t = { text: text, params: params };
|
|
1236
|
+
}
|
|
1237
|
+
else {
|
|
1238
|
+
t = { text: text };
|
|
1239
|
+
}
|
|
1240
|
+
return callNative(getFuncName$3('sendVoiceTextToAI'), t);
|
|
1199
1241
|
}
|
|
1200
1242
|
// 开启意图识别指令返回
|
|
1201
1243
|
function setA2UI(enable) {
|
|
1202
1244
|
if (enable === void 0) { enable = true; }
|
|
1203
|
-
return callNative(getFuncName$
|
|
1245
|
+
return callNative(getFuncName$3('setA2UI'), { enable: enable });
|
|
1204
1246
|
}
|
|
1205
1247
|
var voice = {
|
|
1206
1248
|
enableVoiceInput: enableVoiceInput,
|
|
@@ -1215,6 +1257,7 @@ var voice = {
|
|
|
1215
1257
|
setTtsSpeaker: setTtsSpeaker,
|
|
1216
1258
|
setTtsSpeed: setTtsSpeed,
|
|
1217
1259
|
sendVoiceTextToAI: sendVoiceTextToAI,
|
|
1260
|
+
sendText: sendText,
|
|
1218
1261
|
setA2UI: setA2UI,
|
|
1219
1262
|
};
|
|
1220
1263
|
|
|
@@ -1237,18 +1280,18 @@ var event = {
|
|
|
1237
1280
|
removeEventListener: removeEventListener,
|
|
1238
1281
|
};
|
|
1239
1282
|
|
|
1240
|
-
var moduleName$
|
|
1241
|
-
function getFuncName$
|
|
1242
|
-
return moduleName$
|
|
1283
|
+
var moduleName$2 = 'log';
|
|
1284
|
+
function getFuncName$2(name) {
|
|
1285
|
+
return moduleName$2 + '_' + name;
|
|
1243
1286
|
}
|
|
1244
1287
|
function init$1(logInitInfo) {
|
|
1245
|
-
return callNative(getFuncName$
|
|
1288
|
+
return callNative(getFuncName$2('init'), logInitInfo);
|
|
1246
1289
|
}
|
|
1247
1290
|
function submit(logData) {
|
|
1248
|
-
return callNative(getFuncName$
|
|
1291
|
+
return callNative(getFuncName$2('submit'), logData);
|
|
1249
1292
|
}
|
|
1250
1293
|
function submitToByte(logData) {
|
|
1251
|
-
return callNative(getFuncName$
|
|
1294
|
+
return callNative(getFuncName$2('submitToByte'), logData);
|
|
1252
1295
|
}
|
|
1253
1296
|
var log = {
|
|
1254
1297
|
init: init$1,
|
|
@@ -1256,22 +1299,22 @@ var log = {
|
|
|
1256
1299
|
submitToByte: submitToByte,
|
|
1257
1300
|
};
|
|
1258
1301
|
|
|
1259
|
-
var moduleName = 'tts';
|
|
1260
|
-
function getFuncName(name) {
|
|
1261
|
-
return moduleName + '_' + name;
|
|
1302
|
+
var moduleName$1 = 'tts';
|
|
1303
|
+
function getFuncName$1(name) {
|
|
1304
|
+
return moduleName$1 + '_' + name;
|
|
1262
1305
|
}
|
|
1263
1306
|
// 停止TTS播报
|
|
1264
1307
|
//
|
|
1265
1308
|
function stopTts() {
|
|
1266
|
-
return callNative(getFuncName('stopTts'), {});
|
|
1309
|
+
return callNative(getFuncName$1('stopTts'), {});
|
|
1267
1310
|
}
|
|
1268
1311
|
// 开始 TTS 播报
|
|
1269
1312
|
function sendTts(text, ttsId) {
|
|
1270
|
-
return callNative(getFuncName('sendTts'), { text: text, ttsId: ttsId });
|
|
1313
|
+
return callNative(getFuncName$1('sendTts'), { text: text, ttsId: ttsId });
|
|
1271
1314
|
}
|
|
1272
1315
|
// 流式播报 TTS
|
|
1273
1316
|
function sendStreamTts(text, ttsId, isFirst, isEnd) {
|
|
1274
|
-
return callNative(getFuncName('sendStreamTts'), { text: text, ttsId: ttsId, isFirst: isFirst, isEnd: isEnd });
|
|
1317
|
+
return callNative(getFuncName$1('sendStreamTts'), { text: text, ttsId: ttsId, isFirst: isFirst, isEnd: isEnd });
|
|
1275
1318
|
}
|
|
1276
1319
|
var tts = {
|
|
1277
1320
|
stopTts: stopTts,
|
|
@@ -1279,6 +1322,41 @@ var tts = {
|
|
|
1279
1322
|
sendStreamTts: sendStreamTts,
|
|
1280
1323
|
};
|
|
1281
1324
|
|
|
1325
|
+
var moduleName = 'user';
|
|
1326
|
+
function getFuncName(name) {
|
|
1327
|
+
return moduleName + '_' + name;
|
|
1328
|
+
}
|
|
1329
|
+
function getUserInfo() {
|
|
1330
|
+
return callNative(getFuncName('getUserInfo'), null);
|
|
1331
|
+
}
|
|
1332
|
+
function refreshGroupData() {
|
|
1333
|
+
return callNative(getFuncName('refreshGroupData'), null);
|
|
1334
|
+
}
|
|
1335
|
+
function switchGroupRole(id) {
|
|
1336
|
+
return callNative(getFuncName('switchGroupRole'), { id: id });
|
|
1337
|
+
}
|
|
1338
|
+
function switchChildRole(id) {
|
|
1339
|
+
return callNative(getFuncName('switchChildRole'), { id: id });
|
|
1340
|
+
}
|
|
1341
|
+
function launchGroupUI() {
|
|
1342
|
+
return callNative(getFuncName('launchGroupUI'), null);
|
|
1343
|
+
}
|
|
1344
|
+
function launchSwitchGroupRoleUI() {
|
|
1345
|
+
return callNative(getFuncName('launchSwitchGroupRoleUI'), null);
|
|
1346
|
+
}
|
|
1347
|
+
function launchSwitchChildRoleUI() {
|
|
1348
|
+
return callNative(getFuncName('launchSwitchChildRoleUI'), null);
|
|
1349
|
+
}
|
|
1350
|
+
var user = {
|
|
1351
|
+
getUserInfo: getUserInfo,
|
|
1352
|
+
refreshGroupData: refreshGroupData,
|
|
1353
|
+
switchGroupRole: switchGroupRole,
|
|
1354
|
+
switchChildRole: switchChildRole,
|
|
1355
|
+
launchGroupUI: launchGroupUI,
|
|
1356
|
+
launchSwitchGroupRoleUI: launchSwitchGroupRoleUI,
|
|
1357
|
+
launchSwitchChildRoleUI: launchSwitchChildRoleUI,
|
|
1358
|
+
};
|
|
1359
|
+
|
|
1282
1360
|
function apkNativeCallJs(str) {
|
|
1283
1361
|
var res = null;
|
|
1284
1362
|
//console.log('str1=' + str);
|
|
@@ -1344,6 +1422,7 @@ var index = {
|
|
|
1344
1422
|
event: event,
|
|
1345
1423
|
log: log,
|
|
1346
1424
|
fs: fs,
|
|
1425
|
+
user: user,
|
|
1347
1426
|
tts: tts,
|
|
1348
1427
|
apkNativeCallJs: apkNativeCallJs,
|
|
1349
1428
|
isRunInAppBrowser: isRunInAppBrowser
|
package/lib/index.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ declare const _default: {
|
|
|
25
25
|
getInstalledAppInfo: typeof import("./app").getInstalledAppInfo;
|
|
26
26
|
getInstalledAppsList: typeof import("./app").getInstalledAppsList;
|
|
27
27
|
execActionString: typeof import("./app").execActionString;
|
|
28
|
+
getApplicationEnabledSetting: typeof import("./app").getApplicationEnabledSetting;
|
|
29
|
+
getComponentEnabledSetting: typeof import("./app").getComponentEnabledSetting;
|
|
28
30
|
};
|
|
29
31
|
system: {
|
|
30
32
|
ready: typeof import("./system").ready;
|
|
@@ -42,6 +44,9 @@ declare const _default: {
|
|
|
42
44
|
registerKeys: typeof import("./system").registerKeys;
|
|
43
45
|
unregisterKeys: typeof import("./system").unregisterKeys;
|
|
44
46
|
providerCall: typeof import("./system").providerCall;
|
|
47
|
+
isPluginReady: typeof import("./system").isPluginReady;
|
|
48
|
+
callPlugin: typeof import("./system").callPlugin;
|
|
49
|
+
runShell: typeof import("./system").runShell;
|
|
45
50
|
};
|
|
46
51
|
storage: {
|
|
47
52
|
setKey: typeof import("./storage").setKey;
|
|
@@ -111,6 +116,7 @@ declare const _default: {
|
|
|
111
116
|
setTtsSpeaker: typeof import("./voice").setTtsSpeaker;
|
|
112
117
|
setTtsSpeed: typeof import("./voice").setTtsSpeed;
|
|
113
118
|
sendVoiceTextToAI: typeof import("./voice").sendVoiceTextToAI;
|
|
119
|
+
sendText: typeof import("./voice").sendText;
|
|
114
120
|
setA2UI: typeof import("./voice").setA2UI;
|
|
115
121
|
};
|
|
116
122
|
event: {
|
|
@@ -154,6 +160,15 @@ declare const _default: {
|
|
|
154
160
|
readStream: typeof import("./file").readStream;
|
|
155
161
|
writeStream: typeof import("./file").writeStream;
|
|
156
162
|
};
|
|
163
|
+
user: {
|
|
164
|
+
getUserInfo: typeof import("./user").getUserInfo;
|
|
165
|
+
refreshGroupData: typeof import("./user").refreshGroupData;
|
|
166
|
+
switchGroupRole: typeof import("./user").switchGroupRole;
|
|
167
|
+
switchChildRole: typeof import("./user").switchChildRole;
|
|
168
|
+
launchGroupUI: typeof import("./user").launchGroupUI;
|
|
169
|
+
launchSwitchGroupRoleUI: typeof import("./user").launchSwitchGroupRoleUI;
|
|
170
|
+
launchSwitchChildRoleUI: typeof import("./user").launchSwitchChildRoleUI;
|
|
171
|
+
};
|
|
157
172
|
tts: {
|
|
158
173
|
stopTts: typeof import("./tts").stopTts;
|
|
159
174
|
sendTts: typeof import("./tts").sendTts;
|
package/lib/system/index.d.ts
CHANGED
|
@@ -29,6 +29,9 @@ export declare function sendBroadcast(params: IntentParam): Promise<any>;
|
|
|
29
29
|
export declare function registerKeys(params: SystemKeyParam | null): Promise<any>;
|
|
30
30
|
export declare function unregisterKeys(params: SystemKeyParam | null): Promise<any>;
|
|
31
31
|
export declare function providerCall(params: ProviderCallParam): Promise<any>;
|
|
32
|
+
export declare function isPluginReady(pluginName: string): Promise<any>;
|
|
33
|
+
export declare function callPlugin(pluginName: string, funcName: string, syncMode?: boolean, params?: any): Promise<any>;
|
|
34
|
+
export declare function runShell(commandString: string): Promise<any>;
|
|
32
35
|
declare const _default: {
|
|
33
36
|
ready: typeof ready;
|
|
34
37
|
getStartupParams: typeof getStartupParams;
|
|
@@ -45,5 +48,8 @@ declare const _default: {
|
|
|
45
48
|
registerKeys: typeof registerKeys;
|
|
46
49
|
unregisterKeys: typeof unregisterKeys;
|
|
47
50
|
providerCall: typeof providerCall;
|
|
51
|
+
isPluginReady: typeof isPluginReady;
|
|
52
|
+
callPlugin: typeof callPlugin;
|
|
53
|
+
runShell: typeof runShell;
|
|
48
54
|
};
|
|
49
55
|
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare function getUserInfo(): Promise<any>;
|
|
2
|
+
export declare function refreshGroupData(): Promise<any>;
|
|
3
|
+
export declare function switchGroupRole(id: string): Promise<any>;
|
|
4
|
+
export declare function switchChildRole(id: string): Promise<any>;
|
|
5
|
+
export declare function launchGroupUI(): Promise<any>;
|
|
6
|
+
export declare function launchSwitchGroupRoleUI(): Promise<any>;
|
|
7
|
+
export declare function launchSwitchChildRoleUI(): Promise<any>;
|
|
8
|
+
declare const _default: {
|
|
9
|
+
getUserInfo: typeof getUserInfo;
|
|
10
|
+
refreshGroupData: typeof refreshGroupData;
|
|
11
|
+
switchGroupRole: typeof switchGroupRole;
|
|
12
|
+
switchChildRole: typeof switchChildRole;
|
|
13
|
+
launchGroupUI: typeof launchGroupUI;
|
|
14
|
+
launchSwitchGroupRoleUI: typeof launchSwitchGroupRoleUI;
|
|
15
|
+
launchSwitchChildRoleUI: typeof launchSwitchChildRoleUI;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
package/lib/voice/index.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ export declare function sendTts(text: string, ttsId: string): Promise<any>;
|
|
|
9
9
|
export declare function sendStreamTts(text: string, ttsId: string, isFirst: boolean, isEnd: boolean): Promise<any>;
|
|
10
10
|
export declare function setTtsSpeaker(speaker: string): Promise<any>;
|
|
11
11
|
export declare function setTtsSpeed(speed: number): Promise<any>;
|
|
12
|
-
export declare function sendVoiceTextToAI(text: string): Promise<any>;
|
|
12
|
+
export declare function sendVoiceTextToAI(text: string, params?: any): Promise<any>;
|
|
13
|
+
export declare function sendText(text: string, params?: any): Promise<any>;
|
|
13
14
|
export declare function setA2UI(enable?: boolean): Promise<any>;
|
|
14
15
|
declare const _default: {
|
|
15
16
|
enableVoiceInput: typeof enableVoiceInput;
|
|
@@ -24,6 +25,7 @@ declare const _default: {
|
|
|
24
25
|
setTtsSpeaker: typeof setTtsSpeaker;
|
|
25
26
|
setTtsSpeed: typeof setTtsSpeed;
|
|
26
27
|
sendVoiceTextToAI: typeof sendVoiceTextToAI;
|
|
28
|
+
sendText: typeof sendText;
|
|
27
29
|
setA2UI: typeof setA2UI;
|
|
28
30
|
};
|
|
29
31
|
export default _default;
|