sentry-miniapp.d.ts
1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Type definitions for sentry-miniapp.js
// 导出所有Sentry相关的类型和函数
declare namespace Sentry {
// 基本配置接口
interface Options {
dsn?: string;
environment?: string;
release?: string;
debug?: boolean;
[key: string]: any;
}
// 错误级别类型
type SeverityLevel = 'fatal' | 'error' | 'warning' | 'log' | 'info' | 'debug';
// 错误捕获和上报相关函数
function init(options: Options): void;
function captureException(error: Error | string, options?: any): string;
function captureMessage(message: string, options?: any): string;
function captureEvent(event: any): string;
// 上下文相关函数
function setTag(key: string, value: string): void;
function setTags(tags: Record<string, string>): void;
function setExtra(key: string, value: any): void;
function setExtras(extras: Record<string, any>): void;
function setUser(user: Record<string, any> | null): void;
function setContext(name: string, context: Record<string, any> | null): void;
// Scope相关函数
function withScope(callback: (scope: any) => void): void;
// 其他可能的辅助函数
function addBreadcrumb(breadcrumb: any): void;
function configureScope(callback: (scope: any) => void): void;
}
export = Sentry;
export as namespace Sentry;