UNPKG

1.39 kBTypeScriptView Raw
1import type { Integration } from '@sentry/types';
2import type { AsyncContextStrategy } from './asyncContext/types';
3/**
4 * An object that contains a hub and maintains a scope stack.
5 * @hidden
6 */
7export interface Carrier {
8 __SENTRY__?: SentryCarrier;
9}
10interface SentryCarrier {
11 acs?: AsyncContextStrategy;
12}
13/**
14 * An object that contains a hub and maintains a scope stack.
15 * @hidden
16 */
17export interface Carrier {
18 __SENTRY__?: SentryCarrier;
19}
20interface SentryCarrier {
21 acs?: AsyncContextStrategy;
22 /**
23 * Extra Hub properties injected by various SDKs
24 */
25 integrations?: Integration[];
26 extensions?: {
27 /** Extension methods for the hub, which are bound to the current Hub instance */
28 [key: string]: Function;
29 };
30}
31/**
32 * Returns the global shim registry.
33 *
34 * FIXME: This function is problematic, because despite always returning a valid Carrier,
35 * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check
36 * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.
37 **/
38export declare function getMainCarrier(): Carrier;
39/** Will either get the existing sentry carrier, or create a new one. */
40export declare function getSentryCarrier(carrier: Carrier): SentryCarrier;
41export {};
42//# sourceMappingURL=carrier.d.ts.map
\No newline at end of file