larksr_websdk 3.2.34 → 3.2.37

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.
@@ -263,5 +263,17 @@ export declare class AppliParamsUtils {
263
263
  static getIntOption(option: string | null | undefined, emptyValue?: number): number;
264
264
  static getBgColor(option: string | null | undefined): string;
265
265
  }
266
+ /**
267
+ * WARNING 服务器端返回数据随机性较大,统一在该函数里做兼容处理
268
+ * 服务器端可能随意修改字段名称或值,需要注意测试
269
+ * @param startAppInfo
270
+ * @returns
271
+ */
266
272
  export declare function LoadAppliParamsFromUrl(): IAppliParams;
273
+ /**
274
+ * WARNING 服务器端返回数据随机性较大,统一在该函数里做兼容处理
275
+ * 服务器端可能随意修改字段名称或值,需要注意测试
276
+ * @param startAppInfo
277
+ * @returns
278
+ */
267
279
  export declare function LoadAppliParamsStartAppInfo(startAppInfo: StartAppInfo): IAppliParams;
@@ -173,7 +173,11 @@ declare enum LarkSRClientEvent {
173
173
  /**
174
174
  * 对话返回的结果
175
175
  */
176
- AI_VOICE_DM_RESULT = "aivoicedmresult"
176
+ AI_VOICE_DM_RESULT = "aivoicedmresult",
177
+ /**
178
+ * 对话出错详细信息
179
+ */
180
+ AI_VOICE_ERROR = "aivoiceerror"
177
181
  }
178
182
  /**
179
183
  * LarkSR 发出的事件
@@ -447,6 +451,8 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
447
451
  userType?: number;
448
452
  roomCode?: string;
449
453
  taskId?: string;
454
+ regionId?: string;
455
+ groupId?: string;
450
456
  }): Promise<void>;
451
457
  /**
452
458
  * 连接云端渲染资源
@@ -494,6 +500,13 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
494
500
  * 主动关闭连接
495
501
  */
496
502
  close(): void;
503
+ /**
504
+ * 设置是否强制横屏显示内容.
505
+ * handelRootElementSize 必须设置为 true 才有作用。
506
+ * 要注意强制横屏模式下网页的坐标系xy和视觉上相反,如果通过外部输入 input 事件。要注意调整
507
+ * @param force 是否强制横屏
508
+ */
509
+ setMobileForceLandScape(force: boolean): void;
497
510
  /**
498
511
  * 切换当前操作者
499
512
  * @param uid 用户id
@@ -637,10 +650,29 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
637
650
  */
638
651
  keyUp(key: string): void;
639
652
  /**
653
+ * 手柄接口消息按照 windows xbox 360 手柄标准定义,即包含 xbox 360 手柄的功能,如按钮,摇杆,扳机键。windows 上最多支持4个手柄,
654
+ * 当前版本服务端只处理1个手柄,后续会放开多个手柄的支持。接口中发送的按键值为对应的 windows 中定义的按键值。
640
655
  * 向云端发送手柄按钮按下事件
641
- * 參考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
642
- * @param userIndex 手柄的索引
643
- * @param button 按鍵
656
+ * 參考 js 中获取手柄事件,参考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
657
+ * @param userIndex 手柄的索引,硬件设备索引 0-3. 第一个连接的手柄为0,第二个为1,以此类推。
658
+ * @param button 按鍵 @see https://docs.microsoft.com/en-us/windows/win32/api/xinput/ns-xinput-xinput_gamepad
659
+ * export const enum XINPUT_BUTTONS {
660
+ * XINPUT_GAMEPAD_DPAD_UP = 0x0001,
661
+ * XINPUT_GAMEPAD_DPAD_DOWN = 0x0002,
662
+ * XINPUT_GAMEPAD_DPAD_LEFT = 0x0004,
663
+ * XINPUT_GAMEPAD_DPAD_RIGHT = 0x0008,
664
+ * XINPUT_GAMEPAD_START = 0x0010,
665
+ * XINPUT_GAMEPAD_BACK = 0x0020,
666
+ * XINPUT_GAMEPAD_LEFT_THUMB = 0x0040,
667
+ * XINPUT_GAMEPAD_RIGHT_THUMB = 0x0080,
668
+ * XINPUT_GAMEPAD_LEFT_SHOULDER = 0x0100,
669
+ * XINPUT_GAMEPAD_RIGHT_SHOULDER = 0x0200,
670
+ * XINPUT_GAMEPAD_A = 0x1000,
671
+ * XINPUT_GAMEPAD_B = 0x2000,
672
+ * XINPUT_GAMEPAD_X = 0x4000,
673
+ * XINPUT_GAMEPAD_Y = 0x8000,
674
+ * XINPUT_UNKNOWN = -1,
675
+ * }
644
676
  * @param isRepeat 是否重复按下
645
677
  * @returns
646
678
  */
@@ -658,25 +690,31 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
658
690
  * 參考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
659
691
  * @param userIndex 手柄的索引
660
692
  * @param isleft 是否是左trigger
661
- * @param value trigger的值
693
+ * @param value trigger的值 扳机键的值 0-255
662
694
  * @returns
663
695
  */
664
696
  gamepadTrigger(userIndex: number, isleft: boolean, value: number): void;
665
697
  /**
666
698
  * 向云端发送手柄按摇杆的值,即 axes 值
667
- * 參考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
699
+ * win MAX
700
+ * |
701
+ * MIN-------------MAX
702
+ * |
703
+ * MIN
704
+ * js 中获取硬件手柄參考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
668
705
  * @param userIndex 手柄的索引
669
- * @param thumblx 手柄摇杆的x轴坐标
670
- * @param thumbly 手柄摇杆的y轴坐标
671
- * @param thumbrx 手柄摇杆的x轴相对坐标
672
- * @param thumbry 手柄摇杆的y轴相对坐标
706
+ * @param thumblx 左摇杆 X 值,-32767 到 32767
707
+ * @param thumbly 左摇杆 Y 值,-32767 到 32767
708
+ * @param thumbrx 右摇杆 X 值,-32767 到 32767
709
+ * @param thumbry 右摇杆 Y 值,-32767 到 32767
673
710
  * @returns
674
711
  */
675
712
  joystick(userIndex: number, thumblx: number, thumbly: number, thumbrx: number, thumbry: number): void;
676
713
  /**
677
714
  * 向云端发送触摸按下事件
678
715
  * 坐标位置与 mouseMove 相同,相对与云端的鼠标移动位置
679
- * @param id 手指的id
716
+ * @param id 手指的id,当前触摸事件按下手指的 id,同一个手指 id 相同。id 应每次触摸增加。即 touchdown 时 +1,
717
+ * touch move 和 touch up 时保持。当前手指未离开,又有新的手指 touchdown 时再 +1 获得新的 id
680
718
  * @param x 相对云端的x轴坐标
681
719
  * @param y 相对云端的y轴坐标
682
720
  * @returns
@@ -108,5 +108,6 @@ export default class ScreenState extends EventBase<SCREEN_EVENT_TYPE, ScreenEven
108
108
  private larksr;
109
109
  constructor(rootElement: HTMLElement, params: IAppliParams, larksr: LarkSR, handelRootElementSize?: boolean);
110
110
  reset(params: IAppliParams): void;
111
+ setMobileForceLandScape(force: boolean): void;
111
112
  resize(): void;
112
113
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "larksr_websdk",
3
- "version": "3.2.34",
3
+ "version": "3.2.37",
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",
@@ -64,6 +64,7 @@
64
64
  "url-loader": "^4.1.1",
65
65
  "webpack": "^5.54.0",
66
66
  "webpack-cli": "^4.8.0",
67
- "webpack-dev-server": "^4.3.0"
67
+ "webpack-dev-server": "^4.3.0",
68
+ "vconsole": "^3.12.1"
68
69
  }
69
70
  }
@@ -263,5 +263,17 @@ export declare class AppliParamsUtils {
263
263
  static getIntOption(option: string | null | undefined, emptyValue?: number): number;
264
264
  static getBgColor(option: string | null | undefined): string;
265
265
  }
266
+ /**
267
+ * WARNING 服务器端返回数据随机性较大,统一在该函数里做兼容处理
268
+ * 服务器端可能随意修改字段名称或值,需要注意测试
269
+ * @param startAppInfo
270
+ * @returns
271
+ */
266
272
  export declare function LoadAppliParamsFromUrl(): IAppliParams;
273
+ /**
274
+ * WARNING 服务器端返回数据随机性较大,统一在该函数里做兼容处理
275
+ * 服务器端可能随意修改字段名称或值,需要注意测试
276
+ * @param startAppInfo
277
+ * @returns
278
+ */
267
279
  export declare function LoadAppliParamsStartAppInfo(startAppInfo: StartAppInfo): IAppliParams;
@@ -41,7 +41,8 @@ export declare enum APP_EVENT_TYPE {
41
41
  LK_DATA_CHANNEL_RENDERSERVER_CLOSE = 17,
42
42
  AI_VOICE_STATUS = 18,
43
43
  AI_VOICE_ASR_RESULT = 19,
44
- AI_VOICE_DM_RESULT = 20
44
+ AI_VOICE_DM_RESULT = 20,
45
+ AI_VOICE_ERROR = 21
45
46
  }
46
47
  export interface AppEvent extends LocalEvent<APP_EVENT_TYPE> {
47
48
  data?: any;
@@ -127,6 +128,7 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
127
128
  private onAiVoiceStatus;
128
129
  private onAiVoiceAsrResult;
129
130
  private onAiVoiceDMResult;
131
+ private onAiVoiceError;
130
132
  appStateChange(state: APP_STATE): void;
131
133
  private infoMsg;
132
134
  private errorMsg;
@@ -28,7 +28,8 @@ export declare enum WEBRTC_EVENT_TYPE {
28
28
  RTC_ICECANDIDATE = 17,
29
29
  AI_VOICE_STATUS = 18,
30
30
  AI_VOICE_ASR_RESULT = 19,
31
- AI_VOICE_DM_RESULT = 20
31
+ AI_VOICE_DM_RESULT = 20,
32
+ AI_VOICE_ERROR = 21
32
33
  }
33
34
  export interface GoogleBitRate {
34
35
  start: number;
package/types/larksr.d.ts CHANGED
@@ -173,7 +173,11 @@ declare enum LarkSRClientEvent {
173
173
  /**
174
174
  * 对话返回的结果
175
175
  */
176
- AI_VOICE_DM_RESULT = "aivoicedmresult"
176
+ AI_VOICE_DM_RESULT = "aivoicedmresult",
177
+ /**
178
+ * 对话出错详细信息
179
+ */
180
+ AI_VOICE_ERROR = "aivoiceerror"
177
181
  }
178
182
  /**
179
183
  * LarkSR 发出的事件
@@ -447,6 +451,8 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
447
451
  userType?: number;
448
452
  roomCode?: string;
449
453
  taskId?: string;
454
+ regionId?: string;
455
+ groupId?: string;
450
456
  }): Promise<void>;
451
457
  /**
452
458
  * 连接云端渲染资源
@@ -494,6 +500,13 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
494
500
  * 主动关闭连接
495
501
  */
496
502
  close(): void;
503
+ /**
504
+ * 设置是否强制横屏显示内容.
505
+ * handelRootElementSize 必须设置为 true 才有作用。
506
+ * 要注意强制横屏模式下网页的坐标系xy和视觉上相反,如果通过外部输入 input 事件。要注意调整
507
+ * @param force 是否强制横屏
508
+ */
509
+ setMobileForceLandScape(force: boolean): void;
497
510
  /**
498
511
  * 切换当前操作者
499
512
  * @param uid 用户id
@@ -637,10 +650,29 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
637
650
  */
638
651
  keyUp(key: string): void;
639
652
  /**
653
+ * 手柄接口消息按照 windows xbox 360 手柄标准定义,即包含 xbox 360 手柄的功能,如按钮,摇杆,扳机键。windows 上最多支持4个手柄,
654
+ * 当前版本服务端只处理1个手柄,后续会放开多个手柄的支持。接口中发送的按键值为对应的 windows 中定义的按键值。
640
655
  * 向云端发送手柄按钮按下事件
641
- * 參考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
642
- * @param userIndex 手柄的索引
643
- * @param button 按鍵
656
+ * 參考 js 中获取手柄事件,参考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
657
+ * @param userIndex 手柄的索引,硬件设备索引 0-3. 第一个连接的手柄为0,第二个为1,以此类推。
658
+ * @param button 按鍵 @see https://docs.microsoft.com/en-us/windows/win32/api/xinput/ns-xinput-xinput_gamepad
659
+ * export const enum XINPUT_BUTTONS {
660
+ * XINPUT_GAMEPAD_DPAD_UP = 0x0001,
661
+ * XINPUT_GAMEPAD_DPAD_DOWN = 0x0002,
662
+ * XINPUT_GAMEPAD_DPAD_LEFT = 0x0004,
663
+ * XINPUT_GAMEPAD_DPAD_RIGHT = 0x0008,
664
+ * XINPUT_GAMEPAD_START = 0x0010,
665
+ * XINPUT_GAMEPAD_BACK = 0x0020,
666
+ * XINPUT_GAMEPAD_LEFT_THUMB = 0x0040,
667
+ * XINPUT_GAMEPAD_RIGHT_THUMB = 0x0080,
668
+ * XINPUT_GAMEPAD_LEFT_SHOULDER = 0x0100,
669
+ * XINPUT_GAMEPAD_RIGHT_SHOULDER = 0x0200,
670
+ * XINPUT_GAMEPAD_A = 0x1000,
671
+ * XINPUT_GAMEPAD_B = 0x2000,
672
+ * XINPUT_GAMEPAD_X = 0x4000,
673
+ * XINPUT_GAMEPAD_Y = 0x8000,
674
+ * XINPUT_UNKNOWN = -1,
675
+ * }
644
676
  * @param isRepeat 是否重复按下
645
677
  * @returns
646
678
  */
@@ -658,25 +690,31 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
658
690
  * 參考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
659
691
  * @param userIndex 手柄的索引
660
692
  * @param isleft 是否是左trigger
661
- * @param value trigger的值
693
+ * @param value trigger的值 扳机键的值 0-255
662
694
  * @returns
663
695
  */
664
696
  gamepadTrigger(userIndex: number, isleft: boolean, value: number): void;
665
697
  /**
666
698
  * 向云端发送手柄按摇杆的值,即 axes 值
667
- * 參考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
699
+ * win MAX
700
+ * |
701
+ * MIN-------------MAX
702
+ * |
703
+ * MIN
704
+ * js 中获取硬件手柄參考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
668
705
  * @param userIndex 手柄的索引
669
- * @param thumblx 手柄摇杆的x轴坐标
670
- * @param thumbly 手柄摇杆的y轴坐标
671
- * @param thumbrx 手柄摇杆的x轴相对坐标
672
- * @param thumbry 手柄摇杆的y轴相对坐标
706
+ * @param thumblx 左摇杆 X 值,-32767 到 32767
707
+ * @param thumbly 左摇杆 Y 值,-32767 到 32767
708
+ * @param thumbrx 右摇杆 X 值,-32767 到 32767
709
+ * @param thumbry 右摇杆 Y 值,-32767 到 32767
673
710
  * @returns
674
711
  */
675
712
  joystick(userIndex: number, thumblx: number, thumbly: number, thumbrx: number, thumbry: number): void;
676
713
  /**
677
714
  * 向云端发送触摸按下事件
678
715
  * 坐标位置与 mouseMove 相同,相对与云端的鼠标移动位置
679
- * @param id 手指的id
716
+ * @param id 手指的id,当前触摸事件按下手指的 id,同一个手指 id 相同。id 应每次触摸增加。即 touchdown 时 +1,
717
+ * touch move 和 touch up 时保持。当前手指未离开,又有新的手指 touchdown 时再 +1 获得新的 id
680
718
  * @param x 相对云端的x轴坐标
681
719
  * @param y 相对云端的y轴坐标
682
720
  * @returns
@@ -6884,6 +6884,102 @@ export namespace CloudLark {
6884
6884
  public toJSON(): { [k: string]: any };
6885
6885
  }
6886
6886
 
6887
+ /** Properties of an AivoiceError. */
6888
+ interface IAivoiceError {
6889
+
6890
+ /** AivoiceError voiceId */
6891
+ voiceId?: (number|null);
6892
+
6893
+ /** AivoiceError text */
6894
+ text?: (string|null);
6895
+ }
6896
+
6897
+ /** Represents an AivoiceError. */
6898
+ class AivoiceError implements IAivoiceError {
6899
+
6900
+ /**
6901
+ * Constructs a new AivoiceError.
6902
+ * @param [properties] Properties to set
6903
+ */
6904
+ constructor(properties?: CloudLark.IAivoiceError);
6905
+
6906
+ /** AivoiceError voiceId. */
6907
+ public voiceId: number;
6908
+
6909
+ /** AivoiceError text. */
6910
+ public text: string;
6911
+
6912
+ /**
6913
+ * Creates a new AivoiceError instance using the specified properties.
6914
+ * @param [properties] Properties to set
6915
+ * @returns AivoiceError instance
6916
+ */
6917
+ public static create(properties?: CloudLark.IAivoiceError): CloudLark.AivoiceError;
6918
+
6919
+ /**
6920
+ * Encodes the specified AivoiceError message. Does not implicitly {@link CloudLark.AivoiceError.verify|verify} messages.
6921
+ * @param message AivoiceError message or plain object to encode
6922
+ * @param [writer] Writer to encode to
6923
+ * @returns Writer
6924
+ */
6925
+ public static encode(message: CloudLark.IAivoiceError, writer?: $protobuf.Writer): $protobuf.Writer;
6926
+
6927
+ /**
6928
+ * Encodes the specified AivoiceError message, length delimited. Does not implicitly {@link CloudLark.AivoiceError.verify|verify} messages.
6929
+ * @param message AivoiceError message or plain object to encode
6930
+ * @param [writer] Writer to encode to
6931
+ * @returns Writer
6932
+ */
6933
+ public static encodeDelimited(message: CloudLark.IAivoiceError, writer?: $protobuf.Writer): $protobuf.Writer;
6934
+
6935
+ /**
6936
+ * Decodes an AivoiceError message from the specified reader or buffer.
6937
+ * @param reader Reader or buffer to decode from
6938
+ * @param [length] Message length if known beforehand
6939
+ * @returns AivoiceError
6940
+ * @throws {Error} If the payload is not a reader or valid buffer
6941
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
6942
+ */
6943
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): CloudLark.AivoiceError;
6944
+
6945
+ /**
6946
+ * Decodes an AivoiceError message from the specified reader or buffer, length delimited.
6947
+ * @param reader Reader or buffer to decode from
6948
+ * @returns AivoiceError
6949
+ * @throws {Error} If the payload is not a reader or valid buffer
6950
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
6951
+ */
6952
+ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): CloudLark.AivoiceError;
6953
+
6954
+ /**
6955
+ * Verifies an AivoiceError message.
6956
+ * @param message Plain object to verify
6957
+ * @returns `null` if valid, otherwise the reason why it is not
6958
+ */
6959
+ public static verify(message: { [k: string]: any }): (string|null);
6960
+
6961
+ /**
6962
+ * Creates an AivoiceError message from a plain object. Also converts values to their respective internal types.
6963
+ * @param object Plain object
6964
+ * @returns AivoiceError
6965
+ */
6966
+ public static fromObject(object: { [k: string]: any }): CloudLark.AivoiceError;
6967
+
6968
+ /**
6969
+ * Creates a plain object from an AivoiceError message. Also converts values to other types if specified.
6970
+ * @param message AivoiceError
6971
+ * @param [options] Conversion options
6972
+ * @returns Plain object
6973
+ */
6974
+ public static toObject(message: CloudLark.AivoiceError, options?: $protobuf.IConversionOptions): { [k: string]: any };
6975
+
6976
+ /**
6977
+ * Converts this AivoiceError to JSON.
6978
+ * @returns JSON object
6979
+ */
6980
+ public toJSON(): { [k: string]: any };
6981
+ }
6982
+
6887
6983
  /** Properties of a ClientInput. */
6888
6984
  interface IClientInput {
6889
6985
 
@@ -7150,6 +7246,9 @@ export namespace CloudLark {
7150
7246
 
7151
7247
  /** AppNotification aiVoiceServiceStatus */
7152
7248
  aiVoiceServiceStatus?: (CloudLark.IAiVoiceServiceStatus|null);
7249
+
7250
+ /** AppNotification aiVoiceErr */
7251
+ aiVoiceErr?: (CloudLark.IAivoiceError|null);
7153
7252
  }
7154
7253
 
7155
7254
  /** Represents an AppNotification. */
@@ -7194,8 +7293,11 @@ export namespace CloudLark {
7194
7293
  /** AppNotification aiVoiceServiceStatus. */
7195
7294
  public aiVoiceServiceStatus?: (CloudLark.IAiVoiceServiceStatus|null);
7196
7295
 
7296
+ /** AppNotification aiVoiceErr. */
7297
+ public aiVoiceErr?: (CloudLark.IAivoiceError|null);
7298
+
7197
7299
  /** AppNotification notify. */
7198
- public notify?: ("resize"|"mousemode"|"updatePlayers"|"requestInput"|"gamepadOutput"|"datachannelState"|"appDcMsg"|"cursorStyle"|"aiVoiceRealtimeParseresult"|"aiVoiceResult"|"aiVoiceServiceStatus");
7300
+ public notify?: ("resize"|"mousemode"|"updatePlayers"|"requestInput"|"gamepadOutput"|"datachannelState"|"appDcMsg"|"cursorStyle"|"aiVoiceRealtimeParseresult"|"aiVoiceResult"|"aiVoiceServiceStatus"|"aiVoiceErr");
7199
7301
 
7200
7302
  /**
7201
7303
  * Creates a new AppNotification instance using the specified properties.
@@ -108,5 +108,6 @@ export default class ScreenState extends EventBase<SCREEN_EVENT_TYPE, ScreenEven
108
108
  private larksr;
109
109
  constructor(rootElement: HTMLElement, params: IAppliParams, larksr: LarkSR, handelRootElementSize?: boolean);
110
110
  reset(params: IAppliParams): void;
111
+ setMobileForceLandScape(force: boolean): void;
111
112
  resize(): void;
112
113
  }