/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */ /** * @module ai/aichat/utils/promisequeue */ import { type EmitterMixinConstructor } from "@ckeditor/ckeditor5-utils"; declare const PromiseQueueBase: EmitterMixinConstructor; export declare class PromiseQueue extends PromiseQueueBase { isProcessing: boolean; /** * Adds a task to the queue. An abort signal is provided to the callback to allow it to abort the task. */ enqueue(callback: PromiseQueueTaskCallback): Promise; /** * Aborts the queue, rejects all pending tasks and resets it to initial state. */ abort(): void; /** * A promise that resolves when the queue is empty. */ get queueEmptyPromise(): Promise; /** * Processes the queue sequentially. */ private _processQueue; } type PromiseQueueTaskCallback = (signal: AbortSignal) => Promise; export {};