@tencentcloud/trtc-cloud-wx 1.0.8 → 1.0.9-beta.0

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.
Files changed (56) hide show
  1. package/.babelrc +6 -0
  2. package/.eslintrc.json +129 -0
  3. package/build/chokidar.js +19 -0
  4. package/build/clear.js +24 -0
  5. package/build/copy.js +24 -0
  6. package/build/copy_to_roomkit.js +19 -0
  7. package/dist/package.json +14 -0
  8. package/{trtc-cloud-wx.js → dist/trtc-cloud-wx.js} +15 -5
  9. package/docs/API/TRTCCloud.html +4353 -0
  10. package/docs/API/index.html +98 -0
  11. package/docs/API/scripts/add-toc.js +57 -0
  12. package/docs/API/scripts/collapse.js +20 -0
  13. package/docs/API/scripts/highlight/highlight.min.js +1282 -0
  14. package/docs/API/scripts/highlight/highlightjs-line-numbers.min.js +1 -0
  15. package/docs/API/scripts/linenumber.js +25 -0
  16. package/docs/API/scripts/nav.js +12 -0
  17. package/docs/API/scripts/polyfill.js +4 -0
  18. package/docs/API/scripts/prettify/Apache-License-2.0.txt +202 -0
  19. package/docs/API/scripts/prettify/lang-css.js +2 -0
  20. package/docs/API/scripts/prettify/prettify.js +28 -0
  21. package/docs/API/scripts/search.js +83 -0
  22. package/docs/API/styles/font.css +81 -0
  23. package/docs/API/styles/fonts/JTURjIg1_i6t8kCHKm45_dJE3g3D_vx3rCubqg.woff2 +0 -0
  24. package/docs/API/styles/fonts/JTURjIg1_i6t8kCHKm45_dJE3gTD_vx3rCubqg.woff2 +0 -0
  25. package/docs/API/styles/fonts/JTURjIg1_i6t8kCHKm45_dJE3gbD_vx3rCubqg.woff2 +0 -0
  26. package/docs/API/styles/fonts/JTURjIg1_i6t8kCHKm45_dJE3gfD_vx3rCubqg.woff2 +0 -0
  27. package/docs/API/styles/fonts/JTURjIg1_i6t8kCHKm45_dJE3gnD_vx3rCs.woff2 +0 -0
  28. package/docs/API/styles/fonts/JTUSjIg1_i6t8kCHKm459W1hyyTh89ZNpQ.woff2 +0 -0
  29. package/docs/API/styles/fonts/JTUSjIg1_i6t8kCHKm459WRhyyTh89ZNpQ.woff2 +0 -0
  30. package/docs/API/styles/fonts/JTUSjIg1_i6t8kCHKm459WZhyyTh89ZNpQ.woff2 +0 -0
  31. package/docs/API/styles/fonts/JTUSjIg1_i6t8kCHKm459WdhyyTh89ZNpQ.woff2 +0 -0
  32. package/docs/API/styles/fonts/JTUSjIg1_i6t8kCHKm459WlhyyTh89Y.woff2 +0 -0
  33. package/docs/API/styles/highlight/highlight.min.css +26 -0
  34. package/docs/API/styles/highlight/rainbow.min.css +1 -0
  35. package/docs/API/styles/jsdoc.css +684 -0
  36. package/docs/API/styles/prettify.css +79 -0
  37. package/docs/API/styles/toc.css +44 -0
  38. package/docs/API/tutorial-00-guideline.html +81 -0
  39. package/docs/doc-src/home.md +7 -0
  40. package/docs/doc-src/tutorials/00-guideline.md +1 -0
  41. package/docs/doc-src/tutorials/tutorials.json +5 -0
  42. package/jsdoc.json +43 -0
  43. package/package.json +40 -2
  44. package/rollup.config.js +19 -0
  45. package/sdk_publish.bash +5 -0
  46. package/src/TaskMachine.ts +371 -0
  47. package/src/index.ts +1184 -0
  48. package/src/interface/index.ts +45 -0
  49. package/src/interface/types.ts +95 -0
  50. package/src/log/logger.ts +80 -0
  51. package/src/types.d.ts +1 -0
  52. package/src/utils/common.ts +50 -0
  53. package/src/utils/index.ts +2 -0
  54. package/src/utils/translate.ts +139 -0
  55. package/tsconfig.json +15 -0
  56. package/typedoc.json +21 -0
@@ -0,0 +1,79 @@
1
+ .pln {
2
+ color: #ddd;
3
+ }
4
+
5
+ /* string content */
6
+ .str {
7
+ color: #61ce3c;
8
+ }
9
+
10
+ /* a keyword */
11
+ .kwd {
12
+ color: #fbde2d;
13
+ }
14
+
15
+ /* a comment */
16
+ .com {
17
+ color: #aeaeae;
18
+ }
19
+
20
+ /* a type name */
21
+ .typ {
22
+ color: #8da6ce;
23
+ }
24
+
25
+ /* a literal value */
26
+ .lit {
27
+ color: #fbde2d;
28
+ }
29
+
30
+ /* punctuation */
31
+ .pun {
32
+ color: #ddd;
33
+ }
34
+
35
+ /* lisp open bracket */
36
+ .opn {
37
+ color: #000000;
38
+ }
39
+
40
+ /* lisp close bracket */
41
+ .clo {
42
+ color: #000000;
43
+ }
44
+
45
+ /* a markup tag name */
46
+ .tag {
47
+ color: #8da6ce;
48
+ }
49
+
50
+ /* a markup attribute name */
51
+ .atn {
52
+ color: #fbde2d;
53
+ }
54
+
55
+ /* a markup attribute value */
56
+ .atv {
57
+ color: #ddd;
58
+ }
59
+
60
+ /* a declaration */
61
+ .dec {
62
+ color: #EF5050;
63
+ }
64
+
65
+ /* a variable name */
66
+ .var {
67
+ color: #c82829;
68
+ }
69
+
70
+ /* a function name */
71
+ .fun {
72
+ color: #4271ae;
73
+ }
74
+
75
+ /* Specify class=linenums on a pre to get line numbering */
76
+ ol.linenums {
77
+ margin-top: 0;
78
+ margin-bottom: 0;
79
+ }
@@ -0,0 +1,44 @@
1
+ /* toc 相关样式 */
2
+ .toc{overflow-y:auto}.toc>.toc-list{overflow:hidden;position:relative}.toc>.toc-list li{list-style:none}.toc-list{margin:0;padding-left:10px}a.toc-link{color:currentColor;height:100%}.is-collapsible{max-height:1000px;overflow:hidden;transition:all 300ms ease-in-out}.is-collapsed{max-height:0}.is-position-fixed{position:fixed !important;top:0}.is-active-link{font-weight:700}.toc-link::before{background-color:#EEE;content:' ';display:inline-block;height:inherit;left:0;margin-top:-1px;position:absolute;width:2px}.is-active-link::before{background-color:#54BC4B}
3
+
4
+ section {
5
+ display: flex;
6
+ }
7
+
8
+ section article {
9
+ width: calc(100% - 300px);
10
+ }
11
+
12
+ #toc-container {
13
+ width: 300px;
14
+ max-height: 80vh;
15
+ background: #fff;
16
+ overflow-y: auto;
17
+ position: sticky;
18
+ top: 100px;
19
+ margin-left: 10px;
20
+ }
21
+
22
+ .toc-link::before {
23
+ width: 3px !important;
24
+ }
25
+ .is-active-link::before {
26
+ background-color: #00a4ff !important;
27
+ }
28
+
29
+ .toc-link::before {
30
+ height: 30px;
31
+ }
32
+ .toc-list {
33
+ list-style-type: none;
34
+ }
35
+
36
+ @media screen and (max-width:1024px){
37
+ section article {
38
+ width: 100%;
39
+ }
40
+ /* 小屏不显示目录 */
41
+ #toc-container {
42
+ display: none;
43
+ }
44
+ }
@@ -0,0 +1,81 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+
5
+ <meta charset="utf-8">
6
+ <title>Tutorial: ChatEngine 使用指引 - Documentation</title>
7
+
8
+
9
+ <script src="scripts/highlight/highlight.min.js"></script>
10
+ <script src="scripts/highlight/highlightjs-line-numbers.min.js"></script>
11
+ <!--[if lt IE 9]>
12
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
13
+ <![endif]-->
14
+ <link type="text/css" rel="stylesheet" href="styles/highlight/rainbow.min.css">
15
+ <link type="text/css" rel="stylesheet" href="styles/highlight/highlight.min.css">
16
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
17
+ <script src="scripts/nav.js" defer></script>
18
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
19
+ </head>
20
+ <body>
21
+
22
+ <input type="checkbox" id="nav-trigger" class="nav-trigger" />
23
+ <label for="nav-trigger" class="navicon-button x">
24
+ <div class="navicon"></div>
25
+ </label>
26
+
27
+ <label for="nav-trigger" class="overlay"></label>
28
+
29
+ <nav >
30
+
31
+ <input type="text" id="nav-search" placeholder="Search" />
32
+
33
+ <h2><a href="index.html">Home</a></h2><h3>Interfaces</h3><ul><li><a href="TRTCCloud.html">TRTCCloud</a><ul class='methods'><li data-type='method' style='display: none;'><a href="TRTCCloud.html#.getTRTCShareInstance">getTRTCShareInstance</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#.destroyTRTCShareInstance">destroyTRTCShareInstance</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#on">on</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#off">off</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#emit">emit</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#enterRoom">enterRoom</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#exitRoom">exitRoom</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#switchRoom">switchRoom</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#switchRole">switchRole</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#startLocalPreview">startLocalPreview</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#stopLocalPreview">stopLocalPreview</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#updateLocalView">updateLocalView</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#muteLocalVideo">muteLocalVideo</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#startRemoteView">startRemoteView</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#stopRemoteView">stopRemoteView</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#updateRemoteView">updateRemoteView</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#switchCamera">switchCamera</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#.getTRTCShareInstance">getTRTCShareInstance</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#.destroyTRTCShareInstance">destroyTRTCShareInstance</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#on">on</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#off">off</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#emit">emit</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#enterRoom">enterRoom</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#exitRoom">exitRoom</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#switchRoom">switchRoom</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#switchRole">switchRole</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#startLocalPreview">startLocalPreview</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#stopLocalPreview">stopLocalPreview</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#updateLocalView">updateLocalView</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#muteLocalVideo">muteLocalVideo</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#startRemoteView">startRemoteView</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#stopRemoteView">stopRemoteView</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#updateRemoteView">updateRemoteView</a></li><li data-type='method' style='display: none;'><a href="TRTCCloud.html#switchCamera">switchCamera</a></li></ul></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-00-guideline.html">ChatEngine 使用指引</a></li></ul>
34
+ </nav>
35
+
36
+ <div id="main">
37
+
38
+ <h1 class="page-title">Tutorial: ChatEngine 使用指引</h1>
39
+
40
+
41
+ <section>
42
+
43
+ <header>
44
+
45
+
46
+ <h2>ChatEngine 使用指引</h2>
47
+ <link type="text/css" rel="stylesheet" href="styles/toc.css">
48
+
49
+ </header>
50
+
51
+ <article>
52
+ <p>待补充</p>
53
+ </article>
54
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.11.1/tocbot.min.js"></script>
55
+ <script src="scripts/add-toc.js"></script>
56
+ </section>
57
+
58
+
59
+
60
+ </div>
61
+
62
+ <br class="clear">
63
+
64
+ <footer>
65
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Apr 24 2023 16:55:54 GMT+0800 (China Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
66
+ </footer>
67
+
68
+ <script>
69
+ hljs.highlightAll({cssSelector:'highlight'});
70
+ hljs.initLineNumbersOnLoad();
71
+ </script>
72
+ <script src="scripts/polyfill.js"></script>
73
+
74
+ <script src="scripts/search.js" defer></script>
75
+
76
+
77
+ <script src="scripts/collapse.js" defer></script>
78
+
79
+
80
+ </body>
81
+ </html>
@@ -0,0 +1,7 @@
1
+ # 腾讯云即时通信 IM SDK
2
+
3
+ ## 简介
4
+ 腾讯是国内最早也是最大的即时通信开发商,QQ 和微信已经成为每个互联网用户必不可少的应用。顺应行业数字化转型的趋势,腾讯将高并发、高可靠的即时通信能力进行开放,您可以轻易地根据腾讯提供的 SDK 将即时通信功能集成到 App 中,来满足您业务的各种需求。<br/>
5
+ 针对开发者的不同阶段需求及不同场景,即时通信 IM 团队提供了一系列解决方案,包括:Android、iOS、Windows、Web 的 SDK 组件、服务端集成 REST API 接口、第三方回调接口 等。利用这些组件和能力,开发者可以简单快捷地构建高可靠且稳定的即时通信产品,随心所想,触达全球。
6
+
7
+ ChatEngine 基于腾讯云即时通讯 IM SDK 底层能力实现业务逻辑层核心逻辑封装,支持在 Web 网页、H5、微信小程序、uniapp 等平台下接入使用。
@@ -0,0 +1 @@
1
+ 待补充
@@ -0,0 +1,5 @@
1
+ {
2
+ "00-guideline": {
3
+ "title": "ChatEngine 使用指引"
4
+ }
5
+ }
package/jsdoc.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "plugins": [
3
+ "plugins/markdown",
4
+ "node_modules/better-docs/typescript"
5
+ ],
6
+ "sourceType": "module",
7
+ "source": {
8
+ "include": [
9
+ "./src/index.ts",
10
+ "./src/interface/types.ts"
11
+ ],
12
+ "includePattern": ".+\\.ts(doc|x)?$"
13
+ },
14
+ "typescript": {
15
+ "moduleRoot": "src"
16
+ },
17
+ "opts": {
18
+ "encoding": "utf8",
19
+ "recurse": true,
20
+ "verbose": true,
21
+ "readme": "./docs/doc-src/home.md",
22
+ "tutorials": "./docs/doc-src/tutorials",
23
+ "template": "node_modules/docdash-blue",
24
+ "destination": "docs/API"
25
+ },
26
+ "docdash":{
27
+ "sort": false,
28
+ "search": true,
29
+ "collapse": true,
30
+ "static": true,
31
+ "sectionOrder": [
32
+ "Interfaces",
33
+ "Modules",
34
+ "Tutorials"
35
+ ]
36
+ },
37
+ "templates": {
38
+ "default": {
39
+ "outputSourceFiles": false,
40
+ "useLongnameInNav": true
41
+ }
42
+ }
43
+ }
package/package.json CHANGED
@@ -1,12 +1,50 @@
1
1
  {
2
2
  "name": "@tencentcloud/trtc-cloud-wx",
3
- "version": "1.0.8",
3
+ "version": "1.0.9-beta.0",
4
4
  "description": "",
5
- "main": "./trtc-cloud-wx.js",
5
+ "main": "dist/trtc-cloud-wx.js",
6
+ "module": "dist/trtc-cloud-wx.js",
6
7
  "type": "module",
8
+ "scripts": {
9
+ "build": "npm run clear && rollup -c",
10
+ "dev": "node ./build/chokidar.js",
11
+ "clear": "node ./build/clear.js",
12
+ "copy": "node ./build/copy.js",
13
+ "doc": "npx typedoc --tsconfig typedoc.json",
14
+ "doc:watch": "typedoc --watch",
15
+ "doc:build": "jsdoc -c jsdoc.json",
16
+ "publish": "bash ./sdk_publish.bash"
17
+ },
7
18
  "keywords": [],
8
19
  "author": "",
9
20
  "license": "ISC",
21
+ "devDependencies": {
22
+ "@babel/core": "^7.21.4",
23
+ "@babel/preset-env": "^7.21.4",
24
+ "@babel/preset-typescript": "^7.21.4",
25
+ "@rollup/plugin-babel": "^6.0.3",
26
+ "@rollup/plugin-json": "^6.0.0",
27
+ "@rollup/plugin-terser": "^0.4.3",
28
+ "@rollup/plugin-typescript": "^11.0.0",
29
+ "@types/node": "^18.15.11",
30
+ "@typescript-eslint/eslint-plugin": "^2.28.0",
31
+ "@typescript-eslint/parser": "^2.28.0",
32
+ "babel-loader": "^9.1.2",
33
+ "better-docs": "^2.7.2",
34
+ "chokidar": "^3.5.3",
35
+ "docdash-blue": "^1.1.9",
36
+ "eslint": "^5.14.1",
37
+ "eslint-config-airbnb-base": "13.1.0",
38
+ "eslint-plugin-import": "^2.27.5",
39
+ "eslint-plugin-node": "^7.0.1",
40
+ "eslint-plugin-promise": "^3.8.0",
41
+ "jsdoc": "^4.0.2",
42
+ "rollup": "^3.27.1",
43
+ "taffydb": "^2.7.3",
44
+ "tslib": "^2.5.0",
45
+ "typedoc": "^0.28.0",
46
+ "typescript": "^5.0.2"
47
+ },
10
48
  "dependencies": {
11
49
  "eventemitter3": "^5.0.0",
12
50
  "trtc-wx-sdk": "^1.1.14"
@@ -0,0 +1,19 @@
1
+ import typescript from '@rollup/plugin-typescript'
2
+ import {babel} from '@rollup/plugin-babel'
3
+ import json from '@rollup/plugin-json'
4
+
5
+
6
+ export default {
7
+ input: 'src/index.ts',
8
+ output: {
9
+ file: 'dist/trtc-cloud-wx.js',
10
+ format: 'cjs',
11
+ },
12
+ plugins: [
13
+ babel({
14
+ extensions: ['.js', '.jsx', '.es6', '.es', '.mjs', 'ts', 'tsx'],
15
+ }),
16
+ typescript(),
17
+ json()
18
+ ],
19
+ }
@@ -0,0 +1,5 @@
1
+ npm version patch
2
+ npm run build
3
+ cd ./dist
4
+ npm version patch
5
+ npm publish