@tencentcloud/trtc-component-wx 0.0.1

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/.babelrc ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "plugins": [
3
+ ["module-resolver", {
4
+ "root": ["./src"],
5
+ "alias": {}
6
+ }]
7
+ ],
8
+ "presets": [
9
+ ["env", {"loose": true, "modules": "commonjs"}]
10
+ ]
11
+ }
package/.eslintrc.js ADDED
@@ -0,0 +1,101 @@
1
+ module.exports = {
2
+ 'extends': [
3
+ 'airbnb-base',
4
+ 'plugin:promise/recommended'
5
+ ],
6
+ 'parser': '@typescript-eslint/parser',
7
+ 'plugins': ['@typescript-eslint'],
8
+ 'parserOptions': {
9
+ 'ecmaVersion': 9,
10
+ 'ecmaFeatures': {
11
+ 'jsx': false
12
+ },
13
+ 'sourceType': 'module'
14
+ },
15
+ 'env': {
16
+ 'es6': true,
17
+ 'node': true,
18
+ 'jest': true
19
+ },
20
+ 'plugins': [
21
+ 'import',
22
+ 'node',
23
+ 'promise'
24
+ ],
25
+ 'rules': {
26
+ 'arrow-parens': 'off',
27
+ 'comma-dangle': [
28
+ 'error',
29
+ 'only-multiline'
30
+ ],
31
+ 'complexity': ['error', 20],
32
+ 'func-names': 'off',
33
+ 'global-require': 'off',
34
+ 'handle-callback-err': [
35
+ 'error',
36
+ '^(err|error)$'
37
+ ],
38
+ 'import/no-unresolved': [
39
+ 'error',
40
+ {
41
+ 'caseSensitive': true,
42
+ 'commonjs': true,
43
+ 'ignore': ['^[^.]']
44
+ }
45
+ ],
46
+ 'import/prefer-default-export': 'off',
47
+ 'linebreak-style': 'off',
48
+ 'no-catch-shadow': 'error',
49
+ 'no-continue': 'off',
50
+ 'no-div-regex': 'warn',
51
+ 'no-else-return': 'off',
52
+ 'no-param-reassign': 'off',
53
+ 'no-plusplus': 'off',
54
+ 'no-shadow': 'off',
55
+ 'no-multi-assign': 'off',
56
+ 'no-underscore-dangle': 'off',
57
+ 'node/no-deprecated-api': 'error',
58
+ 'node/process-exit-as-throw': 'error',
59
+ 'object-curly-spacing': [
60
+ 'error',
61
+ 'never'
62
+ ],
63
+ 'operator-linebreak': [
64
+ 'error',
65
+ 'after',
66
+ {
67
+ 'overrides': {
68
+ ':': 'before',
69
+ '?': 'before'
70
+ }
71
+ }
72
+ ],
73
+ 'prefer-arrow-callback': 'off',
74
+ 'prefer-destructuring': 'off',
75
+ 'prefer-template': 'off',
76
+ 'quote-props': [
77
+ 1,
78
+ 'as-needed',
79
+ {
80
+ 'unnecessary': true
81
+ }
82
+ ],
83
+ 'semi': [
84
+ 'error',
85
+ 'never'
86
+ ],
87
+ 'no-await-in-loop': 'off',
88
+ 'no-restricted-syntax': 'off',
89
+ 'promise/always-return': 'off',
90
+ },
91
+ 'globals': {
92
+ 'window': true,
93
+ 'document': true,
94
+ 'App': true,
95
+ 'Page': true,
96
+ 'Component': true,
97
+ 'Behavior': true,
98
+ 'wx': true,
99
+ 'getCurrentPages': true,
100
+ }
101
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,131 @@
1
+ # miniprogram-custom-component
2
+
3
+ 小程序自定义组件开发模板:
4
+
5
+ * 支持使用 less 语法编写 wxss 文件
6
+ * 使用 webpack 构建 js
7
+ * 支持自定义组件单元测试
8
+ * 支持 eslint
9
+ * 支持多入口构建
10
+
11
+ ## 使用
12
+
13
+ * 使用[命令行工具](https://github.com/wechat-miniprogram/miniprogram-cli)进行初始化
14
+ * 直接从 github 上 clone 下来
15
+
16
+ ## 开发
17
+
18
+ 1. 安装依赖:
19
+
20
+ ```
21
+ npm install
22
+ ```
23
+
24
+ 2. 执行命令:
25
+
26
+ ```
27
+ npm run dev
28
+ ```
29
+
30
+ 默认会在包根目录下生成 miniprogram\_dev 目录,src 中的源代码会被构建并生成到 miniprogram\_dev/components 目录下。如果需要监听文件变化动态构建,则可以执行命令:
31
+
32
+ ```
33
+ npm run watch
34
+ ```
35
+
36
+ > ps: 如果 minirpogram\_dev 目录下已存在小程序 demo,执行`npm run dev`则不会再将 tools 下的 demo 拷贝到此目录下。而执行`npm run watch`则会监听 tools 目录下的 demo 变动并进行拷贝。
37
+
38
+ 3. 生成的 miniprogram\_dev 目录是一个小程序项目目录,以此目录作为小程序项目目录在开发者工具中打开即可查看自定义组件被使用的效果。
39
+
40
+ 4. 进阶:
41
+
42
+ * 如果有额外的构建需求,可自行修改 tools 目录中的构建脚本。
43
+ * 内置支持 webpack、less 语法、sourcemap 等功能,默认关闭。如若需要可以自行修改 tools/config.js 配置文件中相关配置。
44
+ * 内置支持多入口构建,如若需要可自行调整 tools/config.js 配置文件的 entry 字段。
45
+ * 默认开启 eslint,可自行调整规则或在 tools/config.js 中注释掉 eslint-loader 行来关闭此功能。
46
+
47
+ ## 发布
48
+
49
+ > ps: 发布前得确保已经执行构建,小程序 npm 包只有构建出来的目录是真正被使用到的。
50
+
51
+ 1. 如果还没有 npm 帐号,可以到[ npm 官网](https://www.npmjs.com/)注册一个 npm 帐号。
52
+ 2. 在本地登录 npm 帐号,在本地执行:
53
+
54
+ ```
55
+ npm adduser
56
+ ```
57
+
58
+ 或者
59
+
60
+ ```
61
+ npm login
62
+ ```
63
+
64
+ 3. 在已完成编写的 npm 包根目录下执行:
65
+
66
+ ```
67
+ npm publish
68
+ ```
69
+
70
+ 到此,npm 包就成功发布到 npm 平台了。
71
+
72
+ > PS:一些开发者在开发过程中可能修改过 npm 的源,所以当进行登录或发布时需要注意要将源切回 npm 的源。
73
+
74
+ ## 目录结构
75
+
76
+ 以下为推荐使用的目录结构,如果有必要开发者也可以自行做一些调整:
77
+
78
+ ```
79
+ |--miniprogram_dev // 开发环境构建目录
80
+ |--miniprogram_dist // 生产环境构建目录
81
+ |--src // 源码
82
+ | |--components // 通用自定义组件
83
+ | |--images // 图片资源
84
+ | |
85
+ | |--xxx.js/xxx.wxml/xxx.json/xxx.wxss // 暴露的 js 模块/自定义组件入口文件
86
+ |
87
+ |--test // 测试用例
88
+ |--tools // 构建相关代码
89
+ | |--demo // demo 小程序目录,开发环境下会被拷贝生成到 miniprogram_dev 目录中
90
+ | |--config.js // 构建相关配置文件
91
+ |
92
+ |--gulpfile.js
93
+ ```
94
+
95
+ > PS:对外暴露的 js 模块/自定义组件请放在 src 目录下,不宜放置在过深的目录。另外新增的暴露模块需要在 tools/config.js 的 entry 字段中补充,不然不会进行构建。
96
+
97
+ ## 测试
98
+
99
+ * 执行测试用例:
100
+
101
+ ```
102
+ npm run test
103
+ ```
104
+
105
+ * 执行测试用例并进入 node inspect 调试:
106
+
107
+ ```
108
+ npm run test-debug
109
+ ```
110
+
111
+ * 检测覆盖率:
112
+
113
+ ```
114
+ npm run coverage
115
+ ```
116
+
117
+ 测试用例放在 test 目录下,使用 **miniprogram-simulate** 工具集进行测试,[点击此处查看](https://github.com/wechat-miniprogram/miniprogram-simulate/blob/master/README.md)使用方法。在测试中可能需要变更或调整工具集中的一些方法,可在 test/utils 下自行实现。
118
+
119
+ ## 其他命令
120
+
121
+ * 清空 miniprogram_dist 目录:
122
+
123
+ ```
124
+ npm run clean
125
+ ```
126
+
127
+ * 清空 miniprogam_dev 目录:
128
+
129
+ ```
130
+ npm run clean-dev
131
+ ```
package/gulpfile.js ADDED
@@ -0,0 +1,26 @@
1
+ const gulp = require('gulp')
2
+ const clean = require('gulp-clean')
3
+
4
+ const config = require('./tools/config')
5
+ const BuildTask = require('./tools/build')
6
+ const id = require('./package.json').name || 'miniprogram-custom-component'
7
+
8
+ // 构建任务实例
9
+ // eslint-disable-next-line no-new
10
+ new BuildTask(id, config.entry)
11
+
12
+ // 清空生成目录和文件
13
+ gulp.task('clean', gulp.series(() => gulp.src(config.distPath, {read: false, allowEmpty: true}).pipe(clean()), done => {
14
+ if (config.isDev) {
15
+ return gulp.src(config.demoDist, {read: false, allowEmpty: true})
16
+ .pipe(clean())
17
+ }
18
+
19
+ return done()
20
+ }))
21
+ // 监听文件变化并进行开发模式构建
22
+ gulp.task('watch', gulp.series(`${id}-watch`))
23
+ // 开发模式构建
24
+ gulp.task('dev', gulp.series(`${id}-dev`))
25
+ // 生产模式构建
26
+ gulp.task('default', gulp.series(`${id}-default`))
@@ -0,0 +1,183 @@
1
+ module.exports =
2
+ /******/ (function(modules) { // webpackBootstrap
3
+ /******/ // The module cache
4
+ /******/ var installedModules = {};
5
+ /******/
6
+ /******/ // The require function
7
+ /******/ function __webpack_require__(moduleId) {
8
+ /******/
9
+ /******/ // Check if module is in cache
10
+ /******/ if(installedModules[moduleId]) {
11
+ /******/ return installedModules[moduleId].exports;
12
+ /******/ }
13
+ /******/ // Create a new module (and put it into the cache)
14
+ /******/ var module = installedModules[moduleId] = {
15
+ /******/ i: moduleId,
16
+ /******/ l: false,
17
+ /******/ exports: {}
18
+ /******/ };
19
+ /******/
20
+ /******/ // Execute the module function
21
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
+ /******/
23
+ /******/ // Flag the module as loaded
24
+ /******/ module.l = true;
25
+ /******/
26
+ /******/ // Return the exports of the module
27
+ /******/ return module.exports;
28
+ /******/ }
29
+ /******/
30
+ /******/
31
+ /******/ // expose the modules object (__webpack_modules__)
32
+ /******/ __webpack_require__.m = modules;
33
+ /******/
34
+ /******/ // expose the module cache
35
+ /******/ __webpack_require__.c = installedModules;
36
+ /******/
37
+ /******/ // define getter function for harmony exports
38
+ /******/ __webpack_require__.d = function(exports, name, getter) {
39
+ /******/ if(!__webpack_require__.o(exports, name)) {
40
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
+ /******/ }
42
+ /******/ };
43
+ /******/
44
+ /******/ // define __esModule on exports
45
+ /******/ __webpack_require__.r = function(exports) {
46
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
+ /******/ }
49
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
+ /******/ };
51
+ /******/
52
+ /******/ // create a fake namespace object
53
+ /******/ // mode & 1: value is a module id, require it
54
+ /******/ // mode & 2: merge all properties of value into the ns
55
+ /******/ // mode & 4: return value when already ns object
56
+ /******/ // mode & 8|1: behave like require
57
+ /******/ __webpack_require__.t = function(value, mode) {
58
+ /******/ if(mode & 1) value = __webpack_require__(value);
59
+ /******/ if(mode & 8) return value;
60
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
+ /******/ var ns = Object.create(null);
62
+ /******/ __webpack_require__.r(ns);
63
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
+ /******/ return ns;
66
+ /******/ };
67
+ /******/
68
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
69
+ /******/ __webpack_require__.n = function(module) {
70
+ /******/ var getter = module && module.__esModule ?
71
+ /******/ function getDefault() { return module['default']; } :
72
+ /******/ function getModuleExports() { return module; };
73
+ /******/ __webpack_require__.d(getter, 'a', getter);
74
+ /******/ return getter;
75
+ /******/ };
76
+ /******/
77
+ /******/ // Object.prototype.hasOwnProperty.call
78
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
+ /******/
80
+ /******/ // __webpack_public_path__
81
+ /******/ __webpack_require__.p = "";
82
+ /******/
83
+ /******/
84
+ /******/ // Load entry module and return exports
85
+ /******/ return __webpack_require__(__webpack_require__.s = 5);
86
+ /******/ })
87
+ /************************************************************************/
88
+ /******/ ([
89
+ /* 0 */
90
+ /***/ (function(module, exports, __webpack_require__) {
91
+
92
+ "use strict";
93
+
94
+
95
+ var mitt = __webpack_require__(1);
96
+ var TRTC = __webpack_require__(2);
97
+
98
+ var TrtcCloud = /** @class */function () {
99
+ function TrtcCloud() {
100
+ this.emitter = mitt();
101
+ this.init();
102
+ }
103
+ TrtcCloud.getTRTCShareInstance = function () {
104
+ console.log('@@TrtcCloud.instance1', TrtcCloud.instance);
105
+ if (!TrtcCloud.instance) {
106
+ TrtcCloud.instance = new TrtcCloud();
107
+ console.log('@@TrtcCloud.instance2', TrtcCloud.instance);
108
+ }
109
+ return TrtcCloud.instance;
110
+ };
111
+ TrtcCloud.prototype.init = function () {
112
+ this.TRTC = new TRTC(this);
113
+ this.EVENT = this.TRTC.EVENT;
114
+ };
115
+ TrtcCloud.prototype.on = function (eventName, handler) {
116
+ this.emitter.on(eventName, handler);
117
+ };
118
+ TrtcCloud.prototype.enterRoom = function (params, scene) {
119
+ var sdkAppId = params.sdkAppId,
120
+ userId = params.userId,
121
+ userSig = params.userSig,
122
+ roomId = params.roomId;
123
+ this.TRTC.createPusher({});
124
+ var pusher = this.TRTC.enterRoom({
125
+ sdkAppID: sdkAppId,
126
+ userID: userId,
127
+ userSig: userSig,
128
+ roomID: roomId,
129
+ enableMic: true,
130
+ enableCamera: true // 进房默认开启视频上行
131
+ });
132
+
133
+ this.emitter.emit('enterRoom', pusher);
134
+ };
135
+ return TrtcCloud;
136
+ }();
137
+
138
+ module.exports = TrtcCloud;
139
+
140
+ /***/ }),
141
+ /* 1 */
142
+ /***/ (function(module, exports) {
143
+
144
+ module.exports = require("mitt");
145
+
146
+ /***/ }),
147
+ /* 2 */
148
+ /***/ (function(module, exports) {
149
+
150
+ module.exports = require("trtc-wx-sdk");
151
+
152
+ /***/ }),
153
+ /* 3 */,
154
+ /* 4 */,
155
+ /* 5 */
156
+ /***/ (function(module, exports, __webpack_require__) {
157
+
158
+ "use strict";
159
+
160
+
161
+ exports.__esModule = true;
162
+
163
+ var _trtcCloudWx = __webpack_require__(0);
164
+
165
+ Object.keys(_trtcCloudWx).forEach(function (key) {
166
+ if (key === "default" || key === "__esModule") return;
167
+ Object.defineProperty(exports, key, {
168
+ enumerable: true,
169
+ get: function get() {
170
+ return _trtcCloudWx[key];
171
+ }
172
+ });
173
+ });
174
+
175
+ var _trtcCloudWx2 = _interopRequireDefault(_trtcCloudWx);
176
+
177
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
178
+
179
+ exports.default = _trtcCloudWx2.default;
180
+
181
+ /***/ })
182
+ /******/ ]);
183
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/trtc-cloud-wx.js","webpack:///external \"mitt\"","webpack:///external \"trtc-wx-sdk\"","webpack:///./src/index.js"],"names":["mitt","require","TRTC","TrtcCloud","emitter","init","getTRTCShareInstance","console","log","instance","prototype","EVENT","on","eventName","handler","enterRoom","params","scene","sdkAppId","userId","userSig","roomId","createPusher","pusher","sdkAppID","userID","roomID","enableMic","enableCamera","emit","module","exports","TRTCCloud"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFa;;AAEb,IAAIA,OAAOC,mBAAOA,CAAC,CAAR,CAAX;AACA,IAAIC,OAAOD,mBAAOA,CAAC,CAAR,CAAX;;AAEA,IAAIE,YAAY,aAAa,YAAY;AACvC,WAASA,SAAT,GAAqB;AACnB,SAAKC,OAAL,GAAeJ,MAAf;AACA,SAAKK,IAAL;AACD;AACDF,YAAUG,oBAAV,GAAiC,YAAY;AAC3CC,YAAQC,GAAR,CAAY,uBAAZ,EAAqCL,UAAUM,QAA/C;AACA,QAAI,CAACN,UAAUM,QAAf,EAAyB;AACvBN,gBAAUM,QAAV,GAAqB,IAAIN,SAAJ,EAArB;AACAI,cAAQC,GAAR,CAAY,uBAAZ,EAAqCL,UAAUM,QAA/C;AACD;AACD,WAAON,UAAUM,QAAjB;AACD,GAPD;AAQAN,YAAUO,SAAV,CAAoBL,IAApB,GAA2B,YAAY;AACrC,SAAKH,IAAL,GAAY,IAAIA,IAAJ,CAAS,IAAT,CAAZ;AACA,SAAKS,KAAL,GAAa,KAAKT,IAAL,CAAUS,KAAvB;AACD,GAHD;AAIAR,YAAUO,SAAV,CAAoBE,EAApB,GAAyB,UAAUC,SAAV,EAAqBC,OAArB,EAA8B;AACrD,SAAKV,OAAL,CAAaQ,EAAb,CAAgBC,SAAhB,EAA2BC,OAA3B;AACD,GAFD;AAGAX,YAAUO,SAAV,CAAoBK,SAApB,GAAgC,UAAUC,MAAV,EAAkBC,KAAlB,EAAyB;AACvD,QAAIC,WAAWF,OAAOE,QAAtB;AAAA,QACEC,SAASH,OAAOG,MADlB;AAAA,QAEEC,UAAUJ,OAAOI,OAFnB;AAAA,QAGEC,SAASL,OAAOK,MAHlB;AAIA,SAAKnB,IAAL,CAAUoB,YAAV,CAAuB,EAAvB;AACA,QAAIC,SAAS,KAAKrB,IAAL,CAAUa,SAAV,CAAoB;AAC/BS,gBAAUN,QADqB;AAE/BO,cAAQN,MAFuB;AAG/BC,eAASA,OAHsB;AAI/BM,cAAQL,MAJuB;AAK/BM,iBAAW,IALoB;AAM/BC,oBAAc,IANiB,CAMZ;AANY,KAApB,CAAb;;AASA,SAAKxB,OAAL,CAAayB,IAAb,CAAkB,WAAlB,EAA+BN,MAA/B;AACD,GAhBD;AAiBA,SAAOpB,SAAP;AACD,CAtC4B,EAA7B;;AAwCA2B,OAAOC,OAAP,GAAiB5B,SAAjB,C;;;;;;AC7CA,iC;;;;;;ACAA,wC;;;;;;;;;;;;;ACAA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;kBACe6B,qB","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","'use strict';\n\nvar mitt = require('mitt');\nvar TRTC = require('trtc-wx-sdk');\n\nvar TrtcCloud = /** @class */function () {\n function TrtcCloud() {\n this.emitter = mitt();\n this.init();\n }\n TrtcCloud.getTRTCShareInstance = function () {\n console.log('@@TrtcCloud.instance1', TrtcCloud.instance);\n if (!TrtcCloud.instance) {\n TrtcCloud.instance = new TrtcCloud();\n console.log('@@TrtcCloud.instance2', TrtcCloud.instance);\n }\n return TrtcCloud.instance;\n };\n TrtcCloud.prototype.init = function () {\n this.TRTC = new TRTC(this);\n this.EVENT = this.TRTC.EVENT;\n };\n TrtcCloud.prototype.on = function (eventName, handler) {\n this.emitter.on(eventName, handler);\n };\n TrtcCloud.prototype.enterRoom = function (params, scene) {\n var sdkAppId = params.sdkAppId,\n userId = params.userId,\n userSig = params.userSig,\n roomId = params.roomId;\n this.TRTC.createPusher({});\n var pusher = this.TRTC.enterRoom({\n sdkAppID: sdkAppId,\n userID: userId,\n userSig: userSig,\n roomID: roomId,\n enableMic: true,\n enableCamera: true // 进房默认开启视频上行\n });\n\n this.emitter.emit('enterRoom', pusher);\n };\n return TrtcCloud;\n}();\n\nmodule.exports = TrtcCloud;\n","module.exports = require(\"mitt\");","module.exports = require(\"trtc-wx-sdk\");","import TRTCCloud from 'trtc-cloud-wx'\n\nexport * from 'trtc-cloud-wx'\nexport default TRTCCloud\n"],"sourceRoot":""}