@ckeditor/ckeditor5-ai
Version:
AI features for CKEditor 5.
33 lines (32 loc) • 1.06 kB
TypeScript
/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/
declare const PromiseQueue_base: {
new (): import("ckeditor5/src/utils.js").Emitter;
prototype: import("ckeditor5/src/utils.js").Emitter;
};
/**
* @module ai/aichat/utils/promisequeue
*/
export declare class PromiseQueue extends PromiseQueue_base {
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<void>;
/**
* 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<void>;
/**
* Processes the queue sequentially.
*/
private _processQueue;
}
type PromiseQueueTaskCallback = (signal: AbortSignal) => Promise<void>;
export {};