46 lines
1.7 KiB
TypeScript
46 lines
1.7 KiB
TypeScript
import type { LightConfig, LightClient, LightPlugin, DSNInfo, SentryEvent, EventLevel, UserInfo, Breadcrumb, TransactionContext, SpanContext, Transaction, Span } from '../types';
|
|
declare class Client implements LightClient {
|
|
dsn: DSNInfo;
|
|
private configManager;
|
|
private eventBus;
|
|
private queue;
|
|
private reporter;
|
|
private pluginManager;
|
|
private tracingManager;
|
|
private breadcrumbs;
|
|
private enabled;
|
|
private get maxBreadcrumbs();
|
|
get config(): LightConfig;
|
|
constructor(config: LightConfig);
|
|
init(): void;
|
|
private flushEvents;
|
|
private syncFlushEvents;
|
|
on(event: string, handler: (...args: unknown[]) => void): void;
|
|
off(event: string, handler: (...args: unknown[]) => void): void;
|
|
emit(event: string, ...args: unknown[]): void;
|
|
captureException(error: Error | unknown): void;
|
|
captureMessage(message: string, level?: EventLevel): void;
|
|
captureEvent(event: Partial<SentryEvent> & {
|
|
type: string;
|
|
}): void;
|
|
private attachTraceContext;
|
|
private buildErrorEvent;
|
|
setUser(user: UserInfo | null): void;
|
|
setAnonymousId(id: string): void;
|
|
startTransaction(context: TransactionContext): Transaction | null;
|
|
getCurrentTransaction(): Transaction | null;
|
|
getCurrentSpan(): Span | null;
|
|
setSpan(span: Span | null): void;
|
|
startSpan(context: SpanContext): Span | null;
|
|
setTag(key: string, value: string): void;
|
|
setTags(tags: Record<string, string>): void;
|
|
setExtra(key: string, value: unknown): void;
|
|
addBreadcrumb(breadcrumb: Omit<Breadcrumb, 'timestamp'>): void;
|
|
flush(): Promise<void>;
|
|
disable(): void;
|
|
enable(): void;
|
|
use(plugin: LightPlugin): void;
|
|
destroy(): void;
|
|
}
|
|
export default Client;
|