forked from bugsnag/bugsnag-react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
106 lines (80 loc) · 2.38 KB
/
index.d.ts
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
export class Client {
public config: Configuration;
constructor(apiKeyOrConfig?: string | Configuration);
public notify(
error: Error,
beforeSendCallback?: BeforeSend,
blocking?: boolean,
postSendCallback?: (sent: boolean) => void,
): void;
public setUser(id?: string, name?: string, email?: string): void;
public clearUser(): void;
public startSession(): void;
public stopSession(): void;
public resumeSession(): void;
public enableConsoleBreadcrumbs(): void;
public disableConsoleBreadCrumbs(): void;
public leaveBreadcrumb(name: string, metadata?: IMetadata | string): void;
}
export class Configuration {
public version: string;
public apiKey?: string;
public delivery: StandardDelivery;
public beforeSendCallbacks: BeforeSend[];
public notifyReleaseStages?: string[];
public releaseStage?: string;
public appVersion?: string;
public codeBundleId?: string;
public autoNotify: boolean;
public handlePromiseRejections: boolean;
public autoCaptureSessions: boolean;
public automaticallyCollectBreadcrumbs: boolean;
public consoleBreadcrumbsEnabled: boolean;
constructor(apiKey?: string);
public shouldNotify(): boolean;
public registerBeforeSendCallback(callback: BeforeSend): void;
public unregisterBeforeSendCallback(
callback: BeforeSend,
): void;
public clearBeforeSendCallbacks(): void;
public toJSON(): any;
}
type BeforeSend = (report: Report) => boolean | void;
export class StandardDelivery {
public endpoint: string;
public sessionsEndpoint: string;
constructor(endpoint: string, sessionsEndpoint: string);
}
export interface IMetadata {
type?:
| "error"
| "log"
| "navigation"
| "process"
| "request"
| "state"
| "user"
| "manual";
[key: string]: IMetadataValue | string | number | boolean | undefined;
}
export interface IMetadataValue {
[key: string]: string | number | boolean | undefined;
}
export class Report {
public apiKey: string;
public errorClass: string;
public errorMessage: string;
public context?: string;
public groupingHash?: string;
public metadata: IMetadata;
public severity: "warning" | "error" | "info";
public stacktrace: string;
public user: any;
constructor(apiKey: string, error: Error);
public addMetadata(
section: string,
key: string,
value: number | string | boolean,
): void;
public toJSON(): any;
}