@ccos/ccsdk-lite 1.0.19 → 1.0.21
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 +18 -3
- package/lib/index.d.ts +3 -0
- package/lib/system/index.d.ts +7 -0
- package/lib/voice/index.d.ts +5 -1
- package/package.json +1 -1
package/lib/bundle.js
CHANGED
|
@@ -509,6 +509,9 @@ function registerKeys(params) {
|
|
|
509
509
|
function unregisterKeys(params) {
|
|
510
510
|
return callNative(getFuncName$7('unregisterKeys'), params || { keys: [] });
|
|
511
511
|
}
|
|
512
|
+
function providerCall(params) {
|
|
513
|
+
return callNative(getFuncName$7('providerCall'), params);
|
|
514
|
+
}
|
|
512
515
|
var system = {
|
|
513
516
|
ready: ready,
|
|
514
517
|
getStartupParams: getStartupParams,
|
|
@@ -523,6 +526,7 @@ var system = {
|
|
|
523
526
|
sendBroadcast: sendBroadcast,
|
|
524
527
|
registerKeys: registerKeys,
|
|
525
528
|
unregisterKeys: unregisterKeys,
|
|
529
|
+
providerCall: providerCall,
|
|
526
530
|
//sendEvent
|
|
527
531
|
};
|
|
528
532
|
|
|
@@ -1097,10 +1101,15 @@ function getFuncName$1(name) {
|
|
|
1097
1101
|
return moduleName$1 + '_' + name;
|
|
1098
1102
|
}
|
|
1099
1103
|
// 开启语音输入
|
|
1100
|
-
function enableVoiceInput(clientId,
|
|
1104
|
+
function enableVoiceInput(clientId, parameters, expandedParameters) {
|
|
1101
1105
|
if (clientId === void 0) { clientId = ''; }
|
|
1102
|
-
if (
|
|
1103
|
-
|
|
1106
|
+
if (parameters === void 0) { parameters = {}; }
|
|
1107
|
+
if (expandedParameters === void 0) { expandedParameters = {}; }
|
|
1108
|
+
return callNative(getFuncName$1('enableVoiceInput'), { clientId: clientId, parameters: parameters, expandedParameters: expandedParameters });
|
|
1109
|
+
}
|
|
1110
|
+
// 关闭语音输入
|
|
1111
|
+
function disableVoiceInput() {
|
|
1112
|
+
return callNative(getFuncName$1('disableVoiceInput'), {});
|
|
1104
1113
|
}
|
|
1105
1114
|
// 开启意图识别指令返回
|
|
1106
1115
|
function enableDirective(enable) {
|
|
@@ -1124,13 +1133,19 @@ function sendStreamTts$1(text, ttsId, isFirst, isEnd) {
|
|
|
1124
1133
|
function setTtsSpeaker(speaker) {
|
|
1125
1134
|
return callNative(getFuncName$1('setTtsSpeaker'), { speaker: speaker });
|
|
1126
1135
|
}
|
|
1136
|
+
// 发送纯文本
|
|
1137
|
+
function sendVoiceTextToAI(text) {
|
|
1138
|
+
return callNative(getFuncName$1('sendVoiceTextToAI'), { text: text });
|
|
1139
|
+
}
|
|
1127
1140
|
var voice = {
|
|
1128
1141
|
enableVoiceInput: enableVoiceInput,
|
|
1142
|
+
disableVoiceInput: disableVoiceInput,
|
|
1129
1143
|
enableDirective: enableDirective,
|
|
1130
1144
|
stopTts: stopTts$1,
|
|
1131
1145
|
sendTts: sendTts$1,
|
|
1132
1146
|
sendStreamTts: sendStreamTts$1,
|
|
1133
1147
|
setTtsSpeaker: setTtsSpeaker,
|
|
1148
|
+
sendVoiceTextToAI: sendVoiceTextToAI,
|
|
1134
1149
|
};
|
|
1135
1150
|
|
|
1136
1151
|
// 添加事件监听
|
package/lib/index.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ declare const _default: {
|
|
|
39
39
|
sendBroadcast: typeof import("./system").sendBroadcast;
|
|
40
40
|
registerKeys: typeof import("./system").registerKeys;
|
|
41
41
|
unregisterKeys: typeof import("./system").unregisterKeys;
|
|
42
|
+
providerCall: typeof import("./system").providerCall;
|
|
42
43
|
};
|
|
43
44
|
storage: {
|
|
44
45
|
setKey: typeof import("./storage").setKey;
|
|
@@ -97,11 +98,13 @@ declare const _default: {
|
|
|
97
98
|
};
|
|
98
99
|
voice: {
|
|
99
100
|
enableVoiceInput: typeof import("./voice").enableVoiceInput;
|
|
101
|
+
disableVoiceInput: typeof import("./voice").disableVoiceInput;
|
|
100
102
|
enableDirective: typeof import("./voice").enableDirective;
|
|
101
103
|
stopTts: typeof import("./voice").stopTts;
|
|
102
104
|
sendTts: typeof import("./voice").sendTts;
|
|
103
105
|
sendStreamTts: typeof import("./voice").sendStreamTts;
|
|
104
106
|
setTtsSpeaker: typeof import("./voice").setTtsSpeaker;
|
|
107
|
+
sendVoiceTextToAI: typeof import("./voice").sendVoiceTextToAI;
|
|
105
108
|
};
|
|
106
109
|
event: {
|
|
107
110
|
addEventListener: typeof import("./event").addEventListener;
|
package/lib/system/index.d.ts
CHANGED
|
@@ -8,6 +8,11 @@ export interface IntentParam {
|
|
|
8
8
|
uri?: string;
|
|
9
9
|
extras?: any;
|
|
10
10
|
}
|
|
11
|
+
export interface ProviderCallParam {
|
|
12
|
+
uri: string;
|
|
13
|
+
method?: string;
|
|
14
|
+
arg?: string;
|
|
15
|
+
}
|
|
11
16
|
export declare function ready(): Promise<any>;
|
|
12
17
|
export declare function getStartupParams(): Promise<any>;
|
|
13
18
|
export declare function getDeviceInfo(): Promise<any>;
|
|
@@ -21,6 +26,7 @@ export declare function removeEventListener(eventName: string, callback: Functio
|
|
|
21
26
|
export declare function sendBroadcast(params: IntentParam): Promise<any>;
|
|
22
27
|
export declare function registerKeys(params: SystemKeyParam | null): Promise<any>;
|
|
23
28
|
export declare function unregisterKeys(params: SystemKeyParam | null): Promise<any>;
|
|
29
|
+
export declare function providerCall(params: ProviderCallParam): Promise<any>;
|
|
24
30
|
declare const _default: {
|
|
25
31
|
ready: typeof ready;
|
|
26
32
|
getStartupParams: typeof getStartupParams;
|
|
@@ -35,5 +41,6 @@ declare const _default: {
|
|
|
35
41
|
sendBroadcast: typeof sendBroadcast;
|
|
36
42
|
registerKeys: typeof registerKeys;
|
|
37
43
|
unregisterKeys: typeof unregisterKeys;
|
|
44
|
+
providerCall: typeof providerCall;
|
|
38
45
|
};
|
|
39
46
|
export default _default;
|
package/lib/voice/index.d.ts
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
export declare function enableVoiceInput(clientId?: string,
|
|
1
|
+
export declare function enableVoiceInput(clientId?: string, parameters?: any, expandedParameters?: any): Promise<any>;
|
|
2
|
+
export declare function disableVoiceInput(): Promise<any>;
|
|
2
3
|
export declare function enableDirective(enable?: boolean): Promise<any>;
|
|
3
4
|
export declare function stopTts(): Promise<any>;
|
|
4
5
|
export declare function sendTts(text: string, ttsId: string): Promise<any>;
|
|
5
6
|
export declare function sendStreamTts(text: string, ttsId: string, isFirst: boolean, isEnd: boolean): Promise<any>;
|
|
6
7
|
export declare function setTtsSpeaker(speaker: string): Promise<any>;
|
|
8
|
+
export declare function sendVoiceTextToAI(text: string): Promise<any>;
|
|
7
9
|
declare const _default: {
|
|
8
10
|
enableVoiceInput: typeof enableVoiceInput;
|
|
11
|
+
disableVoiceInput: typeof disableVoiceInput;
|
|
9
12
|
enableDirective: typeof enableDirective;
|
|
10
13
|
stopTts: typeof stopTts;
|
|
11
14
|
sendTts: typeof sendTts;
|
|
12
15
|
sendStreamTts: typeof sendStreamTts;
|
|
13
16
|
setTtsSpeaker: typeof setTtsSpeaker;
|
|
17
|
+
sendVoiceTextToAI: typeof sendVoiceTextToAI;
|
|
14
18
|
};
|
|
15
19
|
export default _default;
|