Initial commit

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
dinlo
2026-05-31 18:45:31 +08:00
commit e0a986eb30
1018 changed files with 615974 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
declare type QueueItem = () => void;
declare type IdleCallback = () => void | Promise<void>;
declare type AddCallback = () => void | Promise<void>;
interface Options {
concurrency?: number;
}
declare class PromiseQueue {
options: Required<Options>;
running: number;
queue: QueueItem[];
idleCallbacks: IdleCallback[];
constructor({ concurrency }?: Options);
clear(): void;
onIdle(callback: IdleCallback): () => void;
waitTillIdle(): Promise<void>;
add(callback: AddCallback): Promise<unknown>;
private processNext;
}
export { PromiseQueue };