larksr_websdk 3.2.16 → 3.2.33
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/README.md +19 -21
- package/dist/doc/config.md +1 -0
- package/dist/doc/index.md +22 -75
- package/dist/doc/sdkid_encryption.md +40 -0
- package/dist/doc/update.md +54 -0
- package/dist/larksr-web-sdk.min.js +1 -15
- package/dist/types/api.d.ts +1 -0
- package/dist/types/appli_params.d.ts +2 -2
- package/dist/types/index.d.ts +1 -4
- package/dist/types/larksr.d.ts +44 -48
- package/package.json +1 -1
- package/types/api.d.ts +1 -0
- package/types/appli_params.d.ts +2 -2
- package/types/index.d.ts +1 -4
- package/types/lark/application.d.ts +15 -1
- package/types/lark/lark_event_type.d.ts +3 -2
- package/types/lark/peer_connection.d.ts +4 -1
- package/types/lark/recoder.d.ts +55 -0
- package/types/larksr.d.ts +44 -48
- package/types/operation/keyboard_handler.d.ts +3 -0
- package/types/operation/mouse_handler.d.ts +2 -0
- package/types/operation/operation.d.ts +0 -1
- package/types/protobuf/cloudlark.d.ts +806 -2
- package/types/utils/capabilities.d.ts +4 -0
- package/types/utils/log.d.ts +1 -1
- package/dist/types/sdk_auth.d.ts +0 -11
- package/types/sdk_auth.d.ts +0 -11
package/dist/types/api.d.ts
CHANGED
|
@@ -132,7 +132,7 @@ export interface IAppliParams {
|
|
|
132
132
|
/**
|
|
133
133
|
* 口令:8位唯一码,写入TaskInfo. 房间code,备用。
|
|
134
134
|
*/
|
|
135
|
-
roomCode:
|
|
135
|
+
roomCode: string;
|
|
136
136
|
/**
|
|
137
137
|
* debug task. 跳过task检测
|
|
138
138
|
*/
|
|
@@ -231,7 +231,7 @@ export declare class AppliParams implements IAppliParams {
|
|
|
231
231
|
playerMode: number;
|
|
232
232
|
userType: number;
|
|
233
233
|
nickname: string;
|
|
234
|
-
roomCode:
|
|
234
|
+
roomCode: string;
|
|
235
235
|
debugTask: boolean;
|
|
236
236
|
debugWebServer: string;
|
|
237
237
|
loadingTimeout: number;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import 'core-js/stable/symbol';
|
|
2
|
-
import { LarkSR,
|
|
2
|
+
import { LarkSR, LarkEventType, LarkSRClientEvent, AppliParams, LoadAppliParamsFromUrl, AppliParamsUtils, LoadAppliParamsStartAppInfo, EventBase, API, Operation, Capabilities, ScaleMode, CloudLark, FullScreen, LockPointer, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent } from "./larksr";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
LarkSR: typeof LarkSR;
|
|
5
|
-
CreateLarkSRClientFromePXYHost: typeof CreateLarkSRClientFromePXYHost;
|
|
6
|
-
CreateLarkSRClientFromeAPI: typeof CreateLarkSRClientFromeAPI;
|
|
7
|
-
CreateLarkSRClientFromeUrl: typeof CreateLarkSRClientFromeUrl;
|
|
8
5
|
API: typeof API;
|
|
9
6
|
AppliParams: typeof AppliParams;
|
|
10
7
|
LoadAppliParamsFromUrl: typeof LoadAppliParamsFromUrl;
|
package/dist/types/larksr.d.ts
CHANGED
|
@@ -46,6 +46,14 @@ declare enum UserType {
|
|
|
46
46
|
* LarkSR 实例会发出的事件
|
|
47
47
|
*/
|
|
48
48
|
declare enum LarkSRClientEvent {
|
|
49
|
+
/**
|
|
50
|
+
* TASK 创建成功,返回 Task 相关信息
|
|
51
|
+
*/
|
|
52
|
+
TASK_CREATE_SUCCESS = "taskcreatesuccess",
|
|
53
|
+
/**
|
|
54
|
+
* TASK 创建失败
|
|
55
|
+
*/
|
|
56
|
+
TASK_CREATE_FAILED = "taskcreatefailed",
|
|
49
57
|
/**
|
|
50
58
|
* 连接渲染服务器成功 .
|
|
51
59
|
*/
|
|
@@ -153,7 +161,19 @@ declare enum LarkSRClientEvent {
|
|
|
153
161
|
/**
|
|
154
162
|
* 一般信息提示
|
|
155
163
|
*/
|
|
156
|
-
INFO = "info"
|
|
164
|
+
INFO = "info",
|
|
165
|
+
/**
|
|
166
|
+
* 语音对话的状态
|
|
167
|
+
*/
|
|
168
|
+
AI_VOICE_STATUS = "aivoicestatus",
|
|
169
|
+
/**
|
|
170
|
+
* 语音识别转文字的结果
|
|
171
|
+
*/
|
|
172
|
+
AI_VOICE_ASR_RESULT = "aivoiceasrresult",
|
|
173
|
+
/**
|
|
174
|
+
* 对话返回的结果
|
|
175
|
+
*/
|
|
176
|
+
AI_VOICE_DM_RESULT = "aivoicedmresult"
|
|
157
177
|
}
|
|
158
178
|
/**
|
|
159
179
|
* LarkSR 发出的事件
|
|
@@ -192,6 +212,7 @@ interface ILarkSRConfig {
|
|
|
192
212
|
authCode?: string;
|
|
193
213
|
/**
|
|
194
214
|
* 可选项,授权是否成功
|
|
215
|
+
* @deprecated 目前不会回调该参数。如果SDK验证失败将在 connect 返回失败
|
|
195
216
|
*/
|
|
196
217
|
authCodeCallback?: (isSuccess: boolean, e: any) => void;
|
|
197
218
|
/**
|
|
@@ -288,46 +309,6 @@ interface ILarkSRConfig {
|
|
|
288
309
|
*/
|
|
289
310
|
publicPortMapping?: PublicPortMapping;
|
|
290
311
|
}
|
|
291
|
-
/**
|
|
292
|
-
* 通过平行云托管平台创建客户端并启动应用
|
|
293
|
-
* @param config 传入 config @see ILarkSRConfig
|
|
294
|
-
* @param params 进入应用接口参数。appliId 为必填项
|
|
295
|
-
* @returns Promise 创建 larksr client 是否成功
|
|
296
|
-
*/
|
|
297
|
-
export declare function CreateLarkSRClientFromePXYHost(config: ILarkSRConfig, params: {
|
|
298
|
-
appliId: string;
|
|
299
|
-
playerMode?: number;
|
|
300
|
-
userType?: number;
|
|
301
|
-
roomCode?: string;
|
|
302
|
-
taskId?: string;
|
|
303
|
-
nickname?: string;
|
|
304
|
-
}): Promise<LarkSR>;
|
|
305
|
-
/**
|
|
306
|
-
* 通过调用后台接口获取云端应用参数
|
|
307
|
-
* @param config 传入 config @see ILarkSRConfig
|
|
308
|
-
* @param params 进入应用接口参数。appliId 为必填项
|
|
309
|
-
* @returns Promise 创建 larksr client 是否成功
|
|
310
|
-
*/
|
|
311
|
-
export declare function CreateLarkSRClientFromeAPI(config: ILarkSRConfig, params: {
|
|
312
|
-
appliId: string;
|
|
313
|
-
playerMode?: number;
|
|
314
|
-
userType?: number;
|
|
315
|
-
roomCode?: string;
|
|
316
|
-
taskId?: string;
|
|
317
|
-
clientMac?: string;
|
|
318
|
-
groupId?: string;
|
|
319
|
-
regionId?: string;
|
|
320
|
-
targetServerIp?: string;
|
|
321
|
-
appKey?: string;
|
|
322
|
-
timestamp?: string;
|
|
323
|
-
signature?: string;
|
|
324
|
-
}): Promise<LarkSR>;
|
|
325
|
-
/**
|
|
326
|
-
* 通过从url参数中获取云端应用相关参数
|
|
327
|
-
* @param config 传入 config @see ILarkSRConfig
|
|
328
|
-
* @returns Promise 创建 larksr client 是否成功
|
|
329
|
-
*/
|
|
330
|
-
export declare function CreateLarkSRClientFromeUrl(config: ILarkSRConfig): Promise<LarkSR>;
|
|
331
312
|
declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
332
313
|
/**
|
|
333
314
|
* 应用参数,构建时传入
|
|
@@ -434,7 +415,6 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
434
415
|
get config(): ILarkSRConfig;
|
|
435
416
|
private _config;
|
|
436
417
|
private loadingTimeout;
|
|
437
|
-
private sdkAuth;
|
|
438
418
|
/**
|
|
439
419
|
* 后台分配的用户id
|
|
440
420
|
*/
|
|
@@ -452,13 +432,11 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
452
432
|
get initCursorMode(): boolean;
|
|
453
433
|
/**
|
|
454
434
|
* LarkSR 客户端。所有操作和事件通过该类传递
|
|
455
|
-
* @
|
|
456
|
-
* @param config 本地配置,如果有 IAppliParams 相同的配置项,优先级最高
|
|
457
|
-
* @param params [可选参数] 云端应用参数等,通过后台接口或者url参数获取。
|
|
435
|
+
* @param config 本地配置,优先级最高
|
|
458
436
|
*/
|
|
459
|
-
constructor(config: ILarkSRConfig
|
|
437
|
+
constructor(config: ILarkSRConfig);
|
|
460
438
|
/**
|
|
461
|
-
*
|
|
439
|
+
* 单独设置sdk授权码,目前总会返回成功 promise,具体验证失败将在 connectWithPxyHost 或 connect 返回
|
|
462
440
|
* @param id sdk id 初始化sdkid
|
|
463
441
|
* @returns
|
|
464
442
|
*/
|
|
@@ -503,7 +481,7 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
503
481
|
* 启动时应用参数不能为空,包括 taskID,appServer,appPort
|
|
504
482
|
* @returns 是否成功。主要校验授权码是否成功
|
|
505
483
|
*/
|
|
506
|
-
start
|
|
484
|
+
private start;
|
|
507
485
|
/**
|
|
508
486
|
* 重新开始云渲染流程
|
|
509
487
|
*/
|
|
@@ -526,6 +504,24 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
526
504
|
* @param text 文字
|
|
527
505
|
*/
|
|
528
506
|
inputText(text: string): void;
|
|
507
|
+
/**
|
|
508
|
+
* 开始智能语音对话文本输入
|
|
509
|
+
* 应在只能语音为开始状态下开始输入
|
|
510
|
+
* @param text 输入的文本
|
|
511
|
+
* @returns 返回对话 ID
|
|
512
|
+
*/
|
|
513
|
+
aiDmTextInput(text: string): number;
|
|
514
|
+
/**
|
|
515
|
+
* 开始智能语音对话语音输入,自动请求录音权限
|
|
516
|
+
* 应在只能语音为开始状态下开始输入
|
|
517
|
+
* @returns 成功返回对话id,失败返回异常
|
|
518
|
+
*/
|
|
519
|
+
startAiDmVoiceInput(): Promise<number>;
|
|
520
|
+
/**
|
|
521
|
+
* 停止智能语音输入,通知语音引擎当前用户输入对话结束
|
|
522
|
+
* @returns 返回当前对话的id
|
|
523
|
+
*/
|
|
524
|
+
stopAiDmVoiceInput(): number;
|
|
529
525
|
/**
|
|
530
526
|
* 发送文字消息给数据通道
|
|
531
527
|
* 注意 云端应用要继承数据通道功能
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "larksr_websdk",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.33",
|
|
4
4
|
"description": "Larksr websdk. Easy to build a cloud render client for larksr system or ue4 pixelstreaming.docs: https://pingxingyun.github.io/webclient_sdk/",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pingxingyun",
|
package/types/api.d.ts
CHANGED
package/types/appli_params.d.ts
CHANGED
|
@@ -132,7 +132,7 @@ export interface IAppliParams {
|
|
|
132
132
|
/**
|
|
133
133
|
* 口令:8位唯一码,写入TaskInfo. 房间code,备用。
|
|
134
134
|
*/
|
|
135
|
-
roomCode:
|
|
135
|
+
roomCode: string;
|
|
136
136
|
/**
|
|
137
137
|
* debug task. 跳过task检测
|
|
138
138
|
*/
|
|
@@ -231,7 +231,7 @@ export declare class AppliParams implements IAppliParams {
|
|
|
231
231
|
playerMode: number;
|
|
232
232
|
userType: number;
|
|
233
233
|
nickname: string;
|
|
234
|
-
roomCode:
|
|
234
|
+
roomCode: string;
|
|
235
235
|
debugTask: boolean;
|
|
236
236
|
debugWebServer: string;
|
|
237
237
|
loadingTimeout: number;
|
package/types/index.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import 'core-js/stable/symbol';
|
|
2
|
-
import { LarkSR,
|
|
2
|
+
import { LarkSR, LarkEventType, LarkSRClientEvent, AppliParams, LoadAppliParamsFromUrl, AppliParamsUtils, LoadAppliParamsStartAppInfo, EventBase, API, Operation, Capabilities, ScaleMode, CloudLark, FullScreen, LockPointer, ILarkSRConfig, PlayerModeType, UserType, LarkSREvent } from "./larksr";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
LarkSR: typeof LarkSR;
|
|
5
|
-
CreateLarkSRClientFromePXYHost: typeof CreateLarkSRClientFromePXYHost;
|
|
6
|
-
CreateLarkSRClientFromeAPI: typeof CreateLarkSRClientFromeAPI;
|
|
7
|
-
CreateLarkSRClientFromeUrl: typeof CreateLarkSRClientFromeUrl;
|
|
8
5
|
API: typeof API;
|
|
9
6
|
AppliParams: typeof AppliParams;
|
|
10
7
|
LoadAppliParamsFromUrl: typeof LoadAppliParamsFromUrl;
|
|
@@ -4,6 +4,7 @@ import WebSocektChannel from './websocket_channel';
|
|
|
4
4
|
import WebsocketProxy from './websocket_proxy';
|
|
5
5
|
import { LarkSR } from '../larksr';
|
|
6
6
|
import PixelStreamingWebsocketChannel from './test_pixel_streaming';
|
|
7
|
+
import { RECORDER_STATE } from './recoder';
|
|
7
8
|
export declare enum APP_STATE {
|
|
8
9
|
BEFORE_CREATE = 0,
|
|
9
10
|
INITED = 1,
|
|
@@ -37,7 +38,10 @@ export declare enum APP_EVENT_TYPE {
|
|
|
37
38
|
LK_DATA_CHANNEL_RENDERSERVER_TEXT_MESSAGE = 14,
|
|
38
39
|
LK_DATA_CHANNEL_RENDERSERVER_BINARY_MESSAGE = 15,
|
|
39
40
|
LK_DATA_CHANNEL_RENDERSERVER_OPEN = 16,
|
|
40
|
-
LK_DATA_CHANNEL_RENDERSERVER_CLOSE = 17
|
|
41
|
+
LK_DATA_CHANNEL_RENDERSERVER_CLOSE = 17,
|
|
42
|
+
AI_VOICE_STATUS = 18,
|
|
43
|
+
AI_VOICE_ASR_RESULT = 19,
|
|
44
|
+
AI_VOICE_DM_RESULT = 20
|
|
41
45
|
}
|
|
42
46
|
export interface AppEvent extends LocalEvent<APP_EVENT_TYPE> {
|
|
43
47
|
data?: any;
|
|
@@ -53,6 +57,9 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
53
57
|
private _state;
|
|
54
58
|
private retryTime;
|
|
55
59
|
private larksr;
|
|
60
|
+
get voiceId(): number;
|
|
61
|
+
get recodeState(): RECORDER_STATE;
|
|
62
|
+
private recoder;
|
|
56
63
|
constructor(larksr: LarkSR);
|
|
57
64
|
init(): void;
|
|
58
65
|
initPc(): void;
|
|
@@ -62,6 +69,10 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
62
69
|
inputText(text: string): void;
|
|
63
70
|
sendTextToDataChannel(text: string): void;
|
|
64
71
|
sendBinaryToDataChannel(binary: Uint8Array): void;
|
|
72
|
+
aiDmTextInput(text: string): number;
|
|
73
|
+
startAiDmVoiceInput(): Promise<number>;
|
|
74
|
+
stopAiDmVoiceInput(): number;
|
|
75
|
+
private onRecoderData;
|
|
65
76
|
start(): Promise<void>;
|
|
66
77
|
connect(): Promise<PixelStreamingWebsocketChannel> | Promise<WebsocketProxy> | Promise<WebSocektChannel> | undefined;
|
|
67
78
|
disConnect(): void;
|
|
@@ -113,6 +124,9 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
|
|
|
113
124
|
private onDataChannelOpen;
|
|
114
125
|
private onDataChannelClose;
|
|
115
126
|
private onPeerConnectionState;
|
|
127
|
+
private onAiVoiceStatus;
|
|
128
|
+
private onAiVoiceAsrResult;
|
|
129
|
+
private onAiVoiceDMResult;
|
|
116
130
|
appStateChange(state: APP_STATE): void;
|
|
117
131
|
private infoMsg;
|
|
118
132
|
private errorMsg;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare enum LarkEventType {
|
|
2
2
|
LK_WEB_CLIENT_LOAD_SUCCESS = 1,
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
LK_TASK_CREATE_SUCCESS = 10,
|
|
4
|
+
LK_TASK_CREATE_FAILED = 11,
|
|
5
5
|
LK_TASK_SYNC_APP = 20,
|
|
6
6
|
LK_TASK_SYNC_APP_FAILED = 21,
|
|
7
7
|
LK_RENDER_SERVER_CONNECTED = 100,
|
|
@@ -33,6 +33,7 @@ export declare enum LarkEventType {
|
|
|
33
33
|
LK_VIDEO_LOADED = 700,
|
|
34
34
|
LK_VIDEO_PLAY_FAILED = 701,
|
|
35
35
|
LK_GOT_REMOTE_STREAM = 710,
|
|
36
|
+
LK_VIDEO_PLAY_SUCCSS = 711,
|
|
36
37
|
LK_NOTIFY_CLIENT_LOGOUT_PLAYER_LOGOUT = 800,
|
|
37
38
|
LK_NOTIFY_CLIENT_LOGOUT_TASKOWNER_LOGOUT = 801,
|
|
38
39
|
LK_APP_PROCESS_NOTIFI_APP_QUIT = 900,
|
|
@@ -25,7 +25,10 @@ export declare enum WEBRTC_EVENT_TYPE {
|
|
|
25
25
|
BAD_NETWORK = 14,
|
|
26
26
|
ERROR = 15,
|
|
27
27
|
RTC_SDP = 16,
|
|
28
|
-
RTC_ICECANDIDATE = 17
|
|
28
|
+
RTC_ICECANDIDATE = 17,
|
|
29
|
+
AI_VOICE_STATUS = 18,
|
|
30
|
+
AI_VOICE_ASR_RESULT = 19,
|
|
31
|
+
AI_VOICE_DM_RESULT = 20
|
|
29
32
|
}
|
|
30
33
|
export interface GoogleBitRate {
|
|
31
34
|
start: number;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { EventBase, LocalEvent } from '../event/event_base';
|
|
2
|
+
export declare enum RECORDER_STATE {
|
|
3
|
+
READY = 0,
|
|
4
|
+
RECORDING = 1
|
|
5
|
+
}
|
|
6
|
+
export declare const RECODER_DEFAULT_CONFIG: {
|
|
7
|
+
sampleRate: number;
|
|
8
|
+
sampleBits: number;
|
|
9
|
+
bufferSize: number;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* LarkSR 实例会发出的事件
|
|
13
|
+
*/
|
|
14
|
+
export declare enum RecodeEventType {
|
|
15
|
+
DATA = 0
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* LarkSR 发出的事件
|
|
19
|
+
*/
|
|
20
|
+
export interface RecodeEvent extends LocalEvent<RecodeEventType> {
|
|
21
|
+
voiceId: number;
|
|
22
|
+
sliceId: number;
|
|
23
|
+
data: Uint8Array;
|
|
24
|
+
}
|
|
25
|
+
export default class Recorder extends EventBase<RecodeEventType, RecodeEvent> {
|
|
26
|
+
get state(): RECORDER_STATE;
|
|
27
|
+
private _state;
|
|
28
|
+
private ctx;
|
|
29
|
+
private sampleRate;
|
|
30
|
+
private sampleBits;
|
|
31
|
+
private recorder;
|
|
32
|
+
private source;
|
|
33
|
+
private stream;
|
|
34
|
+
private buffer;
|
|
35
|
+
private bufferSize;
|
|
36
|
+
get voiceId(): number;
|
|
37
|
+
updateVoiceId(): number;
|
|
38
|
+
private _voiceId;
|
|
39
|
+
constructor({ bufferSize, sampleRate, sampleBits, }?: {
|
|
40
|
+
sampleRate: number;
|
|
41
|
+
sampleBits: number;
|
|
42
|
+
bufferSize: number;
|
|
43
|
+
});
|
|
44
|
+
start(): Promise<number>;
|
|
45
|
+
pause(): void;
|
|
46
|
+
clear(): void;
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
private getRecord;
|
|
52
|
+
private merge;
|
|
53
|
+
private compress;
|
|
54
|
+
private encodeToPCM;
|
|
55
|
+
}
|
package/types/larksr.d.ts
CHANGED
|
@@ -46,6 +46,14 @@ declare enum UserType {
|
|
|
46
46
|
* LarkSR 实例会发出的事件
|
|
47
47
|
*/
|
|
48
48
|
declare enum LarkSRClientEvent {
|
|
49
|
+
/**
|
|
50
|
+
* TASK 创建成功,返回 Task 相关信息
|
|
51
|
+
*/
|
|
52
|
+
TASK_CREATE_SUCCESS = "taskcreatesuccess",
|
|
53
|
+
/**
|
|
54
|
+
* TASK 创建失败
|
|
55
|
+
*/
|
|
56
|
+
TASK_CREATE_FAILED = "taskcreatefailed",
|
|
49
57
|
/**
|
|
50
58
|
* 连接渲染服务器成功 .
|
|
51
59
|
*/
|
|
@@ -153,7 +161,19 @@ declare enum LarkSRClientEvent {
|
|
|
153
161
|
/**
|
|
154
162
|
* 一般信息提示
|
|
155
163
|
*/
|
|
156
|
-
INFO = "info"
|
|
164
|
+
INFO = "info",
|
|
165
|
+
/**
|
|
166
|
+
* 语音对话的状态
|
|
167
|
+
*/
|
|
168
|
+
AI_VOICE_STATUS = "aivoicestatus",
|
|
169
|
+
/**
|
|
170
|
+
* 语音识别转文字的结果
|
|
171
|
+
*/
|
|
172
|
+
AI_VOICE_ASR_RESULT = "aivoiceasrresult",
|
|
173
|
+
/**
|
|
174
|
+
* 对话返回的结果
|
|
175
|
+
*/
|
|
176
|
+
AI_VOICE_DM_RESULT = "aivoicedmresult"
|
|
157
177
|
}
|
|
158
178
|
/**
|
|
159
179
|
* LarkSR 发出的事件
|
|
@@ -192,6 +212,7 @@ interface ILarkSRConfig {
|
|
|
192
212
|
authCode?: string;
|
|
193
213
|
/**
|
|
194
214
|
* 可选项,授权是否成功
|
|
215
|
+
* @deprecated 目前不会回调该参数。如果SDK验证失败将在 connect 返回失败
|
|
195
216
|
*/
|
|
196
217
|
authCodeCallback?: (isSuccess: boolean, e: any) => void;
|
|
197
218
|
/**
|
|
@@ -288,46 +309,6 @@ interface ILarkSRConfig {
|
|
|
288
309
|
*/
|
|
289
310
|
publicPortMapping?: PublicPortMapping;
|
|
290
311
|
}
|
|
291
|
-
/**
|
|
292
|
-
* 通过平行云托管平台创建客户端并启动应用
|
|
293
|
-
* @param config 传入 config @see ILarkSRConfig
|
|
294
|
-
* @param params 进入应用接口参数。appliId 为必填项
|
|
295
|
-
* @returns Promise 创建 larksr client 是否成功
|
|
296
|
-
*/
|
|
297
|
-
export declare function CreateLarkSRClientFromePXYHost(config: ILarkSRConfig, params: {
|
|
298
|
-
appliId: string;
|
|
299
|
-
playerMode?: number;
|
|
300
|
-
userType?: number;
|
|
301
|
-
roomCode?: string;
|
|
302
|
-
taskId?: string;
|
|
303
|
-
nickname?: string;
|
|
304
|
-
}): Promise<LarkSR>;
|
|
305
|
-
/**
|
|
306
|
-
* 通过调用后台接口获取云端应用参数
|
|
307
|
-
* @param config 传入 config @see ILarkSRConfig
|
|
308
|
-
* @param params 进入应用接口参数。appliId 为必填项
|
|
309
|
-
* @returns Promise 创建 larksr client 是否成功
|
|
310
|
-
*/
|
|
311
|
-
export declare function CreateLarkSRClientFromeAPI(config: ILarkSRConfig, params: {
|
|
312
|
-
appliId: string;
|
|
313
|
-
playerMode?: number;
|
|
314
|
-
userType?: number;
|
|
315
|
-
roomCode?: string;
|
|
316
|
-
taskId?: string;
|
|
317
|
-
clientMac?: string;
|
|
318
|
-
groupId?: string;
|
|
319
|
-
regionId?: string;
|
|
320
|
-
targetServerIp?: string;
|
|
321
|
-
appKey?: string;
|
|
322
|
-
timestamp?: string;
|
|
323
|
-
signature?: string;
|
|
324
|
-
}): Promise<LarkSR>;
|
|
325
|
-
/**
|
|
326
|
-
* 通过从url参数中获取云端应用相关参数
|
|
327
|
-
* @param config 传入 config @see ILarkSRConfig
|
|
328
|
-
* @returns Promise 创建 larksr client 是否成功
|
|
329
|
-
*/
|
|
330
|
-
export declare function CreateLarkSRClientFromeUrl(config: ILarkSRConfig): Promise<LarkSR>;
|
|
331
312
|
declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
332
313
|
/**
|
|
333
314
|
* 应用参数,构建时传入
|
|
@@ -434,7 +415,6 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
434
415
|
get config(): ILarkSRConfig;
|
|
435
416
|
private _config;
|
|
436
417
|
private loadingTimeout;
|
|
437
|
-
private sdkAuth;
|
|
438
418
|
/**
|
|
439
419
|
* 后台分配的用户id
|
|
440
420
|
*/
|
|
@@ -452,13 +432,11 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
452
432
|
get initCursorMode(): boolean;
|
|
453
433
|
/**
|
|
454
434
|
* LarkSR 客户端。所有操作和事件通过该类传递
|
|
455
|
-
* @
|
|
456
|
-
* @param config 本地配置,如果有 IAppliParams 相同的配置项,优先级最高
|
|
457
|
-
* @param params [可选参数] 云端应用参数等,通过后台接口或者url参数获取。
|
|
435
|
+
* @param config 本地配置,优先级最高
|
|
458
436
|
*/
|
|
459
|
-
constructor(config: ILarkSRConfig
|
|
437
|
+
constructor(config: ILarkSRConfig);
|
|
460
438
|
/**
|
|
461
|
-
*
|
|
439
|
+
* 单独设置sdk授权码,目前总会返回成功 promise,具体验证失败将在 connectWithPxyHost 或 connect 返回
|
|
462
440
|
* @param id sdk id 初始化sdkid
|
|
463
441
|
* @returns
|
|
464
442
|
*/
|
|
@@ -503,7 +481,7 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
503
481
|
* 启动时应用参数不能为空,包括 taskID,appServer,appPort
|
|
504
482
|
* @returns 是否成功。主要校验授权码是否成功
|
|
505
483
|
*/
|
|
506
|
-
start
|
|
484
|
+
private start;
|
|
507
485
|
/**
|
|
508
486
|
* 重新开始云渲染流程
|
|
509
487
|
*/
|
|
@@ -526,6 +504,24 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
|
|
|
526
504
|
* @param text 文字
|
|
527
505
|
*/
|
|
528
506
|
inputText(text: string): void;
|
|
507
|
+
/**
|
|
508
|
+
* 开始智能语音对话文本输入
|
|
509
|
+
* 应在只能语音为开始状态下开始输入
|
|
510
|
+
* @param text 输入的文本
|
|
511
|
+
* @returns 返回对话 ID
|
|
512
|
+
*/
|
|
513
|
+
aiDmTextInput(text: string): number;
|
|
514
|
+
/**
|
|
515
|
+
* 开始智能语音对话语音输入,自动请求录音权限
|
|
516
|
+
* 应在只能语音为开始状态下开始输入
|
|
517
|
+
* @returns 成功返回对话id,失败返回异常
|
|
518
|
+
*/
|
|
519
|
+
startAiDmVoiceInput(): Promise<number>;
|
|
520
|
+
/**
|
|
521
|
+
* 停止智能语音输入,通知语音引擎当前用户输入对话结束
|
|
522
|
+
* @returns 返回当前对话的id
|
|
523
|
+
*/
|
|
524
|
+
stopAiDmVoiceInput(): number;
|
|
529
525
|
/**
|
|
530
526
|
* 发送文字消息给数据通道
|
|
531
527
|
* 注意 云端应用要继承数据通道功能
|
|
@@ -3,13 +3,16 @@ import HandlerBase from './handler_base';
|
|
|
3
3
|
export default class KeyboardHandler extends HandlerBase {
|
|
4
4
|
private needSyncKeyState;
|
|
5
5
|
private fistSyncKeyState;
|
|
6
|
+
private pressedKeys;
|
|
6
7
|
constructor(op: Operation);
|
|
7
8
|
startListening(): void;
|
|
8
9
|
stopListening(): void;
|
|
10
|
+
private onLockPointChange;
|
|
9
11
|
private keyboardListenerSetup;
|
|
10
12
|
private onKeyDown;
|
|
11
13
|
private onKeyUp;
|
|
12
14
|
private onWindowBlur;
|
|
13
15
|
private onWindowFocus;
|
|
14
16
|
private onWindowVisibilityChange;
|
|
17
|
+
private releaseKeys;
|
|
15
18
|
}
|
|
@@ -8,6 +8,7 @@ export default class MouseHandler extends HandlerBase {
|
|
|
8
8
|
private isFocus;
|
|
9
9
|
private rootElement;
|
|
10
10
|
private subscribeUpdatePlayerListFromProtoAction;
|
|
11
|
+
private pressedMouseButtons;
|
|
11
12
|
constructor(rootElement: HTMLElement, op: Operation);
|
|
12
13
|
resetLocalRendreMousePosition(p: Point): void;
|
|
13
14
|
setRootElement(rootElement: HTMLElement): void;
|
|
@@ -36,5 +37,6 @@ export default class MouseHandler extends HandlerBase {
|
|
|
36
37
|
private onWindowBlur;
|
|
37
38
|
private onWindowFocus;
|
|
38
39
|
private onWindowVisibilityChange;
|
|
40
|
+
private releaseMouseButtons;
|
|
39
41
|
private toastMsg;
|
|
40
42
|
}
|
|
@@ -18,7 +18,6 @@ export default class Operation extends EventBase<OPREATION_EVENT_TYPE, Operation
|
|
|
18
18
|
private keyboardHandler;
|
|
19
19
|
private mouseHandler;
|
|
20
20
|
private gamepadHandler;
|
|
21
|
-
private useTouch;
|
|
22
21
|
private touchHandler;
|
|
23
22
|
private _startListen;
|
|
24
23
|
set enableParse(enable: boolean);
|