light-sentry-sdk/dist/core/ConfigManager.d.ts

35 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { LightConfig, SentryEvent, UserInfo } from '../types';
export declare class ConfigManager {
private config;
private contexts;
private contextId;
private contextReported;
constructor(config: LightConfig);
markContextReported(): void;
get<K extends keyof LightConfig>(key: K): LightConfig[K];
getAll(): LightConfig;
set<K extends keyof LightConfig>(key: K, value: LightConfig[K]): void;
setUser(user: UserInfo | null): void;
setTags(tags: Record<string, string>): void;
setTag(key: string, value: string): void;
setExtra(key: string, value: unknown): void;
isIgnoredError(message: string): boolean;
shouldSample(): boolean;
/**
* 获取编码后的环境信息(延迟初始化,只在首次上报时计算)
* 注意env.ts 的 getContexts 已经返回编码后的数据
*/
private getEncodedContext;
/**
* 将配置应用到事件
* @param event 事件对象
* @param includeFullContext 是否包含完整环境信息(批次内只有首个事件需要)
*/
applyToEvent(event: SentryEvent, includeFullContext?: boolean): SentryEvent;
/**
* 应用上下文分层策略:根据事件级别裁剪堆栈和 breadcrumbs
* 注意:此方法不修改原始 event 对象,返回裁剪后的副本
*/
private applyContextLevel;
}