import type { Context, ContextManager } from '@opentelemetry/api'; /** * StackContextManager can track context for synchronous code (the call * "stack"). It does not track context for asynchronous code (Promises, * async/await). * * This can be useful as a minimal ContextManager in the web/browser * environment, which does not provide a native system for async context * tracking. Web users might consider `@opentelemetry/context-zone` as * an alternative. Node.js users will almost certainly want to use * `AsyncLocalStorageContextManager`. */ export declare class StackContextManager implements ContextManager { /** * whether the context manager is enabled or not */ private _enabled; /** * Keeps the reference to current context */ _currentContext: Context; /** * * @param context * @param target Function to be executed within the context */ private _bindFunction; /** * Returns the active context */ active(): Context; /** * Binds a the certain context or the active one to the target function and then returns the target * @param context A context (span) to be bind to target * @param target a function or event emitter. When target or one of its callbacks is called, * the provided context will be used as the active context for the duration of the call. */ bind(context: Context, target: T): T; /** * Disable the context manager (clears the current context) */ disable(): this; /** * Enables the context manager and creates a default(root) context */ enable(): this; /** * Calls the callback function [fn] with the provided [context]. If [context] is undefined then it will use the window. * The context will be set as active * @param context * @param fn Callback function * @param thisArg optional receiver to be used for calling fn * @param args optional arguments forwarded to fn */ with ReturnType>(context: Context | null, fn: F, thisArg?: ThisParameterType, ...args: A): ReturnType; } //# sourceMappingURL=StackContextManager.d.ts.map