type Task = (...args: any[]) => T | Promise; /** * promiseQueue is a function that returns an object with two methods: add and flush. * add takes a function that will be added to the queue and returns a promise that resolves to the function's return value when it is called and executed in order of addition to the queue. * flush takes an error and rejects all pending promises with that error. * @returns object with add and flush methods * @example * const queue = promiseQueue() * const promise1 = queue.add(() => 1) * const promise2 = queue.add(() => 2) * promise1.then(value => console.log(value)) // 1 * promise2.then(value => console.log(value)) // 2 */ export default function promiseQueue(): { add(task: Task): Promise; flush(reason: string | Error): void; }; export {}; //# sourceMappingURL=promiseQueue.d.ts.map