sobey-monitor-sdk 1.1.2 → 1.1.4
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/dist/core/config.d.ts +0 -1
- package/dist/frameworks/react.d.ts +1 -1
- package/dist/frameworks/vue.d.ts +1 -1
- package/dist/index.cjs.js +261 -155
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +27 -19
- package/dist/index.esm.js +261 -155
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +261 -155
- package/dist/index.umd.js.map +1 -1
- package/dist/reporter/index.d.ts +18 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -285,7 +285,7 @@ interface DeviceInfo {
|
|
|
285
285
|
* ```
|
|
286
286
|
*/
|
|
287
287
|
declare const VueMonitorPlugin: {
|
|
288
|
-
install(app: any, options
|
|
288
|
+
install(app: any, options?: MonitorConfig): void;
|
|
289
289
|
};
|
|
290
290
|
|
|
291
291
|
/**
|
|
@@ -332,7 +332,7 @@ interface ErrorBoundaryState {
|
|
|
332
332
|
* );
|
|
333
333
|
* ```
|
|
334
334
|
*/
|
|
335
|
-
declare function createReactErrorBoundary(React: any, config
|
|
335
|
+
declare function createReactErrorBoundary(React: any, config?: MonitorConfig): any;
|
|
336
336
|
/**
|
|
337
337
|
* React Hook: 用于手动上报错误
|
|
338
338
|
*
|
|
@@ -361,18 +361,32 @@ declare function createUseMonitorError(React: any): () => any;
|
|
|
361
361
|
* 监控 SDK 主类
|
|
362
362
|
*/
|
|
363
363
|
declare class MonitorSDK {
|
|
364
|
+
/** SDK 是否已初始化(基础初始化,可能还没有完整配置) */
|
|
364
365
|
private initialized;
|
|
365
|
-
|
|
366
|
+
/** SDK 是否已就绪(配置完整,可以上报数据) */
|
|
367
|
+
private ready;
|
|
368
|
+
/** 是否正在加载远程配置 */
|
|
369
|
+
private loading;
|
|
370
|
+
/** 监控模块是否已安装 */
|
|
371
|
+
private monitorsInstalled;
|
|
366
372
|
/**
|
|
367
373
|
* 初始化 SDK
|
|
368
|
-
*
|
|
369
|
-
* 无需 await,SDK 内部会自动处理异步逻辑
|
|
374
|
+
* 支持空配置初始化,后续通过 updateConfig 传入 configUrl 完成配置
|
|
370
375
|
*/
|
|
371
|
-
init(userConfig
|
|
376
|
+
init(userConfig?: MonitorConfig): void;
|
|
372
377
|
/**
|
|
373
|
-
*
|
|
378
|
+
* 基础初始化(安装监控模块,但不开始上报)
|
|
374
379
|
*/
|
|
375
|
-
private
|
|
380
|
+
private initBasic;
|
|
381
|
+
/**
|
|
382
|
+
* 激活 SDK(配置完整后调用)
|
|
383
|
+
*/
|
|
384
|
+
private activate;
|
|
385
|
+
/**
|
|
386
|
+
* 动态更新配置
|
|
387
|
+
* 如果传入 configUrl,会从远程获取配置并激活 SDK
|
|
388
|
+
*/
|
|
389
|
+
updateConfig(partialConfig: Partial<MonitorConfig>): void;
|
|
376
390
|
/**
|
|
377
391
|
* 从远程获取配置
|
|
378
392
|
*/
|
|
@@ -382,19 +396,17 @@ declare class MonitorSDK {
|
|
|
382
396
|
*/
|
|
383
397
|
private mergeUserConfig;
|
|
384
398
|
/**
|
|
385
|
-
*
|
|
399
|
+
* 检查 SDK 是否就绪
|
|
386
400
|
*/
|
|
387
|
-
|
|
401
|
+
isReady(): boolean;
|
|
388
402
|
/**
|
|
389
|
-
*
|
|
390
|
-
* @description 可以在运行时更新 SDK 配置,如 debug、sampling、report 等
|
|
391
|
-
* 如果传入 configUrl,会从远程获取配置并合并
|
|
403
|
+
* 设置用户信息
|
|
392
404
|
*/
|
|
393
|
-
|
|
405
|
+
setUser(user: UserInfo): void;
|
|
394
406
|
/**
|
|
395
407
|
* 获取当前配置
|
|
396
408
|
*/
|
|
397
|
-
getConfig(): MonitorConfig;
|
|
409
|
+
getConfig(): MonitorConfig | null;
|
|
398
410
|
/**
|
|
399
411
|
* 手动上报错误
|
|
400
412
|
*/
|
|
@@ -419,10 +431,6 @@ declare class MonitorSDK {
|
|
|
419
431
|
* 获取 SDK 版本
|
|
420
432
|
*/
|
|
421
433
|
getVersion(): string;
|
|
422
|
-
/**
|
|
423
|
-
* 检查是否已初始化
|
|
424
|
-
*/
|
|
425
|
-
private checkInit;
|
|
426
434
|
}
|
|
427
435
|
declare const monitor: MonitorSDK;
|
|
428
436
|
|