import { Options as ExecaOptions, ExecaChildProcess } from 'execa'; import { Blueprint, Predicates } from 'optimal'; import { Debugger } from '@boost/debug'; import { Event } from '@boost/event'; import Context from './Context'; import Task, { TaskAction } from './Task'; import CoreTool from './Tool'; import { AggregatedResponse } from './Executor'; import { PoolExecutorOptions } from './executors/Pool'; export interface CommandOptions { shell?: boolean; task?: Task; wrap?: (process: ExecaChildProcess) => void; } export default abstract class Routine, Options extends object = {}> extends Task { debug: Debugger; key: string; onCommand: Event<[string]>; onCommandData: Event<[string, string]>; options: Required; parent: Routine | null; routines: Routine[]; tasks: Task[]; tool: Tool; constructor(key: string, title: string, options?: Options); /** * Define an optimal blueprint in which to validate and build the * options passed to the constructor. */ blueprint(preds: Predicates): Blueprint>; /** * Called once the routine has been configured and is ready to execute. */ bootstrap(): void; /** * Configure the routine after it has been instantiated. */ configure(parent: Routine): this; /** * Execute the current routine and return a new value. */ execute(context: Ctx, value: any): Promise; /** * Execute a command with the given arguments and pass the results through a promise. */ executeCommand(command: string, args: string[], options?: ExecaOptions & CommandOptions): Promise; /** * Execute routines in parallel. */ parallelizeRoutines(value?: T, routines?: Routine[]): Promise; /** * Execute tasks in parallel. */ parallelizeTasks(value?: T, tasks?: Task[]): Promise; /** * Add a new routine within this routine. */ pipe(routine: Routine): this; /** * Execute routines in a pool. */ poolRoutines(value?: T, options?: Partial, routines?: Routine[]): Promise>; /** * Execute tasks in a pool. */ poolTasks(value?: T, options?: Partial, tasks?: Task[]): Promise>; /** * Execute routines in sequential (serial) order. */ serializeRoutines(value?: T, routines?: Routine[]): Promise; /** * Execute tasks in sequential (serial) order. */ serializeTasks(value?: T, tasks?: Task[]): Promise; /** * Execute routines in sync. */ synchronizeRoutines(value?: T, routines?: Routine[]): Promise>; /** * Execute tasks in sync. */ synchronizeTasks(value?: T, tasks?: Task[]): Promise>; /** * Define an individual task. */ task(title: string, action: TaskAction, scope?: any): Task; } //# sourceMappingURL=Routine.d.ts.map