import { ReactElement } from "react"; export type ProcessStepInfo = { type: "info"; title: string; }; export type ProcessStepRunnable = { type: "step"; title: string; phase: "running" | "completed" | "failed" | "aborted"; error?: unknown; progress?: string; output?: string; }; export type ProcessStepConfirm = { type: "confirm"; title: string; confirmed: boolean | undefined; }; export type ProcessStepInput = { type: "input"; title: string; mask?: boolean; value?: string; }; export type ProcessStepSelect = { type: "select"; title: string; options: { value: TVal; label: string; }[]; selected?: TVal; }; export type ProcessStep = ProcessStepInfo | ProcessStepRunnable | ProcessStepConfirm | ProcessStepInput | ProcessStepSelect; export type CleanupFunction = { title: string; fn: () => Promise; }; export declare class RunnableHandler { private readonly listener; private readonly processStep; private readonly promise; private resolve; private reject; constructor(state: ProcessStepRunnable, l: () => void); get done(): boolean; wait(): Promise; abort(): void; complete(): void; progress(p: string): void; appendOutput(o: string): void; error(err: unknown): void; } export interface ProcessRenderer { start(): void; addStep(title: string): RunnableHandler; runStep(title: string, fn: (() => Promise) | Promise): Promise; addInfo(title: string): void; addConfirmation(question: string): Promise; addInput(question: string, mask?: boolean): Promise; addSelect(question: string, options: { value: TVal; label: string; }[]): Promise; addCleanup(title: string, fn: () => Promise): void; complete(summary: ReactElement): Promise; error(err: unknown): Promise; }