import { BankJobData } from '../job/bank-job-data'; /** * Step status can be: * - completed * - skipped * - suspended * - error */ export declare enum StepStatus { Completed = "completed", Skipped = "skipped", Suspended = "suspended", Error = "error" } /** * Step completed successfully. */ export type StepCompleted = { status: StepStatus.Completed; state?: any; }; /** * Step is already executed, so it * skipped current execution. */ export type StepSkipped = { status: StepStatus.Skipped; state?: any; }; /** * Step is currently suspended, which * will cause workflow to pause the * execution. */ export type StepSuspend = { status: StepStatus.Suspended; suspendedUntil?: Date; state?: any; }; /** * Error occured while executing * the step, which will stop the * workflow execution. */ export type StepError = { status: StepStatus.Error; error: any; state?: any; }; /** * Abstract step result. */ export type StepResult = StepCompleted | StepSkipped | StepSuspend | StepError; /** * Interface for a workflow step. */ export declare abstract class IStep { /** * Executes the step. * * @param job job to process * @param context step context * @returns step result */ abstract execute(job: BankJobData, context: TContext): Promise; }