@ccos/ccsdk-lite 1.0.24 → 1.0.26
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/bundle.js +185 -143
- package/lib/index.d.ts +9 -0
- package/lib/log/index.d.ts +19 -0
- package/lib/voice/index.d.ts +8 -0
- package/package.json +1 -1
package/lib/bundle.js
CHANGED
|
@@ -239,9 +239,9 @@ function initSDK() {
|
|
|
239
239
|
return callNative('tiny' + num4.toString(), null);
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
var moduleName$
|
|
243
|
-
function getFuncName$
|
|
244
|
-
return moduleName$
|
|
242
|
+
var moduleName$a = 'network';
|
|
243
|
+
function getFuncName$a(name) {
|
|
244
|
+
return moduleName$a + '_' + name;
|
|
245
245
|
}
|
|
246
246
|
function paramToUrl(params) {
|
|
247
247
|
if (!params)
|
|
@@ -273,7 +273,7 @@ function paramToUrl(params) {
|
|
|
273
273
|
}
|
|
274
274
|
// 简单的 HTTP 请求
|
|
275
275
|
function simpleHttpRequest(params) {
|
|
276
|
-
return callNative(getFuncName$
|
|
276
|
+
return callNative(getFuncName$a('simpleHttpRequest'), params);
|
|
277
277
|
}
|
|
278
278
|
function httpGet(url, urlParam, header, base64) {
|
|
279
279
|
var paramString = paramToUrl(urlParam);
|
|
@@ -372,19 +372,19 @@ function httpSseGet(url, urlParam, header, base64) {
|
|
|
372
372
|
}
|
|
373
373
|
// 获取网络的基本信息
|
|
374
374
|
function getNetworkInfo() {
|
|
375
|
-
return callNative(getFuncName$
|
|
375
|
+
return callNative(getFuncName$a('getNetworkInfo'), null);
|
|
376
376
|
}
|
|
377
377
|
// 获取合规化后的域名
|
|
378
378
|
function getDomainName(domain) {
|
|
379
|
-
return callNative(getFuncName$
|
|
379
|
+
return callNative(getFuncName$a('getDomainName'), { domain: domain });
|
|
380
380
|
}
|
|
381
381
|
// 获取基本 Header 信息
|
|
382
382
|
function getCommonHeader() {
|
|
383
|
-
return callNative(getFuncName$
|
|
383
|
+
return callNative(getFuncName$a('getCommonHeader'), null);
|
|
384
384
|
}
|
|
385
385
|
// 读取SSE流
|
|
386
386
|
function readSse(params) {
|
|
387
|
-
return callNative(getFuncName$
|
|
387
|
+
return callNative(getFuncName$a('readSse'), params);
|
|
388
388
|
}
|
|
389
389
|
// 下载一个文件到设备本地
|
|
390
390
|
// url : 需要下载的链接
|
|
@@ -401,7 +401,7 @@ function downloadToFile(url, tempFlag, method, header, postType, body) {
|
|
|
401
401
|
if (header === void 0) { header = ''; }
|
|
402
402
|
if (postType === void 0) { postType = ''; }
|
|
403
403
|
if (body === void 0) { body = ''; }
|
|
404
|
-
return callNative(getFuncName$
|
|
404
|
+
return callNative(getFuncName$a('downloadToFile'), {
|
|
405
405
|
url: url,
|
|
406
406
|
tempFlag: tempFlag,
|
|
407
407
|
method: method,
|
|
@@ -421,39 +421,39 @@ var network = {
|
|
|
421
421
|
downloadToFile: downloadToFile,
|
|
422
422
|
};
|
|
423
423
|
|
|
424
|
-
var moduleName$
|
|
425
|
-
function getFuncName$
|
|
426
|
-
return moduleName$
|
|
424
|
+
var moduleName$9 = 'app';
|
|
425
|
+
function getFuncName$9(name) {
|
|
426
|
+
return moduleName$9 + '_' + name;
|
|
427
427
|
}
|
|
428
428
|
function getUserInfo() {
|
|
429
|
-
return callNative(getFuncName$
|
|
429
|
+
return callNative(getFuncName$9('getUserInfo'), null);
|
|
430
430
|
}
|
|
431
431
|
function getHostAppInfo() {
|
|
432
|
-
return callNative(getFuncName$
|
|
432
|
+
return callNative(getFuncName$9('getHostAppInfo'), null);
|
|
433
433
|
}
|
|
434
434
|
function startPage(params) {
|
|
435
|
-
return callNative(getFuncName$
|
|
435
|
+
return callNative(getFuncName$9('startPage'), params);
|
|
436
436
|
}
|
|
437
437
|
function startActivity(params) {
|
|
438
|
-
return callNative(getFuncName$
|
|
438
|
+
return callNative(getFuncName$9('startPage'), params);
|
|
439
439
|
}
|
|
440
440
|
function exitPage() {
|
|
441
|
-
callNative(getFuncName$
|
|
441
|
+
callNative(getFuncName$9('exitPage'), null);
|
|
442
442
|
}
|
|
443
443
|
function movePageToBack() {
|
|
444
|
-
return callNative(getFuncName$
|
|
444
|
+
return callNative(getFuncName$9('movePageToBack'), null);
|
|
445
445
|
}
|
|
446
446
|
function startService(params) {
|
|
447
|
-
return callNative(getFuncName$
|
|
447
|
+
return callNative(getFuncName$9('startService'), params);
|
|
448
448
|
}
|
|
449
449
|
function getInstalledAppInfo(params) {
|
|
450
|
-
return callNative(getFuncName$
|
|
450
|
+
return callNative(getFuncName$9('getInstalledAppInfo'), params);
|
|
451
451
|
}
|
|
452
452
|
function getInstalledAppsList() {
|
|
453
|
-
callNative(getFuncName$
|
|
453
|
+
callNative(getFuncName$9('getInstalledAppsList'), null);
|
|
454
454
|
}
|
|
455
455
|
function execActionString(action) {
|
|
456
|
-
return callNative(getFuncName$
|
|
456
|
+
return callNative(getFuncName$9('execActionString'), action);
|
|
457
457
|
}
|
|
458
458
|
var app = {
|
|
459
459
|
getUserInfo: getUserInfo,
|
|
@@ -468,73 +468,73 @@ var app = {
|
|
|
468
468
|
execActionString: execActionString,
|
|
469
469
|
};
|
|
470
470
|
|
|
471
|
-
var moduleName$
|
|
472
|
-
function getFuncName$
|
|
473
|
-
return moduleName$
|
|
471
|
+
var moduleName$8 = 'system';
|
|
472
|
+
function getFuncName$8(name) {
|
|
473
|
+
return moduleName$8 + '_' + name;
|
|
474
474
|
}
|
|
475
475
|
// 告知宿主,小程序或者网页已经准备好
|
|
476
476
|
function ready() {
|
|
477
|
-
return callNative(getFuncName$
|
|
477
|
+
return callNative(getFuncName$8('ready'), null);
|
|
478
478
|
}
|
|
479
479
|
// 获取启动参数
|
|
480
480
|
function getStartupParams() {
|
|
481
|
-
return callNative(getFuncName$
|
|
481
|
+
return callNative(getFuncName$8('getStartupParams'), null);
|
|
482
482
|
}
|
|
483
483
|
// 获取设备信息
|
|
484
484
|
function getDeviceInfo() {
|
|
485
|
-
return callNative(getFuncName$
|
|
485
|
+
return callNative(getFuncName$8('getDeviceInfo'), null);
|
|
486
486
|
}
|
|
487
487
|
// 获取显示屏幕信息
|
|
488
488
|
function getDisplayInfo() {
|
|
489
|
-
return callNative(getFuncName$
|
|
489
|
+
return callNative(getFuncName$8('getDisplayInfo'), null);
|
|
490
490
|
}
|
|
491
491
|
// 获取 android property 的值
|
|
492
492
|
function getProperty(key) {
|
|
493
|
-
return callNative(getFuncName$
|
|
493
|
+
return callNative(getFuncName$8('getProperty'), { propName: key });
|
|
494
494
|
}
|
|
495
495
|
// 设置 android property 的值
|
|
496
496
|
function setProperty(key, value) {
|
|
497
|
-
return callNative(getFuncName$
|
|
497
|
+
return callNative(getFuncName$8('setProperty'), { propName: key, propValue: value });
|
|
498
498
|
}
|
|
499
499
|
// 检查 JS-API 是否已经实现
|
|
500
500
|
function checkApi(apiName) {
|
|
501
|
-
return callNative(getFuncName$
|
|
501
|
+
return callNative(getFuncName$8('checkApi'), { apiName: apiName });
|
|
502
502
|
}
|
|
503
503
|
// 获取本地字体的路径
|
|
504
504
|
function getFontPath(fontFileName) {
|
|
505
|
-
return callNative(getFuncName$
|
|
505
|
+
return callNative(getFuncName$8('getFontPath'), { fontFileName: fontFileName });
|
|
506
506
|
}
|
|
507
507
|
// 设置屏幕是否常亮
|
|
508
508
|
function setKeepScreenOn(enable) {
|
|
509
|
-
return callNative(getFuncName$
|
|
509
|
+
return callNative(getFuncName$8('setKeepScreenOn'), { enable: enable });
|
|
510
510
|
}
|
|
511
511
|
// 添加事件监听
|
|
512
512
|
function addEventListener$1(eventName, callback, options) {
|
|
513
513
|
if (options === void 0) { options = {}; }
|
|
514
|
-
return callWithPersistentCallBack(getFuncName$
|
|
514
|
+
return callWithPersistentCallBack(getFuncName$8('addEventListener'), { callbackId: eventName, options: options }, eventName, callback);
|
|
515
515
|
}
|
|
516
516
|
// 删除事件监听
|
|
517
517
|
function removeEventListener$1(eventName, callback, options) {
|
|
518
518
|
if (options === void 0) { options = {}; }
|
|
519
519
|
var ret = deletePersistentCallBack(eventName, callback);
|
|
520
520
|
if (ret) {
|
|
521
|
-
return callNative(getFuncName$
|
|
521
|
+
return callNative(getFuncName$8('removeEventListener'), { callbackId: eventName, options: options });
|
|
522
522
|
}
|
|
523
523
|
return new Promise(function (resolve) { resolve(); });
|
|
524
524
|
}
|
|
525
525
|
function sendBroadcast(params) {
|
|
526
|
-
return callNative(getFuncName$
|
|
526
|
+
return callNative(getFuncName$8('sendBroadcast'), params);
|
|
527
527
|
}
|
|
528
528
|
// 声明本页面接收并处理系统级的按键(如:返回、HOME、MENU 键)
|
|
529
529
|
function registerKeys(params) {
|
|
530
|
-
return callNative(getFuncName$
|
|
530
|
+
return callNative(getFuncName$8('registerKeys'), params || { keys: [] });
|
|
531
531
|
}
|
|
532
532
|
// 声明本页面接收并处理系统级的按键(如:返回、HOME、MENU 键)
|
|
533
533
|
function unregisterKeys(params) {
|
|
534
|
-
return callNative(getFuncName$
|
|
534
|
+
return callNative(getFuncName$8('unregisterKeys'), params || { keys: [] });
|
|
535
535
|
}
|
|
536
536
|
function providerCall(params) {
|
|
537
|
-
return callNative(getFuncName$
|
|
537
|
+
return callNative(getFuncName$8('providerCall'), params);
|
|
538
538
|
}
|
|
539
539
|
var system = {
|
|
540
540
|
ready: ready,
|
|
@@ -555,41 +555,41 @@ var system = {
|
|
|
555
555
|
//sendEvent
|
|
556
556
|
};
|
|
557
557
|
|
|
558
|
-
var moduleName$
|
|
559
|
-
function getFuncName$
|
|
560
|
-
return moduleName$
|
|
558
|
+
var moduleName$7 = 'storage';
|
|
559
|
+
function getFuncName$7(name) {
|
|
560
|
+
return moduleName$7 + '_' + name;
|
|
561
561
|
}
|
|
562
562
|
function setKey(key, value, namespace) {
|
|
563
563
|
if (namespace === void 0) { namespace = ''; }
|
|
564
|
-
return callNative(getFuncName$
|
|
564
|
+
return callNative(getFuncName$7('setKey'), { key: key, value: value, namespace: namespace });
|
|
565
565
|
}
|
|
566
566
|
function getKey(key, namespace) {
|
|
567
567
|
if (namespace === void 0) { namespace = ''; }
|
|
568
|
-
return callNative(getFuncName$
|
|
568
|
+
return callNative(getFuncName$7('getKey'), { key: key, namespace: namespace });
|
|
569
569
|
}
|
|
570
570
|
function deleteKey(key, namespace) {
|
|
571
571
|
if (namespace === void 0) { namespace = ''; }
|
|
572
|
-
return callNative(getFuncName$
|
|
572
|
+
return callNative(getFuncName$7('deleteKey'), { key: key, namespace: namespace });
|
|
573
573
|
}
|
|
574
574
|
function clearAllKeys(namespace) {
|
|
575
575
|
if (namespace === void 0) { namespace = ''; }
|
|
576
|
-
return callNative(getFuncName$
|
|
576
|
+
return callNative(getFuncName$7('clearAllKeys'), { namespace: namespace });
|
|
577
577
|
}
|
|
578
578
|
function setLargeKey(key, value, namespace) {
|
|
579
579
|
if (namespace === void 0) { namespace = ''; }
|
|
580
|
-
return callNative(getFuncName$
|
|
580
|
+
return callNative(getFuncName$7('setLargeKey'), { key: key, value: value, namespace: namespace });
|
|
581
581
|
}
|
|
582
582
|
function getLargeKey(key, namespace) {
|
|
583
583
|
if (namespace === void 0) { namespace = ''; }
|
|
584
|
-
return callNative(getFuncName$
|
|
584
|
+
return callNative(getFuncName$7('getLargeKey'), { key: key, namespace: namespace });
|
|
585
585
|
}
|
|
586
586
|
function deleteLargeKey(key, namespace) {
|
|
587
587
|
if (namespace === void 0) { namespace = ''; }
|
|
588
|
-
return callNative(getFuncName$
|
|
588
|
+
return callNative(getFuncName$7('deleteLargeKey'), { key: key, namespace: namespace });
|
|
589
589
|
}
|
|
590
590
|
function clearAllLargeKey(namespace) {
|
|
591
591
|
if (namespace === void 0) { namespace = ''; }
|
|
592
|
-
return callNative(getFuncName$
|
|
592
|
+
return callNative(getFuncName$7('clearAllLargeKey'), { namespace: namespace });
|
|
593
593
|
}
|
|
594
594
|
var storage = {
|
|
595
595
|
setKey: setKey,
|
|
@@ -602,54 +602,54 @@ var storage = {
|
|
|
602
602
|
clearAllLargeKey: clearAllLargeKey,
|
|
603
603
|
};
|
|
604
604
|
|
|
605
|
-
var moduleName$
|
|
606
|
-
function getFuncName$
|
|
607
|
-
return moduleName$
|
|
605
|
+
var moduleName$6 = 'audio';
|
|
606
|
+
function getFuncName$6(name) {
|
|
607
|
+
return moduleName$6 + '_' + name;
|
|
608
608
|
}
|
|
609
609
|
// 播放器,播放新的URL或者本地文件系统的路径
|
|
610
610
|
function playNew(path) {
|
|
611
|
-
return callNative(getFuncName$
|
|
611
|
+
return callNative(getFuncName$6('playNew'), { path: path });
|
|
612
612
|
}
|
|
613
613
|
// 播放器,停止播放
|
|
614
614
|
function stop$1() {
|
|
615
|
-
return callNative(getFuncName$
|
|
615
|
+
return callNative(getFuncName$6('stop'), null);
|
|
616
616
|
}
|
|
617
617
|
// 播放器,是否正在播放中
|
|
618
618
|
function isPlaying$1() {
|
|
619
|
-
return callNative(getFuncName$
|
|
619
|
+
return callNative(getFuncName$6('isPlaying'), null);
|
|
620
620
|
}
|
|
621
621
|
// 播放器,是否准备好
|
|
622
622
|
function hasPrepared$1() {
|
|
623
|
-
return callNative(getFuncName$
|
|
623
|
+
return callNative(getFuncName$6('hasPrepared'), null);
|
|
624
624
|
}
|
|
625
625
|
// 播放器,获取总时长
|
|
626
626
|
function getDuration$1() {
|
|
627
|
-
return callNative(getFuncName$
|
|
627
|
+
return callNative(getFuncName$6('getDuration'), null);
|
|
628
628
|
}
|
|
629
629
|
// 播放器,获取当前进度值
|
|
630
630
|
function getCurrentPosition$1() {
|
|
631
|
-
return callNative(getFuncName$
|
|
631
|
+
return callNative(getFuncName$6('getCurrentPosition'), null);
|
|
632
632
|
}
|
|
633
633
|
// 播放器,获取播放状态,返回的value为字符串来标识播放状态
|
|
634
634
|
// 例如:Idle, Initialized, Preparing, Prepared, Started, Paused, Stopped, Completed, Error, End
|
|
635
635
|
function getPlayerState$1() {
|
|
636
|
-
return callNative(getFuncName$
|
|
636
|
+
return callNative(getFuncName$6('getPlayerState'), null);
|
|
637
637
|
}
|
|
638
638
|
// 播放器,暂停播放
|
|
639
639
|
function pause$1() {
|
|
640
|
-
return callNative(getFuncName$
|
|
640
|
+
return callNative(getFuncName$6('pause'), null);
|
|
641
641
|
}
|
|
642
642
|
// 播放器,启动播放或者从暂停恢复播放
|
|
643
643
|
function start$1() {
|
|
644
|
-
return callNative(getFuncName$
|
|
644
|
+
return callNative(getFuncName$6('start'), null);
|
|
645
645
|
}
|
|
646
646
|
// 播放器,重新播放
|
|
647
647
|
function rePlay$1() {
|
|
648
|
-
return callNative(getFuncName$
|
|
648
|
+
return callNative(getFuncName$6('rePlay'), null);
|
|
649
649
|
}
|
|
650
650
|
// 播放器,seek
|
|
651
651
|
function seekTo$1(position) {
|
|
652
|
-
return callNative(getFuncName$
|
|
652
|
+
return callNative(getFuncName$6('seekTo'), { position: Math.floor(position) });
|
|
653
653
|
}
|
|
654
654
|
// 播放器,设置单片循环模式
|
|
655
655
|
// isLooping: 是否循环播放
|
|
@@ -657,16 +657,16 @@ function seekTo$1(position) {
|
|
|
657
657
|
// 会无感知重播,即重播时,不会调idle/ preparing/ prepared等开始播放之前的状态)
|
|
658
658
|
function setLooping$1(isLooping, silentLoop) {
|
|
659
659
|
if (silentLoop === void 0) { silentLoop = false; }
|
|
660
|
-
return callNative(getFuncName$
|
|
660
|
+
return callNative(getFuncName$6('setLooping'), { isLooping: isLooping, silentLoop: silentLoop });
|
|
661
661
|
}
|
|
662
662
|
// 设置音量
|
|
663
663
|
function setVolume(volume) {
|
|
664
|
-
return callNative(getFuncName$
|
|
664
|
+
return callNative(getFuncName$6('setVolume'), { volume: volume });
|
|
665
665
|
}
|
|
666
666
|
// 设置播放内核
|
|
667
667
|
// 值: DefaultPlayer, MediaPlayer, SocPlayer, ExoPlayer
|
|
668
668
|
function setPlayerCore$1(core) {
|
|
669
|
-
return callNative(getFuncName$
|
|
669
|
+
return callNative(getFuncName$6('setPlayerCore'), { core: core });
|
|
670
670
|
}
|
|
671
671
|
var audio = {
|
|
672
672
|
playNew: playNew,
|
|
@@ -685,62 +685,62 @@ var audio = {
|
|
|
685
685
|
setPlayerCore: setPlayerCore$1,
|
|
686
686
|
};
|
|
687
687
|
|
|
688
|
-
var moduleName$
|
|
689
|
-
function getFuncName$
|
|
690
|
-
return moduleName$
|
|
688
|
+
var moduleName$5 = 'video';
|
|
689
|
+
function getFuncName$5(name) {
|
|
690
|
+
return moduleName$5 + '_' + name;
|
|
691
691
|
}
|
|
692
692
|
// 设置视频播放窗口的位置与宽高
|
|
693
693
|
function setVideoLayout(width, height, x, y) {
|
|
694
|
-
return callNative(getFuncName$
|
|
694
|
+
return callNative(getFuncName$5('setVideoLayout'), { x: Number(x), y: Number(y), w: Number(width), h: Number(height) });
|
|
695
695
|
}
|
|
696
696
|
// 设置视频窗口是否显示
|
|
697
697
|
function setVideoVisible(show) {
|
|
698
|
-
return callNative(getFuncName$
|
|
698
|
+
return callNative(getFuncName$5('setVideoVisible'), { visible: show });
|
|
699
699
|
}
|
|
700
700
|
// 播放器,播放新的URL
|
|
701
701
|
function playNewUrl(url) {
|
|
702
|
-
return callNative(getFuncName$
|
|
702
|
+
return callNative(getFuncName$5('playNewUrl'), { url: url });
|
|
703
703
|
}
|
|
704
704
|
// 播放器,播放新的本地文件路径
|
|
705
705
|
function playNewFile(path) {
|
|
706
|
-
return callNative(getFuncName$
|
|
706
|
+
return callNative(getFuncName$5('playNewFile'), { path: path });
|
|
707
707
|
}
|
|
708
708
|
// 播放器,停止播放
|
|
709
709
|
function stop() {
|
|
710
|
-
return callNative(getFuncName$
|
|
710
|
+
return callNative(getFuncName$5('stop'), null);
|
|
711
711
|
}
|
|
712
712
|
// 播放器,暂停播放
|
|
713
713
|
function pause() {
|
|
714
|
-
return callNative(getFuncName$
|
|
714
|
+
return callNative(getFuncName$5('pause'), null);
|
|
715
715
|
}
|
|
716
716
|
// 播放器,启动播放或者从暂停恢复播放
|
|
717
717
|
function start() {
|
|
718
|
-
return callNative(getFuncName$
|
|
718
|
+
return callNative(getFuncName$5('start'), null);
|
|
719
719
|
}
|
|
720
720
|
// 播放器,seek
|
|
721
721
|
function seekTo(position) {
|
|
722
|
-
return callNative(getFuncName$
|
|
722
|
+
return callNative(getFuncName$5('seekTo'), { position: Math.floor(position) });
|
|
723
723
|
}
|
|
724
724
|
// 播放器,是否准备好
|
|
725
725
|
function hasPrepared() {
|
|
726
|
-
return callNative(getFuncName$
|
|
726
|
+
return callNative(getFuncName$5('hasPrepared'), null);
|
|
727
727
|
}
|
|
728
728
|
// 播放器,是否正在播放中
|
|
729
729
|
function isPlaying() {
|
|
730
|
-
return callNative(getFuncName$
|
|
730
|
+
return callNative(getFuncName$5('isPlaying'), null);
|
|
731
731
|
}
|
|
732
732
|
// 播放器,获取总时长
|
|
733
733
|
function getDuration() {
|
|
734
|
-
return callNative(getFuncName$
|
|
734
|
+
return callNative(getFuncName$5('getDuration'), null);
|
|
735
735
|
}
|
|
736
736
|
// 播放器,获取当前进度值
|
|
737
737
|
function getCurrentPosition() {
|
|
738
|
-
return callNative(getFuncName$
|
|
738
|
+
return callNative(getFuncName$5('getCurrentPosition'), null);
|
|
739
739
|
}
|
|
740
740
|
// 播放器,获取播放状态,返回的value为字符串来标识播放状态
|
|
741
741
|
// 例如:Idle, Initialized, Preparing, Prepared, Started, Paused, Stopped, Completed, Error, End
|
|
742
742
|
function getPlayerState() {
|
|
743
|
-
return callNative(getFuncName$
|
|
743
|
+
return callNative(getFuncName$5('getPlayerState'), null);
|
|
744
744
|
}
|
|
745
745
|
// 播放器,设置单片循环模式
|
|
746
746
|
// isLooping: 是否循环播放
|
|
@@ -748,40 +748,40 @@ function getPlayerState() {
|
|
|
748
748
|
// 会无感知重播,即重播时,不会调idle/ preparing/ prepared等开始播放之前的状态)
|
|
749
749
|
function setLooping(isLooping, silentLoop) {
|
|
750
750
|
if (silentLoop === void 0) { silentLoop = false; }
|
|
751
|
-
return callNative(getFuncName$
|
|
751
|
+
return callNative(getFuncName$5('setLooping'), { isLooping: isLooping, silentLoop: silentLoop });
|
|
752
752
|
}
|
|
753
753
|
// 播放器,设置自动屏保锁,即:开始或恢复播放->锁屏保,停止或暂停播放->释放屏保锁 默认关闭
|
|
754
754
|
function setAutoWakeLock(autoWakeLock) {
|
|
755
|
-
return callNative(getFuncName$
|
|
755
|
+
return callNative(getFuncName$5('setAutoWakeLock'), { autoWakeLock: autoWakeLock });
|
|
756
756
|
}
|
|
757
757
|
// 播放器,重新播放
|
|
758
758
|
function rePlay() {
|
|
759
|
-
return callNative(getFuncName$
|
|
759
|
+
return callNative(getFuncName$5('rePlay'), null);
|
|
760
760
|
}
|
|
761
761
|
// 播放器,设置是否自动播放,即 play ready 后音视频自动播放 默认开启
|
|
762
762
|
function setPlayWhenReady(playWhenReady) {
|
|
763
763
|
if (playWhenReady === void 0) { playWhenReady = true; }
|
|
764
|
-
return callNative(getFuncName$
|
|
764
|
+
return callNative(getFuncName$5('setPlayWhenReady'), { playWhenReady: playWhenReady });
|
|
765
765
|
}
|
|
766
766
|
// 获取当前设置的播放内核, 有可能会返回 DefaultPlayer
|
|
767
767
|
// 值: DefaultPlayer, MediaPlayer, SocPlayer, ExoPlayer
|
|
768
768
|
function getPlayerCore() {
|
|
769
|
-
return callNative(getFuncName$
|
|
769
|
+
return callNative(getFuncName$5('getPlayerCore'), null);
|
|
770
770
|
}
|
|
771
771
|
// 获取实际的播放内核, 部分内核如:最佳内核,实际上是在各个内核中进行选择,不会返回 DefaultPlayer
|
|
772
772
|
// 值: MediaPlayer, SocPlayer, ExoPlayer
|
|
773
773
|
function getRealPlayerCore() {
|
|
774
|
-
return callNative(getFuncName$
|
|
774
|
+
return callNative(getFuncName$5('getRealPlayerCore'), null);
|
|
775
775
|
}
|
|
776
776
|
// 设置播放内核
|
|
777
777
|
// 值: DefaultPlayer, MediaPlayer, SocPlayer, ExoPlayer
|
|
778
778
|
function setPlayerCore(core) {
|
|
779
|
-
return callNative(getFuncName$
|
|
779
|
+
return callNative(getFuncName$5('setPlayerCore'), { core: core });
|
|
780
780
|
}
|
|
781
781
|
// 设置渲染模式
|
|
782
782
|
// 值: SurfaceView, TextureView
|
|
783
783
|
function setRenderType(playerRender) {
|
|
784
|
-
return callNative(getFuncName$
|
|
784
|
+
return callNative(getFuncName$5('setRenderType'), { playerRender: playerRender });
|
|
785
785
|
}
|
|
786
786
|
var video = {
|
|
787
787
|
setVideoLayout: setVideoLayout,
|
|
@@ -807,9 +807,9 @@ var video = {
|
|
|
807
807
|
setRenderType: setRenderType,
|
|
808
808
|
};
|
|
809
809
|
|
|
810
|
-
var moduleName$
|
|
811
|
-
function getFuncName$
|
|
812
|
-
return moduleName$
|
|
810
|
+
var moduleName$4 = 'fs';
|
|
811
|
+
function getFuncName$4(name) {
|
|
812
|
+
return moduleName$4 + '_' + name;
|
|
813
813
|
}
|
|
814
814
|
// 读取文件并返回文件的所有内容
|
|
815
815
|
// 参数:
|
|
@@ -817,7 +817,7 @@ function getFuncName$3(name) {
|
|
|
817
817
|
// base64Flag: 是否以base64编码方式返回, 如果读取文本文件,则应该设置 base64Flag = false,如果读取二进制文件,则应该设置 base64Flag = true
|
|
818
818
|
function readAllContent(path, base64Flag) {
|
|
819
819
|
if (base64Flag === void 0) { base64Flag = false; }
|
|
820
|
-
return callNative(getFuncName$
|
|
820
|
+
return callNative(getFuncName$4('readAllContent'), { path: path, base64Flag: base64Flag });
|
|
821
821
|
}
|
|
822
822
|
// 将内容全部写入文件
|
|
823
823
|
// 参数:
|
|
@@ -826,114 +826,114 @@ function readAllContent(path, base64Flag) {
|
|
|
826
826
|
// base64Flag: 是否以base64编码方式传输content, 如果写文本文件,则应该设置 base64Flag = false,如果写入二进制文件,则应该设置 base64Flag = true
|
|
827
827
|
function writeAllContent(path, content, base64Flag) {
|
|
828
828
|
if (base64Flag === void 0) { base64Flag = false; }
|
|
829
|
-
return callNative(getFuncName$
|
|
829
|
+
return callNative(getFuncName$4('writeAllContent'), { path: path, content: content, base64Flag: base64Flag });
|
|
830
830
|
}
|
|
831
831
|
// 获取应用基本目录的全路径名
|
|
832
832
|
function getAppBaseDir() {
|
|
833
|
-
return callNative(getFuncName$
|
|
833
|
+
return callNative(getFuncName$4('getAppBaseDir'), null);
|
|
834
834
|
}
|
|
835
835
|
// 获取 Cache 目录的全路径名
|
|
836
836
|
function getAppCacheDir() {
|
|
837
|
-
return callNative(getFuncName$
|
|
837
|
+
return callNative(getFuncName$4('getAppCacheDir'), null);
|
|
838
838
|
}
|
|
839
839
|
// 构建一个临时文件名,返回该文件的绝对路径的全文件路径名
|
|
840
840
|
// 参数:
|
|
841
841
|
// fileName: 指定临时文件的基本名,如果不指定,会默认随机生成一个文件名
|
|
842
842
|
function makeCacheFile(fileName) {
|
|
843
843
|
if (fileName === void 0) { fileName = ''; }
|
|
844
|
-
return callNative(getFuncName$
|
|
844
|
+
return callNative(getFuncName$4('makeCacheFile'), { fileName: fileName });
|
|
845
845
|
}
|
|
846
846
|
// 构建一个正常文件名,返回该文件的绝对路径的全文件路径名
|
|
847
847
|
// 参数:
|
|
848
848
|
// fileName: 指定文件的基本名,如果不指定,会默认随机生成一个文件名
|
|
849
849
|
function makeNormalFile(fileName) {
|
|
850
850
|
if (fileName === void 0) { fileName = ''; }
|
|
851
|
-
return callNative(getFuncName$
|
|
851
|
+
return callNative(getFuncName$4('makeNormalFile'), { fileName: fileName });
|
|
852
852
|
}
|
|
853
853
|
// 检测一个文件或者目录是否存在
|
|
854
854
|
// 参数:
|
|
855
855
|
// path: 指定路径
|
|
856
856
|
function exists(path) {
|
|
857
|
-
return callNative(getFuncName$
|
|
857
|
+
return callNative(getFuncName$4('exists'), { path: path });
|
|
858
858
|
}
|
|
859
859
|
// 检测一个路径是否为一个普通文件
|
|
860
860
|
// 参数:
|
|
861
861
|
// path: 指定路径
|
|
862
862
|
function isFile(path) {
|
|
863
|
-
return callNative(getFuncName$
|
|
863
|
+
return callNative(getFuncName$4('isFile'), { path: path });
|
|
864
864
|
}
|
|
865
865
|
// 检测一个路径是否为一个目录
|
|
866
866
|
// 参数:
|
|
867
867
|
// path: 指定路径
|
|
868
868
|
function isDirectory(path) {
|
|
869
|
-
return callNative(getFuncName$
|
|
869
|
+
return callNative(getFuncName$4('isDirectory'), { path: path });
|
|
870
870
|
}
|
|
871
871
|
// 检测一个路径表示的文件或目录 是否是隐藏的
|
|
872
872
|
// 参数:
|
|
873
873
|
// path: 指定路径
|
|
874
874
|
function isHidden(path) {
|
|
875
|
-
return callNative(getFuncName$
|
|
875
|
+
return callNative(getFuncName$4('isHidden'), { path: path });
|
|
876
876
|
}
|
|
877
877
|
// 检测一个路径表示的文件或目录 是否可读
|
|
878
878
|
// 参数:
|
|
879
879
|
// path: 指定路径
|
|
880
880
|
function canRead(path) {
|
|
881
|
-
return callNative(getFuncName$
|
|
881
|
+
return callNative(getFuncName$4('canRead'), { path: path });
|
|
882
882
|
}
|
|
883
883
|
// 检测一个路径表示的文件或目录 是否可写
|
|
884
884
|
// 参数:
|
|
885
885
|
// path: 指定路径
|
|
886
886
|
function canWrite(path) {
|
|
887
|
-
return callNative(getFuncName$
|
|
887
|
+
return callNative(getFuncName$4('canWrite'), { path: path });
|
|
888
888
|
}
|
|
889
889
|
// 检测一个路径表示的文件或目录 是否可执行
|
|
890
890
|
// 参数:
|
|
891
891
|
// path: 指定路径
|
|
892
892
|
function canExecute(path) {
|
|
893
|
-
return callNative(getFuncName$
|
|
893
|
+
return callNative(getFuncName$4('canExecute'), { path: path });
|
|
894
894
|
}
|
|
895
895
|
// 检测一个路径表示的文件或目录 的最后修改的时间,返回时间戳(1970年开始的秒数)
|
|
896
896
|
// 参数:
|
|
897
897
|
// path: 指定路径
|
|
898
898
|
function lastModified(path) {
|
|
899
|
-
return callNative(getFuncName$
|
|
899
|
+
return callNative(getFuncName$4('lastModified'), { path: path });
|
|
900
900
|
}
|
|
901
901
|
// 删除文件
|
|
902
902
|
// 参数:
|
|
903
903
|
// path: 指定路径
|
|
904
904
|
function deleteIt(path) {
|
|
905
|
-
return callNative(getFuncName$
|
|
905
|
+
return callNative(getFuncName$4('delete'), { path: path });
|
|
906
906
|
}
|
|
907
907
|
// 新建目录
|
|
908
908
|
// 参数:
|
|
909
909
|
// path: 指定路径
|
|
910
910
|
function mkdir(path) {
|
|
911
|
-
return callNative(getFuncName$
|
|
911
|
+
return callNative(getFuncName$4('mkdir'), { path: path });
|
|
912
912
|
}
|
|
913
913
|
// 新建目录 (如果父目录补存在则一并新建所有尚未存在的父目录)
|
|
914
914
|
// 参数:
|
|
915
915
|
// path: 指定路径
|
|
916
916
|
function mkdirs(path) {
|
|
917
|
-
return callNative(getFuncName$
|
|
917
|
+
return callNative(getFuncName$4('mkdirs'), { path: path });
|
|
918
918
|
}
|
|
919
919
|
// 改名
|
|
920
920
|
// 参数:
|
|
921
921
|
// from: 指定源路径
|
|
922
922
|
// to: 指定目标路径
|
|
923
923
|
function rename(from, to) {
|
|
924
|
-
return callNative(getFuncName$
|
|
924
|
+
return callNative(getFuncName$4('rename'), { from: from, to: to });
|
|
925
925
|
}
|
|
926
926
|
// 将相对路径的转换为全路径
|
|
927
927
|
// 参数:
|
|
928
928
|
// path: 指定路径
|
|
929
929
|
function getAbsolutePath(path) {
|
|
930
|
-
return callNative(getFuncName$
|
|
930
|
+
return callNative(getFuncName$4('getAbsolutePath'), { path: path });
|
|
931
931
|
}
|
|
932
932
|
// 指定路径创建新文件
|
|
933
933
|
// 参数:
|
|
934
934
|
// path: 指定路径
|
|
935
935
|
function createNewFile(path) {
|
|
936
|
-
return callNative(getFuncName$
|
|
936
|
+
return callNative(getFuncName$4('createNewFile'), { path: path });
|
|
937
937
|
}
|
|
938
938
|
// 设置可读属性
|
|
939
939
|
// 参数:
|
|
@@ -941,7 +941,7 @@ function createNewFile(path) {
|
|
|
941
941
|
// value: 是否可读
|
|
942
942
|
function setReadable(path, value) {
|
|
943
943
|
if (value === void 0) { value = true; }
|
|
944
|
-
return callNative(getFuncName$
|
|
944
|
+
return callNative(getFuncName$4('setReadable'), { path: path, value: value });
|
|
945
945
|
}
|
|
946
946
|
// 设置可写属性
|
|
947
947
|
// 参数:
|
|
@@ -949,7 +949,7 @@ function setReadable(path, value) {
|
|
|
949
949
|
// value: 是否可写
|
|
950
950
|
function setWritable(path, value) {
|
|
951
951
|
if (value === void 0) { value = true; }
|
|
952
|
-
return callNative(getFuncName$
|
|
952
|
+
return callNative(getFuncName$4('setWritable'), { path: path, value: value });
|
|
953
953
|
}
|
|
954
954
|
// 设置可执行属性
|
|
955
955
|
// 参数:
|
|
@@ -957,7 +957,7 @@ function setWritable(path, value) {
|
|
|
957
957
|
// value: 是否可执行
|
|
958
958
|
function setExecutable(path, value) {
|
|
959
959
|
if (value === void 0) { value = true; }
|
|
960
|
-
return callNative(getFuncName$
|
|
960
|
+
return callNative(getFuncName$4('setExecutable'), { path: path, value: value });
|
|
961
961
|
}
|
|
962
962
|
// 设置文件最后修改的时间
|
|
963
963
|
// 参数:
|
|
@@ -965,13 +965,13 @@ function setExecutable(path, value) {
|
|
|
965
965
|
// value: 时间戳
|
|
966
966
|
function setLastModified(path, value) {
|
|
967
967
|
if (value === void 0) { value = 0; }
|
|
968
|
-
return callNative(getFuncName$
|
|
968
|
+
return callNative(getFuncName$4('setLastModified'), { path: path, value: value });
|
|
969
969
|
}
|
|
970
970
|
// 读取目录,返回该目录下的文件列表
|
|
971
971
|
// 参数:
|
|
972
972
|
// path: 指定路径
|
|
973
973
|
function list(path) {
|
|
974
|
-
return callNative(getFuncName$
|
|
974
|
+
return callNative(getFuncName$4('list'), { path: path });
|
|
975
975
|
}
|
|
976
976
|
// 打开只读文件流
|
|
977
977
|
// 参数:
|
|
@@ -979,7 +979,7 @@ function list(path) {
|
|
|
979
979
|
// 返回:
|
|
980
980
|
// streamId: 流的ID
|
|
981
981
|
function openInputStream(path) {
|
|
982
|
-
return callNative(getFuncName$
|
|
982
|
+
return callNative(getFuncName$4('openInputStream'), { path: path });
|
|
983
983
|
}
|
|
984
984
|
// 打开只写文件流
|
|
985
985
|
// 参数:
|
|
@@ -987,13 +987,13 @@ function openInputStream(path) {
|
|
|
987
987
|
// 返回:
|
|
988
988
|
// streamId: 流的ID
|
|
989
989
|
function openOutputStream(path) {
|
|
990
|
-
return callNative(getFuncName$
|
|
990
|
+
return callNative(getFuncName$4('openOutputStream'), { path: path });
|
|
991
991
|
}
|
|
992
992
|
// 关闭文件流(可以是只读流,也可以是只写流)
|
|
993
993
|
// 参数:
|
|
994
994
|
// streamId: 流的ID
|
|
995
995
|
function closeStream(streamId) {
|
|
996
|
-
return callNative(getFuncName$
|
|
996
|
+
return callNative(getFuncName$4('closeStream'), { streamId: streamId });
|
|
997
997
|
}
|
|
998
998
|
// 读取文件流的内容
|
|
999
999
|
// 参数:
|
|
@@ -1002,7 +1002,7 @@ function closeStream(streamId) {
|
|
|
1002
1002
|
// base64Flag: 是否以base64的形式返回(默认以普通字符串的形式返回,如果读取二进制文件,则应该设置为以base64的形式返回)
|
|
1003
1003
|
function readStream(streamId, size, base64Flag) {
|
|
1004
1004
|
if (base64Flag === void 0) { base64Flag = false; }
|
|
1005
|
-
return callNative(getFuncName$
|
|
1005
|
+
return callNative(getFuncName$4('readStream'), { streamId: streamId, size: size, base64Flag: base64Flag });
|
|
1006
1006
|
}
|
|
1007
1007
|
// 将内容写入文件流
|
|
1008
1008
|
// 参数:
|
|
@@ -1011,7 +1011,7 @@ function readStream(streamId, size, base64Flag) {
|
|
|
1011
1011
|
// base64Flag: 是否以base64的形式传递要写入的内容(默认写入普通字符串的文本,如果要写入二进制数据,则应该设置为以base64的形式的内容)
|
|
1012
1012
|
function writeStream(streamId, content, base64Flag) {
|
|
1013
1013
|
if (base64Flag === void 0) { base64Flag = false; }
|
|
1014
|
-
return callNative(getFuncName$
|
|
1014
|
+
return callNative(getFuncName$4('writeStream'), { streamId: streamId, content: content, base64Flag: base64Flag });
|
|
1015
1015
|
}
|
|
1016
1016
|
var fs = {
|
|
1017
1017
|
readAllContent: readAllContent,
|
|
@@ -1046,19 +1046,19 @@ var fs = {
|
|
|
1046
1046
|
writeStream: writeStream,
|
|
1047
1047
|
};
|
|
1048
1048
|
|
|
1049
|
-
var moduleName$
|
|
1050
|
-
function getFuncName$
|
|
1051
|
-
return moduleName$
|
|
1049
|
+
var moduleName$3 = 'pag';
|
|
1050
|
+
function getFuncName$3(name) {
|
|
1051
|
+
return moduleName$3 + '_' + name;
|
|
1052
1052
|
}
|
|
1053
1053
|
// 播放PAG动画
|
|
1054
1054
|
// repeat: 循环次数 -1 表示无限
|
|
1055
1055
|
//
|
|
1056
1056
|
function startNewPagAni(params) {
|
|
1057
|
-
return callNative(getFuncName$
|
|
1057
|
+
return callNative(getFuncName$3('startNewPagAni'), params);
|
|
1058
1058
|
}
|
|
1059
1059
|
// 停止PAG动画,并消失
|
|
1060
1060
|
function stopPagAni() {
|
|
1061
|
-
return callNative(getFuncName$
|
|
1061
|
+
return callNative(getFuncName$3('stopPagAni'), null);
|
|
1062
1062
|
}
|
|
1063
1063
|
function setPagVisibility(visible) {
|
|
1064
1064
|
if (visible === void 0) { visible = true; }
|
|
@@ -1075,10 +1075,10 @@ function setPagVisibility(visible) {
|
|
|
1075
1075
|
else {
|
|
1076
1076
|
value = visible;
|
|
1077
1077
|
}
|
|
1078
|
-
return callNative(getFuncName$
|
|
1078
|
+
return callNative(getFuncName$3('setPagVisibility'), { visible: value });
|
|
1079
1079
|
}
|
|
1080
1080
|
function setPagXY(x, y) {
|
|
1081
|
-
return callNative(getFuncName$
|
|
1081
|
+
return callNative(getFuncName$3('setPagXY'), { x: x, y: y });
|
|
1082
1082
|
}
|
|
1083
1083
|
// // 播报 TTS 文本语音
|
|
1084
1084
|
// export function sendTts(text: string, ttsId: string): Promise<any> {
|
|
@@ -1121,56 +1121,78 @@ var pag = {
|
|
|
1121
1121
|
// clearBackground,
|
|
1122
1122
|
};
|
|
1123
1123
|
|
|
1124
|
-
var moduleName$
|
|
1125
|
-
function getFuncName$
|
|
1126
|
-
return moduleName$
|
|
1124
|
+
var moduleName$2 = 'voice';
|
|
1125
|
+
function getFuncName$2(name) {
|
|
1126
|
+
return moduleName$2 + '_' + name;
|
|
1127
1127
|
}
|
|
1128
1128
|
// 开启语音输入
|
|
1129
1129
|
function enableVoiceInput(clientId, parameters, expandedParameters) {
|
|
1130
1130
|
if (clientId === void 0) { clientId = ''; }
|
|
1131
1131
|
if (parameters === void 0) { parameters = {}; }
|
|
1132
1132
|
if (expandedParameters === void 0) { expandedParameters = {}; }
|
|
1133
|
-
return callNative(getFuncName$
|
|
1133
|
+
return callNative(getFuncName$2('enableVoiceInput'), { clientId: clientId, parameters: parameters, expandedParameters: expandedParameters });
|
|
1134
1134
|
}
|
|
1135
1135
|
// 关闭语音输入
|
|
1136
1136
|
function disableVoiceInput() {
|
|
1137
|
-
return callNative(getFuncName$
|
|
1137
|
+
return callNative(getFuncName$2('disableVoiceInput'), {});
|
|
1138
1138
|
}
|
|
1139
1139
|
// 开启意图识别指令返回
|
|
1140
1140
|
function enableDirective(enable) {
|
|
1141
1141
|
if (enable === void 0) { enable = true; }
|
|
1142
|
-
return callNative(getFuncName$
|
|
1142
|
+
return callNative(getFuncName$2('enableDirective'), { enable: enable });
|
|
1143
|
+
}
|
|
1144
|
+
// 开启意图识别指令返回
|
|
1145
|
+
function setDirective(enable) {
|
|
1146
|
+
if (enable === void 0) { enable = true; }
|
|
1147
|
+
return callNative(getFuncName$2('setDirective'), { enable: enable });
|
|
1148
|
+
}
|
|
1149
|
+
// 开启录音功能
|
|
1150
|
+
function enableRecording() {
|
|
1151
|
+
return callNative(getFuncName$2('enableRecording'), {});
|
|
1152
|
+
}
|
|
1153
|
+
// 关闭录音功能
|
|
1154
|
+
function disableRecording() {
|
|
1155
|
+
return callNative(getFuncName$2('disableRecording'), {});
|
|
1143
1156
|
}
|
|
1144
1157
|
// 停止TTS播报
|
|
1145
1158
|
//
|
|
1146
1159
|
function stopTts$1() {
|
|
1147
|
-
return callNative(getFuncName$
|
|
1160
|
+
return callNative(getFuncName$2('stopTts'), {});
|
|
1148
1161
|
}
|
|
1149
1162
|
// 开始 TTS 播报
|
|
1150
1163
|
function sendTts$1(text, ttsId) {
|
|
1151
|
-
return callNative(getFuncName$
|
|
1164
|
+
return callNative(getFuncName$2('sendTts'), { text: text, ttsId: ttsId });
|
|
1152
1165
|
}
|
|
1153
1166
|
// 流式播报 TTS
|
|
1154
1167
|
function sendStreamTts$1(text, ttsId, isFirst, isEnd) {
|
|
1155
|
-
return callNative(getFuncName$
|
|
1168
|
+
return callNative(getFuncName$2('sendStreamTts'), { text: text, ttsId: ttsId, isFirst: isFirst, isEnd: isEnd });
|
|
1156
1169
|
}
|
|
1157
1170
|
// 设置播放TTS的人声
|
|
1158
1171
|
function setTtsSpeaker(speaker) {
|
|
1159
|
-
return callNative(getFuncName$
|
|
1172
|
+
return callNative(getFuncName$2('setTtsSpeaker'), { speaker: speaker });
|
|
1160
1173
|
}
|
|
1161
1174
|
// 发送纯文本
|
|
1162
1175
|
function sendVoiceTextToAI(text) {
|
|
1163
|
-
return callNative(getFuncName$
|
|
1176
|
+
return callNative(getFuncName$2('sendVoiceTextToAI'), { text: text });
|
|
1177
|
+
}
|
|
1178
|
+
// 开启意图识别指令返回
|
|
1179
|
+
function setA2UI(enable) {
|
|
1180
|
+
if (enable === void 0) { enable = true; }
|
|
1181
|
+
return callNative(getFuncName$2('setA2UI'), { enable: enable });
|
|
1164
1182
|
}
|
|
1165
1183
|
var voice = {
|
|
1166
1184
|
enableVoiceInput: enableVoiceInput,
|
|
1167
1185
|
disableVoiceInput: disableVoiceInput,
|
|
1168
1186
|
enableDirective: enableDirective,
|
|
1187
|
+
setDirective: setDirective,
|
|
1188
|
+
enableRecording: enableRecording,
|
|
1189
|
+
disableRecording: disableRecording,
|
|
1169
1190
|
stopTts: stopTts$1,
|
|
1170
1191
|
sendTts: sendTts$1,
|
|
1171
1192
|
sendStreamTts: sendStreamTts$1,
|
|
1172
1193
|
setTtsSpeaker: setTtsSpeaker,
|
|
1173
1194
|
sendVoiceTextToAI: sendVoiceTextToAI,
|
|
1195
|
+
setA2UI: setA2UI,
|
|
1174
1196
|
};
|
|
1175
1197
|
|
|
1176
1198
|
// 添加事件监听
|
|
@@ -1192,6 +1214,25 @@ var event = {
|
|
|
1192
1214
|
removeEventListener: removeEventListener,
|
|
1193
1215
|
};
|
|
1194
1216
|
|
|
1217
|
+
var moduleName$1 = 'log';
|
|
1218
|
+
function getFuncName$1(name) {
|
|
1219
|
+
return moduleName$1 + '_' + name;
|
|
1220
|
+
}
|
|
1221
|
+
function init$1(logInitInfo) {
|
|
1222
|
+
return callNative(getFuncName$1('init'), logInitInfo);
|
|
1223
|
+
}
|
|
1224
|
+
function submit(logData) {
|
|
1225
|
+
return callNative(getFuncName$1('submit'), logData);
|
|
1226
|
+
}
|
|
1227
|
+
function submitToByte(logData) {
|
|
1228
|
+
return callNative(getFuncName$1('submitToByte'), logData);
|
|
1229
|
+
}
|
|
1230
|
+
var log = {
|
|
1231
|
+
init: init$1,
|
|
1232
|
+
submit: submit,
|
|
1233
|
+
submitToByte: submitToByte,
|
|
1234
|
+
};
|
|
1235
|
+
|
|
1195
1236
|
var moduleName = 'tts';
|
|
1196
1237
|
function getFuncName(name) {
|
|
1197
1238
|
return moduleName + '_' + name;
|
|
@@ -1271,6 +1312,7 @@ var index = {
|
|
|
1271
1312
|
pag: pag,
|
|
1272
1313
|
voice: voice,
|
|
1273
1314
|
event: event,
|
|
1315
|
+
log: log,
|
|
1274
1316
|
fs: fs,
|
|
1275
1317
|
tts: tts,
|
|
1276
1318
|
apkNativeCallJs: apkNativeCallJs,
|
package/lib/index.d.ts
CHANGED
|
@@ -102,16 +102,25 @@ declare const _default: {
|
|
|
102
102
|
enableVoiceInput: typeof import("./voice").enableVoiceInput;
|
|
103
103
|
disableVoiceInput: typeof import("./voice").disableVoiceInput;
|
|
104
104
|
enableDirective: typeof import("./voice").enableDirective;
|
|
105
|
+
setDirective: typeof import("./voice").setDirective;
|
|
106
|
+
enableRecording: typeof import("./voice").enableRecording;
|
|
107
|
+
disableRecording: typeof import("./voice").disableRecording;
|
|
105
108
|
stopTts: typeof import("./voice").stopTts;
|
|
106
109
|
sendTts: typeof import("./voice").sendTts;
|
|
107
110
|
sendStreamTts: typeof import("./voice").sendStreamTts;
|
|
108
111
|
setTtsSpeaker: typeof import("./voice").setTtsSpeaker;
|
|
109
112
|
sendVoiceTextToAI: typeof import("./voice").sendVoiceTextToAI;
|
|
113
|
+
setA2UI: typeof import("./voice").setA2UI;
|
|
110
114
|
};
|
|
111
115
|
event: {
|
|
112
116
|
addEventListener: typeof import("./event").addEventListener;
|
|
113
117
|
removeEventListener: typeof import("./event").removeEventListener;
|
|
114
118
|
};
|
|
119
|
+
log: {
|
|
120
|
+
init: typeof import("./log").init;
|
|
121
|
+
submit: typeof import("./log").submit;
|
|
122
|
+
submitToByte: typeof import("./log").submitToByte;
|
|
123
|
+
};
|
|
115
124
|
fs: {
|
|
116
125
|
readAllContent: typeof import("./file").readAllContent;
|
|
117
126
|
writeAllContent: typeof import("./file").writeAllContent;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface LogInitInfo {
|
|
2
|
+
appId?: string;
|
|
3
|
+
channel?: string;
|
|
4
|
+
productId?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface LogData {
|
|
7
|
+
eventName: string;
|
|
8
|
+
data?: any;
|
|
9
|
+
productId?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function init(logInitInfo: LogInitInfo): Promise<any>;
|
|
12
|
+
export declare function submit(logData: LogData): Promise<any>;
|
|
13
|
+
export declare function submitToByte(logData: LogData): Promise<any>;
|
|
14
|
+
declare const _default: {
|
|
15
|
+
init: typeof init;
|
|
16
|
+
submit: typeof submit;
|
|
17
|
+
submitToByte: typeof submitToByte;
|
|
18
|
+
};
|
|
19
|
+
export default _default;
|
package/lib/voice/index.d.ts
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
export declare function enableVoiceInput(clientId?: string, parameters?: any, expandedParameters?: any): Promise<any>;
|
|
2
2
|
export declare function disableVoiceInput(): Promise<any>;
|
|
3
3
|
export declare function enableDirective(enable?: boolean): Promise<any>;
|
|
4
|
+
export declare function setDirective(enable?: boolean): Promise<any>;
|
|
5
|
+
export declare function enableRecording(): Promise<any>;
|
|
6
|
+
export declare function disableRecording(): Promise<any>;
|
|
4
7
|
export declare function stopTts(): Promise<any>;
|
|
5
8
|
export declare function sendTts(text: string, ttsId: string): Promise<any>;
|
|
6
9
|
export declare function sendStreamTts(text: string, ttsId: string, isFirst: boolean, isEnd: boolean): Promise<any>;
|
|
7
10
|
export declare function setTtsSpeaker(speaker: string): Promise<any>;
|
|
8
11
|
export declare function sendVoiceTextToAI(text: string): Promise<any>;
|
|
12
|
+
export declare function setA2UI(enable?: boolean): Promise<any>;
|
|
9
13
|
declare const _default: {
|
|
10
14
|
enableVoiceInput: typeof enableVoiceInput;
|
|
11
15
|
disableVoiceInput: typeof disableVoiceInput;
|
|
12
16
|
enableDirective: typeof enableDirective;
|
|
17
|
+
setDirective: typeof setDirective;
|
|
18
|
+
enableRecording: typeof enableRecording;
|
|
19
|
+
disableRecording: typeof disableRecording;
|
|
13
20
|
stopTts: typeof stopTts;
|
|
14
21
|
sendTts: typeof sendTts;
|
|
15
22
|
sendStreamTts: typeof sendStreamTts;
|
|
16
23
|
setTtsSpeaker: typeof setTtsSpeaker;
|
|
17
24
|
sendVoiceTextToAI: typeof sendVoiceTextToAI;
|
|
25
|
+
setA2UI: typeof setA2UI;
|
|
18
26
|
};
|
|
19
27
|
export default _default;
|