alvamind-workflow
Version:
A lightweight and flexible workflow automation library for JavaScript/TypeScript projects
28 lines • 1.26 kB
TypeScript
import { WorkflowBuilder, WorkflowConfig, WorkflowOptions, WorkflowContext } from "./types.js";
declare class WorkflowBuilderImpl implements WorkflowBuilder {
private config;
private lastCommandIndex;
constructor(name?: string);
name(name: string): this;
execute<T extends string = string>(command: string, name: string, skippable?: boolean): this;
executeWithId<T extends string>(id: T, command: string, name: string, skippable?: boolean): this;
executeWith(command: string, name: string, callback: (result: {
exitCode: number;
stdout: string;
stderr: string;
}) => string | undefined, skippable?: boolean): this;
when(condition: (context: WorkflowContext) => boolean | Promise<boolean>, name: string): this;
dependsOn(...ids: string[]): this;
addParallelCommands(name: string, commands: Array<{
command: string;
name: string;
skippable?: boolean;
}>): this;
build(): WorkflowConfig;
getConfig(): WorkflowConfig;
run(options?: WorkflowOptions): Promise<boolean>;
private countTotalSteps;
}
export declare function createWorkflow(options?: WorkflowOptions): WorkflowBuilderImpl;
export { WorkflowBuilderImpl };
//# sourceMappingURL=workflow.d.ts.map