@haluo/util 2.0.29 → 2.0.30

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 (59) hide show
  1. package/README.md +350 -350
  2. package/dist/index.d.ts +39 -39
  3. package/dist/index.js +43 -43
  4. package/dist/modules/cookie/index.d.ts +27 -27
  5. package/dist/modules/cookie/index.js +49 -49
  6. package/dist/modules/date/index.d.ts +52 -52
  7. package/dist/modules/date/index.js +185 -185
  8. package/dist/modules/dom/index.d.ts +28 -28
  9. package/dist/modules/dom/index.js +55 -55
  10. package/dist/modules/filter/index.d.ts +24 -24
  11. package/dist/modules/filter/index.js +38 -38
  12. package/dist/modules/format/index.d.ts +15 -15
  13. package/dist/modules/format/index.js +16 -16
  14. package/dist/modules/match/index.d.ts +12 -12
  15. package/dist/modules/match/index.js +27 -27
  16. package/dist/modules/monitor/index.d.ts +3 -3
  17. package/dist/modules/monitor/index.js +10 -10
  18. package/dist/modules/monitor/lib/jsError.d.ts +1 -1
  19. package/dist/modules/monitor/lib/jsError.js +57 -57
  20. package/dist/modules/monitor/lib/timing.d.ts +1 -1
  21. package/dist/modules/monitor/lib/timing.js +65 -65
  22. package/dist/modules/monitor/lib/xhr.d.ts +1 -1
  23. package/dist/modules/monitor/lib/xhr.js +41 -41
  24. package/dist/modules/monitor/utils/onload.d.ts +1 -1
  25. package/dist/modules/monitor/utils/onload.js +8 -8
  26. package/dist/modules/monitor/utils/tracker.d.ts +7 -7
  27. package/dist/modules/monitor/utils/tracker.js +49 -49
  28. package/dist/modules/number/index.d.ts +47 -47
  29. package/dist/modules/number/index.js +114 -114
  30. package/dist/modules/open-app/index.d.ts +84 -84
  31. package/dist/modules/open-app/index.js +244 -244
  32. package/dist/modules/sentry/index.d.ts +15 -15
  33. package/dist/modules/sentry/index.js +73 -73
  34. package/dist/modules/tools/index.d.ts +166 -166
  35. package/dist/modules/tools/index.js +382 -382
  36. package/dist/modules/upload/aliOss.d.ts +291 -291
  37. package/dist/modules/upload/aliOss.js +629 -629
  38. package/dist/modules/upload/index.d.ts +38 -38
  39. package/dist/modules/upload/index.js +44 -44
  40. package/dist/tsconfig.tsbuildinfo +1 -1
  41. package/dist/types/index.d.ts +3 -3
  42. package/dist/types/index.js +1 -1
  43. package/package.json +88 -88
  44. package/dist/types/modules/cookie/index.d.ts +0 -27
  45. package/dist/types/modules/date/index.d.ts +0 -52
  46. package/dist/types/modules/dom/index.d.ts +0 -28
  47. package/dist/types/modules/filter/index.d.ts +0 -24
  48. package/dist/types/modules/format/index.d.ts +0 -15
  49. package/dist/types/modules/match/index.d.ts +0 -12
  50. package/dist/types/modules/monitor/index.d.ts +0 -3
  51. package/dist/types/modules/monitor/lib/jsError.d.ts +0 -1
  52. package/dist/types/modules/monitor/lib/timing.d.ts +0 -1
  53. package/dist/types/modules/monitor/lib/xhr.d.ts +0 -1
  54. package/dist/types/modules/monitor/utils/onload.d.ts +0 -1
  55. package/dist/types/modules/monitor/utils/tracker.d.ts +0 -7
  56. package/dist/types/modules/number/index.d.ts +0 -41
  57. package/dist/types/modules/sentry/index.d.ts +0 -15
  58. package/dist/types/modules/tools/index.d.ts +0 -166
  59. package/dist/types/types/index.d.ts +0 -3
@@ -1,244 +1,244 @@
1
- /**
2
- * H5打开APP工具类
3
- *
4
- * feature
5
- * 1、应用宝打开app指定页面,参考今日头条
6
- * 2、浏览器中进入页面立即打开app,参考掘金
7
- */
8
- import qs from 'qs';
9
- import tools from '../tools';
10
- class OpenAppClass {
11
- env;
12
- postJddTrack;
13
- trackId;
14
- openAppState;
15
- ua;
16
- _wx;
17
- _android;
18
- _isHarmonyos;
19
- _ios;
20
- _isPrice;
21
- currentEnv;
22
- appUrl;
23
- appStoreUrl;
24
- underway;
25
- /**
26
- * @param {Object} env - 环境配置,必须
27
- * @param {Function} postJddTrack - 埋点方法,必须
28
- * @param {String} trackId - 埋点id,可选
29
- * @param {Object} openAppState - 打开app状态,可选
30
- */
31
- constructor(env, postJddTrack, trackId = 'S_00000000000108', openAppState) {
32
- this.env = env; // 环境配置,必须
33
- this.postJddTrack = postJddTrack; // 埋点方法,必须
34
- this.trackId = trackId; // 埋点id,可选
35
- this.openAppState = openAppState; // 打开app状态,可选
36
- this.ua = navigator.userAgent.toLowerCase();
37
- this._wx = this.ua.indexOf('micromessenger') > -1;
38
- this._android = !!(this.ua.match(/android/i) || this.ua.match(/miuibrowser/i));
39
- this._isHarmonyos = !!this.ua.match(/harmonyos/i);
40
- this._ios = navigator.userAgent.match(/(iPhone|iPod|iPad);?/i);
41
- this._isPrice = sessionStorage.getItem('isHaloenterprise') || false; // 厂家版,切换打开地址
42
- this.currentEnv = env;
43
- this.getCurrentEnv();
44
- this.appUrl = this._isPrice ? env.APPLINKPRICE : this.currentEnv.APPLINK;
45
- this.appStoreUrl = this._isPrice ? env.APPLINKPRICEIOS : this.currentEnv.APPLINKIOS;
46
- this.underway = false;
47
- }
48
- /**
49
- * 根据域名动态获取配置,保证多项目代码一样
50
- */
51
- getCurrentEnv() {
52
- const host = location.host;
53
- if (host.includes('58moto')) {
54
- this.currentEnv = {
55
- motoAndroidScheme: this.env.motoAndroidScheme,
56
- motoIOSScheme: this.env.motoIOSScheme,
57
- APPLINK: this.env.APPLINK,
58
- APPLINKIOS: this.env.APPLINKIOS,
59
- };
60
- }
61
- else if (host.includes('emotofine')) {
62
- this.currentEnv = {
63
- motoAndroidScheme: this.env.emotofineAndroidScheme,
64
- motoIOSScheme: this.env.emotofineIOSScheme,
65
- APPLINK: this.env.EMOTOFINEAPPLINK,
66
- APPLINKIOS: this.env.EMOTOFINEAPPLINKIOS,
67
- };
68
- }
69
- else if (host.includes('biaofine')) {
70
- this.currentEnv = {
71
- motoAndroidScheme: this.env.biaofineAndroidScheme,
72
- motoIOSScheme: this.env.biaofineIOSScheme,
73
- APPLINK: this.env.BIAOFINEAPPLINK,
74
- APPLINKIOS: this.env.BIAOFINEAPPLINKIOS,
75
- };
76
- }
77
- }
78
- /**
79
- * 打开APP主流程
80
- */
81
- invoke() {
82
- if (this.underway) {
83
- return;
84
- }
85
- // 微信里面 安卓、鸿蒙 不支持打开app(待确认)
86
- if (this._wx && (this._android || this._isHarmonyos)) {
87
- this.underway = false;
88
- return;
89
- }
90
- this.underway = true;
91
- // 生成url并且放到剪贴板
92
- let url = this.getSechmaUrl();
93
- if (url) {
94
- tools.clipboard(url);
95
- }
96
- const apk = JSON.parse(sessionStorage.getItem('downloadApk') || '{}');
97
- const tag = this._ios ? (apk.channelName ? `App Store-${apk.channelName}` : 'App Store') : (apk.channelName ? `渠道${apk.channelName}包` : '安卓包');
98
- this.postJddTrack(this.trackId, { tag });
99
- // 厂家版 app
100
- if (this._android && location.href.includes('downloadPrise')) {
101
- window.location.href = (apk && apk.path) || this.appUrl;
102
- this.underway = false;
103
- return;
104
- }
105
- // 客户端打开app-下载页特殊处理
106
- if (location.href.includes('download') && window.AppCall && window.AppCall.has('openOtherAppUrlRouter')) {
107
- this.underway = false;
108
- return window.AppCall.openOtherAppUrlRouter({ appUrlRouter: `https://${location.host}/home` });
109
- }
110
- // 客户端打开app
111
- if (window.AppCall && window.AppCall.has('openOtherAppUrlRouter')) {
112
- this.underway = false;
113
- url = this.getUrl();
114
- return window.AppCall.openOtherAppUrlRouter({ appUrlRouter: url || '' });
115
- }
116
- // IOS系统下,H5中的特殊处理,历史逻辑,应该是用了universal link,待确认
117
- if (this._ios) {
118
- url = this.appStoreUrl;
119
- }
120
- this.open(url);
121
- }
122
- // 获取自定义的url
123
- getUrl() {
124
- const searchParams = qs.parse(location.search.slice(1)); // 路由的query
125
- const url = searchParams.customOpenUrl || window.location.href;
126
- return url;
127
- }
128
- /**
129
- * 获取打开 app sechma url
130
- * @returns {string | undefined} 打开app的schema或跳转链接
131
- * params:params={"type":"","id":0,"name":"","travelId":0}
132
- * type:原生页面key(必须);id:页面id(可选);subject 短话题、版块名称 或 页面标题(可选);travelId 游记id(可选)
133
- */
134
- getSechmaUrl() {
135
- const keys = {
136
- '/posts/': 'thread_detail',
137
- '/detailedForum/': 'forum_detail',
138
- '/video/': 'video_detail',
139
- '/answer-details/': 'topic_detail',
140
- '/details-article/': 'essay_detail',
141
- '/details-views/': 'opinion_detail',
142
- '/topic-homepage': 'short_topic',
143
- '/label-detail': 'tag_detail',
144
- '/circle-article/': 'moment_detail',
145
- '/vehicle-details/': 'car_detail',
146
- '/car-detail': 'newcar_sale_detail',
147
- '/myhomepage': 'person_detail',
148
- '/dealer': 'shop_detail',
149
- '/circle-preview': 'hoop_detail',
150
- '/used-car-detail': 'used_detail',
151
- '/coupon-detail': 'coupon_detail',
152
- '/news/': 'essay_detail' // 文章详情
153
- };
154
- const target = Object.keys(keys).filter(function (value) {
155
- return window.location.href.indexOf(value) > -1;
156
- });
157
- const type = target && target[0] && keys[target[0]];
158
- const searchParams = qs.parse(location.search.slice(1)); // 路由的query
159
- const id = parseInt(location.pathname.split('/').reverse()[0]) ||
160
- parseInt(searchParams.id) ||
161
- parseInt(searchParams.carId) ||
162
- parseInt(searchParams.goodId); // 页面id
163
- const subject = searchParams.subject || undefined; // 页面标题或name
164
- const temp = {
165
- relationType: type,
166
- id: id,
167
- name: subject
168
- };
169
- const data = this.openAppState?.state?.openApps || {};
170
- let open_url = '';
171
- if (data.type && data.href === window.location.href) {
172
- temp.relationType = keys[data.type] || '';
173
- temp.id = data.id || '';
174
- temp.name = data.title || '';
175
- open_url = data.url || '';
176
- }
177
- const openUrl = open_url || searchParams.customOpenUrl || window.location.href;
178
- // activityId 大于零,type 为 activity
179
- if (searchParams.activityId) {
180
- temp.relationType = 'activity';
181
- temp.link = decodeURIComponent(decodeURIComponent(openUrl));
182
- }
183
- temp.jumpUrl = decodeURIComponent(decodeURIComponent(openUrl));
184
- const params = JSON.stringify(temp);
185
- if (this._ios) {
186
- return `${this.currentEnv.motoIOSScheme}?params=${params}`;
187
- }
188
- if (this._android || this._isHarmonyos) {
189
- const url = this._wx ? `${this.appUrl}&android_scheme=${this.currentEnv.motoAndroidScheme}?params=${params}` : `${this.currentEnv.motoAndroidScheme}?params=${params}`;
190
- return url;
191
- }
192
- return undefined;
193
- }
194
- /**
195
- * 方法一(推荐):打开APP
196
- * http://www.cnblogs.com/shadajin/p/5724117.html
197
- */
198
- open(openUrl) {
199
- if (!openUrl) {
200
- this.underway = false;
201
- return;
202
- }
203
- if (this._ios) {
204
- this.underway = false;
205
- setTimeout(() => (location.href = this.appStoreUrl || ''), 3000);
206
- return (location.href = openUrl);
207
- }
208
- if (this._android) {
209
- const ifr = document.createElement('iframe');
210
- ifr.src = openUrl;
211
- ifr.style.display = 'none';
212
- document.body.appendChild(ifr);
213
- setTimeout(function () {
214
- document.body.removeChild(ifr);
215
- }, 3000);
216
- }
217
- return new Promise((resolve, reject) => {
218
- // 检查APP是否打开
219
- const check = (elsTime) => {
220
- if (elsTime > 3000 || document.hidden) {
221
- // @ts-ignore
222
- resolve('成功打开APP');
223
- }
224
- else {
225
- // @ts-ignore
226
- window.location.href = `https://${location.host}/download`;
227
- reject('打开APP失败');
228
- }
229
- this.underway = false;
230
- };
231
- let _count = 0;
232
- const _clickTime = +new Date();
233
- const intHandle = setInterval(() => {
234
- _count++;
235
- const elsTime = +new Date() - _clickTime;
236
- if (_count >= 100 || elsTime > 3000) {
237
- clearInterval(intHandle);
238
- check(elsTime);
239
- }
240
- }, 20);
241
- });
242
- }
243
- }
244
- export default OpenAppClass;
1
+ /**
2
+ * H5打开APP工具类
3
+ *
4
+ * feature
5
+ * 1、应用宝打开app指定页面,参考今日头条
6
+ * 2、浏览器中进入页面立即打开app,参考掘金
7
+ */
8
+ import qs from 'qs';
9
+ import tools from '../tools';
10
+ class OpenAppClass {
11
+ env;
12
+ postJddTrack;
13
+ trackId;
14
+ openAppState;
15
+ ua;
16
+ _wx;
17
+ _android;
18
+ _isHarmonyos;
19
+ _ios;
20
+ _isPrice;
21
+ currentEnv;
22
+ appUrl;
23
+ appStoreUrl;
24
+ underway;
25
+ /**
26
+ * @param {Object} env - 环境配置,必须
27
+ * @param {Function} postJddTrack - 埋点方法,必须
28
+ * @param {String} trackId - 埋点id,可选
29
+ * @param {Object} openAppState - 打开app状态,可选
30
+ */
31
+ constructor(env, postJddTrack, trackId = 'S_00000000000108', openAppState) {
32
+ this.env = env; // 环境配置,必须
33
+ this.postJddTrack = postJddTrack; // 埋点方法,必须
34
+ this.trackId = trackId; // 埋点id,可选
35
+ this.openAppState = openAppState; // 打开app状态,可选
36
+ this.ua = navigator.userAgent.toLowerCase();
37
+ this._wx = this.ua.indexOf('micromessenger') > -1;
38
+ this._android = !!(this.ua.match(/android/i) || this.ua.match(/miuibrowser/i));
39
+ this._isHarmonyos = !!this.ua.match(/harmonyos/i);
40
+ this._ios = navigator.userAgent.match(/(iPhone|iPod|iPad);?/i);
41
+ this._isPrice = sessionStorage.getItem('isHaloenterprise') || false; // 厂家版,切换打开地址
42
+ this.currentEnv = env;
43
+ this.getCurrentEnv();
44
+ this.appUrl = this._isPrice ? env.APPLINKPRICE : this.currentEnv.APPLINK;
45
+ this.appStoreUrl = this._isPrice ? env.APPLINKPRICEIOS : this.currentEnv.APPLINKIOS;
46
+ this.underway = false;
47
+ }
48
+ /**
49
+ * 根据域名动态获取配置,保证多项目代码一样
50
+ */
51
+ getCurrentEnv() {
52
+ const host = location.host;
53
+ if (host.includes('58moto')) {
54
+ this.currentEnv = {
55
+ motoAndroidScheme: this.env.motoAndroidScheme,
56
+ motoIOSScheme: this.env.motoIOSScheme,
57
+ APPLINK: this.env.APPLINK,
58
+ APPLINKIOS: this.env.APPLINKIOS,
59
+ };
60
+ }
61
+ else if (host.includes('emotofine')) {
62
+ this.currentEnv = {
63
+ motoAndroidScheme: this.env.emotofineAndroidScheme,
64
+ motoIOSScheme: this.env.emotofineIOSScheme,
65
+ APPLINK: this.env.EMOTOFINEAPPLINK,
66
+ APPLINKIOS: this.env.EMOTOFINEAPPLINKIOS,
67
+ };
68
+ }
69
+ else if (host.includes('biaofine')) {
70
+ this.currentEnv = {
71
+ motoAndroidScheme: this.env.biaofineAndroidScheme,
72
+ motoIOSScheme: this.env.biaofineIOSScheme,
73
+ APPLINK: this.env.BIAOFINEAPPLINK,
74
+ APPLINKIOS: this.env.BIAOFINEAPPLINKIOS,
75
+ };
76
+ }
77
+ }
78
+ /**
79
+ * 打开APP主流程
80
+ */
81
+ invoke() {
82
+ if (this.underway) {
83
+ return;
84
+ }
85
+ // 微信里面 安卓、鸿蒙 不支持打开app(待确认)
86
+ if (this._wx && (this._android || this._isHarmonyos)) {
87
+ this.underway = false;
88
+ return;
89
+ }
90
+ this.underway = true;
91
+ // 生成url并且放到剪贴板
92
+ let url = this.getSechmaUrl();
93
+ if (url) {
94
+ tools.clipboard(url);
95
+ }
96
+ const apk = JSON.parse(sessionStorage.getItem('downloadApk') || '{}');
97
+ const tag = this._ios ? (apk.channelName ? `App Store-${apk.channelName}` : 'App Store') : (apk.channelName ? `渠道${apk.channelName}包` : '安卓包');
98
+ this.postJddTrack(this.trackId, { tag });
99
+ // 厂家版 app
100
+ if (this._android && location.href.includes('downloadPrise')) {
101
+ window.location.href = (apk && apk.path) || this.appUrl;
102
+ this.underway = false;
103
+ return;
104
+ }
105
+ // 客户端打开app-下载页特殊处理
106
+ if (location.href.includes('download') && window.AppCall && window.AppCall.has('openOtherAppUrlRouter')) {
107
+ this.underway = false;
108
+ return window.AppCall.openOtherAppUrlRouter({ appUrlRouter: `https://${location.host}/home` });
109
+ }
110
+ // 客户端打开app
111
+ if (window.AppCall && window.AppCall.has('openOtherAppUrlRouter')) {
112
+ this.underway = false;
113
+ url = this.getUrl();
114
+ return window.AppCall.openOtherAppUrlRouter({ appUrlRouter: url || '' });
115
+ }
116
+ // IOS系统下,H5中的特殊处理,历史逻辑,应该是用了universal link,待确认
117
+ if (this._ios) {
118
+ url = this.appStoreUrl;
119
+ }
120
+ this.open(url);
121
+ }
122
+ // 获取自定义的url
123
+ getUrl() {
124
+ const searchParams = qs.parse(location.search.slice(1)); // 路由的query
125
+ const url = searchParams.customOpenUrl || window.location.href;
126
+ return url;
127
+ }
128
+ /**
129
+ * 获取打开 app sechma url
130
+ * @returns {string | undefined} 打开app的schema或跳转链接
131
+ * params:params={"type":"","id":0,"name":"","travelId":0}
132
+ * type:原生页面key(必须);id:页面id(可选);subject 短话题、版块名称 或 页面标题(可选);travelId 游记id(可选)
133
+ */
134
+ getSechmaUrl() {
135
+ const keys = {
136
+ '/posts/': 'thread_detail',
137
+ '/detailedForum/': 'forum_detail',
138
+ '/video/': 'video_detail',
139
+ '/answer-details/': 'topic_detail',
140
+ '/details-article/': 'essay_detail',
141
+ '/details-views/': 'opinion_detail',
142
+ '/topic-homepage': 'short_topic',
143
+ '/label-detail': 'tag_detail',
144
+ '/circle-article/': 'moment_detail',
145
+ '/vehicle-details/': 'car_detail',
146
+ '/car-detail': 'newcar_sale_detail',
147
+ '/myhomepage': 'person_detail',
148
+ '/dealer': 'shop_detail',
149
+ '/circle-preview': 'hoop_detail',
150
+ '/used-car-detail': 'used_detail',
151
+ '/coupon-detail': 'coupon_detail',
152
+ '/news/': 'essay_detail' // 文章详情
153
+ };
154
+ const target = Object.keys(keys).filter(function (value) {
155
+ return window.location.href.indexOf(value) > -1;
156
+ });
157
+ const type = target && target[0] && keys[target[0]];
158
+ const searchParams = qs.parse(location.search.slice(1)); // 路由的query
159
+ const id = parseInt(location.pathname.split('/').reverse()[0]) ||
160
+ parseInt(searchParams.id) ||
161
+ parseInt(searchParams.carId) ||
162
+ parseInt(searchParams.goodId); // 页面id
163
+ const subject = searchParams.subject || undefined; // 页面标题或name
164
+ const temp = {
165
+ relationType: type,
166
+ id: id,
167
+ name: subject
168
+ };
169
+ const data = this.openAppState?.state?.openApps || {};
170
+ let open_url = '';
171
+ if (data.type && data.href === window.location.href) {
172
+ temp.relationType = keys[data.type] || '';
173
+ temp.id = data.id || '';
174
+ temp.name = data.title || '';
175
+ open_url = data.url || '';
176
+ }
177
+ const openUrl = open_url || searchParams.customOpenUrl || window.location.href;
178
+ // activityId 大于零,type 为 activity
179
+ if (searchParams.activityId) {
180
+ temp.relationType = 'activity';
181
+ temp.link = decodeURIComponent(decodeURIComponent(openUrl));
182
+ }
183
+ temp.jumpUrl = decodeURIComponent(decodeURIComponent(openUrl));
184
+ const params = JSON.stringify(temp);
185
+ if (this._ios) {
186
+ return `${this.currentEnv.motoIOSScheme}?params=${params}`;
187
+ }
188
+ if (this._android || this._isHarmonyos) {
189
+ const url = this._wx ? `${this.appUrl}&android_scheme=${this.currentEnv.motoAndroidScheme}?params=${params}` : `${this.currentEnv.motoAndroidScheme}?params=${params}`;
190
+ return url;
191
+ }
192
+ return undefined;
193
+ }
194
+ /**
195
+ * 方法一(推荐):打开APP
196
+ * http://www.cnblogs.com/shadajin/p/5724117.html
197
+ */
198
+ open(openUrl) {
199
+ if (!openUrl) {
200
+ this.underway = false;
201
+ return;
202
+ }
203
+ if (this._ios) {
204
+ this.underway = false;
205
+ setTimeout(() => (location.href = this.appStoreUrl || ''), 3000);
206
+ return (location.href = openUrl);
207
+ }
208
+ if (this._android) {
209
+ const ifr = document.createElement('iframe');
210
+ ifr.src = openUrl;
211
+ ifr.style.display = 'none';
212
+ document.body.appendChild(ifr);
213
+ setTimeout(function () {
214
+ document.body.removeChild(ifr);
215
+ }, 3000);
216
+ }
217
+ return new Promise((resolve, reject) => {
218
+ // 检查APP是否打开
219
+ const check = (elsTime) => {
220
+ if (elsTime > 3000 || document.hidden) {
221
+ // @ts-ignore
222
+ resolve('成功打开APP');
223
+ }
224
+ else {
225
+ // @ts-ignore
226
+ window.location.href = `https://${location.host}/download`;
227
+ reject('打开APP失败');
228
+ }
229
+ this.underway = false;
230
+ };
231
+ let _count = 0;
232
+ const _clickTime = +new Date();
233
+ const intHandle = setInterval(() => {
234
+ _count++;
235
+ const elsTime = +new Date() - _clickTime;
236
+ if (_count >= 100 || elsTime > 3000) {
237
+ clearInterval(intHandle);
238
+ check(elsTime);
239
+ }
240
+ }, 20);
241
+ });
242
+ }
243
+ }
244
+ export default OpenAppClass;
@@ -1,15 +1,15 @@
1
- declare class Report {
2
- static instance: any;
3
- constructor(Vue: Object, options?: {});
4
- [key: string]: any;
5
- static getInstance(Vue: Object, Option: Object): any;
6
- install(): void;
7
- /**
8
- * 主动上报
9
- * @param {String} data
10
- * @param {String} type 'info','warning','error'
11
- * @param {Object} options
12
- */
13
- log(data?: any, type?: any, options?: any): void;
14
- }
15
- export default Report;
1
+ declare class Report {
2
+ static instance: any;
3
+ constructor(Vue: Object, options?: {});
4
+ [key: string]: any;
5
+ static getInstance(Vue: Object, Option: Object): any;
6
+ install(): void;
7
+ /**
8
+ * 主动上报
9
+ * @param {String} data
10
+ * @param {String} type 'info','warning','error'
11
+ * @param {Object} options
12
+ */
13
+ log(data?: any, type?: any, options?: any): void;
14
+ }
15
+ export default Report;