import type { AsyncLocalStorage } from 'node:async_hooks'; import type { ContextManager } from '@opentelemetry/api'; export type AsyncLocalStorageLookup = { asyncLocalStorage: AsyncLocalStorage; contextSymbol: symbol; }; type ExtendedContextManagerInstance = new (...args: unknown[]) => ContextManagerInstance & { getAsyncLocalStorageLookup(): AsyncLocalStorageLookup; }; /** * Wrap an OpenTelemetry ContextManager in a way that ensures the context is kept in sync with the Sentry Scope. * * Usage: * import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks'; * const SentryContextManager = wrapContextManagerClass(AsyncLocalStorageContextManager); * const contextManager = new SentryContextManager(); */ export declare function wrapContextManagerClass(ContextManagerClass: new (...args: unknown[]) => ContextManagerInstance): ExtendedContextManagerInstance; export {}; //# sourceMappingURL=contextManager.d.ts.map