larksr_websdk 3.2.6 → 3.2.10
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 +35 -24
- package/dist/doc/index.md +43 -3
- package/dist/larksr-web-sdk.min.js +3 -3
- package/dist/types/api.d.ts +27 -0
- package/dist/types/appli_params.d.ts +7 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/larksr.d.ts +86 -9
- package/dist/types/screen_state.d.ts +6 -1
- package/package.json +9 -6
- package/types/api.d.ts +114 -0
- package/types/appli_params.d.ts +267 -0
- package/{dist/types → types}/common/cmd.d.ts +0 -0
- package/{dist/types → types}/common/constant.d.ts +0 -0
- package/{dist/types → types}/common/interface.d.ts +0 -0
- package/types/config.d.ts +59 -0
- package/{dist/types → types}/event/bus.d.ts +0 -0
- package/{dist/types → types}/event/event_base.d.ts +0 -0
- package/{dist/types → types}/event/events.d.ts +0 -0
- package/{dist/types → types}/event/iframe_poster.d.ts +0 -0
- package/{dist/types → types}/event/message.d.ts +0 -0
- package/types/index.d.ts +25 -0
- package/{dist/types → types}/lark/Worker.d.ts +0 -0
- package/{dist/types → types}/lark/application.d.ts +18 -11
- package/{dist/types → types}/lark/custom.d.ts +0 -0
- package/{dist/types → types}/lark/lark_event_type.d.ts +0 -0
- package/{dist/types → types}/lark/message.d.ts +0 -0
- package/{dist/types → types}/lark/peer_connection.d.ts +20 -17
- package/{dist/types → types}/lark/sdp_util.d.ts +0 -0
- package/{dist/types → types}/lark/test_pixel_streaming.d.ts +0 -0
- package/{dist/types → types}/lark/websocket_channel.d.ts +0 -0
- package/{dist/types → types}/lark/websocket_proxy.d.ts +0 -0
- package/types/larksr.d.ts +562 -0
- package/{dist/types → types}/localization/base.d.ts +0 -0
- package/{dist/types → types}/localization/gesture_ins.d.ts +0 -0
- package/{dist/types → types}/localization/language.d.ts +0 -0
- package/{dist/types → types}/localization/loader.d.ts +0 -0
- package/{dist/types → types}/localization/message.d.ts +0 -0
- package/{dist/types → types}/localization/ui.d.ts +0 -0
- package/{dist/types → types}/operation/gamepad_handler.d.ts +0 -0
- package/{dist/types → types}/operation/gesture.d.ts +0 -0
- package/{dist/types → types}/operation/gesture_handler.d.ts +0 -0
- package/{dist/types → types}/operation/handler_base.d.ts +0 -0
- package/{dist/types → types}/operation/keyboard_handler.d.ts +0 -0
- package/{dist/types → types}/operation/keymap.d.ts +0 -0
- package/{dist/types → types}/operation/letter_keymap.d.ts +0 -0
- package/{dist/types → types}/operation/mouse_handler.d.ts +0 -0
- package/{dist/types → types}/operation/num_keymap.d.ts +0 -0
- package/{dist/types → types}/operation/operation.d.ts +8 -1
- package/{dist/types → types}/operation/pixel_streaming_input.d.ts +0 -0
- package/{dist/types → types}/operation/touch_handler.d.ts +0 -0
- package/{dist/types → types}/operation/utils.d.ts +0 -0
- package/{dist/types → types}/protobuf/cloudlark.d.ts +6466 -5944
- package/{dist/types → types}/protobuf/message.d.ts +0 -0
- package/types/screen_state.d.ts +113 -0
- package/types/sdk_auth.d.ts +11 -0
- package/{dist/types → types}/utils/browser_type.d.ts +0 -0
- package/{dist/types → types}/utils/capabilities.d.ts +0 -0
- package/{dist/types → types}/utils/full_screen.d.ts +0 -0
- package/{dist/types → types}/utils/lock_pointer.d.ts +0 -0
- package/{dist/types → types}/utils/log.d.ts +1 -1
- package/{dist/types → types}/utils/scale_mode.d.ts +0 -0
- package/{dist/types → types}/utils/unit.d.ts +1 -0
- package/dist/dist.zip +0 -0
package/README.md
CHANGED
|
@@ -46,42 +46,51 @@ npm i larksr_websdk
|
|
|
46
46
|
3. 系统中获取的应用 ID,如 http://222.128.6.137:8181/ 系统下的 879408743551336448
|
|
47
47
|
|
|
48
48
|
```javascript
|
|
49
|
-
var client
|
|
50
|
-
//
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
49
|
+
var client = new LarkSR({
|
|
50
|
+
// 设置挂载显示的元素
|
|
51
|
+
// 注意*不要*设置为 document.documentElement
|
|
52
|
+
rootElement: document.getElementById('container'),
|
|
53
|
+
// 服务器地址,实际使用中填写您的服务器地址
|
|
54
|
+
// 如:http://222.128.6.137:8181/
|
|
55
|
+
// 当使用平行云托管服务时服务器地址自动分配,可留空。
|
|
56
|
+
// 使用平行云托管服务时使用 CreateLarkSRClientFromePXYHost 或 larksr.connectWithPxyHost 进入应用
|
|
57
|
+
serverAddress: "Lark 服务器前台地址",
|
|
58
|
+
// SDK ID 也可在 initSDKAuthCode 设置
|
|
59
|
+
// authCode: '您的 SDK ID',
|
|
60
|
+
// 测试载入背景图
|
|
61
|
+
// loadingBgUrl: 'https://home-obs.pingxingyun.com/homePage_4_0/bg.jpg',
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// 授权码,验证成功之后才能调用 connect
|
|
65
|
+
client.initSDKAuthCode('您的 SDK ID')
|
|
66
|
+
.then(() => {
|
|
67
|
+
// start connect;
|
|
68
|
+
// 使用平行云托管服务时,用 connectWithPxyHost 进入应用并自动分配服务器.
|
|
69
|
+
client.connect({
|
|
63
70
|
// 要使用的云端资源的应用 ID,从后云雀后台接口获取
|
|
64
71
|
// 参考查询应用一栏文档
|
|
65
72
|
// https://www.pingxingyun.com/online/api3_2.html?id=476
|
|
66
73
|
// 如 222.128.6.137:8181 系统下的 879408743551336448 应用
|
|
67
74
|
appliId: "应用ID"
|
|
68
75
|
})
|
|
69
|
-
.then((
|
|
70
|
-
console.log('enter
|
|
71
|
-
// 创建成返回 LarkSR 实例
|
|
72
|
-
client = res;
|
|
73
|
-
// 开始流程
|
|
74
|
-
client.start();
|
|
76
|
+
.then(() => {
|
|
77
|
+
console.log('enter success');
|
|
75
78
|
})
|
|
76
79
|
.catch((e) => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
console.error(e);
|
|
81
|
+
});
|
|
82
|
+
})
|
|
83
|
+
.catch((e) => {
|
|
84
|
+
console.error(e);
|
|
85
|
+
});
|
|
86
|
+
// ...
|
|
87
|
+
// 主动关闭并清理资源
|
|
88
|
+
// client.close();
|
|
80
89
|
```
|
|
81
90
|
|
|
82
91
|
SDK 加载成功之后,非模块模式下,SDK 挂载为全局对象 larksr_websdk。
|
|
83
92
|
|
|
84
|
-
连接云端资源,管理生命周期和事件等主要在 LarkSR
|
|
93
|
+
连接云端资源,管理生命周期和事件等主要在 LarkSR 对象下。
|
|
85
94
|
|
|
86
95
|
> 默认情况下自动连接云端资源,将容器设置为浏览器视口高度,并配置网页 100% 宽高显示。SDK 内部自动处理按键输入输出。
|
|
87
96
|
|
|
@@ -92,3 +101,5 @@ SDK 加载成功之后,非模块模式下,SDK 挂载为全局对象 larksr_w
|
|
|
92
101
|
更多使用方式和 API 文档可以参考下面项目和 doc 文件夹下的详细文档
|
|
93
102
|
|
|
94
103
|
[Demos](https://github.com/pingxingyun/lark_sr_websdk_demos)
|
|
104
|
+
|
|
105
|
+
[Docs](https://pingxingyun.github.io/webclient_sdk/)
|
package/dist/doc/index.md
CHANGED
|
@@ -45,8 +45,6 @@ export declare function CreateLarkSRClientFromeUrl(config: ILarkSRConfig): Promi
|
|
|
45
45
|
|
|
46
46
|
## 手动创建
|
|
47
47
|
|
|
48
|
-
> 注意,如果手动创建该类,要清楚参数的意义,一般只有调试等特殊情况才手动创建该类
|
|
49
|
-
|
|
50
48
|
```typescript
|
|
51
49
|
/**
|
|
52
50
|
* LarkSR 客户端。所有操作和事件通过该类传递
|
|
@@ -55,7 +53,49 @@ export declare function CreateLarkSRClientFromeUrl(config: ILarkSRConfig): Promi
|
|
|
55
53
|
* @param config 本地配置,如果有 IAppliParams 相同的配置项,优先级最高
|
|
56
54
|
* @param params 云端应用参数等,通过后台接口或者url参数获取。
|
|
57
55
|
*/
|
|
58
|
-
constructor(config: ILarkSRConfig, params
|
|
56
|
+
constructor(config: ILarkSRConfig, params?: IAppliParams);
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
example:
|
|
60
|
+
|
|
61
|
+
```js
|
|
62
|
+
var client = new LarkSR({
|
|
63
|
+
// 设置挂载显示的元素
|
|
64
|
+
// 注意*不要*设置为 document.documentElement
|
|
65
|
+
rootElement: document.getElementById('container'),
|
|
66
|
+
// 服务器地址,实际使用中填写您的服务器地址
|
|
67
|
+
// 如:http://222.128.6.137:8181/
|
|
68
|
+
serverAddress: "Lark 服务器前台地址",
|
|
69
|
+
// SDK ID 也可在 initSDKAuthCode 设置
|
|
70
|
+
// authCode: '您的 SDK ID',
|
|
71
|
+
// 测试载入背景图
|
|
72
|
+
// loadingBgUrl: 'https://home-obs.pingxingyun.com/homePage_4_0/bg.jpg',
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// 授权码,验证成功之后才能调用 connect
|
|
76
|
+
client.initSDKAuthCode('您的 SDK ID')
|
|
77
|
+
.then(() => {
|
|
78
|
+
// start connect;
|
|
79
|
+
client.connect({
|
|
80
|
+
// 要使用的云端资源的应用 ID,从后云雀后台接口获取
|
|
81
|
+
// 参考查询应用一栏文档
|
|
82
|
+
// https://www.pingxingyun.com/online/api3_2.html?id=476
|
|
83
|
+
// 如 222.128.6.137:8181 系统下的 879408743551336448 应用
|
|
84
|
+
appliId: "应用ID"
|
|
85
|
+
})
|
|
86
|
+
.then(() => {
|
|
87
|
+
console.log('enter success');
|
|
88
|
+
})
|
|
89
|
+
.catch((e) => {
|
|
90
|
+
console.error(e);
|
|
91
|
+
});
|
|
92
|
+
})
|
|
93
|
+
.catch((e) => {
|
|
94
|
+
console.error(e);
|
|
95
|
+
});
|
|
96
|
+
// ...
|
|
97
|
+
// 主动关闭并清理资源
|
|
98
|
+
// client.close();
|
|
59
99
|
```
|
|
60
100
|
|
|
61
101
|
## 文档目录
|