import type { StudioJob } from "../shared/contracts.js";
import type { StudioBookConfigDraft } from "./book-create.js";
export interface StudioJobQueueOptions {
    readonly concurrency: number;
    readonly perUserActiveLimit: number;
    readonly perUserQueuedLimit: number;
}
export interface EnqueueFullBookJobInput {
    readonly userId: string;
    readonly projectRoot: string;
    readonly bookId: string;
    readonly title: string;
    readonly targetChapters: number;
    readonly chapterWordCount: number;
    readonly bookConfig?: StudioBookConfigDraft;
}
export interface StudioJobRunner {
    (job: StudioJob, signal: AbortSignal, updateProgress: (chaptersWritten: number) => void): Promise<void>;
}
export interface StudioJobQueueEvents {
    readonly onEvent?: (event: string, job: StudioJob) => void;
}
export declare class StudioJobQueue {
    private readonly runner;
    private readonly options;
    private readonly events;
    private readonly jobs;
    private readonly bookConfigs;
    private readonly queue;
    private readonly controllers;
    constructor(runner: StudioJobRunner, options: StudioJobQueueOptions, events?: StudioJobQueueEvents);
    enqueue(input: EnqueueFullBookJobInput): StudioJob;
    list(userId?: string): StudioJob[];
    get(id: string): StudioJob | undefined;
    getBookConfig(id: string): StudioBookConfigDraft | undefined;
    cancel(id: string): StudioJob;
    resume(id: string): StudioJob;
    pump(): void;
    resumePausedQuotaJobs(): void;
    private start;
    private dequeueStartableJob;
    private activeJobs;
    private assertUserLimits;
    private requireJob;
    private update;
    private withQueuePosition;
    private emit;
}
//# sourceMappingURL=job-queue.d.ts.map