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.
@@ -12,10 +12,24 @@ LarkSR 对象成员方法主要分为以下三类
12
12
  */
13
13
  initSDKAuthCode(id: string): Promise<void>;
14
14
  /**
15
- * 开始云渲染流程
16
- * @returns 是否成功。主要校验授权码是否成功
15
+ * 连接云端渲染资源
16
+ * @params appID 云端资源的 ID
17
+ * @returns Promise 调用接口并校验授权通过返回成功并自动开始连接
17
18
  */
18
- start(): Promise<void>;
19
+ connect(params: {
20
+ appliId: string;
21
+ playerMode?: number;
22
+ userType?: number;
23
+ roomCode?: string;
24
+ taskId?: string;
25
+ clientMac?: string;
26
+ groupId?: string;
27
+ regionId?: string;
28
+ targetServerIp?: string;
29
+ appKey?: string;
30
+ timestamp?: string;
31
+ signature?: string;
32
+ }): Promise<void>;
19
33
  /**
20
34
  * 重新开始云渲染流程
21
35
  */
@@ -24,6 +38,10 @@ restart(): void;
24
38
  * 重新启动云端应用
25
39
  */
26
40
  restartApp(): void;
41
+ /**
42
+ * 主动关闭连接
43
+ */
44
+ close(): void;
27
45
  ```
28
46
 
29
47
  ## 输入输出相关方法,包括鼠标,键盘,手柄,触摸
@@ -122,11 +140,30 @@ keyDown(key: string, isRepeat: boolean): void;
122
140
  * @returns 是否发送成功,如果key参数传递错误可能发送失败
123
141
  */
124
142
  keyUp(key: string): void;
125
- /**
143
+ /**
144
+ * 手柄接口消息按照 windows xbox 360 手柄标准定义,即包含 xbox 360 手柄的功能,如按钮,摇杆,扳机键。windows 上最多支持4个手柄,
145
+ * 当前版本服务端只处理1个手柄,后续会放开多个手柄的支持。接口中发送的按键值为对应的 windows 中定义的按键值。
126
146
  * 向云端发送手柄按钮按下事件
127
- * 參考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
128
- * @param userIndex 手柄的索引
129
- * @param button 按鍵
147
+ * 參考 js 中获取手柄事件,参考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
148
+ * @param userIndex 手柄的索引,硬件设备索引 0-3. 第一个连接的手柄为0,第二个为1,以此类推。
149
+ * @param button 按鍵 @see https://docs.microsoft.com/en-us/windows/win32/api/xinput/ns-xinput-xinput_gamepad
150
+ * export const enum XINPUT_BUTTONS {
151
+ * XINPUT_GAMEPAD_DPAD_UP = 0x0001,
152
+ * XINPUT_GAMEPAD_DPAD_DOWN = 0x0002,
153
+ * XINPUT_GAMEPAD_DPAD_LEFT = 0x0004,
154
+ * XINPUT_GAMEPAD_DPAD_RIGHT = 0x0008,
155
+ * XINPUT_GAMEPAD_START = 0x0010,
156
+ * XINPUT_GAMEPAD_BACK = 0x0020,
157
+ * XINPUT_GAMEPAD_LEFT_THUMB = 0x0040,
158
+ * XINPUT_GAMEPAD_RIGHT_THUMB = 0x0080,
159
+ * XINPUT_GAMEPAD_LEFT_SHOULDER = 0x0100,
160
+ * XINPUT_GAMEPAD_RIGHT_SHOULDER = 0x0200,
161
+ * XINPUT_GAMEPAD_A = 0x1000,
162
+ * XINPUT_GAMEPAD_B = 0x2000,
163
+ * XINPUT_GAMEPAD_X = 0x4000,
164
+ * XINPUT_GAMEPAD_Y = 0x8000,
165
+ * XINPUT_UNKNOWN = -1,
166
+ * }
130
167
  * @param isRepeat 是否重复按下
131
168
  * @returns
132
169
  */
@@ -144,18 +181,23 @@ gamepadButtonUp(userIndex: number, button: number): void;
144
181
  * 參考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
145
182
  * @param userIndex 手柄的索引
146
183
  * @param isleft 是否是左trigger
147
- * @param value trigger的值
184
+ * @param value trigger的值 扳机键的值 0-255
148
185
  * @returns
149
186
  */
150
187
  gamepadTrigger(userIndex: number, isleft: boolean, value: number): void;
151
188
  /**
152
189
  * 向云端发送手柄按摇杆的值,即 axes 值
153
- * 參考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
190
+ * win MAX
191
+ * |
192
+ * MIN-------------MAX
193
+ * |
194
+ * MIN
195
+ * js 中获取硬件手柄參考 https://developer.mozilla.org/zh-CN/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
154
196
  * @param userIndex 手柄的索引
155
- * @param thumblx 手柄摇杆的x轴坐标
156
- * @param thumbly 手柄摇杆的y轴坐标
157
- * @param thumbrx 手柄摇杆的x轴相对坐标
158
- * @param thumbry 手柄摇杆的y轴相对坐标
197
+ * @param thumblx 左摇杆 X 值,-32767 到 32767
198
+ * @param thumbly 左摇杆 Y 值,-32767 到 32767
199
+ * @param thumbrx 右摇杆 X 值,-32767 到 32767
200
+ * @param thumbry 右摇杆 Y 值,-32767 到 32767
159
201
  * @returns
160
202
  */
161
203
  joystick(userIndex: number, thumblx: number, thumbly: number, thumbrx: number, thumbry: number): void;