import { Queue } from './queue';
export declare type Task = {
  run: () => Promise<void>;
};
/**
 * This queue runs tasks in the order they are added to the queue
 *
 * @implements {Queue<Task>}
 * @property {Task[]} queue used to be stored tasks pending for executing
 */
export declare class SynchronizeTaskQueue implements Queue<Task> {
  queue: Task[];
  private maxSize;
  /**
   * Define the task queue max length, the default is no length limit.
   *
   * @param {number} [maxTaskSize] the
   */
  constructor(maxTaskSize?: number);
  /**
   * If immediatelyRun is true, run the task immediately while the queue is empty. Otherwise, add it to the queue.
   * If immediatelyRun is false, add it to the queue.
   *
   * @param {Task} item - Task - The task to be added to the queue.
   */
  enqueue(item: Task, immediatelyRun?: boolean): Promise<void>;
  /**
   * Run the first task in the queue, then remove it from the queue and run the next task if there is one
   */
  runTask(): Promise<void>;
}
