@ccos/ccsdk-lite 1.0.27 → 1.0.29
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 +232 -162
- package/lib/index.d.ts +13 -0
- package/lib/user/index.d.ts +17 -0
- package/lib/voice/index.d.ts +5 -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,77 @@ 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);
|
|
556
564
|
}
|
|
557
565
|
var system = {
|
|
558
566
|
ready: ready,
|
|
@@ -573,41 +581,41 @@ var system = {
|
|
|
573
581
|
//sendEvent
|
|
574
582
|
};
|
|
575
583
|
|
|
576
|
-
var moduleName$
|
|
577
|
-
function getFuncName$
|
|
578
|
-
return moduleName$
|
|
584
|
+
var moduleName$8 = 'storage';
|
|
585
|
+
function getFuncName$8(name) {
|
|
586
|
+
return moduleName$8 + '_' + name;
|
|
579
587
|
}
|
|
580
588
|
function setKey(key, value, namespace) {
|
|
581
589
|
if (namespace === void 0) { namespace = ''; }
|
|
582
|
-
return callNative(getFuncName$
|
|
590
|
+
return callNative(getFuncName$8('setKey'), { key: key, value: value, namespace: namespace });
|
|
583
591
|
}
|
|
584
592
|
function getKey(key, namespace) {
|
|
585
593
|
if (namespace === void 0) { namespace = ''; }
|
|
586
|
-
return callNative(getFuncName$
|
|
594
|
+
return callNative(getFuncName$8('getKey'), { key: key, namespace: namespace });
|
|
587
595
|
}
|
|
588
596
|
function deleteKey(key, namespace) {
|
|
589
597
|
if (namespace === void 0) { namespace = ''; }
|
|
590
|
-
return callNative(getFuncName$
|
|
598
|
+
return callNative(getFuncName$8('deleteKey'), { key: key, namespace: namespace });
|
|
591
599
|
}
|
|
592
600
|
function clearAllKeys(namespace) {
|
|
593
601
|
if (namespace === void 0) { namespace = ''; }
|
|
594
|
-
return callNative(getFuncName$
|
|
602
|
+
return callNative(getFuncName$8('clearAllKeys'), { namespace: namespace });
|
|
595
603
|
}
|
|
596
604
|
function setLargeKey(key, value, namespace) {
|
|
597
605
|
if (namespace === void 0) { namespace = ''; }
|
|
598
|
-
return callNative(getFuncName$
|
|
606
|
+
return callNative(getFuncName$8('setLargeKey'), { key: key, value: value, namespace: namespace });
|
|
599
607
|
}
|
|
600
608
|
function getLargeKey(key, namespace) {
|
|
601
609
|
if (namespace === void 0) { namespace = ''; }
|
|
602
|
-
return callNative(getFuncName$
|
|
610
|
+
return callNative(getFuncName$8('getLargeKey'), { key: key, namespace: namespace });
|
|
603
611
|
}
|
|
604
612
|
function deleteLargeKey(key, namespace) {
|
|
605
613
|
if (namespace === void 0) { namespace = ''; }
|
|
606
|
-
return callNative(getFuncName$
|
|
614
|
+
return callNative(getFuncName$8('deleteLargeKey'), { key: key, namespace: namespace });
|
|
607
615
|
}
|
|
608
616
|
function clearAllLargeKey(namespace) {
|
|
609
617
|
if (namespace === void 0) { namespace = ''; }
|
|
610
|
-
return callNative(getFuncName$
|
|
618
|
+
return callNative(getFuncName$8('clearAllLargeKey'), { namespace: namespace });
|
|
611
619
|
}
|
|
612
620
|
var storage = {
|
|
613
621
|
setKey: setKey,
|
|
@@ -620,54 +628,54 @@ var storage = {
|
|
|
620
628
|
clearAllLargeKey: clearAllLargeKey,
|
|
621
629
|
};
|
|
622
630
|
|
|
623
|
-
var moduleName$
|
|
624
|
-
function getFuncName$
|
|
625
|
-
return moduleName$
|
|
631
|
+
var moduleName$7 = 'audio';
|
|
632
|
+
function getFuncName$7(name) {
|
|
633
|
+
return moduleName$7 + '_' + name;
|
|
626
634
|
}
|
|
627
635
|
// 播放器,播放新的URL或者本地文件系统的路径
|
|
628
636
|
function playNew(path) {
|
|
629
|
-
return callNative(getFuncName$
|
|
637
|
+
return callNative(getFuncName$7('playNew'), { path: path });
|
|
630
638
|
}
|
|
631
639
|
// 播放器,停止播放
|
|
632
640
|
function stop$1() {
|
|
633
|
-
return callNative(getFuncName$
|
|
641
|
+
return callNative(getFuncName$7('stop'), null);
|
|
634
642
|
}
|
|
635
643
|
// 播放器,是否正在播放中
|
|
636
644
|
function isPlaying$1() {
|
|
637
|
-
return callNative(getFuncName$
|
|
645
|
+
return callNative(getFuncName$7('isPlaying'), null);
|
|
638
646
|
}
|
|
639
647
|
// 播放器,是否准备好
|
|
640
648
|
function hasPrepared$1() {
|
|
641
|
-
return callNative(getFuncName$
|
|
649
|
+
return callNative(getFuncName$7('hasPrepared'), null);
|
|
642
650
|
}
|
|
643
651
|
// 播放器,获取总时长
|
|
644
652
|
function getDuration$1() {
|
|
645
|
-
return callNative(getFuncName$
|
|
653
|
+
return callNative(getFuncName$7('getDuration'), null);
|
|
646
654
|
}
|
|
647
655
|
// 播放器,获取当前进度值
|
|
648
656
|
function getCurrentPosition$1() {
|
|
649
|
-
return callNative(getFuncName$
|
|
657
|
+
return callNative(getFuncName$7('getCurrentPosition'), null);
|
|
650
658
|
}
|
|
651
659
|
// 播放器,获取播放状态,返回的value为字符串来标识播放状态
|
|
652
660
|
// 例如:Idle, Initialized, Preparing, Prepared, Started, Paused, Stopped, Completed, Error, End
|
|
653
661
|
function getPlayerState$1() {
|
|
654
|
-
return callNative(getFuncName$
|
|
662
|
+
return callNative(getFuncName$7('getPlayerState'), null);
|
|
655
663
|
}
|
|
656
664
|
// 播放器,暂停播放
|
|
657
665
|
function pause$1() {
|
|
658
|
-
return callNative(getFuncName$
|
|
666
|
+
return callNative(getFuncName$7('pause'), null);
|
|
659
667
|
}
|
|
660
668
|
// 播放器,启动播放或者从暂停恢复播放
|
|
661
669
|
function start$1() {
|
|
662
|
-
return callNative(getFuncName$
|
|
670
|
+
return callNative(getFuncName$7('start'), null);
|
|
663
671
|
}
|
|
664
672
|
// 播放器,重新播放
|
|
665
673
|
function rePlay$1() {
|
|
666
|
-
return callNative(getFuncName$
|
|
674
|
+
return callNative(getFuncName$7('rePlay'), null);
|
|
667
675
|
}
|
|
668
676
|
// 播放器,seek
|
|
669
677
|
function seekTo$1(position) {
|
|
670
|
-
return callNative(getFuncName$
|
|
678
|
+
return callNative(getFuncName$7('seekTo'), { position: Math.floor(position) });
|
|
671
679
|
}
|
|
672
680
|
// 播放器,设置单片循环模式
|
|
673
681
|
// isLooping: 是否循环播放
|
|
@@ -675,16 +683,16 @@ function seekTo$1(position) {
|
|
|
675
683
|
// 会无感知重播,即重播时,不会调idle/ preparing/ prepared等开始播放之前的状态)
|
|
676
684
|
function setLooping$1(isLooping, silentLoop) {
|
|
677
685
|
if (silentLoop === void 0) { silentLoop = false; }
|
|
678
|
-
return callNative(getFuncName$
|
|
686
|
+
return callNative(getFuncName$7('setLooping'), { isLooping: isLooping, silentLoop: silentLoop });
|
|
679
687
|
}
|
|
680
688
|
// 设置音量
|
|
681
689
|
function setVolume(volume) {
|
|
682
|
-
return callNative(getFuncName$
|
|
690
|
+
return callNative(getFuncName$7('setVolume'), { volume: volume });
|
|
683
691
|
}
|
|
684
692
|
// 设置播放内核
|
|
685
693
|
// 值: DefaultPlayer, MediaPlayer, SocPlayer, ExoPlayer
|
|
686
694
|
function setPlayerCore$1(core) {
|
|
687
|
-
return callNative(getFuncName$
|
|
695
|
+
return callNative(getFuncName$7('setPlayerCore'), { core: core });
|
|
688
696
|
}
|
|
689
697
|
var audio = {
|
|
690
698
|
playNew: playNew,
|
|
@@ -703,62 +711,62 @@ var audio = {
|
|
|
703
711
|
setPlayerCore: setPlayerCore$1,
|
|
704
712
|
};
|
|
705
713
|
|
|
706
|
-
var moduleName$
|
|
707
|
-
function getFuncName$
|
|
708
|
-
return moduleName$
|
|
714
|
+
var moduleName$6 = 'video';
|
|
715
|
+
function getFuncName$6(name) {
|
|
716
|
+
return moduleName$6 + '_' + name;
|
|
709
717
|
}
|
|
710
718
|
// 设置视频播放窗口的位置与宽高
|
|
711
719
|
function setVideoLayout(width, height, x, y) {
|
|
712
|
-
return callNative(getFuncName$
|
|
720
|
+
return callNative(getFuncName$6('setVideoLayout'), { x: Number(x), y: Number(y), w: Number(width), h: Number(height) });
|
|
713
721
|
}
|
|
714
722
|
// 设置视频窗口是否显示
|
|
715
723
|
function setVideoVisible(show) {
|
|
716
|
-
return callNative(getFuncName$
|
|
724
|
+
return callNative(getFuncName$6('setVideoVisible'), { visible: show });
|
|
717
725
|
}
|
|
718
726
|
// 播放器,播放新的URL
|
|
719
727
|
function playNewUrl(url) {
|
|
720
|
-
return callNative(getFuncName$
|
|
728
|
+
return callNative(getFuncName$6('playNewUrl'), { url: url });
|
|
721
729
|
}
|
|
722
730
|
// 播放器,播放新的本地文件路径
|
|
723
731
|
function playNewFile(path) {
|
|
724
|
-
return callNative(getFuncName$
|
|
732
|
+
return callNative(getFuncName$6('playNewFile'), { path: path });
|
|
725
733
|
}
|
|
726
734
|
// 播放器,停止播放
|
|
727
735
|
function stop() {
|
|
728
|
-
return callNative(getFuncName$
|
|
736
|
+
return callNative(getFuncName$6('stop'), null);
|
|
729
737
|
}
|
|
730
738
|
// 播放器,暂停播放
|
|
731
739
|
function pause() {
|
|
732
|
-
return callNative(getFuncName$
|
|
740
|
+
return callNative(getFuncName$6('pause'), null);
|
|
733
741
|
}
|
|
734
742
|
// 播放器,启动播放或者从暂停恢复播放
|
|
735
743
|
function start() {
|
|
736
|
-
return callNative(getFuncName$
|
|
744
|
+
return callNative(getFuncName$6('start'), null);
|
|
737
745
|
}
|
|
738
746
|
// 播放器,seek
|
|
739
747
|
function seekTo(position) {
|
|
740
|
-
return callNative(getFuncName$
|
|
748
|
+
return callNative(getFuncName$6('seekTo'), { position: Math.floor(position) });
|
|
741
749
|
}
|
|
742
750
|
// 播放器,是否准备好
|
|
743
751
|
function hasPrepared() {
|
|
744
|
-
return callNative(getFuncName$
|
|
752
|
+
return callNative(getFuncName$6('hasPrepared'), null);
|
|
745
753
|
}
|
|
746
754
|
// 播放器,是否正在播放中
|
|
747
755
|
function isPlaying() {
|
|
748
|
-
return callNative(getFuncName$
|
|
756
|
+
return callNative(getFuncName$6('isPlaying'), null);
|
|
749
757
|
}
|
|
750
758
|
// 播放器,获取总时长
|
|
751
759
|
function getDuration() {
|
|
752
|
-
return callNative(getFuncName$
|
|
760
|
+
return callNative(getFuncName$6('getDuration'), null);
|
|
753
761
|
}
|
|
754
762
|
// 播放器,获取当前进度值
|
|
755
763
|
function getCurrentPosition() {
|
|
756
|
-
return callNative(getFuncName$
|
|
764
|
+
return callNative(getFuncName$6('getCurrentPosition'), null);
|
|
757
765
|
}
|
|
758
766
|
// 播放器,获取播放状态,返回的value为字符串来标识播放状态
|
|
759
767
|
// 例如:Idle, Initialized, Preparing, Prepared, Started, Paused, Stopped, Completed, Error, End
|
|
760
768
|
function getPlayerState() {
|
|
761
|
-
return callNative(getFuncName$
|
|
769
|
+
return callNative(getFuncName$6('getPlayerState'), null);
|
|
762
770
|
}
|
|
763
771
|
// 播放器,设置单片循环模式
|
|
764
772
|
// isLooping: 是否循环播放
|
|
@@ -766,40 +774,40 @@ function getPlayerState() {
|
|
|
766
774
|
// 会无感知重播,即重播时,不会调idle/ preparing/ prepared等开始播放之前的状态)
|
|
767
775
|
function setLooping(isLooping, silentLoop) {
|
|
768
776
|
if (silentLoop === void 0) { silentLoop = false; }
|
|
769
|
-
return callNative(getFuncName$
|
|
777
|
+
return callNative(getFuncName$6('setLooping'), { isLooping: isLooping, silentLoop: silentLoop });
|
|
770
778
|
}
|
|
771
779
|
// 播放器,设置自动屏保锁,即:开始或恢复播放->锁屏保,停止或暂停播放->释放屏保锁 默认关闭
|
|
772
780
|
function setAutoWakeLock(autoWakeLock) {
|
|
773
|
-
return callNative(getFuncName$
|
|
781
|
+
return callNative(getFuncName$6('setAutoWakeLock'), { autoWakeLock: autoWakeLock });
|
|
774
782
|
}
|
|
775
783
|
// 播放器,重新播放
|
|
776
784
|
function rePlay() {
|
|
777
|
-
return callNative(getFuncName$
|
|
785
|
+
return callNative(getFuncName$6('rePlay'), null);
|
|
778
786
|
}
|
|
779
787
|
// 播放器,设置是否自动播放,即 play ready 后音视频自动播放 默认开启
|
|
780
788
|
function setPlayWhenReady(playWhenReady) {
|
|
781
789
|
if (playWhenReady === void 0) { playWhenReady = true; }
|
|
782
|
-
return callNative(getFuncName$
|
|
790
|
+
return callNative(getFuncName$6('setPlayWhenReady'), { playWhenReady: playWhenReady });
|
|
783
791
|
}
|
|
784
792
|
// 获取当前设置的播放内核, 有可能会返回 DefaultPlayer
|
|
785
793
|
// 值: DefaultPlayer, MediaPlayer, SocPlayer, ExoPlayer
|
|
786
794
|
function getPlayerCore() {
|
|
787
|
-
return callNative(getFuncName$
|
|
795
|
+
return callNative(getFuncName$6('getPlayerCore'), null);
|
|
788
796
|
}
|
|
789
797
|
// 获取实际的播放内核, 部分内核如:最佳内核,实际上是在各个内核中进行选择,不会返回 DefaultPlayer
|
|
790
798
|
// 值: MediaPlayer, SocPlayer, ExoPlayer
|
|
791
799
|
function getRealPlayerCore() {
|
|
792
|
-
return callNative(getFuncName$
|
|
800
|
+
return callNative(getFuncName$6('getRealPlayerCore'), null);
|
|
793
801
|
}
|
|
794
802
|
// 设置播放内核
|
|
795
803
|
// 值: DefaultPlayer, MediaPlayer, SocPlayer, ExoPlayer
|
|
796
804
|
function setPlayerCore(core) {
|
|
797
|
-
return callNative(getFuncName$
|
|
805
|
+
return callNative(getFuncName$6('setPlayerCore'), { core: core });
|
|
798
806
|
}
|
|
799
807
|
// 设置渲染模式
|
|
800
808
|
// 值: SurfaceView, TextureView
|
|
801
809
|
function setRenderType(playerRender) {
|
|
802
|
-
return callNative(getFuncName$
|
|
810
|
+
return callNative(getFuncName$6('setRenderType'), { playerRender: playerRender });
|
|
803
811
|
}
|
|
804
812
|
var video = {
|
|
805
813
|
setVideoLayout: setVideoLayout,
|
|
@@ -825,9 +833,9 @@ var video = {
|
|
|
825
833
|
setRenderType: setRenderType,
|
|
826
834
|
};
|
|
827
835
|
|
|
828
|
-
var moduleName$
|
|
829
|
-
function getFuncName$
|
|
830
|
-
return moduleName$
|
|
836
|
+
var moduleName$5 = 'fs';
|
|
837
|
+
function getFuncName$5(name) {
|
|
838
|
+
return moduleName$5 + '_' + name;
|
|
831
839
|
}
|
|
832
840
|
// 读取文件并返回文件的所有内容
|
|
833
841
|
// 参数:
|
|
@@ -835,7 +843,7 @@ function getFuncName$4(name) {
|
|
|
835
843
|
// base64Flag: 是否以base64编码方式返回, 如果读取文本文件,则应该设置 base64Flag = false,如果读取二进制文件,则应该设置 base64Flag = true
|
|
836
844
|
function readAllContent(path, base64Flag) {
|
|
837
845
|
if (base64Flag === void 0) { base64Flag = false; }
|
|
838
|
-
return callNative(getFuncName$
|
|
846
|
+
return callNative(getFuncName$5('readAllContent'), { path: path, base64Flag: base64Flag });
|
|
839
847
|
}
|
|
840
848
|
// 将内容全部写入文件
|
|
841
849
|
// 参数:
|
|
@@ -844,114 +852,114 @@ function readAllContent(path, base64Flag) {
|
|
|
844
852
|
// base64Flag: 是否以base64编码方式传输content, 如果写文本文件,则应该设置 base64Flag = false,如果写入二进制文件,则应该设置 base64Flag = true
|
|
845
853
|
function writeAllContent(path, content, base64Flag) {
|
|
846
854
|
if (base64Flag === void 0) { base64Flag = false; }
|
|
847
|
-
return callNative(getFuncName$
|
|
855
|
+
return callNative(getFuncName$5('writeAllContent'), { path: path, content: content, base64Flag: base64Flag });
|
|
848
856
|
}
|
|
849
857
|
// 获取应用基本目录的全路径名
|
|
850
858
|
function getAppBaseDir() {
|
|
851
|
-
return callNative(getFuncName$
|
|
859
|
+
return callNative(getFuncName$5('getAppBaseDir'), null);
|
|
852
860
|
}
|
|
853
861
|
// 获取 Cache 目录的全路径名
|
|
854
862
|
function getAppCacheDir() {
|
|
855
|
-
return callNative(getFuncName$
|
|
863
|
+
return callNative(getFuncName$5('getAppCacheDir'), null);
|
|
856
864
|
}
|
|
857
865
|
// 构建一个临时文件名,返回该文件的绝对路径的全文件路径名
|
|
858
866
|
// 参数:
|
|
859
867
|
// fileName: 指定临时文件的基本名,如果不指定,会默认随机生成一个文件名
|
|
860
868
|
function makeCacheFile(fileName) {
|
|
861
869
|
if (fileName === void 0) { fileName = ''; }
|
|
862
|
-
return callNative(getFuncName$
|
|
870
|
+
return callNative(getFuncName$5('makeCacheFile'), { fileName: fileName });
|
|
863
871
|
}
|
|
864
872
|
// 构建一个正常文件名,返回该文件的绝对路径的全文件路径名
|
|
865
873
|
// 参数:
|
|
866
874
|
// fileName: 指定文件的基本名,如果不指定,会默认随机生成一个文件名
|
|
867
875
|
function makeNormalFile(fileName) {
|
|
868
876
|
if (fileName === void 0) { fileName = ''; }
|
|
869
|
-
return callNative(getFuncName$
|
|
877
|
+
return callNative(getFuncName$5('makeNormalFile'), { fileName: fileName });
|
|
870
878
|
}
|
|
871
879
|
// 检测一个文件或者目录是否存在
|
|
872
880
|
// 参数:
|
|
873
881
|
// path: 指定路径
|
|
874
882
|
function exists(path) {
|
|
875
|
-
return callNative(getFuncName$
|
|
883
|
+
return callNative(getFuncName$5('exists'), { path: path });
|
|
876
884
|
}
|
|
877
885
|
// 检测一个路径是否为一个普通文件
|
|
878
886
|
// 参数:
|
|
879
887
|
// path: 指定路径
|
|
880
888
|
function isFile(path) {
|
|
881
|
-
return callNative(getFuncName$
|
|
889
|
+
return callNative(getFuncName$5('isFile'), { path: path });
|
|
882
890
|
}
|
|
883
891
|
// 检测一个路径是否为一个目录
|
|
884
892
|
// 参数:
|
|
885
893
|
// path: 指定路径
|
|
886
894
|
function isDirectory(path) {
|
|
887
|
-
return callNative(getFuncName$
|
|
895
|
+
return callNative(getFuncName$5('isDirectory'), { path: path });
|
|
888
896
|
}
|
|
889
897
|
// 检测一个路径表示的文件或目录 是否是隐藏的
|
|
890
898
|
// 参数:
|
|
891
899
|
// path: 指定路径
|
|
892
900
|
function isHidden(path) {
|
|
893
|
-
return callNative(getFuncName$
|
|
901
|
+
return callNative(getFuncName$5('isHidden'), { path: path });
|
|
894
902
|
}
|
|
895
903
|
// 检测一个路径表示的文件或目录 是否可读
|
|
896
904
|
// 参数:
|
|
897
905
|
// path: 指定路径
|
|
898
906
|
function canRead(path) {
|
|
899
|
-
return callNative(getFuncName$
|
|
907
|
+
return callNative(getFuncName$5('canRead'), { path: path });
|
|
900
908
|
}
|
|
901
909
|
// 检测一个路径表示的文件或目录 是否可写
|
|
902
910
|
// 参数:
|
|
903
911
|
// path: 指定路径
|
|
904
912
|
function canWrite(path) {
|
|
905
|
-
return callNative(getFuncName$
|
|
913
|
+
return callNative(getFuncName$5('canWrite'), { path: path });
|
|
906
914
|
}
|
|
907
915
|
// 检测一个路径表示的文件或目录 是否可执行
|
|
908
916
|
// 参数:
|
|
909
917
|
// path: 指定路径
|
|
910
918
|
function canExecute(path) {
|
|
911
|
-
return callNative(getFuncName$
|
|
919
|
+
return callNative(getFuncName$5('canExecute'), { path: path });
|
|
912
920
|
}
|
|
913
921
|
// 检测一个路径表示的文件或目录 的最后修改的时间,返回时间戳(1970年开始的秒数)
|
|
914
922
|
// 参数:
|
|
915
923
|
// path: 指定路径
|
|
916
924
|
function lastModified(path) {
|
|
917
|
-
return callNative(getFuncName$
|
|
925
|
+
return callNative(getFuncName$5('lastModified'), { path: path });
|
|
918
926
|
}
|
|
919
927
|
// 删除文件
|
|
920
928
|
// 参数:
|
|
921
929
|
// path: 指定路径
|
|
922
930
|
function deleteIt(path) {
|
|
923
|
-
return callNative(getFuncName$
|
|
931
|
+
return callNative(getFuncName$5('delete'), { path: path });
|
|
924
932
|
}
|
|
925
933
|
// 新建目录
|
|
926
934
|
// 参数:
|
|
927
935
|
// path: 指定路径
|
|
928
936
|
function mkdir(path) {
|
|
929
|
-
return callNative(getFuncName$
|
|
937
|
+
return callNative(getFuncName$5('mkdir'), { path: path });
|
|
930
938
|
}
|
|
931
939
|
// 新建目录 (如果父目录补存在则一并新建所有尚未存在的父目录)
|
|
932
940
|
// 参数:
|
|
933
941
|
// path: 指定路径
|
|
934
942
|
function mkdirs(path) {
|
|
935
|
-
return callNative(getFuncName$
|
|
943
|
+
return callNative(getFuncName$5('mkdirs'), { path: path });
|
|
936
944
|
}
|
|
937
945
|
// 改名
|
|
938
946
|
// 参数:
|
|
939
947
|
// from: 指定源路径
|
|
940
948
|
// to: 指定目标路径
|
|
941
949
|
function rename(from, to) {
|
|
942
|
-
return callNative(getFuncName$
|
|
950
|
+
return callNative(getFuncName$5('rename'), { from: from, to: to });
|
|
943
951
|
}
|
|
944
952
|
// 将相对路径的转换为全路径
|
|
945
953
|
// 参数:
|
|
946
954
|
// path: 指定路径
|
|
947
955
|
function getAbsolutePath(path) {
|
|
948
|
-
return callNative(getFuncName$
|
|
956
|
+
return callNative(getFuncName$5('getAbsolutePath'), { path: path });
|
|
949
957
|
}
|
|
950
958
|
// 指定路径创建新文件
|
|
951
959
|
// 参数:
|
|
952
960
|
// path: 指定路径
|
|
953
961
|
function createNewFile(path) {
|
|
954
|
-
return callNative(getFuncName$
|
|
962
|
+
return callNative(getFuncName$5('createNewFile'), { path: path });
|
|
955
963
|
}
|
|
956
964
|
// 设置可读属性
|
|
957
965
|
// 参数:
|
|
@@ -959,7 +967,7 @@ function createNewFile(path) {
|
|
|
959
967
|
// value: 是否可读
|
|
960
968
|
function setReadable(path, value) {
|
|
961
969
|
if (value === void 0) { value = true; }
|
|
962
|
-
return callNative(getFuncName$
|
|
970
|
+
return callNative(getFuncName$5('setReadable'), { path: path, value: value });
|
|
963
971
|
}
|
|
964
972
|
// 设置可写属性
|
|
965
973
|
// 参数:
|
|
@@ -967,7 +975,7 @@ function setReadable(path, value) {
|
|
|
967
975
|
// value: 是否可写
|
|
968
976
|
function setWritable(path, value) {
|
|
969
977
|
if (value === void 0) { value = true; }
|
|
970
|
-
return callNative(getFuncName$
|
|
978
|
+
return callNative(getFuncName$5('setWritable'), { path: path, value: value });
|
|
971
979
|
}
|
|
972
980
|
// 设置可执行属性
|
|
973
981
|
// 参数:
|
|
@@ -975,7 +983,7 @@ function setWritable(path, value) {
|
|
|
975
983
|
// value: 是否可执行
|
|
976
984
|
function setExecutable(path, value) {
|
|
977
985
|
if (value === void 0) { value = true; }
|
|
978
|
-
return callNative(getFuncName$
|
|
986
|
+
return callNative(getFuncName$5('setExecutable'), { path: path, value: value });
|
|
979
987
|
}
|
|
980
988
|
// 设置文件最后修改的时间
|
|
981
989
|
// 参数:
|
|
@@ -983,13 +991,13 @@ function setExecutable(path, value) {
|
|
|
983
991
|
// value: 时间戳
|
|
984
992
|
function setLastModified(path, value) {
|
|
985
993
|
if (value === void 0) { value = 0; }
|
|
986
|
-
return callNative(getFuncName$
|
|
994
|
+
return callNative(getFuncName$5('setLastModified'), { path: path, value: value });
|
|
987
995
|
}
|
|
988
996
|
// 读取目录,返回该目录下的文件列表
|
|
989
997
|
// 参数:
|
|
990
998
|
// path: 指定路径
|
|
991
999
|
function list(path) {
|
|
992
|
-
return callNative(getFuncName$
|
|
1000
|
+
return callNative(getFuncName$5('list'), { path: path });
|
|
993
1001
|
}
|
|
994
1002
|
// 打开只读文件流
|
|
995
1003
|
// 参数:
|
|
@@ -997,7 +1005,7 @@ function list(path) {
|
|
|
997
1005
|
// 返回:
|
|
998
1006
|
// streamId: 流的ID
|
|
999
1007
|
function openInputStream(path) {
|
|
1000
|
-
return callNative(getFuncName$
|
|
1008
|
+
return callNative(getFuncName$5('openInputStream'), { path: path });
|
|
1001
1009
|
}
|
|
1002
1010
|
// 打开只写文件流
|
|
1003
1011
|
// 参数:
|
|
@@ -1005,13 +1013,13 @@ function openInputStream(path) {
|
|
|
1005
1013
|
// 返回:
|
|
1006
1014
|
// streamId: 流的ID
|
|
1007
1015
|
function openOutputStream(path) {
|
|
1008
|
-
return callNative(getFuncName$
|
|
1016
|
+
return callNative(getFuncName$5('openOutputStream'), { path: path });
|
|
1009
1017
|
}
|
|
1010
1018
|
// 关闭文件流(可以是只读流,也可以是只写流)
|
|
1011
1019
|
// 参数:
|
|
1012
1020
|
// streamId: 流的ID
|
|
1013
1021
|
function closeStream(streamId) {
|
|
1014
|
-
return callNative(getFuncName$
|
|
1022
|
+
return callNative(getFuncName$5('closeStream'), { streamId: streamId });
|
|
1015
1023
|
}
|
|
1016
1024
|
// 读取文件流的内容
|
|
1017
1025
|
// 参数:
|
|
@@ -1020,7 +1028,7 @@ function closeStream(streamId) {
|
|
|
1020
1028
|
// base64Flag: 是否以base64的形式返回(默认以普通字符串的形式返回,如果读取二进制文件,则应该设置为以base64的形式返回)
|
|
1021
1029
|
function readStream(streamId, size, base64Flag) {
|
|
1022
1030
|
if (base64Flag === void 0) { base64Flag = false; }
|
|
1023
|
-
return callNative(getFuncName$
|
|
1031
|
+
return callNative(getFuncName$5('readStream'), { streamId: streamId, size: size, base64Flag: base64Flag });
|
|
1024
1032
|
}
|
|
1025
1033
|
// 将内容写入文件流
|
|
1026
1034
|
// 参数:
|
|
@@ -1029,7 +1037,7 @@ function readStream(streamId, size, base64Flag) {
|
|
|
1029
1037
|
// base64Flag: 是否以base64的形式传递要写入的内容(默认写入普通字符串的文本,如果要写入二进制数据,则应该设置为以base64的形式的内容)
|
|
1030
1038
|
function writeStream(streamId, content, base64Flag) {
|
|
1031
1039
|
if (base64Flag === void 0) { base64Flag = false; }
|
|
1032
|
-
return callNative(getFuncName$
|
|
1040
|
+
return callNative(getFuncName$5('writeStream'), { streamId: streamId, content: content, base64Flag: base64Flag });
|
|
1033
1041
|
}
|
|
1034
1042
|
var fs = {
|
|
1035
1043
|
readAllContent: readAllContent,
|
|
@@ -1064,19 +1072,19 @@ var fs = {
|
|
|
1064
1072
|
writeStream: writeStream,
|
|
1065
1073
|
};
|
|
1066
1074
|
|
|
1067
|
-
var moduleName$
|
|
1068
|
-
function getFuncName$
|
|
1069
|
-
return moduleName$
|
|
1075
|
+
var moduleName$4 = 'pag';
|
|
1076
|
+
function getFuncName$4(name) {
|
|
1077
|
+
return moduleName$4 + '_' + name;
|
|
1070
1078
|
}
|
|
1071
1079
|
// 播放PAG动画
|
|
1072
1080
|
// repeat: 循环次数 -1 表示无限
|
|
1073
1081
|
//
|
|
1074
1082
|
function startNewPagAni(params) {
|
|
1075
|
-
return callNative(getFuncName$
|
|
1083
|
+
return callNative(getFuncName$4('startNewPagAni'), params);
|
|
1076
1084
|
}
|
|
1077
1085
|
// 停止PAG动画,并消失
|
|
1078
1086
|
function stopPagAni() {
|
|
1079
|
-
return callNative(getFuncName$
|
|
1087
|
+
return callNative(getFuncName$4('stopPagAni'), null);
|
|
1080
1088
|
}
|
|
1081
1089
|
function setPagVisibility(visible) {
|
|
1082
1090
|
if (visible === void 0) { visible = true; }
|
|
@@ -1093,10 +1101,10 @@ function setPagVisibility(visible) {
|
|
|
1093
1101
|
else {
|
|
1094
1102
|
value = visible;
|
|
1095
1103
|
}
|
|
1096
|
-
return callNative(getFuncName$
|
|
1104
|
+
return callNative(getFuncName$4('setPagVisibility'), { visible: value });
|
|
1097
1105
|
}
|
|
1098
1106
|
function setPagXY(x, y) {
|
|
1099
|
-
return callNative(getFuncName$
|
|
1107
|
+
return callNative(getFuncName$4('setPagXY'), { x: x, y: y });
|
|
1100
1108
|
}
|
|
1101
1109
|
// // 播报 TTS 文本语音
|
|
1102
1110
|
// export function sendTts(text: string, ttsId: string): Promise<any> {
|
|
@@ -1139,64 +1147,88 @@ var pag = {
|
|
|
1139
1147
|
// clearBackground,
|
|
1140
1148
|
};
|
|
1141
1149
|
|
|
1142
|
-
var moduleName$
|
|
1143
|
-
function getFuncName$
|
|
1144
|
-
return moduleName$
|
|
1150
|
+
var moduleName$3 = 'voice';
|
|
1151
|
+
function getFuncName$3(name) {
|
|
1152
|
+
return moduleName$3 + '_' + name;
|
|
1145
1153
|
}
|
|
1146
1154
|
// 开启语音输入
|
|
1147
1155
|
function enableVoiceInput(clientId, parameters, expandedParameters) {
|
|
1148
1156
|
if (clientId === void 0) { clientId = ''; }
|
|
1149
1157
|
if (parameters === void 0) { parameters = {}; }
|
|
1150
1158
|
if (expandedParameters === void 0) { expandedParameters = {}; }
|
|
1151
|
-
return callNative(getFuncName$
|
|
1159
|
+
return callNative(getFuncName$3('enableVoiceInput'), { clientId: clientId, parameters: parameters, expandedParameters: expandedParameters });
|
|
1152
1160
|
}
|
|
1153
1161
|
// 关闭语音输入
|
|
1154
1162
|
function disableVoiceInput() {
|
|
1155
|
-
return callNative(getFuncName$
|
|
1163
|
+
return callNative(getFuncName$3('disableVoiceInput'), {});
|
|
1156
1164
|
}
|
|
1157
1165
|
// 开启意图识别指令返回
|
|
1158
1166
|
function enableDirective(enable) {
|
|
1159
1167
|
if (enable === void 0) { enable = true; }
|
|
1160
|
-
return callNative(getFuncName$
|
|
1168
|
+
return callNative(getFuncName$3('enableDirective'), { enable: enable });
|
|
1161
1169
|
}
|
|
1162
1170
|
// 开启意图识别指令返回
|
|
1163
1171
|
function setDirective(enable) {
|
|
1164
1172
|
if (enable === void 0) { enable = true; }
|
|
1165
|
-
return callNative(getFuncName$
|
|
1173
|
+
return callNative(getFuncName$3('setDirective'), { enable: enable });
|
|
1166
1174
|
}
|
|
1167
1175
|
// 开启录音功能
|
|
1168
1176
|
function enableRecording() {
|
|
1169
|
-
return callNative(getFuncName$
|
|
1177
|
+
return callNative(getFuncName$3('enableRecording'), {});
|
|
1170
1178
|
}
|
|
1171
1179
|
// 关闭录音功能
|
|
1172
1180
|
function disableRecording() {
|
|
1173
|
-
return callNative(getFuncName$
|
|
1181
|
+
return callNative(getFuncName$3('disableRecording'), {});
|
|
1174
1182
|
}
|
|
1175
1183
|
// 停止TTS播报
|
|
1176
1184
|
//
|
|
1177
1185
|
function stopTts$1() {
|
|
1178
|
-
return callNative(getFuncName$
|
|
1186
|
+
return callNative(getFuncName$3('stopTts'), {});
|
|
1179
1187
|
}
|
|
1180
1188
|
// 开始 TTS 播报
|
|
1181
1189
|
function sendTts$1(text, ttsId) {
|
|
1182
|
-
return callNative(getFuncName$
|
|
1190
|
+
return callNative(getFuncName$3('sendTts'), { text: text, ttsId: ttsId });
|
|
1183
1191
|
}
|
|
1184
1192
|
// 流式播报 TTS
|
|
1185
1193
|
function sendStreamTts$1(text, ttsId, isFirst, isEnd) {
|
|
1186
|
-
return callNative(getFuncName$
|
|
1194
|
+
return callNative(getFuncName$3('sendStreamTts'), { text: text, ttsId: ttsId, isFirst: isFirst, isEnd: isEnd });
|
|
1187
1195
|
}
|
|
1188
1196
|
// 设置播放TTS的人声
|
|
1189
1197
|
function setTtsSpeaker(speaker) {
|
|
1190
|
-
return callNative(getFuncName$
|
|
1198
|
+
return callNative(getFuncName$3('setTtsSpeaker'), { speaker: speaker });
|
|
1199
|
+
}
|
|
1200
|
+
// 设置播放TTS的音速
|
|
1201
|
+
function setTtsSpeed(speed) {
|
|
1202
|
+
return callNative(getFuncName$3('setTtsSpeed'), { speed: speed });
|
|
1191
1203
|
}
|
|
1192
1204
|
// 发送纯文本
|
|
1193
|
-
function sendVoiceTextToAI(text) {
|
|
1194
|
-
|
|
1205
|
+
function sendVoiceTextToAI(text, params) {
|
|
1206
|
+
if (params === void 0) { params = undefined; }
|
|
1207
|
+
var t;
|
|
1208
|
+
if (params) {
|
|
1209
|
+
t = { text: text, params: params };
|
|
1210
|
+
}
|
|
1211
|
+
else {
|
|
1212
|
+
t = { text: text };
|
|
1213
|
+
}
|
|
1214
|
+
return callNative(getFuncName$3('sendVoiceTextToAI'), t);
|
|
1215
|
+
}
|
|
1216
|
+
// 发送纯文本 (功能同sendVoiceTextToAI, 仅仅缩小API方法名称)
|
|
1217
|
+
function sendText(text, params) {
|
|
1218
|
+
if (params === void 0) { params = undefined; }
|
|
1219
|
+
var t;
|
|
1220
|
+
if (params) {
|
|
1221
|
+
t = { text: text, params: params };
|
|
1222
|
+
}
|
|
1223
|
+
else {
|
|
1224
|
+
t = { text: text };
|
|
1225
|
+
}
|
|
1226
|
+
return callNative(getFuncName$3('sendVoiceTextToAI'), t);
|
|
1195
1227
|
}
|
|
1196
1228
|
// 开启意图识别指令返回
|
|
1197
1229
|
function setA2UI(enable) {
|
|
1198
1230
|
if (enable === void 0) { enable = true; }
|
|
1199
|
-
return callNative(getFuncName$
|
|
1231
|
+
return callNative(getFuncName$3('setA2UI'), { enable: enable });
|
|
1200
1232
|
}
|
|
1201
1233
|
var voice = {
|
|
1202
1234
|
enableVoiceInput: enableVoiceInput,
|
|
@@ -1209,7 +1241,9 @@ var voice = {
|
|
|
1209
1241
|
sendTts: sendTts$1,
|
|
1210
1242
|
sendStreamTts: sendStreamTts$1,
|
|
1211
1243
|
setTtsSpeaker: setTtsSpeaker,
|
|
1244
|
+
setTtsSpeed: setTtsSpeed,
|
|
1212
1245
|
sendVoiceTextToAI: sendVoiceTextToAI,
|
|
1246
|
+
sendText: sendText,
|
|
1213
1247
|
setA2UI: setA2UI,
|
|
1214
1248
|
};
|
|
1215
1249
|
|
|
@@ -1232,18 +1266,18 @@ var event = {
|
|
|
1232
1266
|
removeEventListener: removeEventListener,
|
|
1233
1267
|
};
|
|
1234
1268
|
|
|
1235
|
-
var moduleName$
|
|
1236
|
-
function getFuncName$
|
|
1237
|
-
return moduleName$
|
|
1269
|
+
var moduleName$2 = 'log';
|
|
1270
|
+
function getFuncName$2(name) {
|
|
1271
|
+
return moduleName$2 + '_' + name;
|
|
1238
1272
|
}
|
|
1239
1273
|
function init$1(logInitInfo) {
|
|
1240
|
-
return callNative(getFuncName$
|
|
1274
|
+
return callNative(getFuncName$2('init'), logInitInfo);
|
|
1241
1275
|
}
|
|
1242
1276
|
function submit(logData) {
|
|
1243
|
-
return callNative(getFuncName$
|
|
1277
|
+
return callNative(getFuncName$2('submit'), logData);
|
|
1244
1278
|
}
|
|
1245
1279
|
function submitToByte(logData) {
|
|
1246
|
-
return callNative(getFuncName$
|
|
1280
|
+
return callNative(getFuncName$2('submitToByte'), logData);
|
|
1247
1281
|
}
|
|
1248
1282
|
var log = {
|
|
1249
1283
|
init: init$1,
|
|
@@ -1251,22 +1285,22 @@ var log = {
|
|
|
1251
1285
|
submitToByte: submitToByte,
|
|
1252
1286
|
};
|
|
1253
1287
|
|
|
1254
|
-
var moduleName = 'tts';
|
|
1255
|
-
function getFuncName(name) {
|
|
1256
|
-
return moduleName + '_' + name;
|
|
1288
|
+
var moduleName$1 = 'tts';
|
|
1289
|
+
function getFuncName$1(name) {
|
|
1290
|
+
return moduleName$1 + '_' + name;
|
|
1257
1291
|
}
|
|
1258
1292
|
// 停止TTS播报
|
|
1259
1293
|
//
|
|
1260
1294
|
function stopTts() {
|
|
1261
|
-
return callNative(getFuncName('stopTts'), {});
|
|
1295
|
+
return callNative(getFuncName$1('stopTts'), {});
|
|
1262
1296
|
}
|
|
1263
1297
|
// 开始 TTS 播报
|
|
1264
1298
|
function sendTts(text, ttsId) {
|
|
1265
|
-
return callNative(getFuncName('sendTts'), { text: text, ttsId: ttsId });
|
|
1299
|
+
return callNative(getFuncName$1('sendTts'), { text: text, ttsId: ttsId });
|
|
1266
1300
|
}
|
|
1267
1301
|
// 流式播报 TTS
|
|
1268
1302
|
function sendStreamTts(text, ttsId, isFirst, isEnd) {
|
|
1269
|
-
return callNative(getFuncName('sendStreamTts'), { text: text, ttsId: ttsId, isFirst: isFirst, isEnd: isEnd });
|
|
1303
|
+
return callNative(getFuncName$1('sendStreamTts'), { text: text, ttsId: ttsId, isFirst: isFirst, isEnd: isEnd });
|
|
1270
1304
|
}
|
|
1271
1305
|
var tts = {
|
|
1272
1306
|
stopTts: stopTts,
|
|
@@ -1274,6 +1308,41 @@ var tts = {
|
|
|
1274
1308
|
sendStreamTts: sendStreamTts,
|
|
1275
1309
|
};
|
|
1276
1310
|
|
|
1311
|
+
var moduleName = 'user';
|
|
1312
|
+
function getFuncName(name) {
|
|
1313
|
+
return moduleName + '_' + name;
|
|
1314
|
+
}
|
|
1315
|
+
function getUserInfo() {
|
|
1316
|
+
return callNative(getFuncName('getUserInfo'), null);
|
|
1317
|
+
}
|
|
1318
|
+
function refreshGroupData() {
|
|
1319
|
+
return callNative(getFuncName('refreshGroupData'), null);
|
|
1320
|
+
}
|
|
1321
|
+
function switchGroupRole(id) {
|
|
1322
|
+
return callNative(getFuncName('switchGroupRole'), { id: id });
|
|
1323
|
+
}
|
|
1324
|
+
function switchChildRole(id) {
|
|
1325
|
+
return callNative(getFuncName('switchChildRole'), { id: id });
|
|
1326
|
+
}
|
|
1327
|
+
function launchGroupUI() {
|
|
1328
|
+
return callNative(getFuncName('launchGroupUI'), null);
|
|
1329
|
+
}
|
|
1330
|
+
function launchSwitchGroupRoleUI() {
|
|
1331
|
+
return callNative(getFuncName('launchSwitchGroupRoleUI'), null);
|
|
1332
|
+
}
|
|
1333
|
+
function launchSwitchChildRoleUI() {
|
|
1334
|
+
return callNative(getFuncName('launchSwitchChildRoleUI'), null);
|
|
1335
|
+
}
|
|
1336
|
+
var user = {
|
|
1337
|
+
getUserInfo: getUserInfo,
|
|
1338
|
+
refreshGroupData: refreshGroupData,
|
|
1339
|
+
switchGroupRole: switchGroupRole,
|
|
1340
|
+
switchChildRole: switchChildRole,
|
|
1341
|
+
launchGroupUI: launchGroupUI,
|
|
1342
|
+
launchSwitchGroupRoleUI: launchSwitchGroupRoleUI,
|
|
1343
|
+
launchSwitchChildRoleUI: launchSwitchChildRoleUI,
|
|
1344
|
+
};
|
|
1345
|
+
|
|
1277
1346
|
function apkNativeCallJs(str) {
|
|
1278
1347
|
var res = null;
|
|
1279
1348
|
//console.log('str1=' + str);
|
|
@@ -1339,6 +1408,7 @@ var index = {
|
|
|
1339
1408
|
event: event,
|
|
1340
1409
|
log: log,
|
|
1341
1410
|
fs: fs,
|
|
1411
|
+
user: user,
|
|
1342
1412
|
tts: tts,
|
|
1343
1413
|
apkNativeCallJs: apkNativeCallJs,
|
|
1344
1414
|
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;
|
|
@@ -109,7 +111,9 @@ declare const _default: {
|
|
|
109
111
|
sendTts: typeof import("./voice").sendTts;
|
|
110
112
|
sendStreamTts: typeof import("./voice").sendStreamTts;
|
|
111
113
|
setTtsSpeaker: typeof import("./voice").setTtsSpeaker;
|
|
114
|
+
setTtsSpeed: typeof import("./voice").setTtsSpeed;
|
|
112
115
|
sendVoiceTextToAI: typeof import("./voice").sendVoiceTextToAI;
|
|
116
|
+
sendText: typeof import("./voice").sendText;
|
|
113
117
|
setA2UI: typeof import("./voice").setA2UI;
|
|
114
118
|
};
|
|
115
119
|
event: {
|
|
@@ -153,6 +157,15 @@ declare const _default: {
|
|
|
153
157
|
readStream: typeof import("./file").readStream;
|
|
154
158
|
writeStream: typeof import("./file").writeStream;
|
|
155
159
|
};
|
|
160
|
+
user: {
|
|
161
|
+
getUserInfo: typeof import("./user").getUserInfo;
|
|
162
|
+
refreshGroupData: typeof import("./user").refreshGroupData;
|
|
163
|
+
switchGroupRole: typeof import("./user").switchGroupRole;
|
|
164
|
+
switchChildRole: typeof import("./user").switchChildRole;
|
|
165
|
+
launchGroupUI: typeof import("./user").launchGroupUI;
|
|
166
|
+
launchSwitchGroupRoleUI: typeof import("./user").launchSwitchGroupRoleUI;
|
|
167
|
+
launchSwitchChildRoleUI: typeof import("./user").launchSwitchChildRoleUI;
|
|
168
|
+
};
|
|
156
169
|
tts: {
|
|
157
170
|
stopTts: typeof import("./tts").stopTts;
|
|
158
171
|
sendTts: typeof import("./tts").sendTts;
|
|
@@ -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
|
@@ -8,7 +8,9 @@ export declare function stopTts(): Promise<any>;
|
|
|
8
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
|
-
export declare function
|
|
11
|
+
export declare function setTtsSpeed(speed: number): Promise<any>;
|
|
12
|
+
export declare function sendVoiceTextToAI(text: string, params?: any): Promise<any>;
|
|
13
|
+
export declare function sendText(text: string, params?: any): Promise<any>;
|
|
12
14
|
export declare function setA2UI(enable?: boolean): Promise<any>;
|
|
13
15
|
declare const _default: {
|
|
14
16
|
enableVoiceInput: typeof enableVoiceInput;
|
|
@@ -21,7 +23,9 @@ declare const _default: {
|
|
|
21
23
|
sendTts: typeof sendTts;
|
|
22
24
|
sendStreamTts: typeof sendStreamTts;
|
|
23
25
|
setTtsSpeaker: typeof setTtsSpeaker;
|
|
26
|
+
setTtsSpeed: typeof setTtsSpeed;
|
|
24
27
|
sendVoiceTextToAI: typeof sendVoiceTextToAI;
|
|
28
|
+
sendText: typeof sendText;
|
|
25
29
|
setA2UI: typeof setA2UI;
|
|
26
30
|
};
|
|
27
31
|
export default _default;
|