export declare class QueueCancelledError extends Error { constructor(); } interface AsyncQueueState { enqueue: (task: () => Promise) => Promise; size: number; running: boolean; clear: () => void; } /** * A hook that manages a queue of async tasks and executes them sequentially. * Tasks are executed in FIFO order, and each task starts only after the previous one completes. * If a task fails, the error is propagated to the caller but the queue continues processing. * * @returns Object containing: * - enqueue: Function to add a task to the queue * - size: Current number of pending tasks * - running: Whether the queue is currently processing tasks * - clear: Function to clear all pending tasks * * @example * const queue = useAsyncQueue(); * await queue.enqueue(() => api.saveItem(item)); * await queue.enqueue(() => api.updateStatus(status)); */ export declare function useAsyncQueue(): AsyncQueueState; export {};