import vm from 'node:vm'; import { Workflow, WorkflowCreateOptions, WorkflowCreator } from './interface'; import { WorkflowBundleWithSourceMapAndFilename } from './workflow-worker-thread/input'; import { BaseVMWorkflow } from './vm-shared'; /** * A WorkflowCreator that creates VMWorkflows in the current isolate */ export declare class VMWorkflowCreator implements WorkflowCreator { protected readonly workflowBundle: WorkflowBundleWithSourceMapAndFilename; protected readonly isolateExecutionTimeoutMs: number; protected readonly registeredActivityNames: Set; private static unhandledRejectionHandlerHasBeenSet; static workflowByRunId: Map; script?: vm.Script; constructor(script: vm.Script, workflowBundle: WorkflowBundleWithSourceMapAndFilename, isolateExecutionTimeoutMs: number, registeredActivityNames: Set); /** * Create a workflow with given options */ createWorkflow(options: WorkflowCreateOptions): Promise; protected get context(): vm.Context & typeof globalThis; /** * Inject global objects as well as console.[log|...] into a vm context. * * Overridable for test purposes. */ protected injectGlobals(context: vm.Context): void; /** * Create a new instance, pre-compile scripts from given code. * * This method is generic to support subclassing. */ static create(this: T, workflowBundle: WorkflowBundleWithSourceMapAndFilename, isolateExecutionTimeoutMs: number, registeredActivityNames: Set): Promise>; /** * Cleanup the pre-compiled script */ destroy(): Promise; } /** * A Workflow implementation using Node.js' built-in `vm` module */ export declare class VMWorkflow extends BaseVMWorkflow { dispose(): Promise; }