import { TOrchestrator } from "../types/orchestrator.type"; import { TActivity } from "../types/activity.type"; import { TInput } from "../types/input.type"; import { TOutput } from "../types/output.type"; import { InMemoryOrchestrationBackend } from "./in-memory-backend"; /** * Worker that processes orchestrations and activities from the in-memory backend. * * This worker runs in the same process as the test and processes work items * synchronously in the Node.js event loop, avoiding the need for a separate * sidecar process. */ export declare class TestOrchestrationWorker { private readonly registry; private readonly backend; private isRunning; private processingPromise; private stopRequested; constructor(backend: InMemoryOrchestrationBackend); /** * Registers an orchestrator function with the worker. */ addOrchestrator(fn: TOrchestrator): string; /** * Registers a named orchestrator function with the worker. */ addNamedOrchestrator(name: string, fn: TOrchestrator): string; /** * Registers an activity function with the worker. */ addActivity(fn: TActivity): string; /** * Registers a named activity function with the worker. */ addNamedActivity(name: string, fn: TActivity): string; /** * Starts the worker processing loop. */ start(): Promise; /** * Stops the worker. This method is idempotent and can be safely called * even if the worker is not running. */ stop(): Promise; /** * Main processing loop that continuously processes work items. */ private runProcessingLoop; /** * Processes a single orchestration work item. */ private processOrchestration; /** * Processes a single activity work item. */ private processActivity; /** * Yields control to the event loop to allow timers and I/O to process. */ private yieldToEventLoop; }