@dmhsq_monitor/web
Version:
Web monitoring package for monitor system
45 lines (44 loc) • 1.3 kB
TypeScript
/**
* 获取元素的路径
* @param element 目标元素
* @returns 元素路径字符串
*/
export declare function getElementPath(element: HTMLElement): string;
/**
* 获取元素内容
* @param element 目标元素
* @returns 元素内容
*/
export declare function getElementContent(element: HTMLElement): string;
/**
* 过滤敏感信息
* @param obj 要过滤的对象
* @returns 过滤后的对象
*/
export declare function filterSensitiveInfo(obj: Record<string, any>): Record<string, any>;
/**
* 检查是否应该采样
* @param rate 采样率 (0-1)
* @returns 是否采样
*/
export declare function shouldSample(rate: number): boolean;
/**
* 判断是否忽略错误
* @param message 错误消息
* @param ignorePatterns 忽略模式
* @returns 是否忽略
*/
export declare function shouldIgnoreError(message: string, ignorePatterns?: (string | RegExp)[]): boolean;
/**
* 判断是否忽略URL
* @param url URL字符串
* @param ignorePatterns 忽略模式
* @returns 是否忽略
*/
export declare function shouldIgnoreUrl(url: string, ignorePatterns?: RegExp[]): boolean;
/**
* 从错误对象提取重要信息
* @param error 错误对象
* @returns 错误信息对象
*/
export declare function extractErrorInfo(error: Error | any): Record<string, any>;