import { Queue } from './queue'; export declare type Task = { run: () => Promise; }; /** * This queue runs tasks in the order they are added to the queue * * @implements {Queue} * @property {Task[]} queue used to be stored tasks pending for executing */ export declare class SynchronizeTaskQueue implements Queue { 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; /** * Run the first task in the queue, then remove it from the queue and run the next task if there is one */ runTask(): Promise; }