/**
 * Represents a computation task, where computation is performed in cycles.
 * Each cycle is intended to complete very quickly, and be executed by {@link ConcurrentExecutor}
 */
export class Task {
    /**
     *
     * @param {Array<(Task|TaskGroup)>} tasks
     * @return {Promise}
     */
    static promiseAll(tasks: Array<(Task | TaskGroup)>): Promise<any>;
    /**
     *
     * @param {Task|TaskGroup} task
     */
    static promise(task: Task | TaskGroup): Promise<any>;
    /**
     *
     * @param {Task} task
     * @param {function} resolve
     * @param {function} reject
     */
    static join(task: Task, resolve: Function, reject: Function): void;
    /**
     *
     * @param {Task[]} tasks
     * @param {function} resolve
     * @param {function} reject
     */
    static joinAll(tasks: Task[], resolve: Function, reject: Function): void;
    /**
     *
     * @param {string} [name] useful for identifying the task later on, for various UI and debug purposes
     * @param {function(Task, executor:ConcurrentExecutor)} [initializer] function to be executed just before task starts
     * @param {function():TaskSignal} cycleFunction
     * @param {function():number} [computeProgress]
     * @param {Task[]} [dependencies=[]]
     * @param {number} [estimatedDuration=1] in seconds
     * @constructor
     */
    constructor({ name, initializer, cycleFunction, computeProgress, dependencies, estimatedDuration }?: string);
    /**
     * @readonly
     * @type {number}
     */
    readonly id: number;
    /**
     * @readonly
     */
    readonly on: {
        /**
         * @readonly
         * @type {Signal}
         */
        readonly started: Signal;
        /**
         * @readonly
         * @type {Signal}
         */
        readonly completed: Signal;
        /**
         * @readonly
         * @type {Signal}
         */
        readonly failed: Signal;
    };
    /**
     *
     * @type {ObservedInteger}
     */
    state: ObservedInteger;
    /**
     * amount of time spent running this task in milliseconds
     * @type {number}
     * @public
     */
    public __executedCpuTime: number;
    /**
     * number of time task's cycle function was executed
     * @type {number}
     * @public
     */
    public __executedCycleCount: number;
    /**
     *
     * @type {Task[]}
     */
    dependencies: Task[];
    /**
     *
     * @type {number}
     */
    estimatedDuration: number;
    /**
     *
     * @type {string}
     */
    name: string;
    /**
     *
     * @type {function(): TaskSignal}
     */
    cycle: () => TaskSignal;
    /**
     *
     * @type {function(Task, executor:ConcurrentExecutor)}
     */
    initialize: (arg0: Task, arg1: executor) => ConcurrentExecutor;
    computeProgress(): number;
    /**
     * Time in milliseconds that the task has been executing for, suspended time does not count
     * @returns {number}
     */
    getExecutedCpuTime(): number;
    getEstimatedDuration(): number;
    /**
     *
     * @param {Task|TaskGroup} task
     * @returns Task
     */
    addDependency(task: Task | TaskGroup): this;
    /**
     *
     * @param {Array<(Task|TaskGroup)>} tasks
     */
    addDependencies(tasks: Array<(Task | TaskGroup)>): void;
    toString(): string;
    /**
     *
     * @param {function} resolve
     * @param {function} reject
     */
    join(resolve: Function, reject: Function): void;
    /**
     * Run entire task synchronously to completion
     */
    executeSync(): TaskSignal.EndSuccess | TaskSignal.EndFailure;
    /**
     *
     * @returns {Promise}
     */
    promise(): Promise<any>;
    /**
     * @readonly
     * @type {boolean}
     */
    readonly isTask: boolean;
}
export default Task;
import Signal from "../../events/signal/Signal.js";
import ObservedInteger from "../../model/ObservedInteger.js";
import { TaskSignal } from "./TaskSignal.js";
//# sourceMappingURL=Task.d.ts.map