import { TWorkflow } from "../../types/workflow/Workflow.type"; import { TWorkflowActivity } from "../../types/workflow/Activity.type"; import { TInput, TOutput } from "../../types/workflow/InputOutput.type"; import { WorkflowClientOptions } from "../../types/workflow/WorkflowClientOption"; /** * Contains methods to register workflows and activities. */ export default class WorkflowRuntime { private worker; /** * Initializes a new instance of the WorkflowRuntime. * @param {WorkflowClientOptions | undefined} options - Additional options for configuring WorkflowRuntime. */ constructor(options?: Partial); private buildInnerWorker; /** * Registers a Workflow implementation for handling orchestrations. * * @param {TWorkflow} workflow - The instance of the Workflow class being registered. */ registerWorkflow(workflow: TWorkflow): WorkflowRuntime; /** * Registers a Workflow implementation for handling orchestrations with a given name. * The name provided need not be same as workflow name. * * @param {string} name - The name or identifier for the registered Workflow. * @param {TWorkflow} workflow - The instance of the Workflow class being registered. */ registerWorkflowWithName(name: string, workflow: TWorkflow): WorkflowRuntime; /** * Registers an Activity object. * * @param {TWorkflowActivity} fn - The instance of the WorkflowActivity class being registered. * @returns {WorkflowRuntime} The current instance of WorkflowRuntime. */ registerActivity(fn: TWorkflowActivity): WorkflowRuntime; /** * Registers an Activity object with a given name. * The name provided need not be same as WorkflowActivity name. * * @param {string} name - The name or identifier for the registered Activity. * @param {TWorkflowActivity} fn - The instance of the WorkflowActivity class being registered. * @returns {WorkflowRuntime} The current instance of WorkflowRuntime. */ registerActivityWithName(name: string, fn: TWorkflowActivity): WorkflowRuntime; /** * Start the Workflow runtime processing items and block. */ start(): Promise; /** * Stop the worker and wait for any pending work items to complete */ stop(): Promise; }