import { ClassConstructor } from '@node-ts/bus-core'; import { WorkflowData } from './workflow-data'; export declare type WorkflowConstructor = Workflow> = ClassConstructor; export declare const WORKFLOW_STEP_DISCARDED = "discarded"; export declare abstract class Workflow { /** * Flags that the workflow is complete, thereby preventing it from reacting to any * subsequent messages. This should be called as part of the return value of * a handling function * @param data Any final modifications to the workflow data that will be persisted * @example * \@Handles(TaskRan, event => event.value, 'property1') * async handleTaskRan (event: TaskRan): Promise> { * return this.complete({ taskRunDuration: event.duration }) * } */ protected complete(data?: Partial): Partial; /** * Tells the workflow engine to avoid persisting state for this workflow step. If this is * returned in a StartedBy handler, then the handler state will not be created and stored. * If this is run in a Handles handler, then changes to the state will not be run. */ protected discard(): Partial; }