import { TransportMessage } from '../transport'; import ALS from 'alscontext'; type Context = TransportMessage & { isInHandlerContext?: boolean; }; /** * A context that stores the transport message when it is received from the bus. Any calls in deeper stacks can * access the context by calling `messageHandlingContext.get()`. */ declare class MessageHandlingContext extends ALS { /** * Fetch the message context for the current async stack */ get(): Context; /** * Set the message context for the current async stack */ set(message: Context): any; /** * Start and run a new async context */ run(context: Context, fn: () => T | Promise, isInHandlerContext?: boolean): T | Promise; /** * Check if the call stack is within a handler or workflow handler context */ get isInHandlerContext(): boolean; } export declare const messageHandlingContext: MessageHandlingContext; export {};