import { ProjectAwareGoalInvocation } from "../../../api-helper/project/withProject";
import { ExecuteGoalResult } from "../../../api/goal/ExecuteGoalResult";
import { FulfillableGoalDetails, GoalWithFulfillment } from "../../../api/goal/GoalWithFulfillment";
/**
 * Single step in the Goal pipeline execution
 */
export interface PipelineStep<G extends Record<string, any> = any> {
    /** Name of the step */
    name: string;
    /** Function that gets called when the step should execute */
    run: (gi: ProjectAwareGoalInvocation, context: G) => Promise<void | ExecuteGoalResult>;
    /** Optional function to indicate if the step should run */
    runWhen?: (gi: ProjectAwareGoalInvocation) => Promise<boolean>;
}
/**
 * Execute provided pipeline steps in the order they are provided or until one fails
 */
export declare function runPipeline(gi: ProjectAwareGoalInvocation, ...steps: PipelineStep[]): Promise<void | ExecuteGoalResult>;
/**
 * Goal that executes the provided pipeline steps
 */
export declare function pipeline(details: FulfillableGoalDetails, ...steps: PipelineStep[]): GoalWithFulfillment;
//# sourceMappingURL=pipeline.d.ts.map