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