UNPKG

smr-performance-monitor

Version:

smr-performance-monitor

67 lines (66 loc) 1.55 kB
/** 事件类型 */ export declare enum EventTypeEnum { /** 页面切换进入 */ PV = 1, /** 用户第一次进入 */ UV = 2, /** 点击 */ CLICK = 3, /** 信息 */ INFO = 4, /** 错误 */ ERROR = 5, /** 警告 */ WARN = 6, /** 输入 */ INPUT = 7, /** 鼠标悬浮 */ HOVER = 8, /** 框架初始化 */ APP_PE = 9, /** 切换页面路由 */ PAGE_PE = 10 } /** 当前系统自定义上报 Api 传值 */ interface UploadReportParams { /** 页面路径 */ path?: string; /** 用户唯一id */ uin?: string; accountId?: string; /** 页面名称 */ moduleName?: string; /** 事件名称 */ eventName?: string; /** 事件类型 */ eventType: EventTypeEnum | number; /** 错误信息 */ errMsg?: string; /** 性能指标 */ performance?: Record<any, any>; /** 扩展字段 */ exts?: Record<any, any>; } declare type ConfigType = { uin?: any; accountId?: any; token?: any; serviceType?: any; env?: any; reportPath?: string; }; export declare class ReportApi { private config; constructor(option: ConfigType); uploadReport(params: UploadReportParams): Promise<void>; reportAppRelaunch(params: { exts?: any; performance?: any; }): void; reportChangeRouter(params: { exts?: any; performance?: any; }): void; reportEvent(params: any): void; } export {};