import { Options } from "execa"; import { Context, ContextLike, InternalOptionsContext } from "./context.js"; import { Command, Exec, Line, OutputLine } from "./exec.js"; type BaseTask = Readonly<{ title: Line; }>; type SkipResult = boolean | string | Promise; type SkippableTask = Readonly<{ skip?: (context: Context) => SkipResult; }>; type TaggedTask = Readonly<{ tags?: readonly Line[]; }>; type BaseLeafTask = BaseTask & SkippableTask & TaggedTask; type CommandGetter = (context: Context) => Command; type OptionsGetter = (context: Context) => Options; type CommandProperties = Readonly<{ command: Command | CommandGetter; options?: Options | OptionsGetter; }>; type CommandTask = BaseLeafTask & CommandProperties; type RunnableTask = Readonly<{ run: (payload: Readonly<{ context: Context; exec: Exec; outputLine: OutputLine; }>) => Line | void | Promise; }>; type RegularTask = BaseLeafTask & RunnableTask; type LeafTask = CommandTask | RegularTask; type IntersectableContext = C extends ContextLike ? C : unknown; type NestedChildrenMarker = false; type ParentTask = BaseTask & Readonly<{ rollback?: RunnableTask>["run"]; }> & SkippableTask> & (A extends ContextLike ? Readonly<{ addContext: (payload: Readonly<{ /** * Secrets will be redacted in displayed command strings. */ addSecret: (secret: string) => void; context: Context>; exec: Exec; }>) => A | Promise; }> : unknown) & Readonly<{ children: A extends NestedChildrenMarker ? any : ReadonlyArray & IntersectableContext, NestedChildrenMarker>>; concurrent?: boolean | number; }>; export type Task = LeafTask | ParentTask; type FlatTask = Readonly<{ parentTitle?: string; }> & (TaggedTask | Readonly<{ children: readonly string[]; }>); type MutableFlatTasks = Record; export type FlatTasks = Readonly; export declare const buildFlatTasks: (task: Task, flatTasks?: MutableFlatTasks, parentTitle?: string) => FlatTasks; export declare const runTask: (task: Task, context: Readonly<{ concurrency: number; }> & Readonly & Readonly<{ dryRun: boolean; from: string | undefined; only: readonly string[]; skip: readonly string[]; tag: readonly string[]; until: string | undefined; }>, flatTasks: FlatTasks) => Promise; export {}; //# sourceMappingURL=tasks.d.ts.map