@sentry/core
Version:
Base implementation for all Sentry JavaScript SDKs
42 lines • 1.39 kB
TypeScript
import type { Integration } from '@sentry/types';
import type { AsyncContextStrategy } from './asyncContext/types';
/**
* An object that contains a hub and maintains a scope stack.
* @hidden
*/
export interface Carrier {
__SENTRY__?: SentryCarrier;
}
interface SentryCarrier {
acs?: AsyncContextStrategy;
}
/**
* An object that contains a hub and maintains a scope stack.
* @hidden
*/
export interface Carrier {
__SENTRY__?: SentryCarrier;
}
interface SentryCarrier {
acs?: AsyncContextStrategy;
/**
* Extra Hub properties injected by various SDKs
*/
integrations?: Integration[];
extensions?: {
/** Extension methods for the hub, which are bound to the current Hub instance */
[key: string]: Function;
};
}
/**
* Returns the global shim registry.
*
* FIXME: This function is problematic, because despite always returning a valid Carrier,
* it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check
* at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.
**/
export declare function getMainCarrier(): Carrier;
/** Will either get the existing sentry carrier, or create a new one. */
export declare function getSentryCarrier(carrier: Carrier): SentryCarrier;
export {};
//# sourceMappingURL=carrier.d.ts.map