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