whitch-frontend-monitor
Version:
前端监控系统 - 一个轻量级的前端监控SDK
43 lines (42 loc) • 866 B
TypeScript
/**
* 用户行为监控模块
*/
export interface BehaviorInfo {
type: string;
target?: string;
pageUrl: string;
timestamp: number;
metadata?: any;
}
export declare class BehaviorMonitor {
private static behaviorList;
private static reporter;
/**
* 初始化行为监控
*/
static init(): void;
/**
* 监控点击事件
*/
private static initClickMonitor;
/**
* 监控路由变化
*/
private static initRouteMonitor;
/**
* 监控控制台输出
*/
private static initConsoleMonitor;
/**
* 获取元素的CSS选择器路径
*/
private static getElementPath;
/**
* 获取收集到的用户行为数据
*/
static getBehaviors(): BehaviorInfo[];
/**
* 清空用户行为数据
*/
static clearBehaviors(): void;
}