/** * Stream context containing metadata for the current stream operation. This interface is extensible - additional fields can be added as needed without changing * function signatures throughout the codebase. */ export interface StreamContext { channelName?: string; streamId: string; url?: string; } /** * Runs a function within a stream context. All async operations called within the function will have access to the stream context via getStreamContext() and * getStreamId(). This should be called at stream entry points (request handlers) and at the start of timer callbacks (setInterval, setTimeout) to re-establish * context. * @param context - The stream context containing streamId and optional metadata. * @param fn - The async function to run within the context. * @returns The result of the function. */ export declare function runWithStreamContext(context: StreamContext, fn: () => Promise): Promise; /** * Retrieves the full stream context for the current async operation. * @returns The stream context, or undefined if not running within a stream context. */ export declare function getStreamContext(): StreamContext | undefined; /** * Convenience function to retrieve just the stream ID from the current context. * @returns The stream ID, or undefined if not running within a stream context. */ export declare function getStreamId(): string | undefined;