import { TaskContract, UpdateListener } from '../Contracts';
/**
 * Task exposes a very simple API to create tasks with states, along with a
 * listener to listen for the task state updates.
 *
 * The task itself has does not render anything to the console. The task
 * renderers does that.
 */
export declare class Task implements TaskContract {
    title: string;
    private startTime;
    private onUpdateListener;
    /**
     * Duration of the task. Updated after the task is over
     */
    duration?: string;
    /**
     * Message set after completing the task. Can be an error or the
     * a success message
     */
    completionMessage?: TaskContract['completionMessage'];
    /**
     * Task current state
     */
    state: TaskContract['state'];
    constructor(title: string);
    /**
     * Bind a listener to listen to the state updates of the task
     */
    onUpdate(listener: UpdateListener): this;
    /**
     * Start the task
     */
    start(): this;
    /**
     * Mark task as completed
     */
    complete(message?: string): this;
    /**
     * Mark task as failed
     */
    fail(error: TaskContract['completionMessage']): this;
}
