1 | import { Breadcrumb, BreadcrumbHint, Client, CustomSamplingContext, Event, EventHint, Extra, Extras, Hub as HubInterface, Integration, IntegrationClass, Primitive, Session, SessionContext, Severity, SeverityLevel, Transaction, TransactionContext, User } from '@sentry/types';
|
2 | import { Scope } from './scope';
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | export declare const API_VERSION = 4;
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export interface Layer {
|
17 | client?: Client;
|
18 | scope?: Scope;
|
19 | }
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | export interface Carrier {
|
25 | __SENTRY__?: {
|
26 | hub?: Hub;
|
27 | |
28 |
|
29 |
|
30 | integrations?: Integration[];
|
31 | extensions?: {
|
32 |
|
33 | domain?: {
|
34 | [key: string]: any;
|
35 | };
|
36 | } & {
|
37 |
|
38 | [key: string]: Function;
|
39 | };
|
40 | };
|
41 | }
|
42 |
|
43 |
|
44 |
|
45 | export declare class Hub implements HubInterface {
|
46 | private readonly _version;
|
47 |
|
48 | private readonly _stack;
|
49 |
|
50 | private _lastEventId?;
|
51 | |
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 | constructor(client?: Client, scope?: Scope, _version?: number);
|
60 | /**
|
61 | * @inheritDoc
|
62 | */
|
63 | isOlderThan(version: number): boolean;
|
64 | /**
|
65 | * @inheritDoc
|
66 | */
|
67 | bindClient(client?: Client): void;
|
68 | /**
|
69 | * @inheritDoc
|
70 | */
|
71 | pushScope(): Scope;
|
72 | /**
|
73 | * @inheritDoc
|
74 | */
|
75 | popScope(): boolean;
|
76 | /**
|
77 | * @inheritDoc
|
78 | */
|
79 | withScope(callback: (scope: Scope) => void): void;
|
80 | /**
|
81 | * @inheritDoc
|
82 | */
|
83 | getClient<C extends Client>(): C | undefined;
|
84 | /** Returns the scope of the top stack. */
|
85 | getScope(): Scope | undefined;
|
86 | /** Returns the scope stack for domains or the process. */
|
87 | getStack(): Layer[];
|
88 | /** Returns the topmost scope layer in the order domain > local > process. */
|
89 | getStackTop(): Layer;
|
90 | /**
|
91 | * @inheritDoc
|
92 | */
|
93 | captureException(exception: any, hint?: EventHint): string;
|
94 | /**
|
95 | * @inheritDoc
|
96 | */
|
97 | captureMessage(message: string, level?: Severity | SeverityLevel, hint?: EventHint): string;
|
98 | /**
|
99 | * @inheritDoc
|
100 | */
|
101 | captureEvent(event: Event, hint?: EventHint): string;
|
102 | /**
|
103 | * @inheritDoc
|
104 | */
|
105 | lastEventId(): string | undefined;
|
106 | /**
|
107 | * @inheritDoc
|
108 | */
|
109 | addBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;
|
110 | /**
|
111 | * @inheritDoc
|
112 | */
|
113 | setUser(user: User | null): void;
|
114 | /**
|
115 | * @inheritDoc
|
116 | */
|
117 | setTags(tags: {
|
118 | [key: string]: Primitive;
|
119 | }): void;
|
120 | /**
|
121 | * @inheritDoc
|
122 | */
|
123 | setExtras(extras: Extras): void;
|
124 | /**
|
125 | * @inheritDoc
|
126 | */
|
127 | setTag(key: string, value: Primitive): void;
|
128 | /**
|
129 | * @inheritDoc
|
130 | */
|
131 | setExtra(key: string, extra: Extra): void;
|
132 | /**
|
133 | * @inheritDoc
|
134 | */
|
135 | setContext(name: string, context: {
|
136 | [key: string]: any;
|
137 | } | null): void;
|
138 | /**
|
139 | * @inheritDoc
|
140 | */
|
141 | configureScope(callback: (scope: Scope) => void): void;
|
142 | /**
|
143 | * @inheritDoc
|
144 | */
|
145 | run(callback: (hub: Hub) => void): void;
|
146 | /**
|
147 | * @inheritDoc
|
148 | */
|
149 | getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null;
|
150 | /**
|
151 | * @inheritDoc
|
152 | */
|
153 | startTransaction(context: TransactionContext, customSamplingContext?: CustomSamplingContext): Transaction;
|
154 | /**
|
155 | * @inheritDoc
|
156 | */
|
157 | traceHeaders(): {
|
158 | [key: string]: string;
|
159 | };
|
160 | |
161 |
|
162 |
|
163 | captureSession(endSession?: boolean): void;
|
164 | |
165 |
|
166 |
|
167 | endSession(): void;
|
168 | |
169 |
|
170 |
|
171 | startSession(context?: SessionContext): Session;
|
172 | |
173 |
|
174 |
|
175 |
|
176 | shouldSendDefaultPii(): boolean;
|
177 | |
178 |
|
179 |
|
180 | private _sendSessionUpdate;
|
181 | |
182 |
|
183 |
|
184 |
|
185 |
|
186 |
|
187 | private _withClient;
|
188 | |
189 |
|
190 |
|
191 | private _callExtensionMethod;
|
192 | }
|
193 |
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 |
|
200 | export declare function getMainCarrier(): Carrier;
|
201 |
|
202 |
|
203 |
|
204 |
|
205 |
|
206 | export declare function makeMain(hub: Hub): Hub;
|
207 |
|
208 |
|
209 |
|
210 |
|
211 |
|
212 |
|
213 |
|
214 | export declare function getCurrentHub(): Hub;
|
215 |
|
216 |
|
217 |
|
218 |
|
219 |
|
220 |
|
221 | export declare function getHubFromCarrier(carrier: Carrier): Hub;
|
222 |
|
223 |
|
224 |
|
225 |
|
226 |
|
227 |
|
228 | export declare function setHubOnCarrier(carrier: Carrier, hub: Hub): boolean;
|
229 |
|
\ | No newline at end of file |