type TasksList<T = any> = { readonly running: Tasks<T>; readonly pending: Tasks<T>; readonly completed: Tasks<T>;};
type TasksCount<T = any> = { total: number; completed: number; list: Task<T>[];};
type RunnerDuration = { start: number; end: number; total: number;};
type TaskWithDone<T = any> = ( done: Done<T>, id: TaskID) => TaskReturn<T> | Promise<TaskReturn<T>>;
type TasksWithDone<T = any> = TaskWithDone<T>[];
type Done<T = any> = (result?: T) => void;
enum TaskStatus { PENDING = "pending", RUNNING = "running", CANCELLED = "cancelled", DONE = "done",}
enum RunnerEvents { START = "onStart", PAUSE = "onPause", DESTROY = "onDestroy", ADD = "onAdd", REMOVE = "onRemove", RUN = "onRun", DONE = "onDone", END = "onEnd",}
enum AdditionMethods { FIRST = "first", LAST = "last", AT_INDEX = "at-index", MULTIPLE_FIRST = "multiple-first", MULTIPLE_LAST = "multiple-range",}
enum RemovalMethods { ALL = "all", BY_INDEX = "by-index", RANGE = "range", FIRST = "first", LAST = "last",}