@ccos/ccsdk-lite 1.0.18 → 1.0.20

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 CHANGED
@@ -1097,9 +1097,20 @@ function getFuncName$1(name) {
1097
1097
  return moduleName$1 + '_' + name;
1098
1098
  }
1099
1099
  // 开启语音输入
1100
- function enableVoiceInput(clientId) {
1100
+ function enableVoiceInput(clientId, parameters, expandedParameters) {
1101
1101
  if (clientId === void 0) { clientId = ''; }
1102
- return callNative(getFuncName$1('enableVoiceInput'), { clientId: clientId });
1102
+ if (parameters === void 0) { parameters = {}; }
1103
+ if (expandedParameters === void 0) { expandedParameters = {}; }
1104
+ return callNative(getFuncName$1('enableVoiceInput'), { clientId: clientId, parameters: parameters, expandedParameters: expandedParameters });
1105
+ }
1106
+ // 关闭语音输入
1107
+ function disableVoiceInput() {
1108
+ return callNative(getFuncName$1('disableVoiceInput'), {});
1109
+ }
1110
+ // 开启意图识别指令返回
1111
+ function enableDirective(enable) {
1112
+ if (enable === void 0) { enable = true; }
1113
+ return callNative(getFuncName$1('enableDirective'), { enable: enable });
1103
1114
  }
1104
1115
  // 停止TTS播报
1105
1116
  //
@@ -1118,12 +1129,19 @@ function sendStreamTts$1(text, ttsId, isFirst, isEnd) {
1118
1129
  function setTtsSpeaker(speaker) {
1119
1130
  return callNative(getFuncName$1('setTtsSpeaker'), { speaker: speaker });
1120
1131
  }
1132
+ // 发送纯文本
1133
+ function sendVoiceTextToAI(text) {
1134
+ return callNative(getFuncName$1('sendVoiceTextToAI'), { text: text });
1135
+ }
1121
1136
  var voice = {
1122
1137
  enableVoiceInput: enableVoiceInput,
1138
+ disableVoiceInput: disableVoiceInput,
1139
+ enableDirective: enableDirective,
1123
1140
  stopTts: stopTts$1,
1124
1141
  sendTts: sendTts$1,
1125
1142
  sendStreamTts: sendStreamTts$1,
1126
1143
  setTtsSpeaker: setTtsSpeaker,
1144
+ sendVoiceTextToAI: sendVoiceTextToAI,
1127
1145
  };
1128
1146
 
1129
1147
  // 添加事件监听
package/lib/index.d.ts CHANGED
@@ -97,10 +97,13 @@ declare const _default: {
97
97
  };
98
98
  voice: {
99
99
  enableVoiceInput: typeof import("./voice").enableVoiceInput;
100
+ disableVoiceInput: typeof import("./voice").disableVoiceInput;
101
+ enableDirective: typeof import("./voice").enableDirective;
100
102
  stopTts: typeof import("./voice").stopTts;
101
103
  sendTts: typeof import("./voice").sendTts;
102
104
  sendStreamTts: typeof import("./voice").sendStreamTts;
103
105
  setTtsSpeaker: typeof import("./voice").setTtsSpeaker;
106
+ sendVoiceTextToAI: typeof import("./voice").sendVoiceTextToAI;
104
107
  };
105
108
  event: {
106
109
  addEventListener: typeof import("./event").addEventListener;
@@ -1,13 +1,19 @@
1
- export declare function enableVoiceInput(clientId?: string): Promise<any>;
1
+ export declare function enableVoiceInput(clientId?: string, parameters?: any, expandedParameters?: any): Promise<any>;
2
+ export declare function disableVoiceInput(): Promise<any>;
3
+ export declare function enableDirective(enable?: boolean): Promise<any>;
2
4
  export declare function stopTts(): Promise<any>;
3
5
  export declare function sendTts(text: string, ttsId: string): Promise<any>;
4
6
  export declare function sendStreamTts(text: string, ttsId: string, isFirst: boolean, isEnd: boolean): Promise<any>;
5
7
  export declare function setTtsSpeaker(speaker: string): Promise<any>;
8
+ export declare function sendVoiceTextToAI(text: string): Promise<any>;
6
9
  declare const _default: {
7
10
  enableVoiceInput: typeof enableVoiceInput;
11
+ disableVoiceInput: typeof disableVoiceInput;
12
+ enableDirective: typeof enableDirective;
8
13
  stopTts: typeof stopTts;
9
14
  sendTts: typeof sendTts;
10
15
  sendStreamTts: typeof sendStreamTts;
11
16
  setTtsSpeaker: typeof setTtsSpeaker;
17
+ sendVoiceTextToAI: typeof sendVoiceTextToAI;
12
18
  };
13
19
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccos/ccsdk-lite",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "description": "a jssdk for coocaa tv-system",
5
5
  "type": "module",
6
6
  "main": "lib/bundle.js",