polyv-rum-sdk 0.1.13 → 0.1.16

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/index.d.mts CHANGED
@@ -37,6 +37,7 @@ interface MitoConfig {
37
37
  debug: boolean;
38
38
  maxBreadcrumbs: number;
39
39
  sampleRate: MitoSampleRateConfig;
40
+ framework?: 'vue' | 'react' | 'native';
40
41
  vue: {
41
42
  Vue?: any;
42
43
  lifecycle: boolean;
@@ -121,6 +122,7 @@ declare class SLSWebTrackingAdapter {
121
122
  private addErrorFields;
122
123
  private addApiFields;
123
124
  private addClickFields;
125
+ private addCustomFields;
124
126
  private filterSensitiveData;
125
127
  private handleSendError;
126
128
  private retryFailedLogs;
@@ -190,7 +192,7 @@ declare const initRUMCore: (context: TransformContext & {
190
192
  }, options?: Partial<MitoSLSAdapterOptions>) => Promise<MitoSLSAdapter>;
191
193
  declare const getRUMCoreInstance: () => MitoSLSAdapter | null;
192
194
 
193
- interface RUMManagerContext extends TransformContext {
195
+ interface RUMManagerContext$1 extends TransformContext {
194
196
  Vue?: any;
195
197
  }
196
198
  declare class RUMManagerVue2 {
@@ -198,7 +200,7 @@ declare class RUMManagerVue2 {
198
200
  private isInitialized;
199
201
  private isEnabled;
200
202
  private context;
201
- init(context: RUMManagerContext, options?: Partial<MitoSLSAdapterOptions>): Promise<void>;
203
+ init(context: RUMManagerContext$1, options?: Partial<MitoSLSAdapterOptions>): Promise<void>;
202
204
  private shouldEnableRUM;
203
205
  private setUserInfo;
204
206
  private setupUserStateListener;
@@ -217,47 +219,36 @@ declare class RUMManagerVue2 {
217
219
  destroy(): void;
218
220
  }
219
221
 
220
- declare const initRUMSystem: (context: RUMManagerContext, options?: Partial<MitoSLSAdapterOptions>) => Promise<void>;
221
- declare const trackEvent: (eventName: string, eventData?: Record<string, any>) => void;
222
- declare const trackPerformance: (performanceData: Record<string, any>) => void;
223
- declare const trackAction: (action: string, actionData?: Record<string, any>) => void;
224
- declare const trackMetric: (metricName: string, value: number, dimensions?: Record<string, any>) => void;
225
- declare const getBreadcrumbs: () => any[];
226
- declare const enableRUM: () => void;
227
- declare const disableRUM: () => void;
228
- declare const getRUMConfig: () => Record<string, any>;
229
- declare const destroyRUM: () => void;
230
- declare const getRUMManager: () => RUMManagerVue2;
222
+ declare const initRUMSystem$1: (context: RUMManagerContext$1, options?: Partial<MitoSLSAdapterOptions>) => Promise<void>;
223
+ declare const trackEvent$1: (eventName: string, eventData?: Record<string, any>) => void;
224
+ declare const trackPerformance$1: (performanceData: Record<string, any>) => void;
225
+ declare const trackAction$1: (action: string, actionData?: Record<string, any>) => void;
226
+ declare const trackMetric$1: (metricName: string, value: number, dimensions?: Record<string, any>) => void;
227
+ declare const getBreadcrumbs$1: () => any[];
228
+ declare const enableRUM$1: () => void;
229
+ declare const disableRUM$1: () => void;
230
+ declare const getRUMConfig$1: () => Record<string, any>;
231
+ declare const destroyRUM$1: () => void;
232
+ declare const getRUMManager$1: () => RUMManagerVue2;
231
233
  declare const RUMPluginVue2: {
232
234
  install(Vue: any): void;
233
235
  };
234
236
 
235
237
  declare const plugin_vue2_RUMPluginVue2: typeof RUMPluginVue2;
236
- declare const plugin_vue2_destroyRUM: typeof destroyRUM;
237
- declare const plugin_vue2_disableRUM: typeof disableRUM;
238
- declare const plugin_vue2_enableRUM: typeof enableRUM;
239
- declare const plugin_vue2_getBreadcrumbs: typeof getBreadcrumbs;
240
- declare const plugin_vue2_getRUMConfig: typeof getRUMConfig;
241
- declare const plugin_vue2_getRUMManager: typeof getRUMManager;
242
- declare const plugin_vue2_initRUMSystem: typeof initRUMSystem;
243
- declare const plugin_vue2_trackAction: typeof trackAction;
244
- declare const plugin_vue2_trackEvent: typeof trackEvent;
245
- declare const plugin_vue2_trackMetric: typeof trackMetric;
246
- declare const plugin_vue2_trackPerformance: typeof trackPerformance;
247
238
  declare namespace plugin_vue2 {
248
239
  export {
249
240
  plugin_vue2_RUMPluginVue2 as RUMPluginVue2,
250
- plugin_vue2_destroyRUM as destroyRUM,
251
- plugin_vue2_disableRUM as disableRUM,
252
- plugin_vue2_enableRUM as enableRUM,
253
- plugin_vue2_getBreadcrumbs as getBreadcrumbs,
254
- plugin_vue2_getRUMConfig as getRUMConfig,
255
- plugin_vue2_getRUMManager as getRUMManager,
256
- plugin_vue2_initRUMSystem as initRUMSystem,
257
- plugin_vue2_trackAction as trackAction,
258
- plugin_vue2_trackEvent as trackEvent,
259
- plugin_vue2_trackMetric as trackMetric,
260
- plugin_vue2_trackPerformance as trackPerformance,
241
+ destroyRUM$1 as destroyRUM,
242
+ disableRUM$1 as disableRUM,
243
+ enableRUM$1 as enableRUM,
244
+ getBreadcrumbs$1 as getBreadcrumbs,
245
+ getRUMConfig$1 as getRUMConfig,
246
+ getRUMManager$1 as getRUMManager,
247
+ initRUMSystem$1 as initRUMSystem,
248
+ trackAction$1 as trackAction,
249
+ trackEvent$1 as trackEvent,
250
+ trackMetric$1 as trackMetric,
251
+ trackPerformance$1 as trackPerformance,
261
252
  };
262
253
  }
263
254
 
@@ -285,17 +276,193 @@ interface RUMVue3PluginOptions {
285
276
  declare function createRUMPluginVue3(options: RUMVue3PluginOptions): {
286
277
  install(app: App): void;
287
278
  };
288
- declare function useRUM(): RUMManagerVue3 | undefined;
279
+ declare function useRUM$1(): RUMManagerVue3 | undefined;
289
280
 
290
281
  type plugin_vue3_RUMVue3PluginOptions = RUMVue3PluginOptions;
291
282
  declare const plugin_vue3_createRUMPluginVue3: typeof createRUMPluginVue3;
292
- declare const plugin_vue3_useRUM: typeof useRUM;
293
283
  declare namespace plugin_vue3 {
294
284
  export {
295
285
  plugin_vue3_RUMVue3PluginOptions as RUMVue3PluginOptions,
296
286
  plugin_vue3_createRUMPluginVue3 as createRUMPluginVue3,
297
- plugin_vue3_useRUM as useRUM,
287
+ useRUM$1 as useRUM,
288
+ };
289
+ }
290
+
291
+ interface RUMManagerContext extends TransformContext {
292
+ }
293
+ declare class RUMManagerReact {
294
+ private adapter;
295
+ private isInitialized;
296
+ private isEnabled;
297
+ private context;
298
+ private previousLocation;
299
+ init(context?: RUMManagerContext, options?: Partial<MitoSLSAdapterOptions>): Promise<void>;
300
+ private shouldEnableRUM;
301
+ /**
302
+ * 设置 React Router 路由监听
303
+ * 在路由变化时调用此方法
304
+ */
305
+ handleRouteChange(location: {
306
+ pathname: string;
307
+ search: string;
308
+ hash: string;
309
+ }): void;
310
+ private setupUserInteractionTracking;
311
+ private getCSSSelector;
312
+ trackEvent(eventName: string, eventData?: Record<string, any>): void;
313
+ trackPerformance(performanceData: Record<string, any>): void;
314
+ trackAction(action: string, actionData?: Record<string, any>): void;
315
+ trackMetric(metricName: string, value: number, dimensions?: Record<string, any>): void;
316
+ /**
317
+ * 设置用户信息
318
+ * 在用户登录后调用
319
+ */
320
+ setUser(userInfo: {
321
+ userId?: string;
322
+ userName?: string;
323
+ email?: string;
324
+ accountId?: string;
325
+ roles?: string[];
326
+ }): void;
327
+ /**
328
+ * 清除用户信息
329
+ * 在用户登出后调用
330
+ */
331
+ clearUser(): void;
332
+ getBreadcrumbs(): any[];
333
+ enable(): void;
334
+ disable(): void;
335
+ private checkRUMAvailable;
336
+ getConfig(): Record<string, any>;
337
+ destroy(): void;
338
+ }
339
+
340
+ /**
341
+ * 初始化 RUM 系统
342
+ * 在应用启动时调用
343
+ */
344
+ declare const initRUMSystem: (context?: RUMManagerContext, options?: Partial<MitoSLSAdapterOptions>) => Promise<void>;
345
+ /**
346
+ * 路由变化时调用此方法
347
+ * 配合 React Router 的 useLocation hook 使用
348
+ */
349
+ declare const handleRouteChange: (location: {
350
+ pathname: string;
351
+ search: string;
352
+ hash: string;
353
+ }) => void;
354
+ /**
355
+ * 设置用户信息
356
+ * 在用户登录后调用
357
+ */
358
+ declare const setUser: (userInfo: {
359
+ userId?: string;
360
+ userName?: string;
361
+ email?: string;
362
+ accountId?: string;
363
+ roles?: string[];
364
+ }) => void;
365
+ /**
366
+ * 清除用户信息
367
+ * 在用户登出后调用
368
+ */
369
+ declare const clearUser: () => void;
370
+ /**
371
+ * 手动上报自定义事件
372
+ */
373
+ declare const trackEvent: (eventName: string, eventData?: Record<string, any>) => void;
374
+ /**
375
+ * 手动上报性能数据
376
+ */
377
+ declare const trackPerformance: (performanceData: Record<string, any>) => void;
378
+ /**
379
+ * 手动上报用户行为
380
+ */
381
+ declare const trackAction: (action: string, actionData?: Record<string, any>) => void;
382
+ /**
383
+ * 手动上报指标数据
384
+ */
385
+ declare const trackMetric: (metricName: string, value: number, dimensions?: Record<string, any>) => void;
386
+ /**
387
+ * 获取面包屑
388
+ */
389
+ declare const getBreadcrumbs: () => any[];
390
+ /**
391
+ * 启用 RUM
392
+ */
393
+ declare const enableRUM: () => void;
394
+ /**
395
+ * 禁用 RUM
396
+ */
397
+ declare const disableRUM: () => void;
398
+ /**
399
+ * 获取 RUM 配置
400
+ */
401
+ declare const getRUMConfig: () => Record<string, any>;
402
+ /**
403
+ * 销毁 RUM
404
+ */
405
+ declare const destroyRUM: () => void;
406
+ /**
407
+ * 获取 RUM Manager 实例
408
+ */
409
+ declare const getRUMManager: () => RUMManagerReact;
410
+ /**
411
+ * React Hook: useRUM
412
+ * 返回 RUM 相关方法
413
+ */
414
+ declare const useRUM: () => {
415
+ trackEvent: (eventName: string, eventData?: Record<string, any>) => void;
416
+ trackPerformance: (performanceData: Record<string, any>) => void;
417
+ trackAction: (action: string, actionData?: Record<string, any>) => void;
418
+ trackMetric: (metricName: string, value: number, dimensions?: Record<string, any>) => void;
419
+ getBreadcrumbs: () => any[];
420
+ setUser: (userInfo: {
421
+ userId?: string;
422
+ userName?: string;
423
+ email?: string;
424
+ accountId?: string;
425
+ roles?: string[];
426
+ }) => void;
427
+ clearUser: () => void;
428
+ enable: () => void;
429
+ disable: () => void;
430
+ getConfig: () => Record<string, any>;
431
+ };
432
+
433
+ declare const plugin_react_clearUser: typeof clearUser;
434
+ declare const plugin_react_destroyRUM: typeof destroyRUM;
435
+ declare const plugin_react_disableRUM: typeof disableRUM;
436
+ declare const plugin_react_enableRUM: typeof enableRUM;
437
+ declare const plugin_react_getBreadcrumbs: typeof getBreadcrumbs;
438
+ declare const plugin_react_getRUMConfig: typeof getRUMConfig;
439
+ declare const plugin_react_getRUMManager: typeof getRUMManager;
440
+ declare const plugin_react_handleRouteChange: typeof handleRouteChange;
441
+ declare const plugin_react_initRUMSystem: typeof initRUMSystem;
442
+ declare const plugin_react_setUser: typeof setUser;
443
+ declare const plugin_react_trackAction: typeof trackAction;
444
+ declare const plugin_react_trackEvent: typeof trackEvent;
445
+ declare const plugin_react_trackMetric: typeof trackMetric;
446
+ declare const plugin_react_trackPerformance: typeof trackPerformance;
447
+ declare const plugin_react_useRUM: typeof useRUM;
448
+ declare namespace plugin_react {
449
+ export {
450
+ plugin_react_clearUser as clearUser,
451
+ plugin_react_destroyRUM as destroyRUM,
452
+ plugin_react_disableRUM as disableRUM,
453
+ plugin_react_enableRUM as enableRUM,
454
+ plugin_react_getBreadcrumbs as getBreadcrumbs,
455
+ plugin_react_getRUMConfig as getRUMConfig,
456
+ plugin_react_getRUMManager as getRUMManager,
457
+ plugin_react_handleRouteChange as handleRouteChange,
458
+ plugin_react_initRUMSystem as initRUMSystem,
459
+ plugin_react_setUser as setUser,
460
+ plugin_react_trackAction as trackAction,
461
+ plugin_react_trackEvent as trackEvent,
462
+ plugin_react_trackMetric as trackMetric,
463
+ plugin_react_trackPerformance as trackPerformance,
464
+ plugin_react_useRUM as useRUM,
298
465
  };
299
466
  }
300
467
 
301
- export { MitoConfig, MitoSLSAdapter, MitoSLSAdapterOptions, MitoSampleRateConfig, RUMEnv, RUMPluginVue2, RUM_ENV, SLSAdapterConfig, SLSWebTrackingAdapter, SlsConfig, TransformContext, createRUMPluginVue3, destroyRUM as destroyRUMVue2, disableRUM as disableRUMVue2, enableRUM as enableRUMVue2, getBreadcrumbs as getBreadcrumbsVue2, getMitoAdapter, getRUMConfig as getRUMConfigVue2, getRUMCoreInstance, getRUMEnv, getRUMManager as getRUMManagerVue2, getUserInfo, initRUMCore, initRUMSystem as initRUMSystemVue2, mitoConfig, shouldReport, slsConfig, trackAction as trackActionVue2, trackEvent as trackEventVue2, trackMetric as trackMetricVue2, trackPerformance as trackPerformanceVue2, transformDataForSLS, useRUM, plugin_vue2 as vue2, plugin_vue3 as vue3 };
468
+ export { MitoConfig, MitoSLSAdapter, MitoSLSAdapterOptions, MitoSampleRateConfig, RUMEnv, RUMPluginVue2, RUM_ENV, SLSAdapterConfig, SLSWebTrackingAdapter, SlsConfig, TransformContext, clearUser as clearRUMUserReact, createRUMPluginVue3, destroyRUM as destroyRUMReact, destroyRUM$1 as destroyRUMVue2, disableRUM as disableRUMReact, disableRUM$1 as disableRUMVue2, enableRUM as enableRUMReact, enableRUM$1 as enableRUMVue2, getBreadcrumbs as getBreadcrumbsReact, getBreadcrumbs$1 as getBreadcrumbsVue2, getMitoAdapter, getRUMConfig as getRUMConfigReact, getRUMConfig$1 as getRUMConfigVue2, getRUMCoreInstance, getRUMEnv, getRUMManager as getRUMManagerReact, getRUMManager$1 as getRUMManagerVue2, getUserInfo, handleRouteChange, initRUMCore, initRUMSystem as initRUMSystemReact, initRUMSystem$1 as initRUMSystemVue2, mitoConfig, plugin_react as react, setUser as setRUMUserReact, shouldReport, slsConfig, trackAction as trackActionReact, trackAction$1 as trackActionVue2, trackEvent as trackEventReact, trackEvent$1 as trackEventVue2, trackMetric as trackMetricReact, trackMetric$1 as trackMetricVue2, trackPerformance as trackPerformanceReact, trackPerformance$1 as trackPerformanceVue2, transformDataForSLS, useRUM$1 as useRUM, useRUM as useRUMReact, plugin_vue2 as vue2, plugin_vue3 as vue3 };
package/dist/index.d.ts CHANGED
@@ -37,6 +37,7 @@ interface MitoConfig {
37
37
  debug: boolean;
38
38
  maxBreadcrumbs: number;
39
39
  sampleRate: MitoSampleRateConfig;
40
+ framework?: 'vue' | 'react' | 'native';
40
41
  vue: {
41
42
  Vue?: any;
42
43
  lifecycle: boolean;
@@ -121,6 +122,7 @@ declare class SLSWebTrackingAdapter {
121
122
  private addErrorFields;
122
123
  private addApiFields;
123
124
  private addClickFields;
125
+ private addCustomFields;
124
126
  private filterSensitiveData;
125
127
  private handleSendError;
126
128
  private retryFailedLogs;
@@ -190,7 +192,7 @@ declare const initRUMCore: (context: TransformContext & {
190
192
  }, options?: Partial<MitoSLSAdapterOptions>) => Promise<MitoSLSAdapter>;
191
193
  declare const getRUMCoreInstance: () => MitoSLSAdapter | null;
192
194
 
193
- interface RUMManagerContext extends TransformContext {
195
+ interface RUMManagerContext$1 extends TransformContext {
194
196
  Vue?: any;
195
197
  }
196
198
  declare class RUMManagerVue2 {
@@ -198,7 +200,7 @@ declare class RUMManagerVue2 {
198
200
  private isInitialized;
199
201
  private isEnabled;
200
202
  private context;
201
- init(context: RUMManagerContext, options?: Partial<MitoSLSAdapterOptions>): Promise<void>;
203
+ init(context: RUMManagerContext$1, options?: Partial<MitoSLSAdapterOptions>): Promise<void>;
202
204
  private shouldEnableRUM;
203
205
  private setUserInfo;
204
206
  private setupUserStateListener;
@@ -217,47 +219,36 @@ declare class RUMManagerVue2 {
217
219
  destroy(): void;
218
220
  }
219
221
 
220
- declare const initRUMSystem: (context: RUMManagerContext, options?: Partial<MitoSLSAdapterOptions>) => Promise<void>;
221
- declare const trackEvent: (eventName: string, eventData?: Record<string, any>) => void;
222
- declare const trackPerformance: (performanceData: Record<string, any>) => void;
223
- declare const trackAction: (action: string, actionData?: Record<string, any>) => void;
224
- declare const trackMetric: (metricName: string, value: number, dimensions?: Record<string, any>) => void;
225
- declare const getBreadcrumbs: () => any[];
226
- declare const enableRUM: () => void;
227
- declare const disableRUM: () => void;
228
- declare const getRUMConfig: () => Record<string, any>;
229
- declare const destroyRUM: () => void;
230
- declare const getRUMManager: () => RUMManagerVue2;
222
+ declare const initRUMSystem$1: (context: RUMManagerContext$1, options?: Partial<MitoSLSAdapterOptions>) => Promise<void>;
223
+ declare const trackEvent$1: (eventName: string, eventData?: Record<string, any>) => void;
224
+ declare const trackPerformance$1: (performanceData: Record<string, any>) => void;
225
+ declare const trackAction$1: (action: string, actionData?: Record<string, any>) => void;
226
+ declare const trackMetric$1: (metricName: string, value: number, dimensions?: Record<string, any>) => void;
227
+ declare const getBreadcrumbs$1: () => any[];
228
+ declare const enableRUM$1: () => void;
229
+ declare const disableRUM$1: () => void;
230
+ declare const getRUMConfig$1: () => Record<string, any>;
231
+ declare const destroyRUM$1: () => void;
232
+ declare const getRUMManager$1: () => RUMManagerVue2;
231
233
  declare const RUMPluginVue2: {
232
234
  install(Vue: any): void;
233
235
  };
234
236
 
235
237
  declare const plugin_vue2_RUMPluginVue2: typeof RUMPluginVue2;
236
- declare const plugin_vue2_destroyRUM: typeof destroyRUM;
237
- declare const plugin_vue2_disableRUM: typeof disableRUM;
238
- declare const plugin_vue2_enableRUM: typeof enableRUM;
239
- declare const plugin_vue2_getBreadcrumbs: typeof getBreadcrumbs;
240
- declare const plugin_vue2_getRUMConfig: typeof getRUMConfig;
241
- declare const plugin_vue2_getRUMManager: typeof getRUMManager;
242
- declare const plugin_vue2_initRUMSystem: typeof initRUMSystem;
243
- declare const plugin_vue2_trackAction: typeof trackAction;
244
- declare const plugin_vue2_trackEvent: typeof trackEvent;
245
- declare const plugin_vue2_trackMetric: typeof trackMetric;
246
- declare const plugin_vue2_trackPerformance: typeof trackPerformance;
247
238
  declare namespace plugin_vue2 {
248
239
  export {
249
240
  plugin_vue2_RUMPluginVue2 as RUMPluginVue2,
250
- plugin_vue2_destroyRUM as destroyRUM,
251
- plugin_vue2_disableRUM as disableRUM,
252
- plugin_vue2_enableRUM as enableRUM,
253
- plugin_vue2_getBreadcrumbs as getBreadcrumbs,
254
- plugin_vue2_getRUMConfig as getRUMConfig,
255
- plugin_vue2_getRUMManager as getRUMManager,
256
- plugin_vue2_initRUMSystem as initRUMSystem,
257
- plugin_vue2_trackAction as trackAction,
258
- plugin_vue2_trackEvent as trackEvent,
259
- plugin_vue2_trackMetric as trackMetric,
260
- plugin_vue2_trackPerformance as trackPerformance,
241
+ destroyRUM$1 as destroyRUM,
242
+ disableRUM$1 as disableRUM,
243
+ enableRUM$1 as enableRUM,
244
+ getBreadcrumbs$1 as getBreadcrumbs,
245
+ getRUMConfig$1 as getRUMConfig,
246
+ getRUMManager$1 as getRUMManager,
247
+ initRUMSystem$1 as initRUMSystem,
248
+ trackAction$1 as trackAction,
249
+ trackEvent$1 as trackEvent,
250
+ trackMetric$1 as trackMetric,
251
+ trackPerformance$1 as trackPerformance,
261
252
  };
262
253
  }
263
254
 
@@ -285,17 +276,193 @@ interface RUMVue3PluginOptions {
285
276
  declare function createRUMPluginVue3(options: RUMVue3PluginOptions): {
286
277
  install(app: App): void;
287
278
  };
288
- declare function useRUM(): RUMManagerVue3 | undefined;
279
+ declare function useRUM$1(): RUMManagerVue3 | undefined;
289
280
 
290
281
  type plugin_vue3_RUMVue3PluginOptions = RUMVue3PluginOptions;
291
282
  declare const plugin_vue3_createRUMPluginVue3: typeof createRUMPluginVue3;
292
- declare const plugin_vue3_useRUM: typeof useRUM;
293
283
  declare namespace plugin_vue3 {
294
284
  export {
295
285
  plugin_vue3_RUMVue3PluginOptions as RUMVue3PluginOptions,
296
286
  plugin_vue3_createRUMPluginVue3 as createRUMPluginVue3,
297
- plugin_vue3_useRUM as useRUM,
287
+ useRUM$1 as useRUM,
288
+ };
289
+ }
290
+
291
+ interface RUMManagerContext extends TransformContext {
292
+ }
293
+ declare class RUMManagerReact {
294
+ private adapter;
295
+ private isInitialized;
296
+ private isEnabled;
297
+ private context;
298
+ private previousLocation;
299
+ init(context?: RUMManagerContext, options?: Partial<MitoSLSAdapterOptions>): Promise<void>;
300
+ private shouldEnableRUM;
301
+ /**
302
+ * 设置 React Router 路由监听
303
+ * 在路由变化时调用此方法
304
+ */
305
+ handleRouteChange(location: {
306
+ pathname: string;
307
+ search: string;
308
+ hash: string;
309
+ }): void;
310
+ private setupUserInteractionTracking;
311
+ private getCSSSelector;
312
+ trackEvent(eventName: string, eventData?: Record<string, any>): void;
313
+ trackPerformance(performanceData: Record<string, any>): void;
314
+ trackAction(action: string, actionData?: Record<string, any>): void;
315
+ trackMetric(metricName: string, value: number, dimensions?: Record<string, any>): void;
316
+ /**
317
+ * 设置用户信息
318
+ * 在用户登录后调用
319
+ */
320
+ setUser(userInfo: {
321
+ userId?: string;
322
+ userName?: string;
323
+ email?: string;
324
+ accountId?: string;
325
+ roles?: string[];
326
+ }): void;
327
+ /**
328
+ * 清除用户信息
329
+ * 在用户登出后调用
330
+ */
331
+ clearUser(): void;
332
+ getBreadcrumbs(): any[];
333
+ enable(): void;
334
+ disable(): void;
335
+ private checkRUMAvailable;
336
+ getConfig(): Record<string, any>;
337
+ destroy(): void;
338
+ }
339
+
340
+ /**
341
+ * 初始化 RUM 系统
342
+ * 在应用启动时调用
343
+ */
344
+ declare const initRUMSystem: (context?: RUMManagerContext, options?: Partial<MitoSLSAdapterOptions>) => Promise<void>;
345
+ /**
346
+ * 路由变化时调用此方法
347
+ * 配合 React Router 的 useLocation hook 使用
348
+ */
349
+ declare const handleRouteChange: (location: {
350
+ pathname: string;
351
+ search: string;
352
+ hash: string;
353
+ }) => void;
354
+ /**
355
+ * 设置用户信息
356
+ * 在用户登录后调用
357
+ */
358
+ declare const setUser: (userInfo: {
359
+ userId?: string;
360
+ userName?: string;
361
+ email?: string;
362
+ accountId?: string;
363
+ roles?: string[];
364
+ }) => void;
365
+ /**
366
+ * 清除用户信息
367
+ * 在用户登出后调用
368
+ */
369
+ declare const clearUser: () => void;
370
+ /**
371
+ * 手动上报自定义事件
372
+ */
373
+ declare const trackEvent: (eventName: string, eventData?: Record<string, any>) => void;
374
+ /**
375
+ * 手动上报性能数据
376
+ */
377
+ declare const trackPerformance: (performanceData: Record<string, any>) => void;
378
+ /**
379
+ * 手动上报用户行为
380
+ */
381
+ declare const trackAction: (action: string, actionData?: Record<string, any>) => void;
382
+ /**
383
+ * 手动上报指标数据
384
+ */
385
+ declare const trackMetric: (metricName: string, value: number, dimensions?: Record<string, any>) => void;
386
+ /**
387
+ * 获取面包屑
388
+ */
389
+ declare const getBreadcrumbs: () => any[];
390
+ /**
391
+ * 启用 RUM
392
+ */
393
+ declare const enableRUM: () => void;
394
+ /**
395
+ * 禁用 RUM
396
+ */
397
+ declare const disableRUM: () => void;
398
+ /**
399
+ * 获取 RUM 配置
400
+ */
401
+ declare const getRUMConfig: () => Record<string, any>;
402
+ /**
403
+ * 销毁 RUM
404
+ */
405
+ declare const destroyRUM: () => void;
406
+ /**
407
+ * 获取 RUM Manager 实例
408
+ */
409
+ declare const getRUMManager: () => RUMManagerReact;
410
+ /**
411
+ * React Hook: useRUM
412
+ * 返回 RUM 相关方法
413
+ */
414
+ declare const useRUM: () => {
415
+ trackEvent: (eventName: string, eventData?: Record<string, any>) => void;
416
+ trackPerformance: (performanceData: Record<string, any>) => void;
417
+ trackAction: (action: string, actionData?: Record<string, any>) => void;
418
+ trackMetric: (metricName: string, value: number, dimensions?: Record<string, any>) => void;
419
+ getBreadcrumbs: () => any[];
420
+ setUser: (userInfo: {
421
+ userId?: string;
422
+ userName?: string;
423
+ email?: string;
424
+ accountId?: string;
425
+ roles?: string[];
426
+ }) => void;
427
+ clearUser: () => void;
428
+ enable: () => void;
429
+ disable: () => void;
430
+ getConfig: () => Record<string, any>;
431
+ };
432
+
433
+ declare const plugin_react_clearUser: typeof clearUser;
434
+ declare const plugin_react_destroyRUM: typeof destroyRUM;
435
+ declare const plugin_react_disableRUM: typeof disableRUM;
436
+ declare const plugin_react_enableRUM: typeof enableRUM;
437
+ declare const plugin_react_getBreadcrumbs: typeof getBreadcrumbs;
438
+ declare const plugin_react_getRUMConfig: typeof getRUMConfig;
439
+ declare const plugin_react_getRUMManager: typeof getRUMManager;
440
+ declare const plugin_react_handleRouteChange: typeof handleRouteChange;
441
+ declare const plugin_react_initRUMSystem: typeof initRUMSystem;
442
+ declare const plugin_react_setUser: typeof setUser;
443
+ declare const plugin_react_trackAction: typeof trackAction;
444
+ declare const plugin_react_trackEvent: typeof trackEvent;
445
+ declare const plugin_react_trackMetric: typeof trackMetric;
446
+ declare const plugin_react_trackPerformance: typeof trackPerformance;
447
+ declare const plugin_react_useRUM: typeof useRUM;
448
+ declare namespace plugin_react {
449
+ export {
450
+ plugin_react_clearUser as clearUser,
451
+ plugin_react_destroyRUM as destroyRUM,
452
+ plugin_react_disableRUM as disableRUM,
453
+ plugin_react_enableRUM as enableRUM,
454
+ plugin_react_getBreadcrumbs as getBreadcrumbs,
455
+ plugin_react_getRUMConfig as getRUMConfig,
456
+ plugin_react_getRUMManager as getRUMManager,
457
+ plugin_react_handleRouteChange as handleRouteChange,
458
+ plugin_react_initRUMSystem as initRUMSystem,
459
+ plugin_react_setUser as setUser,
460
+ plugin_react_trackAction as trackAction,
461
+ plugin_react_trackEvent as trackEvent,
462
+ plugin_react_trackMetric as trackMetric,
463
+ plugin_react_trackPerformance as trackPerformance,
464
+ plugin_react_useRUM as useRUM,
298
465
  };
299
466
  }
300
467
 
301
- export { MitoConfig, MitoSLSAdapter, MitoSLSAdapterOptions, MitoSampleRateConfig, RUMEnv, RUMPluginVue2, RUM_ENV, SLSAdapterConfig, SLSWebTrackingAdapter, SlsConfig, TransformContext, createRUMPluginVue3, destroyRUM as destroyRUMVue2, disableRUM as disableRUMVue2, enableRUM as enableRUMVue2, getBreadcrumbs as getBreadcrumbsVue2, getMitoAdapter, getRUMConfig as getRUMConfigVue2, getRUMCoreInstance, getRUMEnv, getRUMManager as getRUMManagerVue2, getUserInfo, initRUMCore, initRUMSystem as initRUMSystemVue2, mitoConfig, shouldReport, slsConfig, trackAction as trackActionVue2, trackEvent as trackEventVue2, trackMetric as trackMetricVue2, trackPerformance as trackPerformanceVue2, transformDataForSLS, useRUM, plugin_vue2 as vue2, plugin_vue3 as vue3 };
468
+ export { MitoConfig, MitoSLSAdapter, MitoSLSAdapterOptions, MitoSampleRateConfig, RUMEnv, RUMPluginVue2, RUM_ENV, SLSAdapterConfig, SLSWebTrackingAdapter, SlsConfig, TransformContext, clearUser as clearRUMUserReact, createRUMPluginVue3, destroyRUM as destroyRUMReact, destroyRUM$1 as destroyRUMVue2, disableRUM as disableRUMReact, disableRUM$1 as disableRUMVue2, enableRUM as enableRUMReact, enableRUM$1 as enableRUMVue2, getBreadcrumbs as getBreadcrumbsReact, getBreadcrumbs$1 as getBreadcrumbsVue2, getMitoAdapter, getRUMConfig as getRUMConfigReact, getRUMConfig$1 as getRUMConfigVue2, getRUMCoreInstance, getRUMEnv, getRUMManager as getRUMManagerReact, getRUMManager$1 as getRUMManagerVue2, getUserInfo, handleRouteChange, initRUMCore, initRUMSystem as initRUMSystemReact, initRUMSystem$1 as initRUMSystemVue2, mitoConfig, plugin_react as react, setUser as setRUMUserReact, shouldReport, slsConfig, trackAction as trackActionReact, trackAction$1 as trackActionVue2, trackEvent as trackEventReact, trackEvent$1 as trackEventVue2, trackMetric as trackMetricReact, trackMetric$1 as trackMetricVue2, trackPerformance as trackPerformanceReact, trackPerformance$1 as trackPerformanceVue2, transformDataForSLS, useRUM$1 as useRUM, useRUM as useRUMReact, plugin_vue2 as vue2, plugin_vue3 as vue3 };